summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/thuthesis/thuthesis.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/thuthesis/thuthesis.dtx')
-rw-r--r--macros/latex/contrib/thuthesis/thuthesis.dtx46
1 files changed, 38 insertions, 8 deletions
diff --git a/macros/latex/contrib/thuthesis/thuthesis.dtx b/macros/latex/contrib/thuthesis/thuthesis.dtx
index ea4ac03f22..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/05/20 7.5.1 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{} 定义了常用的数学环境:
@@ -1269,7 +1273,7 @@
% \begin{macrocode}
%<cls>\NeedsTeXFormat{LaTeX2e}[2017/04/15]
%<cls>\ProvidesClass{thuthesis}
-%<cls>[2024/05/20 7.5.1 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.1}
+\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
@@ -6347,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
}{%