Skip to content

Commit

Permalink
Add option eqn-paren-style (#287)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed May 26, 2024
1 parent fd35bde commit 39a887c
Showing 1 changed file with 25 additions and 1 deletion.
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
\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

0 comments on commit 39a887c

Please sign in to comment.