Skip to content

Commit

Permalink
feat: 整合表格环境字体设置 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
atxy-blip committed Jul 9, 2023
1 parent c78e5ee commit 27be21e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

## [未发布]

### 新增

- 整合表格环境字体设置 - [#94]

## [1.3.0] - 2023-06-06

### 新增
Expand Down Expand Up @@ -538,6 +542,7 @@
[#85]: https://github.com/nju-lug/NJUThesis/discussions/85
[#89]: https://github.com/nju-lug/NJUThesis/discussions/89
[#92]: https://github.com/nju-lug/NJUThesis/issues/92
[#94]: https://github.com/nju-lug/NJUThesis/discussions/94
[#96]: https://github.com/nju-lug/NJUThesis/issues/96
[#98]: https://github.com/nju-lug/NJUThesis/issues/98
[#99]: https://github.com/nju-lug/NJUThesis/discussions/99
Expand Down
10 changes: 6 additions & 4 deletions docs/njuthesis-setup.def
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
}

% 为目录中的章标题添加引导线
% \njusetup[tableofcontents/dotline]{chapter}
\njusetup[tableofcontents/dotline]{chapter}

% math 类用于设置数学符号样式,功能详见手册
\njusetup[math]{
Expand Down Expand Up @@ -254,6 +254,8 @@
% \njusetformat{footer}{}

% 一些灵活调整
% \njusetname{notation}{术语表} % 更改符号表名称
% \njusetname{tableofcontents}{目\qquad{}次} % 更改目录名称
% \njusetlength{crulewd}{330pt} % 加长封面页下划线
% \njusetname{type}{本科毕业设计} % 我做的是毕业设计
% \njusetname{notation}{术语表} % 更改符号表名称
% \njusetlength{crulewd}{240pt} % 加长封面页下划线
% \njusetformat{tabular}{\zihao{-4}\bfseries} % 修改表格环境的字号
% \EditInstance{nju}{u/cover/emblem-img}{align=l} % 左对齐的本科生封面校徽
31 changes: 22 additions & 9 deletions source/njuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ To produce the documentation run the original source files ending with
% \begin{syntax}
% \tn{njusetformat}\marg{名称}\marg{样式}
% \end{syntax}
% 修改样式。默认样式可以参见 \ref{subsubsec:constant-format} 节。
% 修改样式。所有可以修改的默认样式参见 \ref{subsubsec:constant-format} 节。
% \end{function}
%
% 譬如,将章标题字号加大到小二号,示例如下:
Expand All @@ -2243,6 +2243,12 @@ To produce the documentation run the original source files ending with
% \njusetformat{chapter}{\zihao{-2}\sffamily\centering}
% \end{latexexample}
%
% 修改表格内容的字体:
%
% \begin{latexexample}[moretexcs={\njusetformat,\zihao,\bfseries}]
% \njusetformat{tabular}{\zihao{-4}\bfseries}
% \end{latexexample}
%
%
% \subsection{视觉识别系统}
%
Expand Down Expand Up @@ -3453,8 +3459,8 @@ To produce the documentation run the original source files ending with
% \begin{macrocode}
\cs_new_protected:Npn \@@_abs_title:N #1
{
\@@_get_width:NV \l_@@_tmpa_dim #1
\@@_uuline:N \l_@@_tmpa_dim #1
\@@_get_width:NV \l_@@_tmpa_dim #1
\hbox:n { \@@_uuline:N \l_@@_tmpa_dim #1 }
}
% \end{macrocode}
% \end{macro}
Expand Down Expand Up @@ -5864,15 +5870,15 @@ To produce the documentation run the original source files ending with
% \changes{v1.0}{2022/08/06}{兼容 \pkg{tabularray} 设置。}
% 表格默认居中,字号设置为五号。^^A https://www.zhihu.com/question/366803177/answer/977853129
% \begin{macrocode}
\BeforeBeginEnvironment { tabular } { \centering \zihao {5} }
\BeforeBeginEnvironment { tabular } { \centering \c_@@_fmt_tabular_tl }
\ctex_at_end_package:nn { tabularray }
{
% \end{macrocode}
% 等效于 \tn{UseTblrLibrary}、\tn{SetTblrInner} 与 \tn{SetTblrOuter}。
% \begin{macrocode}
\__tblr_use_lib_booktabs:
\tl_set:Nn \l_@@_tmpb_tl
{ , abovesep = 4 pt, stretch = 0.8, cells = { font = \small } }
{ , 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 }
Expand Down Expand Up @@ -8475,6 +8481,12 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
% “目录”二字的样式。
% \begin{macrocode}
% \end{macrocode}
% \changes{v1.4}{2023/07/08}{整合表格环境字体设置。}
% \env{tabular} 环境内的字体样式。
% \begin{macrocode}
{ tabular } { \zihao { 5 } },
% \end{macrocode}
{ toc title } { \centering \zihao { 3 } \bfseries },
{ header } { \small \kaishu },
{ footer } { \small \rmfamily }
Expand All @@ -8484,7 +8496,7 @@ To produce the documentation run the original source files ending with
% \end{macrocode}
%
%
% \subsection{手册文档类 \cls{njudoc}}
% \subsection{手册文档类 \cls{njuthesis-doc}}
% \changes{v1.3}{2023/05/12}{将手册样式设置拆分为单独的 \cls{njuthesis-doc} 文档类。}
%
% \begin{macrocode}
Expand Down Expand Up @@ -8826,11 +8838,12 @@ To produce the documentation run the original source files ending with
% \end{macro}
%
%
% \begin{macro}{\@@_split_pm:n}
% \begin{macro}{\@@_split_pm:n,\@@_split_pm:V}
% 通过竖线分割 guard 标签。
% \begin{macrocode}
\cs_new:Npn \@@_split_pm:n #1
\cs_new:Npn \@@_split_pm:n
{ \seq_set_split:Nnn \l_tmpa_seq { | } }
\cs_generate_variant:Nn \@@_split_pm:n { V }
% \end{macrocode}
% \end{macro}
%
Expand All @@ -8842,7 +8855,7 @@ To produce the documentation run the original source files ending with
\tl_set:Nn \l_tmpa_str {#1}
\clist_map_inline:nn { *, /, (, ) }
{ \str_remove_all:Nn \l_tmpa_str {##1} }
\seq_set_split:NnV \l_tmpa_seq { | } \l_tmpa_str
\@@_split_pm:V \l_tmpa_str
}
% \end{macrocode}
% \end{macro}
Expand Down

0 comments on commit 27be21e

Please sign in to comment.