diff options
Diffstat (limited to 'macros/latex/contrib/thuthesis/thuthesis.dtx')
-rw-r--r-- | macros/latex/contrib/thuthesis/thuthesis.dtx | 65 |
1 files changed, 51 insertions, 14 deletions
diff --git a/macros/latex/contrib/thuthesis/thuthesis.dtx b/macros/latex/contrib/thuthesis/thuthesis.dtx index 6e25d0cdfb..e6f3e46ad8 100644 --- a/macros/latex/contrib/thuthesis/thuthesis.dtx +++ b/macros/latex/contrib/thuthesis/thuthesis.dtx @@ -14,7 +14,7 @@ % % \iffalse %<*driver> -\ProvidesFile{thuthesis.dtx}[2024/03/29 7.5.0 Tsinghua University Thesis Template] +\ProvidesFile{thuthesis.dtx}[2024/07/01 7.5.2 Tsinghua University Thesis Template] \documentclass{ltxdoc} \usepackage{dtx-style} @@ -251,7 +251,7 @@ % $ bibtex thuthesis-example.aux # 生成 bbl 文件 % $ bibtex thuthesis-example-appendix-a.aux # 附录 A 的的参考文献 % $ bibtex thuthesis-example-appendix-b.aux # 附录 B 的的参考文献…… -% $ bibtex thuthesis-example-index.aux # 本科生的书面翻译对应的原文索引 +% $ bibtex thuthesis-example-index-1.aux # 本科生的书面翻译对应的原文索引 % $ xelatex thuthesis-example.tex # 解决引用 % $ xelatex thuthesis-example.tex # 生成论文 PDF % @@ -813,7 +813,7 @@ % } % \end{latex} % -% 用户也可以逐项修改数学样式。 +% 用户也可以逐项修改数学样式,包括: % \newcommand\dif{\mathop{}\!\mathrm{d}} % \begin{enumerate} % \item \DescribeOption{uppercase-greek} @@ -885,12 +885,16 @@ % 模板作了处理,用户可以直接使用这些宏包的命令,如 \cs{bm}、\cs{mathscr}、 % \cs{uppi}。 % -% 另外,模板还为 `math-font` 提供了传统的 Type 1 字体 \option{newtx}。 +% 另外,模板还为 |math-font| 提供了传统的 Type 1 字体 \option{newtx}。 % 该选项会调用 \pkg{newtxmath} 宏包。 % 但是,如果西文字体已经使用了 OpenType 的 Times New Roman, % 混用 Type 1 字体可能会导致问题,尤其是使用 \pkg{siunitx} 宏包时。 % 该选项还处于测试阶段,需要谨慎使用。 % +% \DescribeOption{eqn-paren-style} +% 控制中文论文中,数学公式编号两边的括号样式。可选项包括:\option{full}(全角,默认) / \option{half}(半角)。 +% 在语言为英语(|language = english|)时,此选项无效,仅使用半角括号。 +% % \subsubsection{定理环境} % \label{sec:theorem} % \thuthesis{} 定义了常用的数学环境: @@ -1243,8 +1247,8 @@ % include-spine = true, % } % \end{latex} -% 打开此选项后,书籍会出现在中文封面后面的第一个空白页。如果有英文封面,则在英文封面之前。 -% 如果需要书籍出现在其他位置,请手工使用 \cs{spine} 生成,不要使用此选项。 +% 打开此选项后,书脊会出现在中文封面后面的第一个空白页。如果有英文封面,则在英文封面之前。 +% 如果需要书脊出现在其他位置,请手工使用 \cs{spine} 生成,不要使用此选项。 % % \section{致谢} % \label{sec:thanks} @@ -1269,7 +1273,7 @@ % \begin{macrocode} %<cls>\NeedsTeXFormat{LaTeX2e}[2017/04/15] %<cls>\ProvidesClass{thuthesis} -%<cls>[2024/03/29 7.5.0 Tsinghua University Thesis Template] +%<cls>[2024/07/01 7.5.2 Tsinghua University Thesis Template] % \end{macrocode} % % 报错 @@ -1330,7 +1334,7 @@ %<*cls> \hyphenation{Thu-Thesis} \def\thuthesis{ThuThesis} -\def\version{7.5.0} +\def\version{7.5.2} \RequirePackage{kvdefinekeys} \RequirePackage{kvsetkeys} \RequirePackage{kvoptions} @@ -1658,6 +1662,17 @@ }, default = print, }, +% \end{macrocode} +% +% 数学公式编号的括号使用全角还是半角。 +% \begin{macrocode} + eqn-paren-style = { + name = eqn@paren@style, + choices = { + full, + half, + } + }, } \newif\ifthu@degree@graduate \newcommand\thu@set@graduate{% @@ -3511,10 +3526,23 @@ % 中文模板的公式编号使用中文括号。需要修改 \pkg{amsmath} 的 \cs{tagform@}。 % 这里中文的 \cs{unskip} 是为了“|式~\eqref|”这样的写法不产生额外的空格。 % \begin{macrocode} +\newcommand\thu@eqn@left@paren{(} +\newcommand\thu@eqn@right@paren{)} +\newcommand\thu@set@eqn@paren@style{% + \ifthu@eqn@paren@style@full + \renewcommand\thu@eqn@left@paren{(}% + \renewcommand\thu@eqn@right@paren{)}% + \else + \renewcommand\thu@eqn@left@paren{(}% + \renewcommand\thu@eqn@right@paren{)}% + \fi +} +\thu@set@eqn@paren@style +\thu@option@hook{eqn-paren-style}{\thu@set@eqn@paren@style} \newcommand\thu@put@parentheses[1]{% \ifthu@language@chinese \unskip - (#1)% + \thu@eqn@left@paren#1\thu@eqn@right@paren \else (#1)% \fi @@ -4584,14 +4612,15 @@ \restoregeometry } \newcommand\thu@set@student@id{% - \ifthu@thesis@type@proposal - \ifx\thu@student@id\@empty - \thusetup{student-id=2000310000}% + \ifthu@thesis@type@proposal\else + \ifx\thu@student@id\@empty\else + \thu@warning{`student-id' in "\protect\thusetup" would be ignored when `thesis-type' is not proposal.}% \fi \fi } \thu@set@student@id \thu@option@hook{thesis-type}{\thu@set@student@id} +\thu@option@hook{student-id}{\thu@set@student@id} % \end{macrocode} % % 涉密信息 @@ -4656,7 +4685,13 @@ \thu@info@item{工程领域}{}{\thu@engineering@field}% \thu@info@item{申请人}{\thu@name@title}{\thu@author}% \fi - \thu@info@item{学号}{}{\thu@student@id}% + \ifthu@thesis@type@proposal + \ifx\thu@student@id\@empty + \thu@warning{Missing option `student-id' in "\protect\thusetup", ID will not appear on cover.} + \else + \thu@info@item{学号}{}{\thu@student@id}% + \fi + \fi \thu@info@item{指导教师}{\thu@name@title}{\thu@supervisor}% \thu@info@item{副指导教师}{\thu@name@title}{\thu@associate@supervisor}% \thu@info@item{联合指导教师}{\thu@name@title}{\thu@co@supervisor}% @@ -6340,9 +6375,11 @@ % \begin{macrocode} \newenvironment{translation-index}{}{} \AtEndOfPackageFile*{bibunits}{ + \newcounter{thu@translation@index}% \renewenvironment{translation-index}{% + \global\advance\c@thu@translation@index\@ne \begin{bibunit}% - \renewcommand\@bibunitname{\jobname-index}% + \renewcommand\@bibunitname{\jobname-index-\arabic{thu@translation@index}}% \renewcommand\bibname{书面翻译对应的原文索引}% \thu@set@survey@bibheading }{% |