此处,\bfseries\MakeUppercase{\numberstringnum\numpoints}
结果为一5代替十五。
此外,大写字母不适用于其余元素(例如\MakeUppercase{\numberstringnum\numquestions}
应该给予二代替二。
\documentclass[addpoints]{exam}
\usepackage{fmtcount}
\begin{document}
This exam contains {\bfseries\MakeUppercase{\numberstringnum\numquestions}} questions, {\bfseries\MakeUppercase{\numberstringnum\numpages}} pages (including the cover) for the total of {\bfseries\MakeUppercase{\numberstringnum\numpoints}} marks.
\begin{questions}
\question[10] some question
\question[5] another question
\end{questions}
\end{document}
答案1
以下补丁使用etoolbox
确保在使用字符串打印数字时不会出现任何错误。此外,它还\NAME
为三个\num
-macros 定义了 -companions,允许您在其他地方继续使用\num
-macros:
\documentclass[addpoints]{exam}
\usepackage{fmtcount,etoolbox}
\makeatletter
\let\NAMEquestions\numquestions
\patchcmd{\NAMEquestions}{\exam@numquestions}{{\NUMBERstringnum\exam@numquestions}}{}{}
\let\NAMEpages\numpages
\patchcmd{\NAMEpages}{\exam@lastpage}{{\NUMBERstringnum\exam@lastpage}}{}{}
\let\NAMEpoints\numpoints
\patchcmd{\NAMEpoints}{\exam@numpoints}{{\NUMBERstringnum\exam@numpoints}}{}{}
\makeatother
\begin{document}
This exam contains \textbf{\NAMEquestions} questions,
\textbf{\NAMEpages} pages (including the cover)
for a total of \textbf{\NAMEpoints} marks.
\begin{questions}
\question[10] some question
\question[5] another question
\end{questions}
\end{document}
使用\MakeUppercase
已明确涵盖在fmtcount
文档\NUMBERstring
,因此/的定义\NUMBERstringnum
与\numberstring
/相对应\numberstringnum
。