Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增选项 eqn-paren-style 选择数学公式编号的括号为全角/半角 #959

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion thuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,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{%
Expand Down Expand Up @@ -3511,10 +3522,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
Harry-Chen marked this conversation as resolved.
Show resolved Hide resolved
\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
Expand Down