Skip to content

Commit

Permalink
Fix: 修正 hyperref 和 tabularray 的默认设置
Browse files Browse the repository at this point in the history
  • Loading branch information
atxy-blip committed Mar 6, 2024
1 parent 0586e04 commit d80b455
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 25 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

## [未发布]

## [1.3.3] - 2024-03-06

### 新增

- 增加 `macoffice` 字体配置 - [#164],[#169]
Expand All @@ -14,6 +16,8 @@
### 修复

- 修复定理类环境在共享计数器时的 `cleveref` 引用名问题 - [#234]
- 将部分 `hyperref` 默认设置项放在导言区前以便用户覆盖
- 修正 `tabularray` 默认标题间距

### 杂项

Expand Down Expand Up @@ -538,8 +542,9 @@
- 模板上传至 CTAN


[未发布]: https://github.com/nju-lug/NJUThesis/compare/v1.3.1...HEAD
[未发布]: https://github.com/nju-lug/NJUThesis/compare/v1.3.3...HEAD

[1.3.3]: https://github.com/nju-lug/NJUThesis/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/nju-lug/NJUThesis/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/nju-lug/NJUThesis/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/nju-lug/NJUThesis/compare/v1.2.1...v1.3.0
Expand Down
2 changes: 1 addition & 1 deletion docs/njuthesis-sample.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% njuthesis 示例模板 v1.3.2 2023-12-05
% njuthesis 示例模板 v1.3.3 2024-03-06
% https://github.com/nju-lug/NJUThesis
%
% 贡献者
Expand Down
2 changes: 1 addition & 1 deletion docs/njuthesis-setup.def
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% njuthesis 参数设置文件 v1.3.2 2023-12-05
% njuthesis 参数设置文件 v1.3.3 2024-03-06

% 一些提醒:
% 1. \njusetup 内部千万不要有空行
Expand Down
53 changes: 31 additions & 22 deletions source/njuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ To produce the documentation run the original source files ending with
%
%<class>\NeedsTeXFormat{LaTeX2e}
%<*!(driver|install)>
%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.3.2 2023-12-05 16:30:00
%<+!driver>\GetIdInfo $Id: njuthesis.dtx 1.3.3 2024-03-06 21:00:00
%<+!driver> +0800 NJU LUG <git+nju-lug-email-3104-issue-@yaoge123.cn>$
%<class> {Thesis template for Nanjing University}
%<class>\ProvidesExplClass{njuthesis}
Expand Down Expand Up @@ -148,7 +148,7 @@ To produce the documentation run the original source files ending with
% \thanks{E-mail: \href{mailto:git+nju-lug-email-3104-issue-@yaoge123.cn}
% {git+nju-lug-email-3104-issue-@yaoge123.cn}}}
%
% \date{v1.3.2 \quad 2023-12-05}
% \date{v1.3.3 \quad 2024-03-06}
%
% \changes{v0.1}{2021/09/04}{开始开发。}
% \changes{v0.2}{2021/09/07}{初步搭建了可用的模板。}
Expand Down Expand Up @@ -5775,30 +5775,33 @@ To produce the documentation run the original source files ending with
%
% \subsection{引用}
%
% 在导言区末尾进行 \pkg{hyperref} 设置。
% \changes{v0.11}{2021/10/01}{写入 PDF 元数据。}
% \changes{v0.17}{2022/04/09}{PDF 书签中不生成额外空格。}
% \changes{v1.3}{2024/03/06}{将可能需要覆盖的 \pkg{hyperref} 设置移动到导言区前。}
% \begin{macrocode}
\ctex_at_end_preamble:n
\hypersetup
{
bookmarksnumbered = true,
psdextra = true,
unicode = true,
hidelinks
}
% \end{macrocode}
% \changes{v0.17}{2022/04/09}{PDF 书签中不生成额外空格。}
% 忽略 PDF 字符串中的特定命令,从而抑制 \pkg{hyperref} 警告。
% \begin{macrocode}
\pdfstringdefDisableCommands
{
\clist_map_inline:nn
{ \\, \quad, \qquad, \bigger }
{ \@@_cs_clear:N #1 }
}
\hypersetup
{
bookmarksnumbered = true,
psdextra = true,
unicode = true,
hidelinks,
\pdfstringdefDisableCommands
{
\clist_map_inline:nn
{ \\, \quad, \qquad, \bigger }
{ \@@_cs_clear:N #1 }
}
% \end{macrocode}
% 填写 PDF 元信息。
% 在导言区末尾进行 \pkg{hyperref} 设置。填写 PDF 元信息。
% \changes{v0.11}{2021/10/01}{写入 PDF 元数据。}
% \begin{macrocode}
\ctex_at_end_preamble:n
{
\hypersetup
{
pdftitle = \g_@@_info_title_tl,
pdfauthor = \g_@@_info_author_tl,
pdfkeywords = \g_@@_info_keywords_clist,
Expand Down Expand Up @@ -5997,6 +6000,7 @@ To produce the documentation run the original source files ending with
%
% \changes{v0.16}{2022/03/11}{表格内字体设为五号。}
% \changes{v1.0}{2022/08/06}{兼容 \pkg{tabularray} 设置。}
% \changes{v1.3}{2024/03/06}{调整 \pkg{tabularray} 设置。}
% 表格默认居中,字号设置为五号。^^A https://www.zhihu.com/question/366803177/answer/977853129
% \begin{macrocode}
\BeforeBeginEnvironment { tabular } { \centering \c_@@_fmt_tabular_tl }
Expand All @@ -6010,7 +6014,12 @@ To produce the documentation run the original source files ending with
{ , abovesep = 4 pt, stretch = 0.8, cells = { font = \c_@@_fmt_tabular_tl } }
\tl_put_right:NV \l__tblr_default_tblr_inner_tl \l_@@_tmpb_tl
\tl_put_right:NV \l__tblr_default_talltblr_inner_tl \l_@@_tmpb_tl
\tl_put_right:Nn \l__tblr_default_talltblr_outer_tl { , headsep = -4 pt }
\tl_put_right:NV \l__tblr_default_longtblr_inner_tl \l_@@_tmpb_tl
% \end{macrocode}
% 为了和标准文档类中的间距一致,文档介绍的值为 \qty{10}{pt},实际是 \qty{12.63}{pt}。
% \begin{macrocode}
\tl_put_right:Nn \l__tblr_default_talltblr_outer_tl { , headsep = 12.63 pt }
\tl_put_right:Nn \l__tblr_default_longtblr_outer_tl { , headsep = 12.63 pt }
% \end{macrocode}
% 处理 \env{talltblr} 表注的限宽问题。
% \footnote{\url{https://github.com/lvjr/tabularray/issues/255}}
Expand All @@ -6026,6 +6035,7 @@ To produce the documentation run the original source files ending with
\SetTblrTemplate { firsthead } { caption }
\SetTblrStyle { caption } { font = \normalfont \bfseries \small }
\SetTblrStyle { note } { font = \normalfont \footnotesize }
\SetTblrStyle { remark } { font = \normalfont \footnotesize }
}
% \end{macrocode}
%
Expand All @@ -6035,8 +6045,7 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\DeclareCaptionStyle{njucap}
{
font = small,
font += bf,
font = {small, bf},
labelsep = quad,
justification = centering
}
Expand Down

0 comments on commit d80b455

Please sign in to comment.