当acronym
包创建脚注时,它会插入acro
宏提供的首字母缩略词的定义。我对是否将定义大写存在争议,请参阅 MWE。
\documentclass{article}
\usepackage[footnote]{acronym}
\usepackage{a4wide}
\title{Capitalization issues}
\author{Dohn Joe}
\begin{document}
\maketitle
\section*{My problem}
I would like the long form of the acronyms to be in lower case, since this
supports the use of the \verb+\acl+ macro. However, footnotes\footnote{Like
this example.} should start with a capital letter. \\[3ex]
%
Is there a way to enforce the capitalization of the first letter in a
footnote?\\[5ex]
%
A sentence containing \ac{CCM} and \acl{CCM}. \\[3ex]
%
Another sentence containing \ac{CFD} and \acl{CFD}.
\section*{Acronyms}
\begin{acronym}
\acro{CCM}{Computational continuum mechanics}
\acro{CFD}{computational fluid dynamics}
\end{acronym}
\end{document}
答案1
您可以修补该命令\@acf
。它有一行
\footnote{\AC@placelabel{#1}\AC@acl{#1}{}}
可以改成
\footnote{\AC@placelabel{#1}\@firstupper{\AC@acl{#1}}{}}
该命令\@firstupper
由包定义acronym
。可以使用 来进行etoolbox
修补\patchcmd
。
\documentclass{article}
\usepackage[footnote]{acronym}
\usepackage{a4wide}
\title{Capitalization issues}
\author{Dohn Joe}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@acf
{\footnote{\AC@placelabel{#1}\AC@acl{#1}{}}} % search
{\footnote{\AC@placelabel{#1}\@firstupper{\AC@acl{#1}}{}}} % replace
{} % success
{} % failure
\makeatother
\begin{document}
\maketitle
\section*{My problem}
I would like the long form of the acronyms to be in lower case, since this
supports the use of the \verb+\acl+ macro. However, footnotes\footnote{Like
this example.} should start with a capital letter.
Is there a way to enforce the capitalization of the first letter in a
footnote?
A sentence containing \ac{CCM} and \acl{CCM}.
Another sentence containing \ac{CFD} and \acl{CFD}.
\section*{Acronyms}
\begin{acronym}
\acro{CCM}{Computational continuum mechanics}
\acro{CFD}{computational fluid dynamics}
\end{acronym}
\end{document}