diff options
Diffstat (limited to 'macros/latex/contrib/fduthesis/fduthesis-doc.dtx')
-rw-r--r-- | macros/latex/contrib/fduthesis/fduthesis-doc.dtx | 185 |
1 files changed, 64 insertions, 121 deletions
diff --git a/macros/latex/contrib/fduthesis/fduthesis-doc.dtx b/macros/latex/contrib/fduthesis/fduthesis-doc.dtx index 15bc16d666..c39e192e7a 100644 --- a/macros/latex/contrib/fduthesis/fduthesis-doc.dtx +++ b/macros/latex/contrib/fduthesis/fduthesis-doc.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2017--2022 by Xiangdong Zeng <xdzeng96@gmail.com> +% Copyright (C) 2017--2023 by Xiangdong Zeng <xdzeng96@gmail.com> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -83,8 +83,7 @@ \@namedef{ver@thumbpdf.sty}{9999/99/99} % \end{macrocode} % -% \changes{v0.8}{2021/10/21}{[\pkg{fdudoc}] 使用 \pkg{gbt7714} 宏包 -% 处理参考文献。} +% \changes{v0.8}{2021/10/21}{[\pkg{fdudoc}] 使用 \pkg{gbt7714} 宏包处理参考文献。} % % 载入宏包和文档类。 % \begin{macrocode} @@ -528,7 +527,7 @@ \cs_new_protected:Npn \@@_module_star:w #1 > #2 \q_stop { % \end{macrocode} -% 临时变量 \cs{l_@@_tmp_tl} 保存 |<*|\meta{module}|>| 之后的部分,即真实代码。 +% 临时变量 \cs{l_@@_tmpa_tl} 保存 |<*|\meta{module}|>| 之后的部分,即真实代码。 % \begin{macrocode} \tl_set:Nn \l_@@_tmpa_tl {#2} % \end{macrocode} @@ -1049,7 +1048,7 @@ % \end{macro} % % \begin{macro}[int]{\changes@} -% \changes{v0.4}{2017/07/30}{调整索引排序方式。} +% \changes{v0.4}{2017/07/30}{[\pkg{fdudoc}] 调整索引排序方式。} % 重定义 \tn{changes@},在版本号一行显示修改日期。 % \begin{macrocode} \cs_set_protected:Npn \changes@ #1#2 @@ -1082,7 +1081,7 @@ {#1} \l_@@_tmpa_tl { % \end{macrocode} -% \cs{l_@@_tmp_tl} 相当于两个参数(开始日期、结束日期),因此需要提前展开。 +% \cs{l_@@_tmpa_tl} 相当于两个参数(开始日期、结束日期),因此需要提前展开。 % \begin{macrocode} \exp_after:wN \@@_save_version_date_aux:nnnn \l_@@_tmpa_tl @@ -1330,25 +1329,8 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\SpecialMainEnvIndex} -% 索引汉化。 -% \begin{macrocode} -\ctex_patch_cmd:Nnn \SpecialMainEnvIndex - { (environment) } { ~ 环境 } -\ctex_patch_cmd:Nnn \SpecialMainEnvIndex - { environments: } { 环境: } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[int]{\HDorg@SpecialEnvIndex} -% \pkg{hypdoc} 宏包重新定义了 \tn{SpecialEnvIndex} 命令,因此需要修改内部定义。 -% \begin{macrocode} -\ctex_patch_cmd:Nnn \HDorg@SpecialEnvIndex - { (environment) } { ~ 环境 } -\ctex_patch_cmd:Nnn \HDorg@SpecialEnvIndex - { environments: } { 环境: } -% \end{macrocode} -% \end{macro} +% \changes{v0.9}{2023/02/17}{[\pkg{fdudoc}] 使用 \pkg{makeindex} 处理索引和修订记录。} +% \changes{v0.9}{2023/02/17}{[\pkg{fdudoc}] 不再对索引进行汉化。} % % \begin{macro}[int]{\NAT@citexnum} % 将参考文献引用中的 hyphen 改为 en-dash。 @@ -1405,6 +1387,14 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\@@_typeset_functions:} +% 减少展开标记(用来表明中英文模板中的不同用法)前的空格。 +% \begin{macrocode} +\__fdudoc_patch_cmd:Nnn \@@_typeset_expandability: + { & } { & \skip_horizontal:n { -0.5em } } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@@_typeset_functions:,\@@_macro_init:, % \@@_macro_dump:} % 左侧边注的函数列表采用单倍行距。 @@ -1519,33 +1509,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@@_special_index_module:nnnnN} -% 索引汉化。 -% \begin{macrocode} -\cs_set_protected:Npn \@@_special_index_module:nnnnN #1#2#3#4#5 - { - \use:x - { - \exp_not:n { \@@_special_index_aux:nnnnnnn {#1} {#2} } - \tl_if_empty:nTF {#3} - { { } { } { } { } } - { - \str_if_eq:eeTF {#3} { TeX } - { - { TeX~ and~ LaTeX2e } - { \string \TeX{}~ 和~ \string \LaTeXe{} } - } - { {#3} { \string \pkg {#3} } } - \bool_if:NTF #5 - { { commands~ internal } { ~ 内部命令: } } - { { commands } { ~ 命令: } } - } - } - {#4} - } -% \end{macrocode} -% \end{macro} -% % \begin{macro}{\@@_special_index_aux:nnnnnnn} % 该函数在 \cls{l3doc} 中本来只有 6 个参数。这里增加了一个,用来辅助排序。 % \begin{arguments} @@ -1705,7 +1668,8 @@ \bibliographystyle{gbt7714-numerical} % \end{macrocode} % -% \changes{v0.7c}{2019/02/08}{修改宏包手册主要字体。} +% \changes{v0.7c}{2019/02/08}{[\pkg{fdudoc}] 修改宏包手册主要字体。} +% \changes{v0.9}{2023/02/18}{[\pkg{fdudoc}] 更新宏包手册字体。} % % 西文字体。为兼容 macOS,系统字体需使用字体名,而 \TeXLive{} % 中的字体需使用文件名。 @@ -1723,29 +1687,36 @@ BoldFont = *-Bold, ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic] -\setmonofont{Iosevka Slab}[ - UprightFont = * Light, - BoldFont = * Semibold, - ItalicFont = * Light Oblique, - BoldItalicFont = * Semibold Oblique, - Scale = MatchLowercase] +\setmonofont{lmmonolt10}[ + Extension = .otf, + UprightFont = *-regular, + BoldFont = *-bold, + ItalicFont = *-oblique, + BoldItalicFont = *-boldoblique] \setmathfont{LibertinusMath-Regular.otf} % \end{macrocode} % % 中文字体。 % \begin{macrocode} -\setCJKmainfont{Source Han Serif SC}[ - ItalicFont = FZKai-Z03, - CharacterWidth = Full] -\setCJKsansfont{Source Han Sans SC}[ - ItalicFont = *, - CharacterWidth = Full] -\setCJKmonofont{Source Han Sans SC}[ - UprightFont = * Normal, - BoldFont = * Bold, - AutoFakeSlant = 0.1763, % = tan(10 deg) - Scale = 0.8903, - CharacterWidth = Full] +\setCJKmainfont{SourceHanSerifSC}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + ItalicFont = FandolKai-Regular, + UprightFeatures = { CharacterWidth = Full }, + BoldFeatures = { CharacterWidth = Full }] +\setCJKsansfont{SourceHanSansSC}[ + Extension = .otf, + UprightFont = *-Regular, + BoldFont = *-Bold, + CharacterWidth = Full] +\setCJKmonofont{SourceHanSansSC}[ + Extension = .otf, + UprightFont = *-Normal, + BoldFont = *-Bold, + AutoFakeSlant = 0.1763, % = tan(10 deg) + Scale = 0.9, + CharacterWidth = Full] % \end{macrocode} % % 版式排版格式。 @@ -1887,15 +1858,19 @@ % % \subsubsection{文档层命令} % +% \changes{v0.9}{2023/02/18}{[\pkg{fdudoc}] 调整中英文标记。} +% % \begin{macro}{\exptarget,\rexptarget,\expstar,\rexpstar, % \__codedoc_typeset_exp:,\__codedoc_typeset_rexp:} -% 部分命令之后的特殊符号($^^^^263a$ 或 $^^^^263b$),表明其不同用法。这里的 -% “exp”和“rexp”分别源自 \LaTeX3 中的“expandable”和“restricted-expandable”。 +% 部分命令之后的标记,表明中英文模板中的不同用法。这里的“exp”和“rexp” +% 分别源自 \LaTeX3 中的“expandable”和“restricted-expandable”。 % \begin{macrocode} \newcommand*\exptarget{\Hy@raisedlink{\hypertarget{expstar}{}}} \newcommand*\rexptarget{\Hy@raisedlink{\hypertarget{rexpstar}{}}} -\newcommand*\expstar{\hyperlink{expstar}{$^^^^263b$}} -\newcommand*\rexpstar{\hyperlink{rexpstar}{$^^^^263a$}} +\newcommand*\expstar{% + \hyperlink{expstar}{\textsuperscript{\rmfamily\scshape en}}} +\newcommand*\rexpstar{% + \hyperlink{rexpstar}{\textsuperscript{\rmfamily\scshape zh}}} \ExplSyntaxOn \cs_set_eq:NN \__codedoc_typeset_exp: \expstar \cs_set_eq:NN \__codedoc_typeset_rexp: \rexpstar @@ -1999,38 +1974,7 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\cs,\tn} -% \begin{macro}[int]{\codedoc@cs,\codedoc@tn} -% 控制序列。 -%^^A Colors are used for debug. -% \begin{macrocode} -% \let\codedoc@cs=\cs -% \let\codedoc@tn=\tn -% \renewcommand*\cs[2][]{% -% \textcolor{MaterialIndigo}{\codedoc@cs[#1]{#2}}} -% \renewcommand*\tn[2][]{% -% \textcolor{MaterialPink}{\codedoc@tn[#1]{#2}}} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \begin{macro}{\file,\env,\pkg,\cls} -% 文件、环境、宏包、文档类。 -% \begin{macrocode} -% \renewcommand*\file[1]{% -% \textcolor{MaterialGrey900}{\texttt{#1}}} -\renewcommand*\env[1]{\textbf{\texttt{#1}}} -% \renewcommand*\pkg[1]{\textsf{#1}} -% \renewcommand*\cls[1]{\textit{\textsf{#1}}} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\bashcmd} -% Bash 中的命令。 -% \begin{macrocode} -\newcommand*\bashcmd[1]{\texttt{#1}} -% \end{macrocode} -% \end{macro} +% \changes{v0.9}{2023/02/17}{[\pkg{fdudoc}] 移除多余的文档层定义。} % % \paragraph{示例代码环境} % @@ -2041,14 +1985,13 @@ \@empty\z@\@empty % \end{macrocode} % -% \changes{v0.5}{2017/09/05}{[\pkg{fdudoc}] 移除 \pkg{listings} -% 关键字定义文件。} +% \changes{v0.5}{2017/09/05}{[\pkg{fdudoc}] 移除 \pkg{listings} 关键字定义文件。} % % 定义几种代码样式。 % \begin{macro}[int]{style@base} % \begin{macrocode} \lstdefinestyle{style@base}{ - basewidth = 0.5 em, + basewidth = 0.525 em, gobble = 3, lineskip = 2 pt, frame = l, @@ -2093,17 +2036,17 @@ % \begin{macro}[int]{style@syntax} % \begin{macrocode} \lstdefinestyle{style@syntax}{ - basewidth = 0.5 em, - gobble = 6, - escapeinside = {(*}{*)}, - language = [LaTeX]TeX, - alsoletter = {*, -}, - basicstyle = \footnotesize\ttfamily\color{MaterialGrey900}, - keywordstyle = \bfseries\color{MaterialIndigo}, - commentstyle = \itshape\color{MaterialGrey600}, - texcsstyle = *\color{MaterialDeepOrange}, - emphstyle = [1]\color{MaterialGreen800}, - emphstyle = [2]\color{MaterialTeal} + basewidth = 0.525 em, + gobble = 6, + escapeinside = {(*}{*)}, + language = [LaTeX]TeX, + alsoletter = {*, -}, + basicstyle = \footnotesize\ttfamily\color{MaterialGrey900}, + keywordstyle = \bfseries\color{MaterialIndigo}, + commentstyle = \itshape\color{MaterialGrey600}, + texcsstyle = *\color{MaterialDeepOrange}, + emphstyle = [1]\color{MaterialGreen800}, + emphstyle = [2]\color{MaterialTeal} } % \end{macrocode} % \end{macro} |