diff options
author | Karl Berry <karl@freefriends.org> | 2008-03-10 00:06:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-03-10 00:06:45 +0000 |
commit | 11ac15c4cffc0e2fc7483cbfb12df95486027c39 (patch) | |
tree | 09ef077e1f27d0f859b4bf4da9fff02f041c4641 /Master/texmf-dist/source/latex/glossaries | |
parent | 6334e64f786e98ab10d13c8ef58e72e9dc461b4b (diff) |
glossaries 1.12 (9mar08)
git-svn-id: svn://tug.org/texlive/trunk@6924 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries')
3 files changed, 687 insertions, 129 deletions
diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx index 08536be6b18..b4c707a604c 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -4,6 +4,7 @@ % -macrocode "glossaries\.perl" % -macrocode ".*\.tex" % -src "glossaries.sty\Z=>glossaries.sty" +% -src "mfirstuc.sty\Z=>mfirstuc.sty" % -src "(glossary-.+)\.(sty)\Z=>\1.\2" % -src "(glossaries-babel)\.(sty)\Z=>\1.\2" % -src "(glossaries-dictionary-.+)\.(dict)\Z=>\1.\2" @@ -19,7 +20,7 @@ % -doc "glossaries-manual.tex" % -codetitle "Documented Code" % glossaries -% Created on 2008/3/4 12:06 +% Created on 2008/3/8 23:00 %\fi %\iffalse %<*package> @@ -70,7 +71,7 @@ \makeatother \RecordChanges \PageIndex -\CheckSum{4357} +\CheckSum{4630} \CodelineNumbered \newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}} \newcommand*{\term}[1]{#1\iterm{#1}} @@ -108,7 +109,7 @@ %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{glossaries.sty v 1.11: \LaTeXe\ Package to Assist Generating Glossaries} +% \title{glossaries.sty v 1.12: \LaTeXe\ Package to Assist Generating Glossaries} % \author{Nicola L.C. Talbot\\[10pt] %School of Computing Sciences\\ %University of East Anglia\\ @@ -116,7 +117,7 @@ %NR4 7TJ. United Kingdom.\\ %\url{http://theoval.cmp.uea.ac.uk/~nlct/}} % -% \date{2nd March 2008} +% \date{8th March 2008} % \maketitle %\tableofcontents % @@ -137,7 +138,7 @@ %limited multi-lingual support, thanks to all the people who have sent %me the relevant translations either via email or via comp.text.tex. %However you must load \isty{babel} \emph{before} -%\sty{glossaries} to enable this. (See \autoref{sec:predefinednames} for thepredefined names used by the \sty{glossaries} package.) +%\sty{glossaries} to enable this. (See \autoref{sec:predefinednames} for the predefined names used by the \sty{glossaries} package.) %As from version 1.1, the \sty{glossaries} package also supports %Till~Tantau's \isty{translator} package provided it is loaded %before the \sty{glossaries} package. This makes it easier to change @@ -147,7 +148,12 @@ % %This documentation is structured as follows: \autoref{sec:quick} is for people who want a few quick pointers of how to get started, %without having to read through lengthy descriptions, -%\autoref{sec:overview} gives an overview of available commands. +%\autoref{sec:overview} gives an overview of available commands and their syntax, \autoref{sec:mfirstuc} describes the associated +%\sty{mfirstuc} +%package, \autoref{sec:code} contains the documented source code for those who want to know more about how the +%package works and how to do more complicated things, such as +%changing the way glossary entries appear. +% %\subsection{Generating the associated glossary files} %\label{sec:makeglossaries} % @@ -326,6 +332,12 @@ %\newglossaryentry{elite}{name={{\'e}lite}, %description={select group or class}} %\end{verbatim} +%Likewise with commands such as \cs{ae} and \cs{oe}: +%\begin{verbatim} +%\newglossaryentry{oesophagus}{% +%name={{\oe}sophagus}, +%description={canal from mouth to stomach}} +%\end{verbatim} % %\item If you have multiple glossaries, use the \gloskey{type} %key to specify in which glossary the entry belongs. For example: @@ -763,6 +775,11 @@ %\item[{\gloskey{description}}] A brief description of this term (to %appear in the glossary). % +%\item[{\gloskey{descriptionplural}}] The plural form of the +%description (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst} +%by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value +%is set to the same as the \gloskey{description} key. +% %\item[{\gloskey{text}}] How this entry will appear in the document text %when using \ics{gls} (or one of its uppercase variants). If this %field is omitted, the value of the \gloskey{name} key is used. @@ -787,6 +804,11 @@ %specify an associated symbol, but most glossary styles ignore %this value. If omitted, the value is set to \cs{relax}. % +%\item[{\gloskey{symbolplural}}] This is the plural form of the +%symbol (as passed to \ics{glsdisplay} and \ics{glsdisplayfirst} +%by \ics{glspl}, \ics{Glspl} and \ics{GLSpl}). If omitted, the value +%is set to the same as the \gloskey{symbol} key. +% %\item[{\gloskey{sort}}] This value indicates how \appname{makeindex} %should sort this entry. If omitted, the value is given by the %\gloskey{name} field. This value is equivalent to @@ -801,16 +823,29 @@ %\texttt{acronym}, depending on whether the \pkgopt{acronym} package %option was used. %\end{description} -%Note that if the \gloskey{text} key (or the \gloskey{name} key, if the -%\gloskey{text} key is omitted) starts with an accented letter, +%Note that if the key starts with an accented letter, %you must group the accented letter, otherwise it will cause a %problem for \cs{Gls} and \cs{Glspl}. For example: %\begin{verbatim} %\newglossaryentry{elite}{name={{\'e}lite}, %description={select group or class}} %\end{verbatim} -%(Likewise for the \gloskey{plural}, \gloskey{first} and -%\gloskey{firstplural} keys.) +%Similarly, commands such as \cs{ae} and \cs{oe} should either be placed +%inside a group or followed by a space. For example: +%\begin{verbatim} +%\newglossaryentry{oesophagus}{% +%name={{\oe}sophagus}, +%description={canal from mouth to stomach}} +%\end{verbatim} +%The following is also fine: +%\begin{verbatim} +%\newglossaryentry{oesophagus}{% +%name={\oe sophagus}, +%description={canal from mouth to stomach}} +%\end{verbatim} +%but don't do \verb|\oe{}sophagus| as it will confuse +%\ics{makefirstuc} (described +%in \autoref{sec:mfirstuc}) and will produce \oe{}Sophagus instead of {\OE}sophagus. % %\DescribeMacro{\loadglsentries} %You can store all your glossary entry definitions in another @@ -1429,6 +1464,28 @@ %\end{center} %\end{table} % +%In case you can't remember which key stores the long or short forms +%(or their plurals) the \sty{glossaries} package provides the +%commands: +%\begin{itemize} +%\item\DescribeMacro{\glsshortkey}\cs{glsshortkey} +%The key used to store the short form. +%\item\DescribeMacro{\glsshortpluralkey}\cs{glsshortpluralkey} +%The key used to store the plural version of the short form. +%\item\DescribeMacro{\glslongkey}\cs{glslongkey} +%The key used to store the long form. +%\item\DescribeMacro{\glslongpluralkey}\cs{glslongpluralkey} +%The key used to store the plural version of the long form. +%\end{itemize} +%These can be used in the optional argument of \cs{newacronym} +%to override the defaults. For example: +%\begin{verbatim} +%\newacronym[\glslongpluralkey={diagonal matrices}]{dm}{DM}{diagonal +%matrix} +%\end{verbatim} +%If the first use uses the plural form, \verb|\glspl{dm}| will +%display: diagonal matrices (DMs). +% %Each of the package options \pkgopt{smallcaps}, \pkgopt{footnote} %and \pkgopt{description} use \ics{defglsdisplay} and %\ics{defglsdisplayfirst} (described in \autoref{sec:glsdisplay}) @@ -1878,6 +1935,35 @@ %} %\end{verbatim} % +%\section{Mfirstuc Package} +%\label{sec:mfirstuc} +% +%The \sty{glossaries} package is supplied with the package +%\isty{mfirstuc} which provides the command:\\[10pt] +%\DescribeMacro{\makefirstuc} +%\cs{makefirstuc}\marg{stuff}\\[10pt] +%which makes the first object of +%\meta{stuff} uppercase unless \meta{stuff} starts with a control +%sequence followed by a group, in which case the first +%object in the group is converted to uppercase. Examples: +%\begin{itemize} +%\item \verb|\makefirstuc{abc}| produces Abc +% +%\item \verb|\makefirstuc{\emph{abc}}| produces \emph{Abc} +%(\ics{MakeUppercase} has been applied to the letter \dq{a} rather +%than \cs{emph}.) +% +%\item \verb|\makefirstuc{{\'a}bc}| produces {\'A}bc +% +%\item \verb|\makefirstuc{\ae bc}| produces \AE bc +% +%\item \verb|\makefirstuc{{\ae}bc}| produces {\AE}bc +%\end{itemize} +% +%Note however that \verb|\makefirstuc{\ae{}bc}| produces \ae Bc since +%the empty group following \cs{ae} is considered to be the argument +%of \cs{ae} which is in fact not the case. +% % \StopEventually{\clearpage\phantomsection\addcontentsline{toc}{section}{Index}\PrintIndex} % % @@ -1894,12 +1980,13 @@ % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2008/02/22 v1.11 (NLCT)] +\ProvidesPackage{glossaries}[2008/03/08 v1.12 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] +\RequirePackage{mfirstuc} % \end{macrocode} %\changes{1.1}{2008 Feb 22}{amsgen now loaded (\cs{new@ifnextchar} needed)} % Need to use \cs{new@ifnextchar} instead of \cs{@ifnextchar} in @@ -2774,6 +2861,12 @@ exists}% \def\@glo@desc{#1}% } % \end{macrocode} +% \changes{1.12}{2008 Mar 8}{descriptionplural key added} +% \begin{macrocode} +\define@key{glossentry}{descriptionplural}{% +\def\@glo@descplural{#1}% +} +% \end{macrocode} % % The \gloskey{sort} key needs to be sanitized here % (the sort key is provided for \appname{makeindex}'s benefit, @@ -2840,6 +2933,12 @@ exists}% \def\@glo@symbol{#1}% } % \end{macrocode} +% \changes{1.12}{2008 Mar 8}{symbolplural key added} +% \begin{macrocode} +\define@key{glossentry}{symbolplural}{% +\def\@glo@symbolplural{#1}% +} +% \end{macrocode} % % The \gloskey{type} key specifies to which glossary this % entry belongs. If omitted, the default glossary is used. @@ -2882,12 +2981,30 @@ counter as its value}}{% \string\newglossaryentry}{You haven't specified the entry name}}% \def\@glo@desc{\PackageError{glossaries}{description key required in \string\newglossaryentry}{You haven't specified the entry description}}% +% \end{macrocode} +% \changes{1.12}{2008 Mar 8}{descriptionplural support added} +% \begin{macrocode} +\def\@glo@descplural{\@glo@desc}% +% \end{macrocode} +% \begin{macrocode} \def\@glo@type{\glsdefaulttype}% \def\@glo@symbol{\relax}% +% \end{macrocode} +% \changes{1.12}{2008 Mar 8}{symbolplural support added} +% \begin{macrocode} +\def\@glo@symbolplural{\@glo@symbol}% +% \end{macrocode} +% \begin{macrocode} \def\@glo@text{\@glo@name}% \def\@glo@plural{\@glo@text s}% \def\@glo@first{\@glo@text}% -\def\@glo@firstplural{\@glo@plural}% +% \end{macrocode} +% \changes{1.12}{2008 Mar 8}{Changed default first plural to be first +% key with s appended (was text key with s appended)} +% \begin{macrocode} +\def\@glo@firstplural{\@glo@first s}% +% \end{macrocode} +% \begin{macrocode} \def\@glo@sort{\@glo@name}% \def\@glo@counter{\@gls@getcounter{\@glo@type}}% % \end{macrocode} @@ -2918,9 +3035,11 @@ in it}}{% \expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}% \@gls@sanitizedesc \expandafter\protected@xdef\csname glo@#1@desc\endcsname{\@glo@desc}% +\expandafter\protected@xdef\csname glo@#1@descplural\endcsname{\@glo@descplural}% \expandafter\protected@xdef\csname glo@#1@sort\endcsname{\@glo@sort}% \@gls@sanitizesymbol \expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}% +\expandafter\protected@xdef\csname glo@#1@symbolplural\endcsname{\@glo@symbolplural}% % \end{macrocode} % Define an associated boolean variable to determine whether this % entry has been used yet (needs to be defined globally): @@ -3539,17 +3658,31 @@ counter as its value}}{% % \end{macrocode} %\end{macro} % -% If \ics{hyperlink} -% is not defined, \cs{@glslink} and \cs{@glstarget} -% ignore their first argument, and just do the second argument, -% otherwise they are equivalent to \ics{hyperlink} and -%\ics{hypertarget}. +%\begin{macro}{\@glslink} +% If \ics{hyperlink} is not defined \cs{@glslink} +% ignores its first argument and just does the second argument, +% otherwise it is equivalent to \ics{hyperlink}. % \begin{macrocode} \@ifundefined{hyperlink}{% -\gdef\@glslink#1#2{#2}\gdef\@glstarget#1#2{#2}% -}{\gdef\@glslink#1#2{\hyperlink{#1}{#2}}% -\gdef\@glstarget#1#2{\hypertarget{#1}{#2}}} + \gdef\@glslink#1#2{#2}% +}{% + \gdef\@glslink#1#2{\hyperlink{#1}{#2}}% +} +% \end{macrocode} +%\end{macro} +%\changes{1.12}{2008 Mar 8}{added check for 'hypertarget separate +% to 'hyperlink (memoir defines 'hyperlink but not 'hypertarget)} +%\begin{macro}{\@glstarget} +% If \ics{hypertarget} is not defined, \cs{@glstarget} +% ignores its first argument and just does the second argument, +% otherwise it is equivalent to \ics{hypertarget}. +% \begin{macrocode} +\@ifundefined{hypertarget}{% + \gdef\@glstarget#1#2{#2}% +}{% + \gdef\@glstarget#1#2{\hypertarget{#1}{#2}}} % \end{macrocode} +%\end{macro} % % Glossary hyperlinks can be disabled using \cs{glsdisablehyper} % (effect can be localised): @@ -3693,12 +3826,15 @@ counter as its value}}{% % hyperlink for first use. % \begin{macrocode} \ifglsused{#2}{% - \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }{% \ifglsacrfootnote - \@gls@link[#1,hyper=false]{#2}{\expandafter\MakeUppercase\@glo@text}% + \@gls@link[#1,hyper=false]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% \else - \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% \fi }% % \end{macrocode} @@ -3794,13 +3930,17 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and +% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol} % \begin{macrocode} \ifglsused{#2}{\protected@edef\@glo@text{% \csname gls@\@glo@type @display\endcsname -{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +{\glsentryplural{#2}}{\glsentrydescplural{#2}}{% +\glsentrysymbolplural{#2}}{#3}}}{% \protected@edef\@glo@text{% \csname gls@\@glo@type @displayfirst\endcsname -{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{% +\glsentrysymbolplural{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} % If \pkgopt{footnote} package option has been used, suppress @@ -3853,25 +3993,32 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and +% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol} % \begin{macrocode} \ifglsused{#2}{\protected@edef\@glo@text{% \csname gls@\@glo@type @display\endcsname -{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +{\glsentryplural{#2}}{\glsentrydescplural{#2}}{% +\glsentrysymbolplural{#2}}{#3}}}{% \protected@edef\@glo@text{% \csname gls@\@glo@type @displayfirst\endcsname -{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{% +\glsentrysymbolplural{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} % If \pkgopt{footnote} package option has been used, suppress % hyperlink for first use. % \begin{macrocode} \ifglsused{#2}{% - \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }{% \ifglsacrfootnote - \@gls@link[#1,hyper=false]{#2}{\expandafter\MakeUppercase\@glo@text}% + \@gls@link[#1,hyper=false]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% \else - \@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% + \@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% \fi }% % \end{macrocode} @@ -3910,13 +4057,17 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +%\changes{1.12}{2008 Mar 8}{now uses 'glsentrydescplural and +% 'glsentrysymbolplural instead of 'glsentrydesc and 'glsentrysymbol} % \begin{macrocode} \ifglsused{#2}{\protected@edef\@glo@text{% \csname gls@\@glo@type @display\endcsname -{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}{% +{\glsentryplural{#2}}{\glsentrydescplural{#2}}{% +\glsentrysymbolplural{#2}}{#3}}}{% \protected@edef\@glo@text{% \csname gls@\@glo@type @displayfirst\endcsname -{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}}% +{\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}{% +\glsentrysymbolplural{#2}}{#3}}}% % \end{macrocode} % Call \cs{@gls@link} % If \pkgopt{footnote} package option has been used, suppress @@ -3963,10 +4114,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glstext shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrytext{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -3999,10 +4150,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLStext shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrytext{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4035,14 +4186,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('Glstext shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrytext{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4072,10 +4224,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glsfirst shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryfirst{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4108,14 +4260,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsfirst shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryfirst{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4144,10 +4297,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSfirst shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryfirst{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4181,10 +4334,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glsplural shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4217,14 +4370,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsplural shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4253,10 +4407,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSplural shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4290,10 +4444,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glsfirstplural shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryfirstplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4326,14 +4480,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsfirstplural shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryfirstplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4362,10 +4517,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSfirstplural shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryfirstplural{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryfirstplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4399,10 +4554,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glsname shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryname{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4435,14 +4590,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glsname shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryname{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4471,10 +4627,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSname shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentryname{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentryname{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4508,10 +4664,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glsdesc shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrydesc{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4544,14 +4700,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('Glsdesc shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrydesc{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4580,10 +4737,114 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSdesc shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrydesc{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrydesc{#2}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +% \end{macrocode} +% +% \cs{glsdescplural} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{descriptionplural} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsdescplural} +% \begin{macrocode} +\newcommand*{\glsdescplural}{\@ifstar\@sglsdescplural\@glsdescplural} +% \end{macrocode} +%\end{macro} +% Define the starred form: +% \begin{macrocode} +\newcommand*{\@sglsdescplural}[1][]{\@glsdescplural[hyper=false,#1]} +% \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@glsdescplural}[2][]{% +\new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@glsdescplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{\glsentrydescplural{#2}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +% \end{macrocode} +% +% \cs{Glsdescplural} behaves like \ics{glsdescplural} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsdescplural} +% \begin{macrocode} +\newcommand*{\Glsdescplural}{\@ifstar\@sGlsdescplural\@Glsdescplural} +% \end{macrocode} +%\end{macro} +% Define the starred form: +% \begin{macrocode} +\newcommand*{\@sGlsdescplural}[1][]{\@Glsdescplural[hyper=false,#1]} +% \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@Glsdescplural}[2][]{% +\new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@Glsdescplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{\glsentrydescplural{#2}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% +}% +} +% \end{macrocode} +% +% \cs{GLSdescplural} behaves like \ics{glsdescplural} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSdescplural} +% \begin{macrocode} +\newcommand*{\GLSdescplural}{\@ifstar\@sGLSdescplural\@GLSdescplural} +% \end{macrocode} +%\end{macro} +% Define the starred form: +% \begin{macrocode} +\newcommand*{\@sGLSdescplural}[1][]{\@GLSdescplural[hyper=false,#1]} +% \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@GLSdescplural}[2][]{% +\new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@GLSdescplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{\glsentrydescplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4617,10 +4878,10 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glssymbol shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrysymbol{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4653,14 +4914,15 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('Glssymbol shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrysymbol{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} -\@gls@link[#1]{#2}{\expandafter\MakeUppercase\@glo@text}% +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% }% } % \end{macrocode} @@ -4689,10 +4951,116 @@ counter as its value}}{% % \end{macrocode} % Determine what the link text should be (this is stored in % \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('GLSsymbol shouldn't use +% 'gls@\meta{type}@display)} % \begin{macrocode} -\protected@edef\@glo@text{% -\csname gls@\@glo@type @display\endcsname -{\glsentrysymbol{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% +\protected@edef\@glo@text{\glsentrysymbol{#2}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% +}% +} +% \end{macrocode} +% +% \cs{glssymbolplural} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{symbolplural} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glssymbolplural} +% \begin{macrocode} +\newcommand*{\glssymbolplural}{\@ifstar\@sglssymbolplural\@glssymbolplural} +% \end{macrocode} +%\end{macro} +% Define the starred form: +% \begin{macrocode} +\newcommand*{\@sglssymbolplural}[1][]{\@glssymbolplural[hyper=false,#1]} +% \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@glssymbolplural}[2][]{% +\new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@glssymbolplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \changes{1.12}{2008 Mar 8}{fixed bug ('glssymbolplural shouldn't use +% 'gls@\meta{type}@display)} +% \begin{macrocode} +\protected@edef\@glo@text{\glsentrysymbolplural{#2}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{\@glo@text}% +}% +} +% \end{macrocode} +% +% \cs{Glssymbolplural} behaves like \ics{glssymbolplural} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glssymbolplural} +% \begin{macrocode} +\newcommand*{\Glssymbolplural}{\@ifstar\@sGlssymbolplural\@Glssymbolplural} +% \end{macrocode} +%\end{macro} +% Define the starred form: +% \begin{macrocode} +\newcommand*{\@sGlssymbolplural}[1][]{\@Glssymbolplural[hyper=false,#1]} +% \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@Glssymbolplural}[2][]{% +\new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@Glssymbolplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{\glsentrysymbolplural{#2}}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} +\@gls@link[#1]{#2}{% + \expandafter\makefirstuc\expandafter{\@glo@text}}% +}% +} +% \end{macrocode} +% +% \cs{GLSsymbolplural} behaves like \ics{glssymbolplural} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSsymbolplural} +% \begin{macrocode} +\newcommand*{\GLSsymbolplural}{\@ifstar\@sGLSsymbolplural\@GLSsymbolplural} +% \end{macrocode} +%\end{macro} +% Define the starred form: +% \begin{macrocode} +\newcommand*{\@sGLSsymbolplural}[1][]{\@GLSsymbolplural[hyper=false,#1]} +% \end{macrocode} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@GLSsymbolplural}[2][]{% +\new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}} +% \end{macrocode} +% Read in the final optional argument: +% \begin{macrocode} +\def\@GLSsymbolplural@#1#2[#3]{% +\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +% \begin{macrocode} +\protected@edef\@glo@text{\glsentrysymbolplural{#2}}% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} @@ -4711,7 +5079,7 @@ counter as its value}}{% % when the entry was defined.) The argument % is the label associated with the entry. Note that unless you % used \texttt{name=false} in the \pkgopt{sanitize} package option -% you may get unexpected results if the \gloskey{name} key contained +% you may get unexpected results if the \gloskey{name} key contains % any commands. %\begin{macro}{\glsentryname} % \begin{macrocode} @@ -4720,8 +5088,9 @@ counter as its value}}{% %\end{macro} %\begin{macro}{\Glsentryname} % \begin{macrocode} -\newcommand*{\Glsentryname}[1]{\expandafter -\MakeUppercase\csname glo@#1@name\endcsname} +\newcommand*{\Glsentryname}[1]{% +\protected@edef\@glo@text{\csname glo@#1@name\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -4738,8 +5107,25 @@ counter as its value}}{% %\end{macro} %\begin{macro}{\Glsentrydesc} % \begin{macrocode} -\newcommand*{\Glsentrydesc}[1]{\expandafter -\MakeUppercase\csname glo@#1@desc\endcsname} +\newcommand*{\Glsentrydesc}[1]{% +\protected@edef\@glo@text{\csname glo@#1@desc\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} +% \end{macrocode} +%\end{macro} +% Plural form: +%\begin{macro}{\glsentrydescplural} +%\changes{1.12}{2008 Mar 8}{New} +% \begin{macrocode} +\newcommand*{\glsentrydescplural}[1]{% +\csname glo@#1@descplural\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentrydescplural} +%\changes{1.12}{2008 Mar 8}{New} +% \begin{macrocode} +\newcommand*{\Glsentrydescplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@descplural\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -4753,8 +5139,9 @@ counter as its value}}{% %\end{macro} %\begin{macro}{\Glsentrytext} % \begin{macrocode} -\newcommand*{\Glsentrytext}[1]{\expandafter -\MakeUppercase\csname glo@#1@text\endcsname} +\newcommand*{\Glsentrytext}[1]{% +\protected@edef\@glo@text{\csname glo@#1@text\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -4766,8 +5153,9 @@ counter as its value}}{% %\end{macro} %\begin{macro}{\Glsentryplural} % \begin{macrocode} -\newcommand*{\Glsentryplural}[1]{\expandafter -\MakeUppercase\csname glo@#1@plural\endcsname} +\newcommand*{\Glsentryplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@plural\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -4783,8 +5171,25 @@ counter as its value}}{% %\end{macro} %\begin{macro}{\Glsentrysymbol} % \begin{macrocode} -\newcommand*{\Glsentrysymbol}[1]{\expandafter -\MakeUppercase\csname glo@#1@symbol\endcsname} +\newcommand*{\Glsentrysymbol}[1]{% +\protected@edef\@glo@text{\csname glo@#1@symbol\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} +% \end{macrocode} +%\end{macro} +% Plural form: +%\begin{macro}{\glsentrysymbolplural} +%\changes{1.12}{2008 Mar 8}{New} +% \begin{macrocode} +\newcommand*{\glsentrysymbolplural}[1]{% +\csname glo@#1@symbolplural\endcsname} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentrysymbolplural} +%\changes{1.12}{2008 Mar 8}{New} +% \begin{macrocode} +\newcommand*{\Glsentrysymbolplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@symbolplural\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -4798,8 +5203,9 @@ counter as its value}}{% %\end{macro} %\begin{macro}{\Glsentryfirst} % \begin{macrocode} -\newcommand*{\Glsentryfirst}[1]{\expandafter -\MakeUppercase\csname glo@#1@first\endcsname} +\newcommand*{\Glsentryfirst}[1]{% +\protected@edef\@glo@text{\csname glo@#1@first\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -4814,7 +5220,8 @@ counter as its value}}{% %\begin{macro}{\Glsentryfirstplural} % \begin{macrocode} \newcommand*{\Glsentryfirstplural}[1]{% -\expandafter\MakeUppercase\csname glo@#1@firstpl\endcsname} +\protected@edef\@glo@text{\csname glo@#1@firstpl\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % @@ -5500,8 +5907,10 @@ style `#1' undefined}{}}{% % \begin{macrocode} \newcommand{\newacronym}[4][]{% \newglossaryentry{#2}{type=\acronymtype,% -name={#3},description={#4},text={#3},% -first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} +name={#3},description={#4},text={#3},descriptionplural={#4s},% +first={#4 (#3)},plural={#3s},% +firstplural={\@glo@descplural\space (\@glo@plural)},% +#1}} % \end{macrocode} %\end{macro} % New acronyms can only be defined in the preamble: @@ -5512,6 +5921,29 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} % \cs{newacronym} is changed (or if the \gloskey{description} key % is changed). % +% Make a note of the keys that are used to store the long and +% short forms: +%\begin{macro}{\glsshortkey} +% \begin{macrocode} +\newcommand*{\glsshortkey}{text} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glsshortpluralkey} +% \begin{macrocode} +\newcommand*{\glsshortpluralkey}{plural} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glslongkey} +% \begin{macrocode} +\newcommand*{\glslongkey}{description} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\glslongpluralkey} +% \begin{macrocode} +\newcommand*{\glslongpluralkey}{descriptionplural} +% \end{macrocode} +%\end{macro} +% % Using the default definitions, \ics{acrshort} is the same as % \ics{glstext}, which means that it will print the abbreviation. %\begin{macro}{\acrshort} @@ -5605,6 +6037,14 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} symbol={#4},% #1}} % \end{macrocode} +% Set up the commands to make a note of the keys to store the long +% and short forms: +% \begin{macrocode} +\def\glsshortkey{text}% +\def\glsshortpluralkey{plural}% +\def\glslongkey{symbol}% +\def\glslongpluralkey{symbolplural}% +% \end{macrocode} % Set up short cuts. Short form: % \begin{macrocode} \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} @@ -5630,10 +6070,13 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} % If \pkgopt{footnote} package option is specified, set the first % use to append the long form (stored in \gloskey{symbol}) as a % footnote. +%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote +% and 'glslink} % \begin{macrocode} \defglsdisplayfirst[\acronymtype]{% - \acronymfont{#1}#4\noexpand\footnote{% - \noexpand\glslink[\@gls@link@opts]{\@gls@link@label}{#3}}}% + \acronymfont{#1}#4\noexpand\protect\noexpand\footnote{% + \noexpand\protect\noexpand\glslink + [\@gls@link@opts]{\@gls@link@label}{#3}}}% \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}% \ifglsacrsmallcaps \renewcommand*{\acronymfont}[1]{\textsc{#1}} @@ -5661,6 +6104,14 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} symbol={#3},% #1}} % \end{macrocode} +% Set up the commands to make a note of the keys to store the long +% and short forms: +% \begin{macrocode} +\def\glsshortkey{symbol}% +\def\glsshortpluralkey{symbolplural}% +\def\glslongkey{first}% +\def\glslongpluralkey{plural}% +% \end{macrocode} % Set up short cuts. Short form: % \begin{macrocode} \def\@acrshort#1#2[#3]{\acronymfont{\@glssymbol@{#1}{#2}[#3]}} @@ -5698,6 +6149,14 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} symbol={#3},% #1}} % \end{macrocode} +% Set up the commands to make a note of the keys to store the long +% and short forms: +% \begin{macrocode} +\def\glsshortkey{text}% +\def\glsshortpluralkey{plural}% +\def\glslongkey{first}% +\def\glslongpluralkey{firstplural}% +% \end{macrocode} % Set up short cuts. Short form: % \begin{macrocode} \def\@acrshort#1#2[#3]{\acronymfont{\@glstext@{#1}{#2}[#3]}} @@ -5749,11 +6208,22 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} description={#4},% #1}} % \end{macrocode} +% Set up the commands to make a note of the keys to store the long +% and short forms: +% \begin{macrocode} +\def\glsshortkey{text}% +\def\glsshortpluralkey{plural}% +\def\glslongkey{description}% +\def\glslongpluralkey{descriptionplural}% +% \end{macrocode} % Set display +%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote and +% 'glslink} % \begin{macrocode} \defglsdisplayfirst[\acronymtype]{% - \acronymfont{#1}#4\noexpand\footnote{% - \noexpand\glslink[\@gls@link@opts]{\@gls@link@label}{#2}}}% + \acronymfont{#1}#4\noexpand\protect\noexpand\footnote{% + \noexpand\protect\noexpand\glslink + [\@gls@link@opts]{\@gls@link@label}{#2}}}% \defglsdisplay[\acronymtype]{\acronymfont{#1}#4}% % \end{macrocode} % Set up short cuts. Short form: @@ -5798,10 +6268,7 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} % % Neither footnote nor description required. % Use the \gloskey{symbol} key to store the short form and -% \gloskey{first} to store the description. -% Note that this way makes the first use plural form -% appear as \dq{\meta{long}s (\meta{short})} instead of -% \dq{\meta{long}s (\meta{short}s)}. +% \gloskey{first} to store the long form. % \begin{macrocode} \renewcommand{\newacronym}[4][]{% \newglossaryentry{#2}{type=\acronymtype,% @@ -5811,6 +6278,14 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} symbol={#3},% #1}} % \end{macrocode} +% Set up the commands to make a note of the keys to store the long +% and short forms: +% \begin{macrocode} +\def\glsshortkey{symbol}% +\def\glsshortpluralkey{symbolplural}% +\def\glslongkey{first}% +\def\glslongpluralkey{firstplural}% +% \end{macrocode} % Change the display since \gloskey{first} only contains long form. % \begin{macrocode} \defglsdisplayfirst[\acronymtype]{#1#4 (\acronymfont{#3})} @@ -5860,6 +6335,14 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} symbol={#3},% #1}} % \end{macrocode} +% Set up the commands to make a note of the keys to store the long +% and short forms: +% \begin{macrocode} +\def\glsshortkey{symbol}% +\def\glsshortpluralkey{symbolplural}% +\def\glslongkey{text}% +\def\glslongpluralkey{plural}% +% \end{macrocode} % Set the display % \begin{macrocode} \defglsdisplayfirst[\acronymtype]{#1#4} @@ -5912,6 +6395,78 @@ first={#4 (#3)},plural={#3s},firstplural={#4s (#3s)},#1}} %\fi %\iffalse % \begin{macrocode} +%<*mfirstuc.sty> +% \end{macrocode} +%\fi +%\section{Mfirstuc package} +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mfirstuc}[2008/03/08 v1.0 (NLCT)] +% \end{macrocode} +%\begin{macro}{\makefirstuc} +% Syntax:\\ +% \cs{makefirstuc}\marg{text}\\ +% Makes the first letter uppercase, but will +% skip initial control sequences if they are followed by a group +% and make the first thing in the group uppercase. +% Thus \verb|\makefirstuc{abc}| will produce: Abc, +% \verb|\makefirstuc{\ae bc}| will produce: \AE bc, but +% \verb|\makefirstuc{\emph{abc}}| will produce \emph{Abc}. +% This is required by \ics{Gls} and \ics{Glspl}. +% \begin{macrocode} +\newif\if@glscs +\def\makefirstuc#1{% +\def\gls@argi{#1}% +\ifx\gls@argi\@empty +\else + \protected@edef\@gls@tmp{\ #1}% + \@onelevel@sanitize\@gls@tmp + \expandafter\@gls@checkcs\@gls@tmp\relax\relax + \if@glscs + \@gls@getbody #1{}\@nil + \ifx\@gls@rest\@empty + \MakeUppercase #1% + \else + \@gls@body{\expandafter\@gls@makefirstuc\@gls@rest}% + \fi + \else + \MakeUppercase #1% + \fi +\fi +} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\def\@gls@checkcs#1 #2#3\relax{% +\def\@gls@argi{#1}\def\@gls@argii{#2}% +\ifx\@gls@argi\@gls@argii + \@glscstrue +\else + \@glscsfalse +\fi +} +% \end{macrocode} +% Make first thing upper case: +% \begin{macrocode} +\def\@gls@makefirstuc#1{\MakeUppercase #1} +% \end{macrocode} +% +% Get the first grouped argument and stores in \cs{@gls@body}. +% \begin{macrocode} +\def\@gls@getbody#1#{\def\@gls@body{#1}\@gls@gobbletonil} +% \end{macrocode} +% Scoup up everything to \cs{@nil} and store in \cs{@gls@rest}: +% \begin{macrocode} +\def\@gls@gobbletonil#1\@nil{\def\@gls@rest{#1}} +% \end{macrocode} +% +%\iffalse +% \begin{macrocode} +%</mfirstuc.sty> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*glossary-hypernav.sty> % \end{macrocode} %\fi @@ -8035,7 +8590,7 @@ $glsnumformat{'main'} = $GLSCURRENTFORMAT; $gls_displayfirst{'main'} = "glsdisplayfirst"; $gls_display{'main'} = "glsdisplay"; -%glsentry = (); + %glsentry = (); $acronymtype = 'main'; diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins index 9efa72599bc..37cd7cde61e 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.ins +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.ins @@ -1,4 +1,4 @@ -% glossaries.ins generated using makedtx version 0.94b 2008/3/4 12:06 +% glossaries.ins generated using makedtx version 0.94b 2008/3/8 23:00 \input docstrip \preamble @@ -18,7 +18,7 @@ The Current Maintainer of this work is Nicola Talbot. - This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. + This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-list.sty, glossary-long.sty, glossary-super.sty, glossaries-babel.sty, glossaries-dictionary-Danish.dict, glossaries-dictionary-Dutch.dict, glossaries-dictionary-English.dict, glossaries-dictionary-French.dict, glossaries-dictionary-German.dict, glossaries-dictionary-Irish.dict, glossaries-dictionary-Italian.dict, glossaries-dictionary-Magyar.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample.tex, sample4col.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleDB.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, database1.tex, database2.tex, glossaries.perl. \endpreamble @@ -26,6 +26,8 @@ \generate{\file{glossaries.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries.sty,package}} +\file{mfirstuc.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{mfirstuc.sty,package}} \file{glossary-hypernav.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-hypernav.sty,package}} \file{glossary-list.sty}{\usepreamble\defaultpreamble diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.perl b/Master/texmf-dist/source/latex/glossaries/glossaries.perl index 8a64fbe3aca..d666df02b57 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.perl +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.perl @@ -55,6 +55,7 @@ $glsnumformat{'main'} = $GLSCURRENTFORMAT; $gls_displayfirst{'main'} = "glsdisplayfirst"; $gls_display{'main'} = "glsdisplay"; + %glsentry = (); $acronymtype = 'main'; |