From 1b2dc80bc47f12c5846e7616c287a772be5de763 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 12 Dec 2009 00:36:11 +0000 Subject: acronym update (11dec09) git-svn-id: svn://tug.org/texlive/trunk@16368 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/acronym/acronym.dtx | 248 ++++++++++++++++++--- Master/texmf-dist/source/latex/acronym/acronym.ins | 6 +- 2 files changed, 220 insertions(+), 34 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 47da340cfb8..87571600168 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{865} +% \CheckSum{953} % %% \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 @@ -71,7 +71,7 @@ % \DoNotIndex{\label, \labelsep, \labelwidth, \leftmargin, \let, % \long} % \DoNotIndex{\makelabel, \mathrm} -% \DoNotIndex{\NeedsTeXFormat, \newacro, \newcommand, \newenvironment, +% \DoNotIndex{\NeedsTeXFormat, \newcommand, \newenvironment, % \newif, \newtoks, \noexpand, \nolinebreak, \null} % \DoNotIndex{\PackageWarning, \ProcessOptions, \protect, % \protected@write, \providecommand, \ProvidesPackage} @@ -83,6 +83,7 @@ % \DoNotIndex{\usepackage} % % +% \changes{v1.35}{2009/10/20}{Sergio Callegari added support for nonstandard plural forms and fixed management of default short form.} % \changes{v1.34}{2009/01/25}{make sure that the s of acp get smaller as well when the smaller option is active} % \changes{v1.33}{2008/12/19}{enrico.gregorio provided a patch for makeing non-description acronym lists work} % \changes{v1.32}{2008/05/28}{Ulrich Diez again altered code to redefine labels in order to cope with unreproducable bug-reports. Warnings turnrd into infos for the sake of decreasing frightening-level} @@ -212,19 +213,19 @@ % % \DescribeMacro{\acp} % Works in the same way as \cmd{\ac}, but makes the short and/or -% long forms into English plurals by adding an `s'. +% long forms into plurals. % % \DescribeMacro{\acfp} % Works in the same way as \cmd{\acf}, but makes the short and -% long forms into English plurals by adding an `s'. +% long forms into plurals. % % \DescribeMacro{\acsp} % Works in the same way as \cmd{\acs}, but makes the short -% form into an English plural by adding an `s'. +% form into a plural. % % \DescribeMacro{\aclp} % Works in the same way as \cmd{\acl}, but makes the long form -% into an English plural by adding an `s'. +% into a plural. % % \DescribeMacro{\acfi} % Prints the Full Name acronym (\cmd{\acl}) in italics and the abbreviated @@ -281,9 +282,13 @@ % \end{quote} % % \subsection{Defining Acronyms} +% Acronyms can either defined from an environment specifically +% introduced for that purpose or by direct definitions. +% % \DescribeEnv{acronym} -% With the |acronym| environment you define all the acronyms in -% your document. +% The |acronym| environment allows one to define all the acronyms +% needed by a document at a single place and is self-documenting, +% since a table of acronyms is automatically produced. % % In the |acronym| environment, acronyms are defined with the % \DescribeMacro{\acro} command: @@ -309,11 +314,7 @@ % \end{quote} % Then |\acs{H2O}| gets ``$\mathrm{H_2O}$'' and % |\acl{H2O}| prints ``water''. -% -% All acronym definitions, made by \cmd{\acro} or \cmd{\acrodef} -% are added to the |.aux| file. Therefore they are available -% from start-up in the next run. -% +%% % Inside the |acronym| environment \DescribeMacro{\acroextra} % additional information can be added to the list of acronyms % with the \cmd{\acroextra} command that will not be included @@ -362,8 +363,86 @@ % |\usepackage[printonlyused,withpage]{acronym}| % \end{quote} % +% If one does not want an acronym list to be produced at all, +% acronyms can be defined directly thanks to the two commands +% \DescribeMacro{\newacro}% +% \DescribeMacro{\acrodef}% +% \begin{quote} +% |\newacro{|\meta{acronym}|}[|\meta{short name}|]{|\meta{full name}|}|\\ +% |\acrodef{|\meta{acronym}|}[|\meta{short name}|]{|\meta{full name}|}| +% \end{quote} +% \noindent the difference between the two consisting in the fact +% that the latter makes the acronym definition stored in the |.aux| +% file. Therefore, the acronym becomes available from start-up in +% the next run. +% +% Note that all the acronym definitions made by \cmd{\acro} in the +% |acronym| environment are also similarly added to the |.aux| +% file. +% +% +% \subsubsection{Non standard and foreign plural forms} +% +% When the plural form of an acronym is required, the package +% typically obtains it as an English plural, by adding an `s'. This +% happens both for long and short forms. For instance, for an +% acronym defined as +% \begin{quote} +% |\newacro{IC}{Integrated Circuit}| +% \end{quote} +% \noindent the |\acsp{IC}| command produces ``ICs'', and the +% |\aclp{IC}| command produces ``Integrated Circuits''. +% +% Unfortunately, this is generally not suitable for typesetting in +% languages different from English, and at times it is not correct +% even for English. For instance consider the ``MP'' acronym, +% commonly used to refer to a ``Member of the Parlament''. Of +% course, its long form plural is not ``Member of the Parlaments'', +% but ``Members of the Parlament''. For the short form plural, +% ``MPs'' is anyway commonly accepted. The same happens with ``SOC +% (System on a Chip)'' or ``BUT (Block Under Test)''. +% +% In foreign languages, things can be even more complicated. For +% instance, in Italian, there are different rules for English +% acronyms used in Italian text and Italian acronyms used in +% Italian text. The former do not get a plural at all, neither for +% the long, nor for the short form as in ``Un paio di +% \emph{Integrated Circuit (IC)}''. The latter get a plural long +% form following the natural Italian rules for plurals, and a +% plural short form that can either be the same as the singular +% short form, or --- at times --- a form obtained by doubling those +% letter of the short form that correspond to words that get a +% plural in the long form. For instance: ``Nucleo Investigativo +% (NI)'' could take a plural as in ``Nuclei Investigativi (NNII)'', +% although in modern texts one is more likely to find ``Nuclei +% Investigativi (NI)''. +% +% To deal with all these different situations, the package (since +% version 1.35) has been enriched with the following three commands +% \DescribeMacro{\newacroplural} +% \DescribeMacro{\acrodefplural} +% \DescribeMacro{\acroplural} +% \begin{quote} +% |\newacroplural{|\meta{acronym}|}[|\meta{short plural}|]{|% +% \meta{long plural}|}|\\ +% |\acrodefplural{|\meta{acronym}|}[|\meta{short plural}|]{|% +% \meta{long plural}|}|\\ +% |\acroplural{|\meta{acronym}|}[|\meta{short plural}|]{|% +% \meta{long plural}|}|\\ +% \end{quote} +% \noindent that allow one to define plural exceptions. The first +% one is meant to be used in the |acronym| environment. The +% difference among the latter two is that \cmd{\acrodefplural} puts +% the acronym definition in the |.aux| file, so that the acronym +% exception is available at the next run from start-up. When the +% optional short form is not provided, the acronym name plus an `s' +% is used. +% +% Plural exceptions are never reported in tables of acronyms. +% +% % \subsection{Miscellaneous} -% \subsubsection*{Sectioning and pdf marks} +% \subsubsection{Sectioning and pdf marks} % Acronyms are robust (since version 1.12) and can be used in % sectional headers such as \cmd{\chapter}, \cmd{\section}, etc., % but please note the following: @@ -450,6 +529,11 @@ between the constant of Boltzmann and the \acl{NA}: \acl{lox}/\acl{lh2} (\acsu{lox}/\acsu{lh2}) +\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 + \section{Acronyms} \begin{acronym}[TDMA] \acro{CDMA}{Code Division Multiple Access} @@ -462,6 +546,9 @@ between the constant of Boltzmann and the \acl{NA}: \acro{UA}{Used Acronym} \acro{lox}[\ensuremath{LOX}]{Liquid Oxygen}% \acro{lh2}[\ensuremath{LH_2}]{Liquid Hydrogen}% + \acro{IC}{Integrated Circuit}% + \acro{BUT}{Block Under Test}% + \acrodefplural{BUT}{Blocks Under Test}% \end{acronym} \end{document} @@ -486,8 +573,8 @@ between the constant of Boltzmann and the \acl{NA}: % First we test that we got the right format and name the package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{acronym}[2009/01/25 - v1.34 +\ProvidesPackage{acronym}[2009/10/20 + v1.35 Support for acronyms (Tobias Oetiker)] \RequirePackage{suffix} % \end{macrocode} @@ -689,7 +776,7 @@ between the constant of Boltzmann and the \acl{NA}: \let\acsu\acs \let\aclu\acl \def\AChy@acf#1{\AC@acl{#1} (\AC@acs{#1})}% - \def\AChy@acfp#1{\AC@acl{#1}s (\AC@acs{#1}s)}% + \def\AChy@acfp#1{\AC@aclp{#1} (\AC@acsp{#1})}% }% } % \end{macrocode} @@ -815,12 +902,11 @@ between the constant of Boltzmann and the \acl{NA}: % command \fnacro. % \begin{macrocode} \newcommand*\newacro[1]{% - \@ifnextchar[{\AC@newacro{#1}}{\AC@newacro{#1}[\AC@temp]}} + \@ifnextchar[{\AC@newacro{#1}}{\AC@newacro{#1}[#1]}} % \end{macrocode} % \begin{macrocode} \newcommand\AC@newacro{} \def\AC@newacro#1[#2]#3{% - \def\AC@temp{#1}% \expandafter\gdef\csname fn@#1\endcsname{{#2}{#3}}% } % \end{macrocode} @@ -833,12 +919,11 @@ between the constant of Boltzmann and the \acl{NA}: % writes it into the |.aux| file. % \begin{macrocode} \newcommand*\acrodef[1]{% - \@ifnextchar[{\AC@acrodef{#1}}{\AC@acrodef{#1}[\AC@temp]}} + \@ifnextchar[{\AC@acrodef{#1}}{\AC@acrodef{#1}[#1]}} % \end{macrocode} % \begin{macrocode} \newcommand\AC@acrodef{} \def\AC@acrodef#1[#2]#3{% - \def\AC@temp{#1}% \@bsphack \protected@write\@auxout{}{\string\newacro{#1}[#2]{#3}}% \@esphack} @@ -897,6 +982,7 @@ between the constant of Boltzmann and the \acl{NA}: % \begin{macrocode} \newenvironment{acronym}[1][1]{% \providecommand*{\acro}{\AC@acro}% + \providecommand*{\acroplural}{\AC@acroplural}% \long\def\acroextra##1{##1}% \def\@tempa{1}\def\@tempb{#1}% \ifx\@tempa\@tempb% @@ -933,12 +1019,11 @@ between the constant of Boltzmann and the \acl{NA}: % \begin{macro}{\AC@@acro} % \begin{macrocode} \newcommand*\AC@acro[1]{% - \@ifnextchar[{\AC@@acro{#1}}{\AC@@acro{#1}[\AC@temp]}} + \@ifnextchar[{\AC@@acro{#1}}{\AC@@acro{#1}[#1]}} % \end{macrocode} % \begin{macrocode} \newcommand\AC@@acro{} \def\AC@@acro#1[#2]#3{% - \def\AC@temp{#1}% \ifAC@nolist% \else% \ifAC@printonlyused% @@ -970,6 +1055,107 @@ between the constant of Boltzmann and the \acl{NA}: % \end{macro} % % +% \subsubsection{Non standard or foreign plural forms} +% +% \begin{macro}{\newacroplural} +% \begin{macro}{\AC@newacroplurali} +% \begin{macro}{\AC@newacropluralii} +% Sets up a non standard plural form for a given acronym. +% \begin{macrocode} +\newcommand*\newacroplural[1]{% + \@ifnextchar[%] + {\AC@newacroplurali{#1}}{\AC@newacropluralii{#1}}% +} +\newcommand\AC@newacroplurali{} +\def\AC@newacroplurali#1[#2]#3{% + \expandafter\gdef\csname fn@#1@PS\endcsname{#2}% + \expandafter\gdef\csname fn@#1@PL\endcsname{#3}% +} +\newcommand\AC@newacropluralii[2]{% + \expandafter\gdef\csname fn@#1@PL\endcsname{#2}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\acrodefplural} +% \begin{macro}{\AC@acrodefplurali} +% \begin{macro}{\AC@acrodefpluralii} +% Same as above, storing content in aux file. +% \begin{macrocode} +\newcommand*\acrodefplural[1]{% + \@ifnextchar[%] + {\AC@acrodefplurali{#1}}{\AC@acrodefpluralii{#1}}% +} +\newcommand\AC@acrodefplurali{} +\def\AC@acrodefplurali#1[#2]#3{% + \@bsphack + \protected@write\@auxout{}{\string\newacroplural{#1}[#2]{#3}}% + \@esphack +} +\newcommand\AC@acrodefpluralii[2]{% + \@bsphack + \protected@write\@auxout{}{\string\newacroplural{#1}{#2}}% + \@esphack +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\AC@acroplural} +% \begin{macro}{\AC@acroplurali} +% \begin{macro}{\AC@acropluralii} +% Internal commands to set up a plural version of an acronym in the +% acronym environment. +% \begin{macrocode} +\newcommand*\AC@acroplural[1]{% + \@ifnextchar[%] + {\AC@acroplurali{#1}}{\AC@acropluralii{#1}}% +} +\newcommand\AC@acroplurali{} +\def\AC@acroplurali#1[#2]#3{% + \@bsphack + \protected@write\@auxout{}% + {\string\newacroplural{#1}[\string\AC@hyperlink{#1}{#2}]{#3}}% + \@esphack +} +\newcommand\AC@acropluralii[2]{ + \@bsphack + \protected@write\@auxout{}% + {\string\newacroplural{#1}[\string\AC@hyperlink{#1}{\AC@acs{#1}}]{#2}}% + \@esphack +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\AC@aclp} +% \begin{macro}{\AC@acsp} +% Deliver either standard or nonstandard plural form (long and short +% respectively). +% \begin{macrocode} +\newcommand*\AC@aclp[1]{% + \ifcsname fn@#1@PL\endcsname + \csname fn@#1@PL\endcsname + \else + \AC@acl{#1}s% + \fi +} +\newcommand*\AC@acsp[1]{% + \ifcsname fn@#1@PS\endcsname + \csname fn@#1@PS\endcsname + \else + \AC@acs{#1}s% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} + % % \subsection{Using acronyms} % @@ -1226,11 +1412,11 @@ between the constant of Boltzmann and the \acl{NA}: % \end{macrocode} % \begin{macrocode} \newcommand*{\acspa}[1]{% - \texorpdfstring{\protect\@acsp{#1}}{#1s}} + \texorpdfstring{\protect\@acsp{#1}}{\AC@acsp{#1}}} % \end{macrocode} % \begin{macrocode} \newcommand*{\@acsp}[1]{% - \acsfont{\AC@acs{#1}s}% + \acsfont{\AC@acsp{#1}}% \ifAC@starred\else\AC@logged{#1}\fi} % \end{macrocode} % \end{macro} @@ -1247,7 +1433,7 @@ between the constant of Boltzmann and the \acl{NA}: % \end{macrocode} % \begin{macrocode} \newcommand*{\@aclp}[1]{% - \AC@acl{#1}s% + \AC@aclp{#1}% \ifAC@starred\else\AC@logged{#1}\fi} % \end{macrocode} % \end{macro} @@ -1270,18 +1456,18 @@ between the constant of Boltzmann and the \acl{NA}: % \end{macrocode} % \begin{macrocode} \newcommand*{\acfpa}[1]{% - \texorpdfstring{\protect\@acfp{#1}}{\AC@acl{#1}s (#1s)}} + \texorpdfstring{\protect\@acfp{#1}}{\AC@aclp{#1} (\AC@acsp{#1})}} % \end{macrocode} % \begin{macrocode} \newcommand*{\@acfp}[1]{% \ifAC@footnote - \acsfont{\AC@acs{#1}s}% - \footnote{\AC@placelabel{#1}\AC@acl{#1}s{}}% + \acsfont{\AC@acsp{#1}}% + \footnote{\AC@placelabel{#1}\AC@aclp{#1}{}}% \else \acffont{% - \AC@placelabel{#1}\AC@acl{#1}s% + \AC@placelabel{#1}\AC@aclp{#1}% \nolinebreak[3] % - \acfsfont{(\acsfont{\AC@acs{#1}s})}% + \acfsfont{(\acsfont{\AC@acsp{#1}})}% }% \fi \ifAC@starred\else\AC@logged{#1}\fi} diff --git a/Master/texmf-dist/source/latex/acronym/acronym.ins b/Master/texmf-dist/source/latex/acronym/acronym.ins index e6f4e2795f8..a2e9f586a08 100644 --- a/Master/texmf-dist/source/latex/acronym/acronym.ins +++ b/Master/texmf-dist/source/latex/acronym/acronym.ins @@ -4,7 +4,7 @@ %% driver files from the doc files in this package when run through %% LaTeX or TeX. %% -%% Copyright 1995--2005 by Tobias Oetiker (oetiker@ee.ethz.ch) +%% Copyright 1995--2009 by Tobias Oetiker (tobi@oetiker.ch) %% and individual authors listed elsewhere %% in this file. %% All rights reserved. @@ -20,7 +20,7 @@ %% version 2003/12/01 or later. %% %% This work has the LPPL maintenance status "maintained". -%% The Current Maintainer of this work is Tobias Oetiker (oetiker@ee.ethz.ch). +%% The Current Maintainer of this work is Tobias Oetiker (tobi@oetiker.ch). %% %% This work consists of the files acronym.dtx and acronym.ins and the %% derived files acronym.sty and acrotest.tex. @@ -31,7 +31,7 @@ \keepsilent \preamble - Copyright 1995--2005 by Tobias Oetiker (oetiker@ee.ethz.ch) + Copyright 1995--2009 by Tobias Oetiker (tobi@oetiker.ch) and individual authors listed elsewhere. All rights reserved. -- cgit v1.2.3