cgnieder / acro

acronyms for LaTeX
LaTeX Project Public License v1.3c
42 stars 9 forks source link

Let all acronym commands act as if their starred form also in `\title`, `\author`, `\date` #216

Closed dbitouze closed 2 years ago

dbitouze commented 3 years ago

I've read the warning:

In a number of contexts all acronym commands act as if their starred form is used: in the table of contents, in the list of figures, and in the list of tables. The same is true for floats and the measuring phase of common table environments like tabularx or ltxtable.

and that's a nice feature.

May I suggest making the title's commands (\title, \author, \date) be one of these contexts. It would be nice e.g. in the following case where the first occurrence of \ac{mit} in the text would be welcome to be printed in its full form:

\documentclass{article}
\usepackage{acro}
\DeclareAcronym{mit}{
  short = MIT ,
  long = Massachusetts Institute of Technology
}
\title{Interesting document}
\author{Jane Doe\\\acs{mit}}
\begin{document}
\maketitle
This work has been done at the \ac{mit}.
\end{document}
cgnieder commented 2 years ago

You can use \acswitchoff and \acswitchon for a manual solution but a patch to \maketitle seems reasonable.

\documentclass{article}
\usepackage{acro}
\DeclareAcronym{mit}{
  short = MIT ,
  long = Massachusetts Institute of Technology
}

\title{Interesting document}
\author{Jane Doe\\\acs{mit}}

\begin{document}

\acswitchoff\maketitle\acswitchon

This work has been done at the \ac{mit}.

\end{document}