From a0fc5a65fc2886b3bd8a04e94db45c2f9f126d24 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 11 Apr 2020 22:20:38 +0000 Subject: acronym (11apr20) git-svn-id: svn://tug.org/texlive/trunk@54651 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/acronym/acronym.dtx | 73 ++++++++++++++-------- 1 file changed, 47 insertions(+), 26 deletions(-) (limited to 'Master/texmf-dist/source/latex/acronym') diff --git a/Master/texmf-dist/source/latex/acronym/acronym.dtx b/Master/texmf-dist/source/latex/acronym/acronym.dtx index 31211759a80..f7d8e8eabd2 100644 --- a/Master/texmf-dist/source/latex/acronym/acronym.dtx +++ b/Master/texmf-dist/source/latex/acronym/acronym.dtx @@ -35,7 +35,7 @@ % % \fi % -% \CheckSum{1522} +% \CheckSum{1526} % %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -82,6 +82,7 @@ % \DoNotIndex{\textbf, \textsf, \textsmaller, \textsuperscript, \the} % \DoNotIndex{\usepackage} % +% \changes{v1.47}{2020/04/10}{Tobi Oetiker and Marcus Meeßen \cmd{hskip} Fixed several bugs in macros that use capitalisation, a bug were the output depends on the position of the list of acronyms, and a bug were nested hyperlinks could cause errors.} % \changes{v1.46}{2020/03/13}{Tobi Oetiker \cmd{hskip} Fixed miss merge} % \changes{v1.45}{2020/03/13}{Marcus Meeßen \cmd{hskip} Fixed hyperref and "missing aux" regressions.} % \changes{v1.44}{2020/02/07}{Marcus Meeßen \cmd{hskip} Added the |printonlyreused| option, which allows to automatically exclude acronyms from the list of acronyms if they are used only once} @@ -636,7 +637,8 @@ neutrinoless double beta decay. \subsection{Some testing fundamentals} When testing \acp{IC}, one typically wants to identify functional blocks to be tested separately. The latter are commonly indicated as -\acp{BUT}. To test a \ac{BUT} requires defining a testing strategy\dots +\acp{BUT}. To test a \ac{BUT} requires defining a testing strategy\dots{} +\Iac{IC} popped up unexpectedly. \section{Acronyms} \begin{acronym}[TDMA] @@ -655,6 +657,7 @@ blocks to be tested separately. The latter are commonly indicated as \acro{IC}{Integrated Circuit}% \acro{BUT}{Block Under Test}% \acrodefplural{BUT}{Blocks Under Test}% + \acroindefinite{IC}{an}{an} \end{acronym} \end{document} @@ -679,8 +682,8 @@ blocks to be tested separately. The latter are commonly indicated as % First we test that we got the right format and name the package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{acronym}[2020/03/13 - v1.46 +\ProvidesPackage{acronym}[2020/04/17 + v1.47 Support for acronyms (Tobias Oetiker)] \RequirePackage{suffix,xstring} % \end{macrocode} @@ -1039,7 +1042,6 @@ blocks to be tested separately. The latter are commonly indicated as % acronyms is in the front matter of the document. % \begin{macrocode} \newcommand*{\AC@logged}[1]{% - \acronymused{#1}% mark it as used in the current run too \@bsphack \protected@write\@auxout{}{\string\acronymused{#1}}% \@esphack} @@ -1080,9 +1082,8 @@ blocks to be tested separately. The latter are commonly indicated as % Internal commands for making a first letter upper case. % \begin{macrocode} \newcommand{\@firstupper}[1]{% - \StrLeft{#1}{1}[\firstletter]% - \StrGobbleLeft{#1}{1}[\remainder]% - \MakeUppercase\firstletter\remainder% + \StrSplit{#1}{1}{\head}{\tail}% + \MakeUppercase\head\tail% } % \end{macrocode} % \end{macro} @@ -1340,7 +1341,7 @@ blocks to be tested separately. The latter are commonly indicated as \newcommand\AC@acroindefinite[3]{ \@bsphack \protected@write\@auxout{}% - {\string\newacroindefinite{#1}{\string\AC@hyperlink{#1}{#2}}{#3}}% + {\string\newacroindefinite{#1}{#2}{#3}}% \@esphack } % \end{macrocode} @@ -1438,7 +1439,9 @@ blocks to be tested separately. The latter are commonly indicated as \fi } \newcommand*\AC@Aclp[1]{% - \@firstupper\expandafter{\AC@aclp{#1}}% + \AC@uppertrue% + \AC@aclp{#1}% + \AC@upperfalse% } \newcommand*\AC@acsp[1]{% \ifcsname fn@#1@PS\endcsname @@ -1465,6 +1468,16 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macrocode} % \end{macro} % +% \begin{macro}{\ifAC@upper} +% If an acronym needs to be capitalized, this flag is used to indicate +% this at an appropriate point in the code. In that case, the firstupper +% command will be called at a time when the acronym is expandable, otherwise +% the xstring command will not work properly. +% \begin{macrocode} +\newif\ifAC@upper +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\AC@get} % If the acronym is undefined, the internal macro \cmd{\AC@get} % warns the user by printing the name in bold with an exclamation @@ -1475,12 +1488,17 @@ blocks to be tested separately. The latter are commonly indicated as % saved in \fnacro. % \begin{macrocode} \newcommand*\AC@get[3]{% - \ifx#1\relax - \PackageWarning{acronym}{Acronym `#3' is not defined}% - \textbf{#3!}% + \ifx#1\relax + \PackageWarning{acronym}{Acronym `#3' is not defined}% + \textbf{#3!}% + \else + \ifAC@upper + \@firstupper{\expandafter#2#1}% \else - \expandafter#2#1% - \fi} + \expandafter#2#1% + \fi + \fi +} % \end{macrocode} % \end{macro} % @@ -1500,7 +1518,9 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macrocode} % \begin{macrocode} \newcommand*\AC@Acl[1]{% - \@firstupper\expandafter{\AC@acl{#1}}% + \AC@uppertrue% + \AC@acl{#1}% + \AC@upperfalse% } % \end{macrocode} % \end{macro} @@ -1780,25 +1800,26 @@ blocks to be tested separately. The latter are commonly indicated as % \end{macrocode} % \begin{macrocode} \newcommand*{\@iaci}[1]{% - \ifcsname fn@#1@IL\endcsname - \ifAC@dua - \csname fn@#1@IL\endcsname% - \else - \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used% + \ifcsname fn@#1@IL\endcsname + \ifAC@dua + \csname fn@#1@IL\endcsname% + \else + \expandafter\ifx\csname AC@\AC@prefix#1\endcsname\AC@used% \csname fn@#1@IS\endcsname% \else \csname fn@#1@IL\endcsname% \fi - \fi - \else - a% - \fi + \fi + \else + a% + \fi } \newcommand*{\@iac}[2][\AC@linebreakpenalty]{% \@iaci{#2} \ifAC@starred\ac*[#1]{#2}\else\ac[#1]{#2}\fi% } \newcommand*{\@Iac}[2][\AC@linebreakpenalty]{% - \@firstupper{\@iaci{#2}} \ifAC@starred\ac*[#1]{#2}\else\ac[#1]{#2}\fi% + \@firstupper{\@iaci{#2}}\space% + \ifAC@starred\ac*[#1]{#2}\else\ac[#1]{#2}\fi% } % \end{macrocode} % \end{macro} -- cgit v1.2.3