From 033271bfdf58e2563bd3fbdbeb0f1facfb0c02e5 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 14 Nov 2013 22:52:09 +0000 Subject: glossaries (14nov13) git-svn-id: svn://tug.org/texlive/trunk@32147 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/glossaries/glossaries.dtx | 21763 +++++++++++-------- .../source/latex/glossaries/glossaries.ins | 17 +- 2 files changed, 12908 insertions(+), 8872 deletions(-) (limited to 'Master/texmf-dist/source/latex/glossaries') diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx index c3d0d7ef498..c5b4d894614 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -1,5 +1,5 @@ %\iffalse -% glossaries.dtx generated using makedtx version 0.94b (c) Nicola Talbot +% glossaries.dtx generated using makedtx version 1.1 (c) Nicola Talbot % Command line args: % -macrocode ".*\.perl" % -macrocode ".*\.tex" @@ -11,9 +11,10 @@ % -comment ".*\.tex" % -comment ".*\.xdy" % -src "glossaries.sty\Z=>glossaries.sty" +% -src "glossaries-prefix.sty\Z=>glossaries-prefix.sty" % -src "mfirstuc.sty\Z=>mfirstuc.sty" % -src "(glossary-.+)\.(sty)\Z=>\1.\2" -% -src "(glossaries-compatible-207)\.(sty)\Z=>\1.\2" +% -src "(glossaries-compatible-.+)\.(sty)\Z=>\1.\2" % -src "(glossaries-accsupp)\.(sty)\Z=>\1.\2" % -src "(glossaries-babel)\.(sty)\Z=>\1.\2" % -src "(glossaries-polyglossia)\.(sty)\Z=>\1.\2" @@ -27,7 +28,7 @@ % -author "Nicola Talbot" % -codetitle "Main Package Code" % glossaries -% Created on 2013/7/5 21:47 +% Created on 2013/11/14 14:05 %\fi %\iffalse %<*package> @@ -61,8 +62,6 @@ glossaries-manual.tex is a stub file used by makedtx to create glossaries.dtx \fi -\RecordChanges - \usepackage{alltt} \usepackage{pifont} \usepackage[utf8]{inputenc} @@ -75,6 +74,8 @@ glossaries.dtx pdfkeywords={LaTeX,package,glossary,acronyms}]{hyperref} \usepackage[toc]{glossaries} +\RecordChanges + \makeglossaries \renewcommand*{\main}[1]{\hyperpage{#1}} @@ -136,7 +137,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{14003} +\CheckSum{16315} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -164,12 +165,12 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{Documented Code For glossaries v3.07} +% \title{Documented Code For glossaries v4.0} % \author{Nicola L.C. Talbot\\[10pt] %Dickimaw Books\\ %\url{http://www.dickimaw-books.com/}} % -% \date{2013-07-05} +% \date{2013-11-14} % \maketitle % %This is the documented code for the \styfmt{glossaries} package. @@ -185,7 +186,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %glossaries package}. % %\item[\url{glossaries-user.pdf}] -%For the main user guide, read \qt{glossaries.sty v3.07: +%For the main user guide, read \qt{glossaries.sty v4.0: %\LaTeX2e\ Package to Assist Generating Glossaries}. % %\item[\url{mfirstuc-manual.pdf}] @@ -211,9 +212,9 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % \printglossaries % \phantomsection % \addcontentsline{toc}{section}{Change History}% +% \raggedright % \PrintChanges -% \clearpage\phantomsection -% \addcontentsline{toc}{section}{Index}\PrintIndex +% \PrintIndex %} % % @@ -229,13 +230,22 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2013/07/05 v3.07 (NLCT)] +\ProvidesPackage{glossaries}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] \RequirePackage{mfirstuc} +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{Now requires textcase} +% The \sty{textcase} package has much better case changing handling, +% so use \cs{MakeTextUppercase} instead of \cs{MakeUppercase} +% \begin{macrocode} +\RequirePackage{textcase} +\renewcommand*{\mfirstucMakeUppercase}{\MakeTextUppercase}% +% \end{macrocode} +% \begin{macrocode} \RequirePackage{xfor} % \end{macrocode} %\changes{3.04}{2012-11-18}{added datatool-base as a required @@ -269,12 +279,9 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of {% \@ifclassloaded{nlctdoc}{\@gls@docloadedtrue}{\@gls@docloadedfalse}% } -% \end{macrocode} -%\end{macro} -% \begin{macrocode} \if@gls@docloaded % \end{macrocode} -% It has been loaded, so some modifications need to be made to +% \cs{doc} has been loaded, so some modifications need to be made to % ensure both packages can work together. %\begin{macro}{\glsorg@glossary} %\changes{3.04}{2012-11-18}{new} @@ -283,7 +290,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \newcommand{\glsorg@glossary}{% \@bsphack \begingroup - \@sanitize \glsorg@wrglossary + \@sanitize \endgroup\@esphack } % \end{macrocode} %\end{macro} @@ -298,8 +305,17 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of } % \end{macrocode} %\end{macro} +%\changes{3.09a}{2013-10-09}{Add a fix for \cs{RecordChanges}} +% \begin{macrocode} + \renewcommand*{\RecordChanges}{% + \newwrite\@glossaryfile + \immediate\openout\@glossaryfile=\jobname.glo + \def\glsorg@glossary{\@bsphack\begingroup\@sanitize\glsorg@wrglossary}% + \typeout{Writing glossary file \jobname .glo}% + } +% \end{macrocode} +%\end{macro} %\begin{macro}{\changes} -%\changes{3.04}{2012-11-18}{new} % Now we need to redefine \cs{changes} so that it uses the original % definition of \cs{glossary}. % \begin{macrocode} @@ -452,7 +468,8 @@ false,nolabel,autolabel}[nolabel]{% % \autoref{sec:code:styles}. % \begin{macrocode} \define@key{glossaries.sty}{style}{% -\renewcommand*{\@glossary@default@style}{#1}} + \renewcommand*{\@glossary@default@style}{#1}% +} % \end{macrocode} %\end{option} % @@ -630,11 +647,20 @@ false,nolabel,autolabel}[nolabel]{% % %\begin{option}{ucmark} % Boolean option to determine whether or not to use -% \ics{MakeUppercase} in definition of \ics{glossarymark} +% use upper case in definition of \ics{glsglossarymark} %\changes{3.02}{2012/05/21}{new} % \begin{macrocode} \define@boolkey{glossaries.sty}[gls]{ucmark}[true]{} -\glsucmarkfalse +% \end{macrocode} +%\changes{3.13a}{2013-11-05}{added check for memoir} +% \begin{macrocode} +\@ifclassloaded{memoir} +{% + \glsucmarktrue +}% +{% + \glsucmarkfalse +} % \end{macrocode} %\end{option} % @@ -691,6 +717,22 @@ false,nolabel,autolabel}[nolabel]{% } % \end{macrocode} %\end{option} +% +%\begin{macro}{\glsprestandardsort} +%\changes{3.13a}{2013-11-05}{new} +%\begin{definition} +%\cs{glsprestandardsort}\marg{sort cs}\marg{type}\marg{label} +%\end{definition} +% Allow user to hook into sort mechanism. The first argument +% \meta{sort cs} is the temporary control sequence containing the +% sort value before it has been sanitized and had +% \gls{makeindex}\slash\gls{xindy} special characters escaped. +% \begin{macrocode} +\newcommand*{\glsprestandardsort}[3]{% + \glsdosanitizesort +} +% \end{macrocode} +%\end{macro} %\begin{macro}{\@gls@setupsort@standard} %\changes{3.0}{2011/04/02}{new} % Set up the macros for default sorting. @@ -707,6 +749,7 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} % Sort according to sort key (\cs{@glo@sort}) if provided otherwise % sort according to the entry's name (\cs{@glo@name}). +% (First argument glossary type, second argument entry label.) % \begin{macrocode} \def\@gls@defsort##1##2{% \ifx\@glo@sort\@glsdefaultsort @@ -714,8 +757,11 @@ false,nolabel,autolabel}[nolabel]{% \fi % \end{macrocode} %\changes{3.03}{2012/09/21}{used \cs{@gls@sanitizesort}} +%\changes{3.13a}{2013-11-05}{moved \cs{@gls@santizesort} to +%\cs{glsprestandardsort}} % \begin{macrocode} - \@gls@sanitizesort + \let\glsdosanitizesort\@gls@sanitizesort + \glsprestandardsort{\@glo@sort}{##1}{##2}% \expandafter\protected@xdef\csname glo@##2@sort\endcsname{\@glo@sort}% }% % \end{macrocode} @@ -897,6 +943,50 @@ false,nolabel,autolabel}[nolabel]{% % or not to define a separate glossary for acronyms. % \begin{macrocode} \define@boolkey{glossaries.sty}[gls]{acronym}[true]{% + \ifglsacronym + \renewcommand{\@gls@do@acronymsdef}{% + \DeclareAcronymList{acronym}% + \newglossary[alg]{acronym}{acr}{acn}{\acronymname}% + \renewcommand*{\acronymtype}{acronym}% + }% + \else + \let\@gls@do@acronymsdef\relax + \fi +} +% \end{macrocode} +%\end{option} +%\begin{macro}{\printacronyms} +% Define \cs{printacronyms} at the start of the document if +% \pkgopt{acronym} is set and compatibility mode isn't on and +% \cs{printacronyms} hasn't already been defined. +% \begin{macrocode} +\AtBeginDocument{% + \ifglsacronym + \ifbool{glscompatible-3.07}% + {}% + {% + \providecommand*{\printacronyms}[1][]{% + \printglossary[type=\acronymtype,#1]}% + }% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@do@acronymsdef} +% Set default value +% \begin{macrocode} +\newcommand*{\@gls@do@acronymsdef}{} +% \end{macrocode} +%\end{macro} +% +%\begin{option}{acronyms} +%\changes{3.14a}{2013-11-12}{new} +% Provide a synonym for \pkgopt[true]{acronym} that can be passed +% via the document class options. +% \begin{macrocode} +\DeclareOptionX{acronyms}{% + \glsacronymtrue \DeclareAcronymList{acronym}% } % \end{macrocode} @@ -934,7 +1024,9 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{macro} %\begin{macro}{\glsIfListOfAcronyms} -%\cs{glsIfListOfAcronyms}\marg{label}\marg{true part}\marg{false part}\\[10pt] +%\begin{definition} +%\cs{glsIfListOfAcronyms}\marg{label}\marg{true part}\marg{false part} +%\end{definition} % Determines if the glossary with the given label has been identified % as being a list of acronyms. % \begin{macrocode} @@ -994,9 +1086,11 @@ false,nolabel,autolabel}[nolabel]{% %\end{macro} %\begin{option}{acronymlists} %\changes{2.04}{2009 November 10}{new}% +%\changes{3.11a}{2013-10-15}{replaced \cs{@addtoacronymlists} with +%\cs{DeclareAcronymList}} % \begin{macrocode} \define@key{glossaries.sty}{acronymlists}{% - \@addtoacronymlists{#1}% + \DeclareAcronymList{#1}% } % \end{macrocode} %\end{option} @@ -1052,52 +1146,137 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{option} % -% The glossary keys whose values are written to another file (i.e.\ -% \gloskey{sort}, \gloskey{name}, \gloskey{description} and -% \gloskey{symbol}) need to be sanitized, otherwise fragile -% commands would not be able to be used in -% \ics{newglossaryentry}. However, strange results will occur -% if you then use those fields in the document. As these fields -% are not normally used in the document, but are by default only -% used in the glossary, the default is to sanitize them. If however -% you want to use these values in the document (either by redefining -% commands like \ics{glsdisplay} or by using commands like -% \ics{glsentrydesc}) you will have to switch off the -% sanitization using the \pkgopt{sanitize} package option, but -% you will then have to use \ics{protect} to protect fragile -% commands when defining new glossary entries. -% The \pkgopt{sanitize} option -% takes a key-value list as its value, which can be used to -% switch individual values on and off. For example: -%\begin{verbatim} -%\usepackage[sanitize={description,name,symbol=false}]{glossaries} -%\end{verbatim} -%will switch off the sanitization for the \gloskey{symbol} key, but -% switch it on for the \gloskey{description} and \gloskey{name} keys. -% This would mean that you can use fragile commands in the -%description and name when defining a new glossary entry, but not -% for the symbol. +%\begin{macro}{\GlossariesWarning} +% Prints a warning message. +% \begin{macrocode} +\newcommand*{\GlossariesWarning}[1]{% + \PackageWarning{glossaries}{#1}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\GlossariesWarningNoLine} +% Prints a warning message without the line number. +% \begin{macrocode} +\newcommand*{\GlossariesWarningNoLine}[1]{% + \PackageWarningNoLine{glossaries}{#1}% +} +% \end{macrocode} +%\end{macro} +% Define package option to suppress warnings +% \begin{macrocode} +\DeclareOptionX{nowarn}{% + \renewcommand*{\GlossariesWarning}[1]{}% + \renewcommand*{\GlossariesWarningNoLine}[1]{}% +} +% \end{macrocode} +% As from version 3.08a, the only information written to the external +% glossary files are the label and sort values. Therefore, now, the +% only sanitize option that makes sense is the one for the sort key. +% so the sanitize option is now deprecated and there is only a +% sanitizesort option. % -% The default values are defined as: %\begin{macro}{\@gls@sanitizedesc} % \begin{macrocode} -\newcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc} +\newcommand*{\@gls@sanitizedesc}{% +} +%\end{macro} +% +%\begin{macro}{\glssetexpandfield} +%\changes{3.13a}{2013-11-05}{new} +%\begin{definition} +%\cs{glssetexpandfield}\marg{field} +%\end{definition} +% Sets field to always expand. +% \begin{macrocode} +\newcommand*{\glssetexpandfield}[1]{% + \csdef{gls@assign@#1@field}##1##2{% + \@@gls@expand@field{##1}{#1}{##2}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glssetnoexpandfield} +%\changes{3.13a}{2013-11-05}{new} +%\begin{definition} +%\cs{glssetnoexpandfield}\marg{field} +%\end{definition} +% Sets field to never expand. +% \begin{macrocode} +\newcommand*{\glssetnoexpandfield}[1]{% + \csdef{gls@assign@#1@field}##1##2{% + \@@gls@noexpand@field{##1}{#1}{##2}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@assign@type@field} +%\changes{3.10a}{2013-09-28}{new} +%\changes{3.13a}{2013-11-05}{changed to use \cs{glssetexpandfield}} +% The type must always be expandable. +% \begin{macrocode} +\glssetexpandfield{type} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@assign@desc@field} +%\changes{3.08a}{2013-09-28}{new} +%\changes{3.13a}{2013-11-05}{changed to use \cs{glssetnoexpandfield}} +% The description is not expanded by default: +% \begin{macrocode} +\glssetnoexpandfield{desc} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\gls@assign@descplural@field} +%\changes{3.08a}{2013-09-28}{new} +%\changes{3.13a}{2013-11-05}{changed to use \cs{glssetnoexpandfield}} +% \begin{macrocode} +\glssetnoexpandfield{descplural} % \end{macrocode} %\end{macro} %\begin{macro}{\@gls@sanitizename} % \begin{macrocode} -\newcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name} +\newcommand*{\@gls@sanitizename}{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\gls@assign@name@field} +%\changes{3.13a}{2013-11-05}{changed to use \cs{glssetnoexpandfield}} +% Don't expand name by default. +% \begin{macrocode} +\glssetnoexpandfield{name} % \end{macrocode} %\end{macro} %\begin{macro}{\@gls@sanitizesymbol} % \begin{macrocode} -\newcommand*{\@gls@sanitizesymbol}{\@onelevel@sanitize\@glo@symbol} +\newcommand*{\@gls@sanitizesymbol}{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@assign@symbol@field} +%\changes{3.13a}{2013-11-05}{changed to use \cs{glssetnoexpandfield}} +% Don't expand symbol by default. +% \begin{macrocode} +\glssetnoexpandfield{symbol} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@assign@symbolplural@field} +%\changes{3.13a}{2013-11-05}{changed to use \cs{glssetnoexpandfield}} +%\changes{3.09a}{2013-10-09}{new} +% \begin{macrocode} +\glssetnoexpandfield{symbolplural} % \end{macrocode} %\end{macro} +% +% Sanitizing stuff: %\begin{macro}{\@gls@sanitizesort} %\changes{3.03}{2012/09/21}{new} % \begin{macrocode} -\newcommand*{\@gls@sanitizesort}{\@onelevel@sanitize\@glo@sort} +\newcommand*{\@gls@sanitizesort}{% + \ifglssanitizesort + \@onelevel@sanitize\@glo@sort + \else + \fi +} % \end{macrocode} %\end{macro} % @@ -1106,74 +1285,133 @@ false,nolabel,autolabel}[nolabel]{% % These are all boolean keys. If they are not given a value, assume % \texttt{true}. % -% Firstly the \gloskey{description}. If set, it will redefine -% \cs{@gls@sanitizedesc} to use \cs{@onelevel@sanitize}, -% otherwise \cs{@gls@sanitizedesc} will do nothing. % \begin{macrocode} \define@boolkey[gls]{sanitize}{description}[true]{% -\ifgls@sanitize@description - \renewcommand*{\@gls@sanitizedesc}{\@onelevel@sanitize\@glo@desc}% -\else - \renewcommand*{\@gls@sanitizedesc}{}% -\fi + \GlossariesWarning{sanitize={description} package option deprecated}% + \ifgls@sanitize@description + \glssetnoexpandfield{desc}% + \glssetnoexpandfield{descplural}% + \else + \glssetexpandfield{desc}% + \glssetexpandfield{descplural}% + \fi } % \end{macrocode} -% Similarly for the \gloskey{name} key: % \begin{macrocode} \define@boolkey[gls]{sanitize}{name}[true]{% -\ifgls@sanitize@name - \renewcommand*{\@gls@sanitizename}{\@onelevel@sanitize\@glo@name}% -\else - \renewcommand*{\@gls@sanitizename}{}% -\fi} + \GlossariesWarning{sanitize={name} package option +deprecated}% + \ifgls@sanitize@name + \glssetnoexpandfield{name}% + \else + \glssetexpandfield{name}% + \fi +} % \end{macrocode} -% and for the \gloskey{symbol} key: % \begin{macrocode} \define@boolkey[gls]{sanitize}{symbol}[true]{% -\ifgls@sanitize@symbol - \renewcommand*{\@gls@sanitizesymbol}{% -\@onelevel@sanitize\@glo@symbol}% -\else - \renewcommand*{\@gls@sanitizesymbol}{}% -\fi} + \GlossariesWarning{sanitize={symbol} package option +deprecated}% + \ifgls@sanitize@symbol + \glssetnoexpandfield{symbol}% + \glssetnoexpandfield{symbolplural}% + \else + \glssetexpandfield{symbol}% + \glssetexpandfield{symbolplural}% + \fi +} % \end{macrocode} -% and for the \gloskey{sort} key: +% +%\begin{option}{sanitizesort} % \begin{macrocode} -\define@boolkey[gls]{sanitize}{sort}[true]{% -\ifgls@sanitize@sort - \renewcommand*{\@gls@sanitizesort}{% -\@onelevel@sanitize\@glo@sort}% -\else - \renewcommand*{\@gls@sanitizesort}{}% -\fi} +\define@boolkey{glossaries.sty}[gls]{sanitizesort}[true]{% + \ifglssanitizesort + \glssetnoexpandfield{sortvalue}% + \else + \glssetexpandfield{sortvalue}% + \fi +} +% \end{macrocode} +% Default setting: +% \begin{macrocode} +\glssanitizesorttrue +\glssetnoexpandfield{sortvalue}% % \end{macrocode} +%\end{option} % +% \begin{macrocode} +\define@choicekey{sanitize}{sort}{true,false}[true]{% + \setbool{glssanitizesort}{#1}% + \ifglssanitizesort + \glssetnoexpandfield{sortvalue}% + \else + \glssetexpandfield{sortvalue}% + \fi + \GlossariesWarning{sanitize={sort} package option + deprecated. Use sanitizesort instead}% +} +% \end{macrocode} % %\begin{option}{sanitize} -% Now define the \pkgopt{sanitize} option. It can either take -% a key-val list as its value, or it can take the keyword -% \texttt{none}, which is equivalent to \texttt{description=false, -% symbol=false, name=false}: % \begin{macrocode} \define@key{glossaries.sty}{sanitize}[description=true,symbol=true, name=true]{% -\ifthenelse{\equal{#1}{none}}% -{% - \renewcommand*{\@gls@sanitizedesc}{}% - \renewcommand*{\@gls@sanitizename}{}% - \renewcommand*{\@gls@sanitizesymbol}{}% -}% -{% - \setkeys[gls]{sanitize}{#1}}% + \ifthenelse{\equal{#1}{none}}% + {% + \GlossariesWarning{sanitize package option deprecated}% + }% + {% + \setkeys[gls]{sanitize}{#1}% + }% +} +% \end{macrocode} +%\end{option} +% +%\begin{macro}{\ifglstranslate} +% As from version 3.13a, the \pkgopt{translator} package option is a +% choice rather than boolean option so now need to define +% conditional: +% \begin{macrocode} +\newif\ifglstranslate +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@notranslatorhook} +%\changes{3.13a}{2013-11-05}{new} +% \begin{macrocode} +\newcommand*\@gls@notranslatorhook{} +% \end{macrocode} +%\end{macro} +% +%\begin{option}{notranslate} +%\changes{3.14a}{2013-11-12}{new} +% Provide a synonym for \pkgopt[false]{translate} that can be passed +% via the document class. +% \begin{macrocode} +\DeclareOptionX{notranslate}{% + \glstranslatefalse + \let\@gls@notranslatorhook\relax } % \end{macrocode} %\end{option} +% %\begin{option}{translate} %\changes{1.1}{2008 Feb 22}{translate option added} % Define \pkgopt{translate} option. If false don't set up % multi-lingual support. % \begin{macrocode} -\define@boolkey{glossaries.sty}[gls]{translate}[true]{} +\define@choicekey{glossaries.sty}{translate}[\val\nr]% + {true,false,babel}[true]% + {% + \ifcase\nr\relax + \glstranslatetrue + \or + \glstranslatefalse + \let\@gls@notranslatorhook\relax + \or + \glstranslatefalse + \def\@gls@notranslatorhook{\RequirePackage{glossaries-babel}}% + \fi + } % \end{macrocode} %\end{option} % Set the default value: @@ -1208,12 +1446,23 @@ name=true]{% % \end{macrocode} %\end{option} % +%\begin{macro}{\@gls@setacrstyle} +% Keep track of whether an acronym style has been set (for the +% benefit of \cs{setupglossaries}): +% \begin{macrocode} +\newcommand*{\@gls@setacrstyle}{} +% \end{macrocode} +%\end{macro} %\begin{option}{footnote} % Set the long form of the acronym in footnote on first use. % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{footnote}[true]{% -\ifthenelse{\boolean{glsacrdescription}}{}% -{\renewcommand*{\@gls@sanitizedesc}{}}% + \ifbool{glsacrdescription}% + {}% + {% + \renewcommand*{\@gls@sanitizedesc}{}% + }% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } % \end{macrocode} %\end{option} @@ -1224,6 +1473,7 @@ name=true]{% % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{description}[true]{% \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } % \end{macrocode} %\end{option} @@ -1232,6 +1482,7 @@ name=true]{% % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{smallcaps}[true]{% \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } % \end{macrocode} %\end{option} @@ -1242,6 +1493,7 @@ name=true]{% % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{smaller}[true]{% \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } % \end{macrocode} %\end{option} @@ -1251,6 +1503,7 @@ name=true]{% % \begin{macrocode} \define@boolkey{glossaries.sty}[glsacr]{dua}[true]{% \renewcommand*{\@gls@sanitizesymbol}{}% + \renewcommand*{\@gls@setacrstyle}{\SetAcronymStyle}% } % \end{macrocode} %\end{option} @@ -1346,6 +1599,7 @@ name=true]{% % \end{macrocode} %\end{macro} % +%\begin{option}{xindy} % Define package option to specify that \app{xindy} will be % used to sort the glossaries: % \begin{macrocode} @@ -1354,48 +1608,90 @@ name=true]{% \setkeys[gls]{xindy}{#1}% } % \end{macrocode} +%\end{option} +% +%\begin{option}{xindygloss} +%\changes{3.14a}{2013-11-12}{new} +% Provide a synonym for \pkgopt[]{xindy} that can be passed via the +% document class options. +% \begin{macrocode} +\DeclareOptionX{xindygloss}{% + \glsxindytrue +} +% \end{macrocode} +%\end{option} % %\begin{option}{savewrites} %\changes{3.0}{2011/04/02}{new} % The \pkgopt{savewrites} package option is provided to save on % the number of write registers. % \begin{macrocode} -\define@boolkey{glossaries.sty}[gls]{savewrites}[true]{} +\define@boolkey{glossaries.sty}[gls]{savewrites}[true]{% + \ifglssavewrites + \renewcommand*{\glswritefiles}{\@glswritefiles}% + \else + \let\glswritefiles\relax + \fi +} % \end{macrocode} %\end{option} % Set default: % \begin{macrocode} \glssavewritesfalse +\let\glswritefiles\relax % \end{macrocode} % -%\begin{macro}{\GlossariesWarning} -% Prints a warning message. +%\begin{option}{compatible-3.07} +%\changes{3.11a}{2013-10-15}{cnew} % \begin{macrocode} -\newcommand*{\GlossariesWarning}[1]{% - \PackageWarning{glossaries}{#1}% -} +\define@boolkey{glossaries.sty}[gls]{compatible-3.07}[true]{} +\boolfalse{glscompatible-3.07} % \end{macrocode} -%\end{macro} -%\begin{macro}{\GlossariesWarningNoLine} -% Prints a warning message without the line number. +%\end{option} +% +%\begin{option}{compatible-2.07} +%\changes{3.0}{2011/04/02}{compatible-2.07 option added} % \begin{macrocode} -\newcommand*{\GlossariesWarningNoLine}[1]{% - \PackageWarningNoLine{glossaries}{#1}% -} +\define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{% % \end{macrocode} -%\end{macro} -% Define package option to suppress warnings +% Also set 3.07 compatibility if this option is set. +%\changes{3.14a}{2013-11-12}{added check for 2.07 before setting 3.07 +%compatibility} % \begin{macrocode} -\DeclareOptionX{nowarn}{% - \renewcommand*{\GlossariesWarning}[1]{}% - \renewcommand*{\GlossariesWarningNoLine}[1]{}% + \ifbool{glscompatible-2.07}% + {% + \booltrue{glscompatible-3.07}% + }% + {}% } +\boolfalse{glscompatible-2.07} % \end{macrocode} -%\begin{option}{compatible-2.07} -%\changes{3.0}{2011/04/02}{compatible-2.07 option added} +%\end{option} +% +%\begin{option}{symbols} +% Create a \qt{symbols} glossary type +%\changes{3.11a}{2013-10-15}{new} % \begin{macrocode} -\define@boolkey{glossaries.sty}[gls]{compatible-2.07}[true]{} -\csname glscompatible-2.07false\endcsname +\newcommand{\@gls@do@symbolsdef}{} +\DeclareOptionX{symbols}{% + \renewcommand{\@gls@do@symbolsdef}{% + \newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname}% + \newcommand*{\printsymbols}[1][]{\printglossary[type=symbols,#1]}% + }% +} +% \end{macrocode} +%\end{option} +%\begin{option}{numbers} +% Create a \qt{symbols} glossary type +%\changes{3.11a}{2013-10-15}{new} +% \begin{macrocode} +\newcommand{\@gls@do@numbersdef}{} +\DeclareOptionX{numbers}{% + \renewcommand{\@gls@do@numbersdef}{% + \newglossary[nlg]{numbers}{nls}{nlo}{\glsnumbersgroupname}% + \newcommand*{\printnumbers}[1][]{\printglossary[type=numbers,#1]}% + }% +} % \end{macrocode} %\end{option} % @@ -1404,6 +1700,48 @@ name=true]{% % \begin{macrocode} \ProcessOptionsX % \end{macrocode} +% Load backward compatibility stuff: +% \begin{macrocode} +\RequirePackage{glossaries-compatible-307} +% \end{macrocode} +% +%\begin{macro}{\setupglossaries} +%\changes{3.11a}{2013-10-15}{new} +% Provide way to set options after package has been loaded. However, +% some options must be set before \cs{ProcessOptionsX}, so they have +% to be disabled: +% \begin{macrocode} +\disable@keys{glossaries.sty}{compatible-2.07,% + xindy,xindygloss,makeindex,% + acronym,translate,notranslate,nolong,nosuper,notree,nostyles,nomain} +% \end{macrocode} +%Now define \cs{setupglossaries}: +% \begin{macrocode} +\newcommand*{\setupglossaries}[1]{% + \renewcommand*{\@gls@setacrstyle}{}% + \ifglsacrshortcuts + \def\@gls@setupshortcuts{\glsacrshortcutstrue}% + \else + \def\@gls@setupshortcuts{% + \ifglsacrshortcuts + \DefineAcronymSynonyms + \fi + }% + \fi + \glsacrshortcutsfalse + \let\@gls@do@numbersdef\relax + \let\@gls@do@symbolssdef\relax + \let\@gls@do@acronymsdef\relax + \setkeys{glossaries.sty}{#1}% + \@gls@setacrstyle + \@gls@setupshortcuts + \@gls@do@acronymsdef + \@gls@do@numbersdef + \@gls@do@symbolssdef +} +% \end{macrocode} +%\end{macro} +% % If \isty{babel} package is loaded, check to see if % \isty{translator} is installed, but only if translation is % required. @@ -1432,7 +1770,6 @@ name=true]{% } \fi % \end{macrocode} -% % If chapters are defined and the user has requested the % section counter as a package option, \cs{@chapter} will % be modified so @@ -1474,12 +1811,13 @@ name=true]{% % must be disabled after \ics{makeglossaries}. % \begin{macrocode} \newcommand*{\@onlypremakeg}[1]{% -\ifx\@gls@onlypremakeg\@empty - \def\@gls@onlypremakeg{#1}% -\else - \expandafter\toks@\expandafter{\@gls@onlypremakeg}% - \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}% -\fi} + \ifx\@gls@onlypremakeg\@empty + \def\@gls@onlypremakeg{#1}% + \else + \expandafter\toks@\expandafter{\@gls@onlypremakeg}% + \edef\@gls@onlypremakeg{\the\toks@,\noexpand#1}% + \fi +} % \end{macrocode} %\end{macro} %\begin{macro}{\@disable@onlypremakeg} @@ -1614,7 +1952,7 @@ name=true]{% % \isty{babel} captions, otherwise load \isty{translator} % dictionary. %\changes{1.1}{2008 Feb 22}{Added support for translator package} -%\changes{1.15}{2008 August 15}{Added 'glssettoctitle} +%\changes{1.15}{2008 August 15}{Added \cs{glssettoctitle}} % \begin{macrocode} \@ifpackageloaded{translator}{% \usedictionary{glossaries-dictionary}% @@ -1677,6 +2015,11 @@ name=true]{% \@ifpackageloaded{babel}{% \RequirePackage{glossaries-babel}}{}% }} +\else +% \end{macrocode} +%\changes{3.13a}{2013-11-05}{added cs{@gls@nottranslatorhook} to else clause} +% \begin{macrocode} + \@gls@notranslatorhook \fi % \end{macrocode} %\begin{macro}{\nopostdesc} @@ -1699,6 +2042,12 @@ name=true]{% } % \end{macrocode} %\end{macro} +%\begin{macro}{\@no@post@desc} +% Used for comparison purposes. +% \begin{macrocode} +\newcommand*{\@no@post@desc}{\nopostdesc} +% \end{macrocode} +%\end{macro} %\begin{macro}{\glspar} % Provide means of having a paragraph break in glossary entries % \begin{macrocode} @@ -1923,7 +2272,7 @@ name=true]{% \ifglossaryexists{#1}{% \csgdef{@glossarypreamble@#1}{#2}% }{% - \PackageWarning{glossaries}{% + \GlossariesWarning{% Glossary `#1' is not defined% }% }% @@ -1957,8 +2306,10 @@ name=true]{% % style.) If \ics{phantomsection} % is defined, it uses \cs{\@p@glossarysection}, otherwise it % uses \cs{@glossarysection}. -%\changes{1.05}{2007 Aug 10}{added '@mkboth to 'glossarysection} -%\changes{2.02}{2009 July 13}{changed '@mkboth to 'glossarymark} +%\changes{1.05}{2007 Aug 10}{added \cs{@mkboth} to +%\cs{glossarysection}} +%\changes{2.02}{2009 July 13}{changed \cs{@mkboth} to +%\cs{glossarymark}} %\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} % \begin{macrocode} @@ -1971,55 +2322,65 @@ name=true]{% {% \@p@glossarysection{#1}{#2}% }% - \glossarymark{\glossarytoctitle}% +% \end{macrocode} +%\changes{3.13a}{2013-11-05}{changed \cs{glossarymark} to \cs{glsglossarymark}} +% \begin{macrocode} + \glsglossarymark{\glossarytoctitle}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\glossarymark} +%\begin{macro}{\glsglossarymark} %\changes{2.02}{2009 July 13}{New} %\changes{2.03}{2009 Sep 23}{Added check to see if it's already %defined} -% Sets the header mark for the glossary. Takes the glossary short -% (TOC) title as the argument. %\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} +%\changes{3.11a}{2013-10-15}{replaced \cs{MakeUppercase} with +%\cs{mfirstucMakeUppercase}} +%\changes{3.13a}{2013-11-05}{renamed \cs{glossarymark} to +%\cs{glsglossarymark} to avoid conflict with memoir} +% Sets the header mark for the glossary. Takes the glossary short +% (TOC) title as the argument. % \begin{macrocode} \ifcsundef{glossarymark}% {% - \ifglsucmark - \newcommand{\glossarymark}[1]{% - \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}% - } - \else - \newcommand{\glossarymark}[1]{\@mkboth{#1}{#1}} - \fi + \newcommand{\glsglossarymark}[1]{\glossarymark{#1}} }% {% - \GlossariesWarning{overriding \string\glossarymark}% - \@ifclassloaded{memoir}% - { - \ifglsucmark - \renewcommand{\glossarymark}[1]{% - \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}% - } - \else - \renewcommand{\glossarymark}[1]{% + \@ifclassloaded{memoir} + {% + \newcommand{\glsglossarymark}[1]{% + \ifglsucmark \markboth{\memUChead{#1}}{\memUChead{#1}}% - } - \fi - } - { - \ifglsucmark - \renewcommand{\glossarymark}[1]{% - \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}% - } - \else - \renewcommand{\glossarymark}[1]{\@mkboth{#1}{#1}} - \fi + \else + \markboth{#1}{#1}% + \fi + } + }% + {% + \newcommand{\glsglossarymark}[1]{% + \ifglsucmark + \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% + \else + \@mkboth{#1}{#1}% + \fi + } } } % \end{macrocode} %\end{macro} +%\begin{macro}{\glossarymark} +% Provided for backward compatibility: +% \begin{macrocode} +\providecommand{\glossarymark}[1]{% + \ifglsucmark + \@mkboth{\mfirstucMakeUppercase{#1}}{\mfirstucMakeUppercase{#1}}% + \else + \@mkboth{#1}{#1}% + \fi +} +% \end{macrocode} +%\end{macro} % % The required sectional unit is given by \cs{@@glossarysec} % which was defined by the \pkgopt{section} package option. The @@ -2041,13 +2402,14 @@ name=true]{% %\changes{1.1}{2008 Feb 22}{numbered sections and auto label added} % \begin{macrocode} \newcommand*{\@glossarysection}[2]{% -\ifx\@@glossarysecstar\@empty - \csname\@@glossarysec\endcsname{#2}% -\else - \csname\@@glossarysec\endcsname*{#2}% - \@gls@toc{#1}{\@@glossarysec}% -\fi -\@@glossaryseclabel} + \ifx\@@glossarysecstar\@empty + \csname\@@glossarysec\endcsname{#2}% + \else + \csname\@@glossarysec\endcsname*{#2}% + \@gls@toc{#1}{\@@glossarysec}% + \fi + \@@glossaryseclabel +} % \end{macrocode} %\end{macro} % @@ -2060,15 +2422,16 @@ name=true]{% %\changes{1.1}{2008 Feb 22}{numbered sections and auto label added} % \begin{macrocode} \newcommand*{\@p@glossarysection}[2]{% -\glsclearpage -\phantomsection -\ifx\@@glossarysecstar\@empty - \csname\@@glossarysec\endcsname{#2}% -\else - \@gls@toc{#1}{\@@glossarysec}% - \csname\@@glossarysec\endcsname*{#2}% -\fi -\@@glossaryseclabel} + \glsclearpage + \phantomsection + \ifx\@@glossarysecstar\@empty + \csname\@@glossarysec\endcsname{#2}% + \else + \@gls@toc{#1}{\@@glossarysec}% + \csname\@@glossarysec\endcsname*{#2}% + \fi + \@@glossaryseclabel +} % \end{macrocode} %\end{macro} % @@ -2124,13 +2487,14 @@ name=true]{% %\changes{1.1}{2008 Feb 22}{numberline added} % \begin{macrocode} \newcommand*{\@gls@toc}[2]{% -\ifglstoc - \ifglsnumberline - \addcontentsline{toc}{#2}{\numberline{}#1}% - \else - \addcontentsline{toc}{#2}{#1}% + \ifglstoc + \ifglsnumberline + \addcontentsline{toc}{#2}{\numberline{}#1}% + \else + \addcontentsline{toc}{#2}{#1}% + \fi \fi -\fi} +} % \end{macrocode} %\end{macro} % @@ -2689,13 +3053,14 @@ name=true]{% \renewcommand*{\gls@codepage}{#1}% } % \end{macrocode} -%\changes{}{}{} +%\changes{3.07}{2013-07-05}{Added check for fontspec} % Suggested by egreg: % \begin{macrocode} -\AtBeginDocument{ - \ifx\gls@codepage\@empty - \@ifpackageloaded{fontspec}{\def\gls@codepage{utf8}}{} -\fi} + \AtBeginDocument{% + \ifx\gls@codepage\@empty + \@ifpackageloaded{fontspec}{\def\gls@codepage{utf8}}{}% + \fi + } \else \newcommand*{\GlsSetXdyCodePage}[1]{% \glsnoxindywarning\GlsSetXdyCodePage} @@ -2758,10 +3123,14 @@ name=true]{% % control sequence which will be set to the entry label in the % current iteration. %\changes{2.01}{2009 May 30}{replaced \cs{ifthenelse} with \cs{ifx}} +%\changes{3.11a}{2013-10-15}{replaced \cs{ifx} with \cs{ifdefempty}} % \begin{macrocode} \newcommand*{\forglsentries}[3][\glsdefaulttype]{% \edef\@@glo@list{\csname glolist@#1\endcsname}% - \@for#2:=\@@glo@list\do{\ifx#2\@empty\else#3\fi}% + \@for#2:=\@@glo@list\do + {% + \ifdefempty{#2}{}{#3}% + }% } % \end{macrocode} %\end{macro} @@ -2774,8 +3143,11 @@ name=true]{% % is given by \cs{@@this@glo@}. % \begin{macrocode} \newcommand*{\forallglsentries}[3][\@glo@types]{% -\expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}{% -\forglsentries[\@@this@glo@]{#2}{#3}}} + \expandafter\forallglossaries\expandafter[#1]{\@@this@glo@}% + {% + \forglsentries[\@@this@glo@]{#2}{#3}% + }% +} % \end{macrocode} %\end{macro} % @@ -2793,8 +3165,10 @@ name=true]{% %\end{macro} % %\begin{macro}{\ifglsentryexists} -% To check to see if a glossary entry has been defined use:\\[10pt] -% \cs{ifglsentryexists}\marg{label}\marg{true text}\marg{false text}\\[10pt] +% To check to see if a glossary entry has been defined use: +%\begin{definition} +% \cs{ifglsentryexists}\marg{label}\marg{true text}\marg{false text} +%\end{definition} %where \meta{label} is the entry's label. %\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} @@ -2807,13 +3181,17 @@ name=true]{% % %\begin{macro}{\ifglsused} % To determine if given glossary entry has been -% used in the document text yet use:\\[10pt] -% \cs{ifglsused}\marg{label}\marg{true text}\marg{false text}\\[10pt] +% used in the document text yet use: +%\begin{definition} +% \cs{ifglsused}\marg{label}\marg{true text}\marg{false text} +%\end{definition} % where \meta{label} is the entry's label. % If true it will do \meta{true text} % otherwise it will do \meta{false text}. +%\changes{3.11a}{2013-10-15}{replaced \cs{ifthenelse} with +%\cs{ifbool}} % \begin{macrocode} -\newcommand*{\ifglsused}[3]{\ifthenelse{\boolean{glo@#1@flag}}{#2}{#3}} +\newcommand*{\ifglsused}[3]{\ifbool{glo@#1@flag}{#2}{#3}} % \end{macrocode} %\end{macro} %The following two commands will cause an error if the given @@ -2884,6 +3262,92 @@ name=true]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\ifglshasdesc} +%\cs{ifglshasdesc}\marg{label}\marg{true part}\marg{false part} +%\changes{3.08a}{2013-09-28}{new} +%\changes{3.11a}{2013-10-15}{replaced \cs{ifdefempty} with +%\cs{ifcsempty}} +% \begin{macrocode} +\newcommand*{\ifglshasdesc}[3]{% + \ifcsempty{glo@#1@desc}% + {#3}% + {#2}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\ifglsdescsuppressed} +%\cs{ifglsdescsuppressed}\marg{label}\marg{true part}\marg{false part} +%\changes{3.08a}{2013-09-28}{new} +% Does \meta{true part} if the description is just \cs{nopostdesc} +% otherwise does \meta{false part}. +% \begin{macrocode} +\newcommand*{\ifglsdescsuppressed}[3]{% + \ifcsequal{glos@#1@desc}{@no@post@desc}% + {#2}% + {#3}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\ifglshassymbol} +%\cs{ifglshassymbol}\marg{label}\marg{true part}\marg{false part} +%\changes{3.08a}{2013-09-28}{new} +%\changes{3.09a}{2013-10-09}{changed test to check for +%\cs{@gls@default@symbol}} +%\changes{3.11a}{2013-10-15}{replaced \cs{ifdefempty} with +%\cs{ifcsempty}} +% \begin{macrocode} +\newcommand*{\ifglshassymbol}[3]{% + \ifcsempty{glo@#1@symbol}% + {#3}% + {% + \expandafter\ifx\csname glo@#1@symbol\endcsname\@gls@default@value + #3% + \else + #2% + \fi + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\ifglshaslong} +%\cs{ifglshaslong}\marg{label}\marg{true part}\marg{false part} +%\changes{3.11a}{2013-10-15}{new} +% \begin{macrocode} +\newcommand*{\ifglshaslong}[3]{% + \ifcsempty{glo@#1@long}% + {#3}% + {% + \expandafter\ifx\csname glo@#1@long\endcsname\@gls@default@value + #3% + \else + #2% + \fi + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\ifglshasshort} +%\cs{ifglshasshort}\marg{label}\marg{true part}\marg{false part} +%\changes{3.11a}{2013-10-15}{new} +% \begin{macrocode} +\newcommand*{\ifglshasshort}[3]{% + \ifcsempty{glo@#1@short}% + {#3}% + {% + \expandafter\ifx\csname glo@#1@short\endcsname\@gls@default@value + #3% + \else + #2% + \fi + }% +} +% \end{macrocode} +%\end{macro} +% %\subsection{Defining new glossaries}\label{sec:newglos} % A comma-separated list of glossary names is stored % in \cs{@glo@types}. When a new glossary type @@ -2896,9 +3360,45 @@ name=true]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@gls@provide@newglossary} +%\changes{3.10a}{2013-10-13}{new} +% If the user removes the glossary package from their document, +% ensure the next run doesn't throw a load of undefined control +% sequence errors when the aux file is parsed. +% \begin{macrocode} +\newcommand*\@gls@provide@newglossary{% + \protected@write\@auxout{}{\string\providecommand\string\@newglossary[4]{}}% +% \end{macrocode} +% Only need to do this once. +% \begin{macrocode} + \let\@gls@provide@newglossary\relax +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\defglsentryfmt} +%\changes{3.11a}{2013-10-15}{new} +% Allow different glossaries to have different display styles. +% \begin{macrocode} +\newcommand*{\defglsentryfmt}[2][\glsdefaulttype]{% + \csgdef{gls@#1@entryfmt}{#2}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@doentryfmt} +%\changes{3.11a}{2013-10-15}{new} +% \begin{macrocode} +\newcommand*{\gls@doentryfmt}[1]{\csuse{gls@#1@entryfmt}} +% \end{macrocode} +%\end{macro} +% % A new glossary type is defined using \cs{newglossary}. -% Syntax:\\[10pt]\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}% -%\marg{title}\oarg{counter}\\[10pt]% +% Syntax: +%\begin{definition} +%\cs{newglossary}\oarg{log-ext}\marg{name}\marg{in-ext}\marg{out-ext}% +%\marg{title}\oarg{counter} +%\end{definition} % where \meta{log-ext} is the extension of the \app{makeindex} % transcript file, \meta{in-ext} is the extension of the glossary % input file (read in by \ics{printglossary} and created by @@ -2915,17 +3415,20 @@ name=true]{% %\begin{macro}{\newglossary} % \begin{macrocode} \newcommand*{\newglossary}[5][glg]{% -\ifglossaryexists{#2}{% - \PackageError{glossaries}{Glossary type `#2' already exists}{% - You can't define a new glossary called `#2' because it already - exists}% -}{% + \ifglossaryexists{#2}% + {% + \PackageError{glossaries}{Glossary type `#2' already exists}{% + You can't define a new glossary called `#2' because it already + exists}% + }% + {% % \end{macrocode} % Check if default has been set % \begin{macrocode} - \ifx\glsdefaulttype\relax + \ifundef\glsdefaulttype + {% \gdef\glsdefaulttype{#2}% - \fi + }{}% % \end{macrocode} % Add this to the list of glossary types: % \begin{macrocode} @@ -2943,12 +3446,16 @@ name=true]{% \expandafter\def\csname @glotype@#2@in\endcsname{#3}% \expandafter\def\csname @glotype@#2@out\endcsname{#4}% \expandafter\def\csname @glotype@#2@title\endcsname{#5}% +% \end{macrocode} +%\changes{3.10a}{2013-10-13}{added \cs{@gls@provide@newglossary}} +% \begin{macrocode} + \@gls@provide@newglossary \protected@write\@auxout{}{\string\@newglossary{#2}{#1}{#3}{#4}}% % \end{macrocode} % How to display this entry in the document text (uses -% \cs{glsdisplay} and \cs{glsdisplayfirst} by -% default). These can be redefined by the user later if required -% (see \ics{defglsdisplay} and \ics{defglsdisplayfirst}). These +% \cs{glsentry} by +% default). This can be redefined by the user later if required +% (see \ics{defglsentry}). This % may already have been defined if this has been specified as % a list of acronyms. %\changes{2.04}{2009 November 10}{added check to determine if @@ -2956,17 +3463,12 @@ name=true]{% % have been defined.} %\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with %\cs{ifcsundef}} +%\changes{3.11a}{2013-10-15}{replaced \cs{glsdisplay} and +%\cs{glsdisplayfirst} with \cs{glsentryfmt}} % \begin{macrocode} - \ifcsundef{gls@#2@display}% - {% - \expandafter\gdef\csname gls@#2@display\endcsname{\glsdisplay}% - }% - {}% - \ifcsundef{gls@#2@displayfirst}% + \ifcsundef{gls@#2@entryfmt}% {% - \expandafter\gdef\csname gls@#2@displayfirst\endcsname{% - \glsdisplayfirst - }% + \defglsentryfmt[#2]{\glsentryfmt}% }% {}% % \end{macrocode} @@ -3031,7 +3533,8 @@ name=true]{% %\begin{macro}{\@gls@getcounter} % \begin{macrocode} \newcommand*{\@gls@getcounter}[1]{% -\csname @glotype@#1@counter\endcsname} + \csname @glotype@#1@counter\endcsname +} % \end{macrocode} %\end{macro} % @@ -3040,6 +3543,16 @@ name=true]{% % \begin{macrocode} \glsdefmain % \end{macrocode} +% Define the \qt{acronym} glossaries if required. +% \begin{macrocode} +\@gls@do@acronymsdef +% \end{macrocode} +% Define the \qt{symbols} and \qt{numbers} glossaries if required. +% \begin{macrocode} +\@gls@do@symbolsdef +\@gls@do@numbersdef +% \end{macrocode} +% % %\subsection{Defining new entries}\label{sec:newentry} % New glossary entries are defined using \cs{newglossaryentry}. @@ -3068,20 +3581,10 @@ name=true]{% %\begin{key}{description} % The \gloskey{description} key is usually only used in % the glossary, but can be made to appear in the text by redefining -% \ics{glsdisplay} and \ics{glsdisplayfirst} (or -% using \ics{defglsdisplay} and \ics{defglsdisplayfirst}), however, -% you will have to disable the sanitize option (using the -% \pkgopt{sanitize} package option, -% "sanitize={description=false}", and protect fragile -% commands). The \gloskey{description} key is required when -% defining a new glossary entry. (Be careful not to make the -% description too long, because \app{makeindex} has a limited -% buffer. \cs{@glo@desc} is defined to be a short command -% to discourage lengthy descriptions -% for this reason. If you do have a very long description, or if -% you require paragraph breaks, define a separate command that -% contains the description, and use it as the value to the -% \gloskey{description} key.) +% \ics{glsentryfmt} or using \ics{defglsentryfmt}. The +% \gloskey{description} key is required when +% defining a new glossary entry. If a long description is required, +% use \ics{longnewglossaryentry} instead of \ics{newglossaryentry}. % \begin{macrocode} \define@key{glossentry}{description}{% \def\@glo@desc{#1}% @@ -3103,7 +3606,8 @@ name=true]{% % not for use in the document). The \gloskey{sort} key is optional % when defining a new glossary entry. If omitted, the value % is given by \meta{name} \meta{description}. -%\changes{1.18}{2009 January 14}{moved sanitization to 'newglossaryentry} +%\changes{1.18}{2009 January 14}{moved sanitization to +%\cs{newglossaryentry}} % \begin{macrocode} \define@key{glossentry}{sort}{% \def\@glo@sort{#1}} @@ -3155,6 +3659,12 @@ name=true]{% } % \end{macrocode} %\end{key} +%\begin{macro}{\@gls@default@value} +%\changes{3.09a}{2013-10-09}{new} +% \begin{macrocode} +\newcommand*{\@gls@default@value}{\relax} +% \end{macrocode} +%\end{macro} % %\begin{key}{symbol} % The \gloskey{symbol} key is ignored by most of the predefined @@ -3162,12 +3672,10 @@ name=true]{% % It is provided for glossary styles that require an associated % symbol, as well as a name and description. To make this value % appear in the glossary, you need to redefine -% \ics{glossaryentryfield} so that it uses its fourth parameter. +% \ics{glossentry}. % If you want this value to appear in the text when the term is used % by commands like \ics{gls}, you will need to change -% \ics{glsdisplay} and \ics{glsdisplayfirst} (either -% explicitly for all glossaries or via \ics{defglsdisplay} -% and \ics{defglsdisplayfirst} for individual glossaries). +% \ics{glsentryfmt} (or use for \ics{defglsentryfmt} individual glossaries). % \begin{macrocode} \define@key{glossentry}{symbol}{% \def\@glo@symbol{#1}% @@ -3219,14 +3727,28 @@ name=true]{% % The \gloskey{see} key specifies a list of cross-references % \changes{1.17}{2008 December 26}{new} % \changes{3.0}{2011/04/02}{added \cs{@glo@seeautonumberlist}} +%\changes{3.13a}{2013-11-05}{added \cs{gls@checkseeallowed}} % \begin{macrocode} \define@key{glossentry}{see}{% + \gls@checkseeallowed \def\@glo@see{#1}% \@glo@seeautonumberlist } % \end{macrocode} %\end{key} % +%\begin{macro}{\gls@checkseeallowed} +%\changes{3.13a}{2013-11-05}{new} +% \begin{macrocode} +\newcommand*{\gls@checkseeallowed}{% + \PackageError{glossaries}% + {`see' key may only be used after \string\makeglossaries}% + {You must use \string\makeglossaries\space before defining + any entries that have a `see' key}% +} +% \end{macrocode} +%\end{macro} +% %\begin{key}{parent} % The \gloskey{parent} key specifies the parent entry, if % required. @@ -3354,11 +3876,29 @@ name=true]{% haven't specified the entry name}} % \end{macrocode} %\end{macro} +%\begin{macro}{\@glsnodesc} +% \changes{3.10a}{2013-10-13}{new} +% Define command to generate error if \gloskey{description} key is missing. +% \begin{macrocode} +\newcommand*\@glsnodesc{% + \PackageError{glossaries} + {% + description key required in \string\newglossaryentry\space + for entry `\@glo@label'% + }% + {% + You haven't specified the entry description% + }% +}% +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\@glsdefaultplural} -% Define command to set default plural. % \changes{1.17}{2008 December 26}{new} +%\changes{3.10a}{2013-10-13}{Obsolete} +% Now obsolete. Don't use. % \begin{macrocode} -\newcommand*{\@glsdefaultplural}{\@glo@text\glspluralsuffix} +\newcommand*{\@glsdefaultplural}{} % \end{macrocode} %\end{macro} % @@ -3398,94 +3938,554 @@ name=true]{% % \end{macrocode} %\end{macro} % -%\begin{macro}{\newglossaryentry} -% Define \cs{newglossaryentry}% -% \marg{label} \marg{key-val list}. -% There are two required fields in \meta{key-val list}: -% \gloskey{name} (or \gloskey{parent}) and -% \gloskey{description}. (See above.) -%\changes{3.0}{2011/04/02}{replaced \cs{DeclareRobustCommand} with -%\cs{newrobustcmd}} +%\begin{macro}{\@gls@noexpand@field} % \begin{macrocode} -\newrobustcmd{\newglossaryentry}[2]{% +\newcommand{\@@gls@noexpand@field}[3]{% + \expandafter\global\expandafter + \let\csname glo@#1@#2\endcsname#3% +} % \end{macrocode} -% Check to see if this glossary entry has already been defined: +%\end{macro} +%\begin{macro}{\@gls@noexpand@fields} % \begin{macrocode} - \glsdoifnoexists{#1}% +\newcommand{\@gls@noexpand@fields}[4]{% + \ifcsdef{gls@assign@#3@field} {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \csuse{gls@assign@#3@field}{#2}{\@gls@value}% + }% + {% + \csuse{gls@assign@#3@field}{#2}{#4}% + }% + }% + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% % \end{macrocode} -% Store label -% \begin{macrocode} - \def\@glo@label{#1}% -% \end{macrocode} -% Set up defaults. If the \gloskey{name} or \gloskey{description} -% keys are omitted, an error will be generated. -% \begin{macrocode} - \let\@glo@name\@glsnoname -% \end{macrocode} -%\changes{1.08}{2007 Oct 13}{Fixed error message to say ``description -%key'' rather than ``desc key''} +%\changes{3.11a}{2013-10-15}{Fixed bug \texttt{expand} replaced with +%\texttt{noexpand}} % \begin{macrocode} - \def\@glo@desc{% - \PackageError{glossaries} - {% - description key required in \string\newglossaryentry\space - for entry `\@glo@label'% - }% - {% - You haven't specified the entry description% - }% + \@@gls@noexpand@field{#2}{#3}{\@gls@value}% }% + {% + \@@gls@noexpand@field{#2}{#3}{#4}% + }% + }% +} % \end{macrocode} -% \changes{1.12}{2008 Mar 8}{descriptionplural support added} -% \begin{macrocode} - \def\@glo@descplural{\@glo@desc}% -% \end{macrocode} +%\end{macro} +%\begin{macro}{\@@gls@expand@field} % \begin{macrocode} - \def\@glo@type{\glsdefaulttype}% - \def\@glo@symbol{\relax}% +\newcommand{\@@gls@expand@field}[3]{% + \expandafter + \protected@xdef\csname glo@#1@#2\endcsname{#3}% +} % \end{macrocode} -% \changes{1.12}{2008 Mar 8}{symbolplural support added} +%\end{macro} +%\begin{macro}{@gls@expand@fields} % \begin{macrocode} - \def\@glo@symbolplural{\@glo@symbol}% +\newcommand{\@gls@expand@fields}[4]{% + \ifcsdef{gls@assign@#3@field} + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \edef\@gls@value{\expandonce{#1}}% + \csuse{gls@assign@#3@field}{#2}{\@gls@value}% + }% + {% + \expandafter\@gls@startswithexpandonce#4\relax\relax\gls@endcheck + {% + \@@gls@expand@field{#2}{#3}{#4}% + }% + {% + \csuse{gls@assign@#3@field}{#2}{#4}% + }% + }% + }% + {% + \ifdefequal{#4}{\@gls@default@value}% + {% + \@@gls@expand@field{#2}{#3}{#1}% + }% + {% + \@@gls@expand@field{#2}{#3}{#4}% + }% + }% +} % \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@startswithexpandonce} % \begin{macrocode} - \def\@glo@text{\@glo@name}% +\def\@gls@expandonce{\expandonce} +\def\@gls@startswithexpandonce#1#2\gls@endcheck#3#4{% + \def\@gls@tmp{#1}% + \ifdefequal{\@gls@expandonce}{\@gls@tmp}{#3}{#4}% +} % \end{macrocode} +%\end{macro} +%\begin{macro}{\gls@assign@field} +%\begin{definition} +%\cs{gls@assign@field}\marg{def value}\marg{glossary type}\marg{field}\marg{tmp +%cs} +%\end{definition} +% Assigns an entry field. Expansion performed by default (except for +% name, symbol and description where backward compatibility required). +% If \meta{tmp cs} is \meta{@gls@default@value}, \meta{def value} is +% used instead. +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} - \let\@glo@plural\@glsdefaultplural +\let\gls@assign@field\@gls@expand@fields % \end{macrocode} -% \changes{1.13}{2008 May 10}{Changed default first value} -% Using \cs{let} instead of \cs{def} to make later comparison -% avoid expansion issues. (Thanks to Ulrich~Diez for suggesting -% this.) -% \changes{1.16}{2008 August 27}{Changed def to let} +%\end{macro} +%\begin{macro}{\glsexpandfields} +%\changes{3.08a}{2013-09-28}{new} +% Fully expand values when assigning fields (except for specific +% fields that are overridden by \cs{glssetnoexpandfield}). % \begin{macrocode} - \let\@glo@first\relax +\newcommand*{\glsexpandfields}{% + \let\gls@assign@field\@gls@expand@fields +} % \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)} -% \changes{1.13}{2008 May 10}{Changed default firstplural value} +%\end{macro} +%\begin{macro}{\glsnoexpandfields} +%\changes{3.08a}{2013-09-28}{new} +% Don't expand values when assigning fields (except for specific +% fields that are overridden by \cs{glssetexpandfield}). % \begin{macrocode} - \let\@glo@firstplural\relax +\newcommand*{\glsnoexpandfields}{% + \let\gls@assign@field\@gls@noexpand@fields +} % \end{macrocode} -% Set the default sort: -%\changes{1.05}{2007 Aug 10}{Changed the default value of the sort -% key to just the value of the name key}% -%\changes{1.18}{2009 January 14}{Changed default value of sort -% to '@glsdefaultsort} +%\end{macro} +% +% +%\begin{macro}{\newglossaryentry} +% Define \cs{newglossaryentry}% +% \marg{label} \marg{key-val list}. +% There are two required fields in \meta{key-val list}: +% \gloskey{name} (or \gloskey{parent}) and +% \gloskey{description}. (See above.) +%\changes{3.0}{2011/04/02}{replaced \cs{DeclareRobustCommand} with +%\cs{newrobustcmd}} % \begin{macrocode} - \let\@glo@sort\@glsdefaultsort +\newrobustcmd{\newglossaryentry}[2]{% % \end{macrocode} -% Set the default counter: +% Check to see if this glossary entry has already been defined: % \begin{macrocode} - \def\@glo@counter{\@gls@getcounter{\@glo@type}}% + \glsdoifnoexists{#1}% + {% + \gls@defglossaryentry{#1}{#2}% + }% +} % \end{macrocode} -%\changes{1.17}{2008 December 26}{added see key} +%\end{macro} +% +%\begin{macro}{\provideglossaryentry} +% Like \cs{newglossaryentry} but does nothing if the entry has +% already been defined. +%\changes{3.14a}{2013-11-12}{new} % \begin{macrocode} - \def\@glo@see{}% +\newrobustcmd{\provideglossaryentry}[2]{% + \ifglsentryexists{#1}% + {}% + {% + \gls@defglossaryentry{#1}{#2}% + }% +} +\@onlypreamble{\provideglossaryentry} % \end{macrocode} -%\changes{1.17}{2008 December 26}{added parent key} +%\end{macro} +% +%\begin{macro}{\new@glossaryentry} +%\changes{3.10a}{2013-10-13}{new} +% For use in document environment. +% \begin{macrocode} +\newrobustcmd{\new@glossaryentry}[2]{% + \ifundef\@gls@deffile + {% + \global\newwrite\@gls@deffile + \immediate\openout\@gls@deffile=\jobname.glsdefs + }% + {}% + \ifglsentryexists{#1}{}% + {% + \gls@defglossaryentry{#1}{#2}% + }% + \@gls@writedef{#1}% +} +\AtBeginDocument +{ + \makeatletter + \InputIfFileExists{\jobname.glsdefs}{}{}% + \makeatother + \let\newglossaryentry\new@glossaryentry +} +\AtEndDocument{\ifdef\@gls@deffile{\closeout\@gls@deffile}{}} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@writedef} +%\changes{3.10a}{2013-10-13}{new} +% Writes glossary entry definition to \cs{@gls@deffile}. +% \begin{macrocode} +\newcommand*{\@gls@writedef}[1]{% + \immediate\write\@gls@deffile + {% + \string\ifglsentryexists{#1}{}\expandafter\@gobble\string\%^^J% + \expandafter\@gobble\string\{\expandafter\@gobble\string\%^^J% + \string\gls@defglossaryentry{#1}\expandafter\@gobble\string\%^^J% + \expandafter\@gobble\string\{\expandafter\@gobble\string\%% + }% +% \end{macrocode} +% Write key value information: +% \begin{macrocode} + \@for\@gls@map:=\@gls@keymap\do + {% + \edef\glo@value{\expandafter\expandonce + \csname glo@#1@\expandafter\@secondoftwo\@gls@map\endcsname}% + \@onelevel@sanitize\glo@value + \immediate\write\@gls@deffile + {% + \expandafter\@firstoftwo\@gls@map + =\expandafter\@gobble\string\{\glo@value\expandafter\@gobble\string\},% + \expandafter\@gobble\string\%% + }% + }% +% \end{macrocode} +% Provide hook: +% \begin{macrocode} + \glswritedefhook + \immediate\write\@gls@deffile + {% + \expandafter\@gobble\string\%^^J% + \expandafter\@gobble\string\}\expandafter\@gobble\string\%^^J% + \expandafter\@gobble\string\}\expandafter\@gobble\string\%% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@keymap} +%\changes{3.10a}{2013-10-13}{new} +% List of entry definition key names and corresponding tag in +% control sequence used to store the value. +% \begin{macrocode} +\newcommand*{\@gls@keymap}{% + {name}{name},% + {sort}{sortvalue},% unescaped sort value + {type}{type},% + {first}{first},% + {firstplural}{firstpl},% + {text}{text},% + {plural}{plural},% + {description}{desc},% + {descriptionplural}{descplural},% + {symbol}{symbol},% + {symbolplural}{symbolplural},% + {user1}{useri},% + {user2}{userii},% + {user3}{useriii},% + {user4}{useriv},% + {user5}{userv},% + {user6}{uservi},% + {long}{long},% + {longplural}{longpl},% + {short}{short},% + {shortplural}{shortpl},% + {counter}{counter},% + {parent}{parent}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsaddkey} +%\begin{definition} +%\cs{glsaddkey}\marg{key}\marg{default value}\marg{no link cs}\marg{no link ucfirst +%cs}\marg{link cs}\marg{link ucfirst cs}\marg{link allcaps cs} +%\end{definition} +%\changes{3.12a}{2013-10-16}{new} +% Allow user to add their own custom keys. +% \begin{macrocode} +\newcommand*{\glsaddkey}{\@ifstar\@sglsaddkey\@glsaddkey} +% \end{macrocode} +% Starred version switches on expansion for this key. +% \begin{macrocode} +\newcommand*{\@sglsaddkey}[1]{% + \key@ifundefined{glossentry}{#1}% + {% + \expandafter\newcommand\expandafter*\expandafter + {\csname gls@assign@#1@field\endcsname}[2]{% + \@@gls@expand@field{##1}{#1}{##2}% + }% + }% + {}% + \@glsaddkey{#1}% +} +% \end{macrocode} +% Unstarred version doesn't override default expansion. +% \begin{macrocode} +\newcommand*{\@glsaddkey}[7]{% +% \end{macrocode} +% Check the specified key doesn't already exist. +% \begin{macrocode} + \key@ifundefined{glossentry}{#1}% + {% +% \end{macrocode} +% Set up the key. +% \begin{macrocode} + \define@key{glossentry}{#1}{\csdef{@glo@#1}{##1}}% + \appto\@gls@keymap{,{#1}{#1}}% +% \end{macrocode} +% Set the default value. +% \begin{macrocode} + \appto\@newglossaryentryprehook{\csdef{@glo@#1}{#2}}% +% \end{macrocode} +% Assignment code. +% \begin{macrocode} + \appto\@newglossaryentryposthook{% + \letcs{\@glo@tmp}{@glo@#1}% + \gls@assign@field{#2}{\@glo@label}{#1}{\@glo@tmp}% + }% +% \end{macrocode} +% Define the no-link commands. +% \begin{macrocode} + \newcommand*{#3}[1]{\csuse{glo@##1@#1}}% + \newcommand*{#4}[1]{% + \letcs{\@glo@text}{glo@##1@#1}% + \xmakefirstuc\@glo@text + }% +% \end{macrocode} +% Now for the commands with links. First the version with no case +% change: +% \begin{macrocode} + \ifcsdef{@gls@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#5' as helper command + `\expandafter\string\csname @gls@user@#1@\endcsname' already exists}% + {}% + }% + {% + \newrobustcmd*{#5}{\@ifstar{\csuse{@sgls@user@#1}}{\csuse{@gls@user@#1}}}% + \expandafter\newcommand\expandafter*\expandafter + {\csname @sgls@user@#1\endcsname}[1][]{% + \csuse{@gls@user@#1}[hyper=false,##1]% + }% + \expandafter\newcommand\expandafter*\expandafter + {\csname @gls@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@gls@user@#1@}{##1}{##2}}% + {\csuse{@gls@user@#1@}{##1}{##2}[]}}% + \csdef{@gls@user@#1@}##1##2[##3]{% + \glsdoifexists{##2}% + {% + \edef\@glo@type{\glsentrytype{##2}}% + \@gls@link[##1]{##2}{#3{##2}##3}% + }% + }% + }% +% \end{macrocode} +% Next the version with the first letter converted to upper case: +% \begin{macrocode} + \ifcsdef{@Gls@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#6' as helper command + `\expandafter\string\csname @Gls@user@#1@\endcsname' already exists}% + {}% + }% + {% + \newrobustcmd*{#6}{\@ifstar{\csuse{@sGls@user@#1}}{\csuse{@Gls@user@#1}}}% + \expandafter\newcommand\expandafter*\expandafter + {\csname @sGls@user@#1\endcsname}[1][]{% + \csuse{@Gls@user@#1}[hyper=false,##1]% + }% + \expandafter\newcommand\expandafter*\expandafter + {\csname @Gls@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@Gls@user@#1@}{##1}{##2}}% + {\csuse{@Gls@user@#1@}{##1}{##2}[]}}% + \csdef{@Gls@user@#1@}##1##2[##3]{% + \glsdoifexists{##2}% + {% + \edef\@glo@type{\glsentrytype{##2}}% + \@gls@link[##1]{##2}{#4{##2}##3}% + }% + }% + }% +% \end{macrocode} +% Finally the all caps version: +% \begin{macrocode} + \ifcsdef{@GLS@user@#1@}% + {% + \PackageError{glossaries}% + {Can't define `\string#7' as helper command + `\expandafter\string\csname @GLS@user@#1@\endcsname' already exists}% + {}% + }% + {% + \newrobustcmd*{#7}{\@ifstar{\csuse{@sGLS@user@#1}}{\csuse{@GLS@user@#1}}}% + \expandafter\newcommand\expandafter*\expandafter + {\csname @sGLS@user@#1\endcsname}[1][]{% + \csuse{@GLS@user@#1}[hyper=false,##1]% + }% + \expandafter\newcommand\expandafter*\expandafter + {\csname @GLS@user@#1\endcsname}[2][]{% + \new@ifnextchar[% + {\csuse{@GLS@user@#1@}{##1}{##2}}% + {\csuse{@GLS@user@#1@}{##1}{##2}[]}}% + \csdef{@GLS@user@#1@}##1##2[##3]{% + \glsdoifexists{##2}% + {% + \edef\@glo@type{\glsentrytype{##2}}% + \@gls@link[##1]{##2}{\mfirstucMakeUppercase{#3{##2}##3}}% + }% + }% + }% + }% + {% + \PackageError{glossaries}{Key `#1' already exists}{}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glswritedefhook} +%\changes{3.10a}{2013-10-13}{new} +% \begin{macrocode} +\newcommand*{\glswritedefhook}{} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\gls@assign@desc} +%\changes{3.11a}{2013-10-15}{new} +% \begin{macrocode} +\newcommand*{\gls@assign@desc}[1]{% + \gls@assign@field{}{#1}{desc}{\@glo@desc}% + \gls@assign@field{\@glo@desc}{#1}{descplural}{\@glo@descplural}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\longnewglossaryentry} +%\changes{3.11a}{2013-10-15}{new} +% \begin{macrocode} +\newcommand{\longnewglossaryentry}[3]{% + \glsdoifnoexists{#1}% + {% + \bgroup + \let\@org@newglossaryentryprehook\@newglossaryentryprehook + \long\def\@newglossaryentryprehook{% + \long\def\@glo@desc{#3\leavevmode\unskip\nopostdesc}% + \@org@newglossaryentryprehook + }% + \renewcommand*{\gls@assign@desc}[1]{% + \global\cslet{glo@#1@desc}{\@glo@desc}% + \global\cslet{glo@#1@descplural}{\@glo@desc}% + } + \gls@defglossaryentry{#1}{#2}% + \egroup + } +} +% \end{macrocode} +% Only allowed in the preamble. (Otherwise a long description could +% cause problems when writing the entry definition to the temporary +% file.) +% \begin{macrocode} +\@onlypreamble{\longnewglossaryentry} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\longprovideglossaryentry} +%\changes{3.14a}{2013-11-12}{new} +% As the above but only defines the entry if it doesn't already +% exist. +% \begin{macrocode} +\newcommand{\longprovideglossaryentry}[3]{% + \ifglsentryexists{#1}{}% + {\longnewglossaryentry{#1}{#2}{#3}}% +} +\@onlypreamble{\longprovideglossaryentry} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\gls@defglossaryentry} +%\begin{definition} +%\cs{gls@defglossaryentry}\marg{label}\marg{key-val list} +%\end{definition} +% Defines a new entry without checking if it already exists. +%\changes{3.10a}{2013-10-13}{new} +% \begin{macrocode} +\newcommand{\gls@defglossaryentry}[2]{% +% \end{macrocode} +% Store label +% \begin{macrocode} + \def\@glo@label{#1}% +% \end{macrocode} +% \changes{3.12a}{2013-10-16}{added \cs{glslabel}} +% Provide a means for user define keys to reference the label: +% \begin{macrocode} + \let\glslabel\@glo@label +% \end{macrocode} +% Set up defaults. If the \gloskey{name} or \gloskey{description} +% keys are omitted, an error will be generated. +% \begin{macrocode} + \let\@glo@name\@glsnoname + \let\@glo@desc\@glsnodesc +% \end{macrocode} +% \changes{1.12}{2008 Mar 8}{descriptionplural support added} +% \begin{macrocode} + \let\@glo@descplural\@gls@default@value +% \end{macrocode} +% \begin{macrocode} + \let\@glo@type\@gls@default@value + \let\@glo@symbol\@gls@default@value +% \end{macrocode} +% \changes{1.12}{2008 Mar 8}{symbolplural support added} +% \begin{macrocode} + \let\@glo@symbolplural\@gls@default@value +% \end{macrocode} +% \begin{macrocode} + \let\@glo@text\@gls@default@value +% \end{macrocode} +% \begin{macrocode} + \let\@glo@plural\@gls@default@value +% \end{macrocode} +% \changes{1.13}{2008 May 10}{Changed default first value} +% Using \cs{let} instead of \cs{def} to make later comparison +% avoid expansion issues. (Thanks to Ulrich~Diez for suggesting +% this.) +% \changes{1.16}{2008 August 27}{Changed def to let} +%\changes{3.10a}{2013-10-13}{Changed to using \cs{@gls@default@value}} +% \begin{macrocode} + \let\@glo@first\@gls@default@value +% \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)} +% \changes{1.13}{2008 May 10}{Changed default firstplural value} +% \begin{macrocode} + \let\@glo@firstplural\@gls@default@value +% \end{macrocode} +% Set the default sort: +%\changes{3.10a}{2013-10-13}{Changed to using \cs{@gls@default@value}} +%\changes{1.05}{2007 Aug 10}{Changed the default value of the sort +% key to just the value of the name key}% +%\changes{1.18}{2009 January 14}{Changed default value of sort +% to \cs{@glsdefaultsort}} +% \begin{macrocode} + \let\@glo@sort\@gls@default@value +% \end{macrocode} +% Set the default counter: +% \begin{macrocode} + \let\@glo@counter\@gls@default@value +% \end{macrocode} +%\changes{1.17}{2008 December 26}{added see key} +% \begin{macrocode} + \def\@glo@see{}% +% \end{macrocode} +%\changes{1.17}{2008 December 26}{added parent key} % \begin{macrocode} \def\@glo@parent{}% % \end{macrocode} @@ -3517,6 +4517,23 @@ name=true]{% % \begin{macrocode} \setkeys{glossentry}{#2}% % \end{macrocode} +%\changes{3.14a}{2013-11-12}{added check for existence of default glossary} +% Check there is a default glossary. +% \begin{macrocode} + \ifundef\glsdefaulttype + {% + \PackageError{glossaries}% + {No default glossary type (have you used `nomain'?)}% + {If you use package option `nomain' you must define + a new glossary before you can define entries}% + }% + {}% +% \end{macrocode} +% Assign type. This must be fully expandable +% \begin{macrocode} + \gls@assign@field{\glsdefaulttype}{#1}{type}{\@glo@type}% + \edef\@glo@type{\glsentrytype{#1}}% +% \end{macrocode} % Check to see if this glossary type has been defined, if it has, % add this label to the relevant list, otherwise generate an error. %\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with @@ -3525,7 +4542,7 @@ name=true]{% \ifcsundef{glolist@\@glo@type}% {% \PackageError{glossaries}% - {Glossary type '\@glo@type' has not been defined}% + {Glossary type `\@glo@type' has not been defined}% {You need to define a new glossary type, before making entries in it}% }% @@ -3580,7 +4597,7 @@ name=true]{% % \end{macrocode} % If name and plural haven't been specified, use same as the parent % \begin{macrocode} - \ifx\@glo@plural\@glsdefaultplural + \ifx\@glo@plural\@gls@default@value \expandafter\let\expandafter\@glo@plural \csname glo@\@glo@parent @plural\endcsname \fi @@ -3609,64 +4626,60 @@ name=true]{% % \begin{macrocode} \expandafter\xdef\csname glo@#1@level\endcsname{\number\gls@level}% % \end{macrocode} -% Check if \gloskey{first} and \gloskey{firstplural} have been use. -% If \gloskey{firstplural} hasn't been specified, but \gloskey{first} -% has been specified, then form \gloskey{firstplural} by appending -% \cs{glspluralsuffix} to value of \gloskey{first} key, otherwise -% obtain the value from the \gloskey{plural} key. -% \changes{1.16}{2008 August 27}{Changed if to ifx} -% This now uses \cs{ifx} instead of \cs{if} to avoid expansion -% issues. (Thanks to Ulrich~Diez for suggesting this.) -% \begin{macrocode} - \ifx\relax\@glo@firstplural - \ifx\relax\@glo@first - \def\@glo@firstplural{\@glo@plural}% - \def\@glo@first{\@glo@text}% - \else - \def\@glo@firstplural{\@glo@first\glspluralsuffix}% - \fi +% Define commands associated with this entry: +% \begin{macrocode} + \gls@assign@field{\@glo@name}{#1}{sortvalue}{\@glo@sort}% + \letcs\@glo@sort{glo@#1@sortvalue}% + \gls@assign@field{\@glo@name}{#1}{text}{\@glo@text}% + \expandafter\gls@assign@field\expandafter + {\csname glo@#1@text\endcsname\glspluralsuffix}% + {#1}{plural}{\@glo@plural}% + \expandafter\gls@assign@field\expandafter + {\csname glo@#1@text\endcsname}% + {#1}{first}{\@glo@first}% +% \end{macrocode} +%\changes{3.14a}{2013-11-12}{set the default for firstplural to be the value +%of plural} +%\changes{4.0}{2013-11-14}{added check for first key} +% If \gloskey{first} has been specified, make the default by appending +% \cs{glspluralsuffix}, otherwise make the default the value of the +% \gloskey{plural} key. +% \begin{macrocode} + \ifx\@glo@first\@gls@default@value + \expandafter\gls@assign@field\expandafter + {\csname glo@#1@plural\endcsname}% + {#1}{firstpl}{\@glo@firstplural}% \else - \ifx\relax\@glo@first - \def\@glo@first{\@glo@text}% - \fi + \expandafter\gls@assign@field\expandafter + {\csname glo@#1@first\endcsname\glspluralsuffix}% + {#1}{firstpl}{\@glo@firstplural}% \fi % \end{macrocode} -% Define commands associated with this entry: +%\changes{3.11a}{2013-10-15}{Fixed default counter if none supplied} % \begin{macrocode} - \expandafter - \protected@xdef\csname glo@#1@text\endcsname{\@glo@text}% - \expandafter - \protected@xdef\csname glo@#1@plural\endcsname{\@glo@plural}% - \expandafter - \protected@xdef\csname glo@#1@first\endcsname{\@glo@first}% - \expandafter - \protected@xdef\csname glo@#1@firstpl\endcsname{\@glo@firstplural}% - \expandafter - \protected@xdef\csname glo@#1@type\endcsname{\@glo@type}% - \expandafter - \protected@xdef\csname glo@#1@counter\endcsname{\@glo@counter}% - \expandafter - \protected@xdef\csname glo@#1@useri\endcsname{\@glo@useri}% - \expandafter - \protected@xdef\csname glo@#1@userii\endcsname{\@glo@userii}% - \expandafter - \protected@xdef\csname glo@#1@useriii\endcsname{\@glo@useriii}% - \expandafter - \protected@xdef\csname glo@#1@useriv\endcsname{\@glo@useriv}% - \expandafter - \protected@xdef\csname glo@#1@userv\endcsname{\@glo@userv}% - \expandafter - \protected@xdef\csname glo@#1@uservi\endcsname{\@glo@uservi}% - \expandafter - \protected@xdef\csname glo@#1@short\endcsname{\@glo@short}% - \expandafter - \protected@xdef\csname glo@#1@shortpl\endcsname{\@glo@shortpl}% - \expandafter - \protected@xdef\csname glo@#1@long\endcsname{\@glo@long}% - \expandafter - \protected@xdef\csname glo@#1@longpl\endcsname{\@glo@longpl}% - \@gls@sanitizename - \expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}% + \ifcsundef{@glotype@\@glo@type @counter}% + {% + \def\@glo@defaultcounter{\glscounter}% + }% + {% + \letcs\@glo@defaultcounter{@glotype@\@glo@type @counter}% + }% + \gls@assign@field{\@glo@defaultcounter}{#1}{counter}{\@glo@counter}% + \gls@assign@field{}{#1}{useri}{\@glo@useri}% + \gls@assign@field{}{#1}{userii}{\@glo@userii}% + \gls@assign@field{}{#1}{useriii}{\@glo@useriii}% + \gls@assign@field{}{#1}{useriv}{\@glo@useriv}% + \gls@assign@field{}{#1}{userv}{\@glo@userv}% + \gls@assign@field{}{#1}{uservi}{\@glo@uservi}% + \gls@assign@field{}{#1}{short}{\@glo@short}% + \gls@assign@field{}{#1}{shortpl}{\@glo@shortpl}% + \gls@assign@field{}{#1}{long}{\@glo@long}% + \gls@assign@field{}{#1}{longpl}{\@glo@longpl}% + \ifx\@glo@name\@glsnoname + \@glsnoname + \let\@gloname\@gls@default@value + \fi + \gls@assign@field{}{#1}{name}{\@glo@name}% % \end{macrocode} %\changes{3.02}{2012/05/21}{added numberlist element} % Set default numberlist if not defined: @@ -3680,32 +4693,36 @@ name=true]{% % The smaller and smallcaps options set the description to % \cs{@glo@first}. Need to check for this, otherwise it won't get % expanded if the description gets sanitized. -%\changes{1.15}{2008 August 15}{check for '@glo@first in description}% +%\changes{1.15}{2008 August 15}{check for \cs{@glo@first} in description}% % \begin{macrocode} \def\@glo@@desc{\@glo@first}% \ifx\@glo@desc\@glo@@desc \let\@glo@desc\@glo@first \fi - \@gls@sanitizedesc - \expandafter\protected@xdef\csname glo@#1@desc\endcsname{\@glo@desc}% - \expandafter\protected@xdef\csname glo@#1@descplural\endcsname{\@glo@descplural}% + \ifx\@glo@desc\@glsnodesc + \@glsnodesc + \let\@glodesc\@gls@default@value + \fi + \gls@assign@desc{#1}% % \end{macrocode} %\changes{1.18}{2009 January 14}{moved sort sanitization to -% 'newglossaryentry} +% \cs{newglossaryentry}} %\changes{3.0}{2011/04/02}{added \cs{@gls@defsort}} % Set the sort key for this entry: % \begin{macrocode} \@gls@defsort{\@glo@type}{#1}% % \end{macrocode} -%\changes{1.15}{2008 August 15}{check for '@glo@text in symbol}% +%\changes{1.15}{2008 August 15}{check for \cs{@glo@text} in symbol}% % \begin{macrocode} \def\@glo@@symbol{\@glo@text}% \ifx\@glo@symbol\@glo@@symbol \let\@glo@symbol\@glo@text \fi - \@gls@sanitizesymbol - \expandafter\protected@xdef\csname glo@#1@symbol\endcsname{\@glo@symbol}% - \expandafter\protected@xdef\csname glo@#1@symbolplural\endcsname{\@glo@symbolplural}% + \gls@assign@field{\relax}{#1}{symbol}{\@glo@symbol}% + \expandafter + \gls@assign@field\expandafter + {\csname glo@#1@symbol\endcsname} + {#1}{symbolplural}{\@glo@symbolplural}% % \end{macrocode} % Define an associated boolean variable to determine whether this % entry has been used yet (needs to be defined globally): @@ -3730,7 +4747,6 @@ name=true]{% \noexpand\expandafter\noexpand\@glssee\noexpand\@glo@list{#1}}% \@do@glssee \fi - }% % \end{macrocode} % Determine and store main part of the entry's index format. %\changes{1.17}{2008 December 26}{Stored main part of entry @@ -3745,7 +4761,7 @@ name=true]{% } % \end{macrocode} %\changes{1.13}{2008 May 10}{Removed restriction on only using -% 'newglossaryentry in the preamble} +% \cs{newglossaryentry} in the preamble} %\end{macro} %\begin{macro}{\@newglossaryentryprehook} % Allow extra information to be added to glossary entries: @@ -3785,11 +4801,12 @@ name=true]{% % the glossary. (This enables the \sty{glossaries-accsupp} package % to use \cs{accsuppglossaryentryfield} instead.) %\changes{2.04}{2009 November 10}{new} +%\changes{3.08a}{2013-09-28}{switched to \cs{glossentry}} % \begin{macrocode} \ifglsxindy - \newcommand*{\@glossaryentryfield}{\string\\glossaryentryfield} + \newcommand*{\@glossaryentryfield}{\string\\glossentry} \else - \newcommand*{\@glossaryentryfield}{\string\glossaryentryfield} + \newcommand*{\@glossaryentryfield}{\string\glossentry} \fi % \end{macrocode} %\end{macro} @@ -3799,18 +4816,22 @@ name=true]{% % the glossary. (This enables the \sty{glossaries-accsupp} package % to use \cs{accsuppglossarysubentryfield} instead.) %\changes{2.04}{2009 November 10}{new} +%\changes{3.08a}{2013-09-28}{switched to \cs{subglossentry}} % \begin{macrocode} \ifglsxindy \newcommand*{\@glossarysubentryfield}{% - \string\\glossarysubentryfield} + \string\\subglossentry} \else \newcommand*{\@glossarysubentryfield}{% - \string\glossarysubentryfield} + \string\subglossentry} \fi % \end{macrocode} %\end{macro} % %\begin{macro}{\@glo@storeentry} +%\begin{definition} +%\cs{@glo@storeentry}\marg{label} +%\end{definition} %\changes{1.17}{2008 December 26}{new} % Determine the format to write the entry in the glossary % output (\filetype{.glo}) file. @@ -3821,100 +4842,81 @@ name=true]{% % \begin{macrocode} \newcommand{\@glo@storeentry}[1]{% % \end{macrocode} -% Get the sort string and escape any special characters -% \begin{macrocode} -\protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}% -\@gls@checkmkidxchars\@glo@sort -% \end{macrocode} -% Same again for the name string. -% \begin{macrocode} -\protected@edef\@@glo@name{\csname glo@#1@name\endcsname}% -\@gls@checkmkidxchars\@@glo@name -% \end{macrocode} -% Add the font command. (The backslash needs to be escaped for -% \app{xindy}.) -% \begin{macrocode} -\ifglsxindy - \protected@edef\@glo@name{\string\\glsnamefont{\@@glo@name}}% -\else - \protected@edef\@glo@name{\string\glsnamefont{\@@glo@name}}% -\fi -% \end{macrocode} -% Get the description string and escape any special characters +% Escape special characters in the label: % \begin{macrocode} -\protected@edef\@glo@desc{\csname glo@#1@desc\endcsname}% -\@gls@checkmkidxchars\@glo@desc + \def\@glo@label{#1}% + \@gls@checkmkidxchars\@glo@label % \end{macrocode} -% Same again for the symbol +% Get the sort string and escape any special characters % \begin{macrocode} -\protected@edef\@glo@symbol{\csname glo@#1@symbol\endcsname}% -\@gls@checkmkidxchars\@glo@symbol + \protected@edef\@glo@sort{\csname glo@#1@sort\endcsname}% + \@gls@checkmkidxchars\@glo@sort % \end{macrocode} +% Same again for the name string. +%\changes{3.08a}{2013-09-28}{no longer need to check for special characters +%in any of the fields other than sort} % Escape any special characters in the prefix % \begin{macrocode} -\@gls@checkmkidxchars\@glo@prefix + \@gls@checkmkidxchars\@glo@prefix % \end{macrocode} % Get the parent, if one exists % \begin{macrocode} -\edef\@glo@parent{\csname glo@#1@parent\endcsname}% + \edef\@glo@parent{\csname glo@#1@parent\endcsname}% % \end{macrocode} % Write the information to the glossary file. % \begin{macrocode} -\ifglsxindy + \ifglsxindy % \end{macrocode} % Store using \app{xindy} syntax. % \begin{macrocode} - \ifx\@glo@parent\@empty + \ifx\@glo@parent\@empty % \end{macrocode} % Entry doesn't have a parent +%\changes{3.08a}{2013-09-28}{updated for \cs{glossentry}} % \begin{macrocode} - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - (\string"\@glo@sort\string" % - \string"\@glo@prefix\@glossaryentryfield{#1}{\@glo@name - }{\@glo@desc}{\@glo@symbol}\string") % - }% - \else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + (\string"\@glo@sort\string" % + \string"\@glo@prefix\@glossaryentryfield{\@glo@label}\string") % + }% + \else % \end{macrocode} % Entry has a parent % \begin{macrocode} - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - \csname glo@\@glo@parent @index\endcsname - (\string"\@glo@sort\string" % - \string"\@glo@prefix\@glossarysubentryfield% - {\csname glo@#1@level\endcsname}{#1}{\@glo@name - }{\@glo@desc}{\@glo@symbol}\string") % - }% - \fi -\else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \csname glo@\@glo@parent @index\endcsname + (\string"\@glo@sort\string" % + \string"\@glo@prefix\@glossarysubentryfield + {\csname glo@#1@level\endcsname}{\@glo@label}\string") % + }% + \fi + \else % \end{macrocode} % Store using \app{makeindex} syntax. % \begin{macrocode} - \ifx\@glo@parent\@empty + \ifx\@glo@parent\@empty % \end{macrocode} % Sanitize \cs{@glo@prefix} % \begin{macrocode} - \@onelevel@sanitize\@glo@prefix + \@onelevel@sanitize\@glo@prefix % \end{macrocode} % Entry doesn't have a parent % \begin{macrocode} - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - \@glo@sort\@gls@actualchar\@glo@prefix - \@glossaryentryfield{#1}{\@glo@name}{\@glo@desc - }{\@glo@symbol}% - }% - \else + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \@glo@sort\@gls@actualchar\@glo@prefix + \@glossaryentryfield{\@glo@label}% + }% + \else % \end{macrocode} % Entry has a parent % \begin{macrocode} - \expandafter\protected@xdef\csname glo@#1@index\endcsname{% - \csname glo@\@glo@parent @index\endcsname\@gls@levelchar - \@glo@sort\@gls@actualchar\@glo@prefix - \@glossarysubentryfield - {\csname glo@#1@level\endcsname}{#1}{\@glo@name}{\@glo@desc - }{\@glo@symbol}% - }% + \expandafter\protected@xdef\csname glo@#1@index\endcsname{% + \csname glo@\@glo@parent @index\endcsname\@gls@levelchar + \@glo@sort\@gls@actualchar\@glo@prefix + \@glossarysubentryfield + {\csname glo@#1@level\endcsname}{\@glo@label}% + }% + \fi \fi -\fi } % \end{macrocode} %\end{macro} @@ -3924,42 +4926,88 @@ name=true]{% %\cs{ifglo@}\meta{label}\texttt{@flag} which determines % whether or not the entry has been used (see also % \ics{ifglsused} defined below). These flags can -% be set and unset using the following macros: +% be set and unset using the following macros, but first we need to +% know if we're in \sty{amsmath}'s \env{align} environment's +% measuring pass. % -% The command \cs{glsreset}\marg{label} can be used -% to set the entry flag to indicate that it hasn't been used yet. The -% required argument is the entry label. -%\begin{macro}{\glsreset} +%\begin{macro}{\gls@ifnotmeasuring} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\glsreset}[1]{% -\glsdoifexists{#1}{% -\expandafter\global\csname glo@#1@flagfalse\endcsname}} -% \end{macrocode} -%\end{macro} -% As above, but with only a local effect: +\AtBeginDocument{% + \@ifpackageloaded{amsmath}% + {\let\gls@ifnotmeasuring\@gls@ifnotmeasuring}% + {}% +} +\newcommand*{\@gls@ifnotmeasuring}[1]{% + \ifmeasuring@ + \else + #1% + \fi +} +\newcommand*\gls@ifnotmeasuring[1]{#1} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsreset} +% The command \cs{glsreset}\marg{label} can be used +% to set the entry flag to indicate that it hasn't been used yet. The +% required argument is the entry label. +% \begin{macrocode} +\newcommand*{\glsreset}[1]{% + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \expandafter\global\csname glo@#1@flagfalse\endcsname + }% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glslocalreset} +% As above, but with only a local effect: % \begin{macrocode} \newcommand*{\glslocalreset}[1]{% -\glsdoifexists{#1}{% -\expandafter\let\csname ifglo@#1@flag\endcsname\iffalse}} + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \expandafter\let\csname ifglo@#1@flag\endcsname\iffalse + }% + }% +} % \end{macrocode} %\end{macro} +%\begin{macro}{\glsunset} % The command \cs{glsunset}\marg{label} can be used to % set the entry flag to indicate that it has been used. The required % argument is the entry label. -%\begin{macro}{\glsunset} % \begin{macrocode} \newcommand*{\glsunset}[1]{% -\glsdoifexists{#1}{% -\expandafter\global\csname glo@#1@flagtrue\endcsname}} + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \expandafter\global\csname glo@#1@flagtrue\endcsname + }% + }% +} % \end{macrocode} %\end{macro} -% As above, but with only a local effect: +% %\begin{macro}{\glslocalunset} +% As above, but with only a local effect: % \begin{macrocode} \newcommand*{\glslocalunset}[1]{% -\glsdoifexists{#1}{% -\expandafter\let\csname ifglo@#1@flag\endcsname\iftrue}} + \gls@ifnotmeasuring + {% + \glsdoifexists{#1}% + {% + \expandafter\let\csname ifglo@#1@flag\endcsname\iftrue + }% + }% +} % \end{macrocode} %\end{macro} % Reset all entries for the named glossaries (supplied in a @@ -3968,16 +5016,22 @@ name=true]{% %\begin{macro}{\glsresetall} % \begin{macrocode} \newcommand*{\glsresetall}[1][\@glo@types]{% -\forallglsentries[#1]{\@glsentry}{% -\glsreset{\@glsentry}}} + \forallglsentries[#1]{\@glsentry}% + {% + \glsreset{\@glsentry}% + }% +} % \end{macrocode} %\end{macro} % As above, but with only a local effect: %\begin{macro}{\glslocalresetall} % \begin{macrocode} \newcommand*{\glslocalresetall}[1][\@glo@types]{% -\forallglsentries[#1]{\@glsentry}{% -\glslocalreset{\@glsentry}}} + \forallglsentries[#1]{\@glsentry}% + {% + \glslocalreset{\@glsentry}% + }% +} % \end{macrocode} %\end{macro} % Unset all entries for the named glossaries (supplied in a @@ -3986,16 +5040,22 @@ name=true]{% %\begin{macro}{\glsunsetall} % \begin{macrocode} \newcommand*{\glsunsetall}[1][\@glo@types]{% -\forallglsentries[#1]{\@glsentry}{% -\glsunset{\@glsentry}}} + \forallglsentries[#1]{\@glsentry}% + {% + \glsunset{\@glsentry}% + }% +} % \end{macrocode} %\end{macro} % As above, but with only a local effect: %\begin{macro}{\glslocalunsetall} % \begin{macrocode} \newcommand*{\glslocalunsetall}[1][\@glo@types]{% -\forallglsentries[#1]{\@glsentry}{% -\glslocalunset{\@glsentry}}} + \forallglsentries[#1]{\@glsentry}% + {% + \glslocalunset{\@glsentry}% + }% +} % \end{macrocode} %\end{macro} % @@ -4018,9 +5078,10 @@ name=true]{% %\begin{macro}{\loadglsentries} % \begin{macrocode} \newcommand*{\loadglsentries}[2][\@gls@default]{% -\let\@gls@default\glsdefaulttype -\def\glsdefaulttype{#1}\input{#2}% -\let\glsdefaulttype\@gls@default} + \let\@gls@default\glsdefaulttype + \def\glsdefaulttype{#1}\input{#2}% + \let\glsdefaulttype\@gls@default +} % \end{macrocode} %\end{macro} % \cs{loadglsentries} can only be used in the preamble: @@ -4041,9745 +5102,9979 @@ name=true]{% % subsequent use). Any formatting commands (such as \cs{textbf} % is governed by \ics{glstextformat}. By default this just % displays the \term{link text} ``as is''. -%\changes{1.04}{2007 Aug 3}{Added 'glstextformat}% +%\changes{1.04}{2007 Aug 3}{Added \cs{glstextformat}}% %\begin{macro}{\glstextformat} % \begin{macrocode} \newcommand*{\glstextformat}[1]{#1} % \end{macrocode} %\end{macro} % -% The first time an entry is used, the way in which it is -% displayed is governed by \cs{glsdisplayfirst}. This -% takes four parameters: \verb|#1| will be the value -% of the entry's \gloskey{first} or \gloskey{firstplural} key, -% \verb|#2| will be the value of the entry's \gloskey{description} -% key, \verb|#3| will be the value of the entry's \gloskey{symbol} -% key and \verb|#4| is additional text supplied by the final optional -% argument to commands like \ics{gls} and \ics{glspl}. -% The default is to display the first parameter followed by the -% additional text. -%\begin{macro}{\glsdisplayfirst} -% \begin{macrocode} -\newcommand*{\glsdisplayfirst}[4]{#1#4} -% \end{macrocode} -%\end{macro} -% -% After the first use, the entry is displayed according to -% the format of \cs{glsdisplay}. Again, it takes four -% parameters: \verb|#1| will be the value of the -% entry's \gloskey{text} or \gloskey{plural} key, -% \verb|#2| will be the value of the entry's \gloskey{description} -% key, \verb|#3| will be the value of the entry's \gloskey{symbol} -% key and \verb|#4| is additional text supplied by the final optional -% argument to commands like \ics{gls} and \ics{glspl}. -%\begin{macro}{\glsdisplay} -% \begin{macrocode} -\newcommand*{\glsdisplay}[4]{#1#4} -% \end{macrocode} -%\end{macro} -% -% When a new glossary is created it uses \cs{glsdisplayfirst} -% and \cs{glsdisplay} as the default way of displaying its -% entry in the text. This can be changed for the entries belonging -% to an individual glossary using -% \ics{defglsdisplay} and \ics{defglsdisplayfirst}. -%\\[10pt] -% \cs{defglsdisplay}\oarg{type}\marg{definition}\\[10pt]% -% The glossary type is given by \meta{type} (the default glossary -% if omitted) and -% \meta{definition} should have at most \verb|#1|, \verb|#2|, -% \verb|#3| and \verb|#4|. These represent the same arguments -% as those described for \ics{glsdisplay}. -%\begin{macro}{\defglsdisplay} -% \begin{macrocode} -\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% -\expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}} -% \end{macrocode} -%\end{macro} -%\vskip5pt -% \cs{defglsdisplayfirst}\oarg{type}\marg{definition}\\[10pt]% -% The glossary type is given by \meta{type} (the default glossary -% if omitted) and -% \meta{definition} should have at most \verb|#1|, \verb|#2|, -% \verb|#3| and \verb|#4|. These represent the same arguments -% as those described for \ics{glsdisplayfirst}. -%\begin{macro}{\defglsdisplayfirst} +%\begin{macro}{\glsentryfmt} +% As from version 3.11a, the way in which an entry is displayed is now +% governed by \cs{glsentryfmt}. This doesn't take any arguments. The +% required information is set by commands like \cs{gls}. +% To ensure backward compatibility, the default use the old +% \cs{glsdisplay} and \cs{glsdisplayfirst} style of commands % \begin{macrocode} -\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% -\expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}} +\newcommand*{\glsentryfmt}{% + \@@gls@default@entryfmt\glsdisplayfirst\glsdisplay +} % \end{macrocode} -%\end{macro} -% -%\subsubsection{Links to glossary entries} -% The links to glossary entries all have a first optional -% argument that can be used to change the format and counter -% of the associated entry number. Except for \cs{glslink}, -% the commands like \cs{gls} have a final optional -% argument that can be used to insert additional text in the -% link (this will usually be appended, but can be redefined using -% \ics{defglsdisplay} and \ics{defglsdisplayfirst}). -% It goes against the \LaTeX\ norm to have an optional -% argument after the mandatory arguments, but it makes more -% sense to write, say, \verb|\gls{label}['s]| rather than, say, -% \verb|\gls[append='s]{label}|. Since these control sequences -% are defined to include the final square bracket, spaces -% will be ignored after them. This is likely to lead to -% confusion as most users would not expect, say, "\gls{"\meta{label}"}" -% to ignore following spaces, so \cs{new@ifnextchar} from the -% \isty{amsgen} package is required. -% -% The following keys can be used in the first optional -% argument. The \gloskey[glslink]{counter} key checks that the -% value is the name of a valid counter. -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +% Format that provides backwards compatibility: % \begin{macrocode} -\define@key{glslink}{counter}{% - \ifcsundef{c@#1}% +\newcommand*{\@@gls@default@entryfmt}[2]{% + \ifdefempty\glscustomtext {% - \PackageError{glossaries}% - {There is no counter called `#1'}% + \glsifplural {% - The counter key should have the name of a valid counter - as its value% - }% - }% - {% - \def\@gls@counter{#1}% - }% -} % \end{macrocode} -% The value of the \gloskey[glslink]{format} key should be the name of a -% command (without the initial backslash) that has a single mandatory -% argument which can be used to format the associated entry -% number. +% Plural form % \begin{macrocode} -\define@key{glslink}{format}{% -\def\@glsnumberformat{#1}} + \glscapscase + {% % \end{macrocode} -% The \gloskey[glslink]{hyper} key is a boolean key, it can either have the -% value true or false, and indicates whether or not to make a -% hyperlink to the relevant glossary entry. If hyper is false, an -% entry will still be made in the glossary, but the given text -% won't be a hyperlink. +% Don't adjust case % \begin{macrocode} -\define@boolkey{glslink}{hyper}[true]{} + \ifglsused\glslabel + {% % \end{macrocode} -%\changes{3.04}{2012-11-18}{added local key} -% The \gloskey[glslink]{local} key is a boolean key. If true this -% indicates that commands such as \ics{gls} should only do a local -% reset rather than a global one. +% Subsequent use % \begin{macrocode} -\define@boolkey{glslink}{local}[true]{} + #2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + {% % \end{macrocode} -% -%Syntax:\\[10pt] -% \cs{glslink}\oarg{options}\marg{label}\marg{text} -%\\[10pt] -% Display \meta{text} in the document, and add the entry information -% for \meta{label} into the relevant glossary. The optional -% argument should be a key value list using the \texttt{glslink} -% keys defined above. -% -% There is also a starred version:\\[10pt] -% \cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt] -% which is equivalent to -% \cs{glslink}"[hyper=false,"\meta{options}"]"\marg{label}\marg{text} -% -% First determine whether or not we are using the starred version: -%\begin{macro}{\glslink} -%\changes{3.01}{2011/04/12}{made robust} +% First use % \begin{macrocode} -\newrobustcmd*{\glslink}{% -\@ifstar\@sgls@link\@gls@@link} + #1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@sgls@link} -% The starred version of \cs{glslink} calls the unstarred version -% with hyperlinks disabled. +% Make first letter upper case % \begin{macrocode} -\newcommand*{\@sgls@link}[1][]{\@gls@@link[hyper=false,#1]} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@@link} -%\changes{2.03}{2009 Sep 23}{new} -% The unstarred version of \cs{glslink} checks for the existance -% of the term. The main part of the business is in \cs{@gls@link} -% which shouldn't check if the term is defined as it's called by -% \cs{gls} etc which also perform that check. +% Subsequent use. (Expansion was used in version 3.07 and below +% in case the name wasn't the first thing to be displayed, but now +% the user can sort out the upper casing in \ics{defglsentryfmt}, +% which avoids the issues caused by fragile commands.) % \begin{macrocode} -\newcommand*{\@gls@@link}[3][]{% - \ifglsentryexists{#2}% - {% - \@gls@link[#1]{#2}{#3}% - }{% - \PackageError{glossaries}{Glossary entry `#2' has not been - defined}{You need to define a glossary entry before you - can use it.}% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #2{\Glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + {% % \end{macrocode} -% Display the specified text. (The entry doesn't exist so -% there's nothing to link it to.) +% First use % \begin{macrocode} - \glstextformat{#3}% - }% -} + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #1{\Glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}% + }% + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@link} -%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} -%\changes{1.15}{2008 August 15}{added 'glslabel} +% Make all upper case % \begin{macrocode} -\def\@gls@link[#1]#2#3{% + \ifglsused\glslabel + {% % \end{macrocode} -%\changes{2.03}{2009 Sep 23}{Moved entry existence check to -% avoid duplicate code} -% Inserting \cs{leavevmode} suggested by Donald~Arseneau (avoids -% problem with tabularx). -%\changes{2.03}{2009 Sep 23}{added \cs{leavevmode}} +% Subsequent use % \begin{macrocode} - \leavevmode - \def\glslabel{#2}% - \def\@glsnumberformat{glsnumberformat}% - \edef\@gls@counter{\csname glo@#2@counter\endcsname}% + \mfirstucMakeUppercase{#2{\glsentryplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + }% + {% % \end{macrocode} -%\changes{3.05}{2013-04-21}{added check for ``nohypertypes''}% -%\changes{3.07}{2013-07-05}{fixed bug that failed to find entry in list}% -% If this is in one of the ``nohypertypes'' glossaries, suppress the -% hyperlink by default +% First use % \begin{macrocode} - \edef\gls@type{\csname glo@#2@type\endcsname}% - \expandafter\DTLifinlist\expandafter - {\gls@type}{\@gls@nohyperlist}% - {% - \KV@glslink@hyperfalse + \mfirstucMakeUppercase{#1{\glsentryfirstplural{\glslabel}}% + {\glsentrydescplural{\glslabel}}% + {\glsentrysymbolplural{\glslabel}}{\glsinsert}}% + }% + }% }% {% - \KV@glslink@hypertrue - }% - \setkeys{glslink}{#1}% % \end{macrocode} -% Store the entry's counter in \cs{theglsentrycounter} -%\changes{3.0}{2011/04/02}{added \cs{@gls@saveentrycounter}} +% Singular form % \begin{macrocode} - \@gls@saveentrycounter + \glscapscase + {% % \end{macrocode} -%\changes{3.0}{2011/04/02}{added \cs{@gls@setsort}} -% Define sort key if necessary: +% Don't adjust case % \begin{macrocode} - \@gls@setsort{#2}% + \ifglsused\glslabel + {% % \end{macrocode} -%\changes{2.01}{2009 May 30}{moved \cs{@do@wrglossary} before term is displayed -% to prevent unwanted whatsit} +% Subsequent use % \begin{macrocode} - \@do@wrglossary{#2}% - \ifKV@glslink@hyper - \@glslink{\glolinkprefix#2}{\glstextformat{#3}}% - \else - \glstextformat{#3}\relax - \fi -} + #2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glolinkprefix} +% First use % \begin{macrocode} -\newcommand*{\glolinkprefix}{glo:} + #1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentrycounter} -% Set default value of entry counter -%\changes{3.02}{2012/05/21}{set default value} +% Make first letter upper case % \begin{macrocode} -\def\glsentrycounter{\glscounter}% + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@saveentrycounter} -%\changes{3.0}{2011/04/02}{new} -% Need to check if using \ctr{equation} counter in \env{align} -% environment: +% Subsequent use % \begin{macrocode} -\newcommand*{\@gls@saveentrycounter}{% - \def\@gls@Hcounter{}% + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #2{\Glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + {% % \end{macrocode} -% Are we using \ctr{equation} counter? +% First use % \begin{macrocode} - \ifthenelse{\equal{\@gls@counter}{equation}}% - { + \ifbool{glscompatible-3.07}% + {% + \protected@edef\@glo@etext{% + #1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% + \xmakefirstuc\@glo@etext + }% + {% + #1{\Glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}% + }% + }% + }% + {% % \end{macrocode} -% If we in \env{align} environment, \cs{xatlevel@} will be defined. -% (Can't test for \cs{@currenvir} as may be inside an inner -% environment.) +% Make all upper case % \begin{macrocode} - \ifcsundef{xatlevel@}% - {% - \edef\theglsentrycounter{\expandafter\noexpand - \csname the\@gls@counter\endcsname}% - }% - {% - \ifx\xatlevel@\@empty - \edef\theglsentrycounter{\expandafter\noexpand - \csname the\@gls@counter\endcsname}% - \else - \savecounters@ - \advance\c@equation by 1\relax - \edef\theglsentrycounter{\csname the\@gls@counter\endcsname}% + \ifglsused\glslabel + {% % \end{macrocode} -% Check if hyperref version of this counter +% Subsequent use % \begin{macrocode} - \ifcsundef{theH\@gls@counter}% - {% - \def\@gls@Hcounter{\theglsentrycounter}% + \mfirstucMakeUppercase{#2{\glsentrytext{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% }% {% - \def\@gls@Hcounter{\csname theH\@gls@counter\endcsname}% +% \end{macrocode} +% First use +% \begin{macrocode} + \mfirstucMakeUppercase{#1{\glsentryfirst{\glslabel}}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{\glsinsert}}% }% - \protected@edef\theHglsentrycounter{\@gls@Hcounter}% - \restorecounters@ - \fi + }% }% }% {% % \end{macrocode} -% Not using \ctr{equation} counter so no special measures: +% Custom text provided in \cs{glsdisp} % \begin{macrocode} - \edef\theglsentrycounter{\expandafter\noexpand - \csname the\@gls@counter\endcsname}% - }% + \ifglsused{\glslabel}% + {% % \end{macrocode} -% Check if hyperref version of this counter +% Subsequent use % \begin{macrocode} - \ifx\@gls@Hcounter\@empty - \ifcsundef{theH\@gls@counter}% - {% - \def\theHglsentrycounter{\theglsentrycounter}% + #2{\glscustomtext}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{}% }% {% - \protected@edef\theHglsentrycounter{\expandafter\noexpand - \csname theH\@gls@counter\endcsname}% - }% - \fi -} % \end{macrocode} -%\end{macro} -% -%\changes{1.01}{2007 May 17}{Added range facility in format key}% -%\begin{macro}{\@set@glo@numformat} -% Set the formatting information in the format required by -% \app{makeindex}. The first argument is the format specified -% by the user (via the format key), the second argument is the -% name of the counter used to indicate the location, the third -% argument is a control sequence which stores the required format -% and the fourth argument (new to v3.0) is the hyper-prefix. -%\changes{3.0}{2010/03/31}{added 4th argument} +% First use % \begin{macrocode} -\def\@set@glo@numformat#1#2#3#4{% - \expandafter\@glo@check@mkidxrangechar#3\@nil - \protected@edef#1{% - \@glo@prefix setentrycounter[#4]{#2}% - \expandafter\string\csname\@glo@suffix\endcsname + #1{\glscustomtext}% + {\glsentrydesc{\glslabel}}% + {\glsentrysymbol{\glslabel}}{}% + }% }% - \@gls@checkmkidxchars#1% } % \end{macrocode} %\end{macro} -% Check to see if the given string starts with a ( or ). If it -% does set \cs{@glo@prefix} to the starting character, -% and \cs{@glo@suffix} to the rest (or "glsnumberformat" -% if there is nothing else), -% otherwise set \cs{@glo@prefix} to nothing and -% \cs{@glo@suffix} to all of it. +% +%\begin{macro}{\glsgenentryfmt} +% Define a generic format that just uses the first, text, plural or +% first plural keys (or the custom text) with the insert text appended. +%\changes{3.11a}{2013-10-15}{new} % \begin{macrocode} -\def\@glo@check@mkidxrangechar#1#2\@nil{% -\if#1(\relax - \def\@glo@prefix{(}% - \if\relax#2\relax - \def\@glo@suffix{glsnumberformat}% - \else - \def\@glo@suffix{#2}% - \fi -\else - \if#1)\relax - \def\@glo@prefix{)}% - \if\relax#2\relax - \def\@glo@suffix{glsnumberformat}% - \else - \def\@glo@suffix{#2}% - \fi - \else - \def\@glo@prefix{}\def\@glo@suffix{#1#2}% - \fi -\fi} +\newcommand*{\glsgenentryfmt}{% + \ifdefempty\glscustomtext + {% + \glsifplural + {% % \end{macrocode} -% -%\begin{macro}{\@gls@escbsdq} -% Escape backslashes and double quote marks. The argument must be -% a control sequence. +% Plural form % \begin{macrocode} -\newcommand*{\@gls@escbsdq}[1]{% - \def\@gls@checkedmkidx{}% - \let\gls@xdystring=#1\relax - \@onelevel@sanitize\gls@xdystring - \edef\do@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil - \@backslashchar\@backslashchar\noexpand\null}% - \do@gls@xdycheckbackslash - \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% + \glscapscase + {% % \end{macrocode} -%\changes{3.04}{2012-11-18}{unsanitize \cs{gls@numberpage}, -%\cs{gls@alphpage}, \cs{gls@Alphpage} and \cs{gls@romanpage}} -% Unsanitize \cs{gls@numberpage}, \cs{gls@alphpage}, -% \cs{gls@Alphpage} and \cs{glsromanpage} (thanks to David~Carlise -% for the suggestion.) +% Don't adjust case % \begin{macrocode} - \@for\@gls@tmp:=\gls@protected@pagefmts\do - {% - \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% - \@onelevel@sanitize\@gls@sanitized@tmp - \edef\gls@dosubst{% - \noexpand\DTLsubstituteall\noexpand\gls@xdystring - {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% - }% - \gls@dosubst - }% + \ifglsused\glslabel + {% % \end{macrocode} -% Assign to required control sequence +% Subsequent use % \begin{macrocode} - \let#1=\gls@xdystring -} + \glsentryplural{\glslabel}\glsinsert + }% + {% % \end{macrocode} -%\end{macro} -% Catch special characters\mkidxspch (argument must be a -% control sequence): -%\begin{macro}{\@gls@checkmkidxchars} +% First use % \begin{macrocode} -\newcommand{\@gls@checkmkidxchars}[1]{% -\ifglsxindy - \@gls@escbsdq{#1}% -\else - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkquote#1\@nil""\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkescquote#1\@nil\"\"\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkescactual#1\@nil\?\?\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkactual#1\@nil??\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkbar#1\@nil||\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checkescbar#1\@nil\|\|\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% - \def\@gls@checkedmkidx{}% - \expandafter\@gls@checklevel#1\@nil!!\null - \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% -\fi -} + \glsentryfirstplural{\glslabel}\glsinsert + }% + }% + {% % \end{macrocode} -%\end{macro} -% Update the control sequence and strip trailing \cs{@nil}: -%\begin{macro}{\@gls@updatechecked} +% Make first letter upper case % \begin{macrocode} -\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@tmpb} -%\changes{1.1}{2008 Feb 22}{changed \cs{toksdef} to \cs{newtoks}} -% Define temporary token +% Subsequent use. % \begin{macrocode} -\newtoks\@gls@tmpb + \Glsentryplural{\glslabel}\glsinsert + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkquote} -% Replace \verb|"| with \verb|""| since \verb|"| is a makeindex -% special character\mkidxspch. +% First use % \begin{macrocode} -\def\@gls@checkquote#1"#2"#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkquote{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}% - \def\@@gls@checkquote{\@gls@checkquote#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@quotechar}% - \ifx\null#3\null - \def\@@gls@checkquote{\@gls@checkquote#2""\null}% - \else - \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}% - \fi -\fi -\@@gls@checkquote} + \Glsentryfirstplural{\glslabel}\glsinsert + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkescquote} -% Do the same for \verb|\"|: +% Make all upper case % \begin{macrocode} -\def\@gls@checkescquote#1\"#2\"#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkescquote{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@quotechar - \@gls@quotechar\string\"\@gls@quotechar}% - \def\@@gls@checkescquote{\@gls@checkescquote#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@quotechar}% - \ifx\null#3\null - \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}% - \else - \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}% - \fi -\fi -\@@gls@checkescquote} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkescactual} -% Similarly for \verb|\?| (which is replaces @ as -% \app{makeindex}'s special character): +% Subsequent use % \begin{macrocode} -\def\@gls@checkescactual#1\?#2\?#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkescactual{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@actualchar - \@gls@quotechar\string\"\@gls@actualchar}% - \def\@@gls@checkescactual{\@gls@checkescactual#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@actualchar}% - \ifx\null#3\null - \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}% - \else - \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}% - \fi -\fi -\@@gls@checkescactual} + \mfirstucMakeUppercase + {\glsentryplural{\glslabel}\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkescbar} -% Similarly for \verb"\|": +% First use % \begin{macrocode} -\def\@gls@checkescbar#1\|#2\|#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkescbar{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@encapchar - \@gls@quotechar\string\"\@gls@encapchar}% - \def\@@gls@checkescbar{\@gls@checkescbar#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@encapchar}% - \ifx\null#3\null - \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}% - \else - \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}% - \fi -\fi -\@@gls@checkescbar} + \mfirstucMakeUppercase + {\glsentryfirstplural{\glslabel}\glsinsert}% + }% + }% + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkesclevel} -% Similarly for \verb"\!": +% Singular form % \begin{macrocode} -\def\@gls@checkesclevel#1\!#2\!#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkesclevel{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@levelchar - \@gls@quotechar\string\"\@gls@levelchar}% - \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\string\"\@gls@levelchar}% - \ifx\null#3\null - \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}% - \else - \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}% - \fi -\fi -\@@gls@checkesclevel} + \glscapscase + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkbar} -% and for \verb"|": +% Don't adjust case % \begin{macrocode} -\def\@gls@checkbar#1|#2|#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkbar{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}% - \def\@@gls@checkbar{\@gls@checkbar#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@encapchar}% - \ifx\null#3\null - \def\@@gls@checkbar{\@gls@checkbar#2||\null}% - \else - \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}% - \fi -\fi -\@@gls@checkbar} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checklevel} -% and for \verb"!": +% Subsequent use % \begin{macrocode} -\def\@gls@checklevel#1!#2!#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checklevel{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}% - \def\@@gls@checklevel{\@gls@checklevel#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@levelchar}% - \ifx\null#3\null - \def\@@gls@checklevel{\@gls@checklevel#2!!\null}% - \else - \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}% - \fi -\fi -\@@gls@checklevel} + \glsentrytext{\glslabel}\glsinsert + }% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@gls@checkactual} -% and for \verb"?": +% First use % \begin{macrocode} -\def\@gls@checkactual#1?#2?#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@checkactual{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}% - \def\@@gls@checkactual{\@gls@checkactual#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \@gls@quotechar\@gls@actualchar}% - \ifx\null#3\null - \def\@@gls@checkactual{\@gls@checkactual#2??\null}% - \else - \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}% - \fi -\fi -\@@gls@checkactual} + \glsentryfirst{\glslabel}\glsinsert + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@xdycheckquote} -% As before but for use with \app{xindy} +% Make first letter upper case % \begin{macrocode} -\def\@gls@xdycheckquote#1"#2"#3\null{% -\@gls@tmpb=\expandafter{\@gls@checkedmkidx}% -\toks@={#1}% -\ifx\null#2\null - \ifx\null#3\null - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% - \def\@@gls@xdycheckquote{\relax}% - \else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \string\"\string\"}% - \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}% - \fi -\else - \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ - \string\"}% - \ifx\null#3\null - \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}% - \else - \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}% - \fi -\fi -\@@gls@xdycheckquote -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@xdycheckbackslash} -% Need to escape all backslashes for \app{xindy}. -% Define command that will define \cs{@gls@xdycheckbackslash} +% Subsequent use % \begin{macrocode} -\edef\def@gls@xdycheckbackslash{% - \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar - ##2\@backslashchar##3\noexpand\null{% - \noexpand\@gls@tmpb=\noexpand\expandafter - {\noexpand\@gls@checkedmkidx}% - \noexpand\toks@={##1}% - \noexpand\ifx\noexpand\null##2\noexpand\null - \noexpand\ifx\noexpand\null##3\noexpand\null - \noexpand\edef\noexpand\@gls@checkedmkidx{% - \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% - \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}% - \noexpand\else - \noexpand\edef\noexpand\@gls@checkedmkidx{% - \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ - \@backslashchar\@backslashchar\@backslashchar\@backslashchar}% - \noexpand\def\noexpand\@@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash##3\noexpand\null}% - \noexpand\fi - \noexpand\else - \noexpand\edef\noexpand\@gls@checkedmkidx{% - \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ - \@backslashchar\@backslashchar}% - \noexpand\ifx\noexpand\null##3\noexpand\null - \noexpand\def\noexpand\@@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash##2\@backslashchar - \@backslashchar\noexpand\null}% - \noexpand\else - \noexpand\def\noexpand\@@gls@xdycheckbackslash{% - \noexpand\@gls@xdycheckbackslash##2\@backslashchar - ##3\noexpand\null}% - \noexpand\fi - \noexpand\fi - \noexpand\@@gls@xdycheckbackslash - }% -} + \Glsentrytext{\glslabel}\glsinsert + }% + {% % \end{macrocode} -% Now go ahead and define \cs{@gls@xdycheckbackslash} +% First use % \begin{macrocode} -\def@gls@xdycheckbackslash + \Glsentryfirst{\glslabel}\glsinsert + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\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}. -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +% Make all upper case % \begin{macrocode} -\ifcsundef{hyperlink}% -{% - \gdef\@glslink#1#2{#2}% -}% -{% - \gdef\@glslink#1#2{\hyperlink{#1}{#2}}% -} + \ifglsused\glslabel + {% % \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}. -%\changes{1.16}{2008 August 27}{raised the hypertarget so the target text doesn't -% scroll off the top of the page} +% Subsequent use % \begin{macrocode} -\newlength\gls@tmplen -\ifcsundef{hypertarget}% -{% - \gdef\@glstarget#1#2{#2}% -}% -{% - \gdef\@glstarget#1#2{% - \settoheight{\gls@tmplen}{#2}% - \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% - }% -} + \mfirstucMakeUppercase{\glsentrytext{\glslabel}\glsinsert}% + }% + {% % \end{macrocode} -%\end{macro} -% -% Glossary hyperlinks can be disabled using \cs{glsdisablehyper} -% (effect can be localised): -%\begin{macro}{\glsdisablehyper} +% First use % \begin{macrocode} -\newcommand{\glsdisablehyper}{% -\renewcommand*\@glslink[2]{##2}% -\renewcommand*\@glstarget[2]{##2}} + \mfirstucMakeUppercase{\glsentryfirst{\glslabel}\glsinsert}% + }% + }% + }% + }% + {% % \end{macrocode} -%\end{macro} -% Glossary hyperlinks can be enabled using \cs{glsenablehyper} -% (effect can be localised): -%\begin{macro}{\glsenablehyper} +% Custom text provided in \cs{glsdisp}. (The insert is most likely +% to be empty at this point.) % \begin{macrocode} -\newcommand{\glsenablehyper}{% -\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}% -\renewcommand*\@glstarget[2]{% - \settoheight{\gls@tmplen}{##2}% - \raisebox{\gls@tmplen}{\hypertarget{##1}{}}##2}} + \glscustomtext\glsinsert + }% +} % \end{macrocode} %\end{macro} % -%Syntax:\\[10pt] -% \cs{gls}\oarg{options}\marg{label}\oarg{insert text}\\[10pt] -% Link to glossary entry using singular form. The link text -% is taken from the value of the \gloskey{text} or \gloskey{first} -% keys used when the entry was defined. -% -% The first optional argument is a key-value list, the same as -% \ics{glslink}\igloskey[glslink]{hyper}\igloskey[glslink]{format}\igloskey[glslink]{counter}, -% the mandatory argument is the entry label. -% After the mandatory argument, there is another optional argument -% to insert extra text in the link text (the location of the inserted -% text is governed by \ics{glsdisplay} and -% \ics{glsdisplayfirst}). As with \cs{glslink} -% there is a starred version which is the same as the unstarred -% version but with the \gloskey[glslink]{hyper} key set to \texttt{false}. -% (Additional options can also be specified -% in the first optional argument.) -% -% First determine if we are using the starred form: -%\begin{macro}{\gls} +%\begin{macro}{\glsdisplayfirst} +% Deprecated. Kept for backward compatibility. +%\changes{3.11a}{2013-10-15}{obsoleted} % \begin{macrocode} -\newrobustcmd*{\gls}{\@ifstar\@sgls\@gls} +\newcommand*{\glsdisplayfirst}[4]{#1#4} % \end{macrocode} %\end{macro} -% Define the starred form: -%\begin{macro}{\@sgls} +% +%\begin{macro}{\glsdisplay} +% Deprecated. Kept for backward compatibility. +%\changes{3.11a}{2013-10-15}{obsoleted} % \begin{macrocode} -\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]} +\newcommand*{\glsdisplay}[4]{#1#4} % \end{macrocode} %\end{macro} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -%\begin{macro}{\@gls} +% +%\begin{macro}{\defglsdisplay} +%\changes{3.11a}{2013-10-15}{obsoleted} +% Deprecated. Kept for backward compatibility. % \begin{macrocode} -\newcommand*{\@gls}[2][]{% - \new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}% +\newcommand*{\defglsdisplay}[2][\glsdefaulttype]{% + \GlossariesWarning{\string\defglsdisplay\space is now obsolete.^^J + Use \string\defglsentryfmt\space instead}% + \expandafter\def\csname gls@#1@display\endcsname##1##2##3##4{#2}% + \edef\@gls@doentrydef{% + \noexpand\defglsentryfmt[#1]{% + \noexpand\ifcsdef{gls@#1@displayfirst}% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}} + {\noexpand\csuse{gls@#1@display}}% + }% + {% + \noexpand\@@gls@default@entryfmt + {\noexpand\glsdisplayfirst} + {\noexpand\csuse{gls@#1@display}}% + }% + }% + }% + \@gls@doentrydef } % \end{macrocode} %\end{macro} -%\begin{macro}{\@gls@} -% Read in the final optional argument: -% \begin{macrocode} -\def\@gls@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% -% \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} -% \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% -% \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) -% \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{% - \csname gls@\@glo@type @display\endcsname - {\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% - }% - {% - \def\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}}% - }% -% \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} +% +%\begin{macro}{\defglsdisplayfirst} +% Deprecated. Kept for backward compatibility. +%\changes{3.11a}{2013-10-15}{obsoleted} % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse - {\(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) - \OR \NOT\boolean{glshyperfirst} - }% +\newcommand*{\defglsdisplayfirst}[2][\glsdefaulttype]{% + \GlossariesWarning{\string\defglsdisplayfirst\space is now obsolete.^^J + Use \string\defglsentryfmt\space instead}% + \expandafter\def\csname gls@#1@displayfirst\endcsname##1##2##3##4{#2}% + \edef\@gls@doentrydef{% + \noexpand\defglsentryfmt[#1]{% + \noexpand\ifcsdef{gls@#1@display}% {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}} + {\noexpand\csuse{gls@#1@display}}% }% {% - \@gls@link[#1]{#2}{\@glo@text}% + \noexpand\@@gls@default@entryfmt + {\noexpand\csuse{gls@#1@displayfirst}}% + {\noexpand\glsdisplay} }% }% -% \end{macrocode} -% Indicate that this entry has now been used -% \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi }% + \@gls@doentrydef } % \end{macrocode} %\end{macro} % -% \cs{Gls} behaves like \cs{gls}, but the first letter -% of the link text is converted to uppercase (note that if the -% first letter has an accent, the accented letter will need to -% be grouped when you define the entry). It is mainly intended -% for terms that start a sentence: -%\begin{macro}{\Gls} -%\changes{3.01}{2011/04/12}{made robust} -% \begin{macrocode} -\newrobustcmd*{\Gls}{\@ifstar\@sGls\@Gls} -% \end{macrocode} -%\end{macro} -% Define the starred form: -% \begin{macrocode} -\newcommand*{\@sGls}[1][]{\@Gls[hyper=false,#1]} -% \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@Gls}[2][]{% - \new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}% -} -% \end{macrocode} -%\begin{macro}{\@Gls@} -% Read in the final optional argument: +%\subsubsection{Links to glossary entries} +% The links to glossary entries all have a first optional +% argument that can be used to change the format and counter +% of the associated entry number. Except for \cs{glslink} +% and \cs{glsdisp}, +% the commands like \cs{gls} have a final optional +% argument that can be used to insert additional text in the +% link (this will usually be appended, but can be redefined using +% \ics{defentryfmt}). +% It goes against the \LaTeX\ norm to have an optional +% argument after the mandatory arguments, but it makes more +% sense to write, say, \verb|\gls{label}['s]| rather than, say, +% \verb|\gls[append='s]{label}|. Since these control sequences +% are defined to include the final square bracket, spaces +% will be ignored after them. This is likely to lead to +% confusion as most users would not expect, say, "\gls{"\meta{label}"}" +% to ignore following spaces, so \cs{new@ifnextchar} from the +% \isty{amsgen} package is required. +% +% The following keys can be used in the first optional +% argument. The \gloskey[glslink]{counter} key checks that the +% value is the name of a valid counter. +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} -\def\@Gls@#1#2[#3]{% - \glsdoifexists{#2}% +\define@key{glslink}{counter}{% + \ifcsundef{c@#1}% {% - \edef\@glo@type{\glsentrytype{#2}}% + \PackageError{glossaries}% + {There is no counter called `#1'}% + {% + The counter key should have the name of a valid counter + as its value% + }% + }% + {% + \def\@gls@counter{#1}% + }% +} % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% The value of the \gloskey[glslink]{format} key should be the name of a +% command (without the initial backslash) that has a single mandatory +% argument which can be used to format the associated entry +% number. % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% - \def\glslabel{#2}% +\define@key{glslink}{format}{% +\def\@glsnumberformat{#1}} % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +% The \gloskey[glslink]{hyper} key is a boolean key, it can either have the +% value true or false, and indicates whether or not to make a +% hyperlink to the relevant glossary entry. If hyper is false, an +% entry will still be made in the glossary, but the given text +% won't be a hyperlink. % \begin{macrocode} - \ifglsused{#2}% - {% - \protected@edef\@glo@text{% - \csname gls@\@glo@type @display\endcsname - {\glsentrytext{#2}}{\glsentrydesc{#2}}% - {\glsentrysymbol{#2}}{#3}}% - }% - {% - \protected@edef\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {\glsentryfirst{#2}}{\glsentrydesc{#2}}% - {\glsentrysymbol{#2}}{#3}}% - }% +\define@boolkey{glslink}{hyper}[true]{} % \end{macrocode} -% Call \cs{@gls@link} -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} +%\changes{3.04}{2012-11-18}{added local key} +% The \gloskey[glslink]{local} key is a boolean key. If true this +% indicates that commands such as \ics{gls} should only do a local +% reset rather than a global one. % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse - {% - \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) - \OR \NOT\boolean{glshyperfirst}% - }% - {% - \@gls@link[#1,hyper=false]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}}% - }% - {% - \@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}}% - }% - }% +\define@boolkey{glslink}{local}[true]{} % \end{macrocode} -% Indicate that this entry has now been used +% +%Syntax:\\[10pt] +% \cs{glslink}\oarg{options}\marg{label}\marg{text} +%\\[10pt] +% Display \meta{text} in the document, and add the entry information +% for \meta{label} into the relevant glossary. The optional +% argument should be a key value list using the \texttt{glslink} +% keys defined above. +% +% There is also a starred version:\\[10pt] +% \cs{glslink*}\oarg{options}\marg{label}\marg{text}\\[10pt] +% which is equivalent to +% \cs{glslink}"[hyper=false,"\meta{options}"]"\marg{label}\marg{text} +% +% First determine whether or not we are using the starred version: +%\begin{macro}{\glslink} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% +\newrobustcmd*{\glslink}{% + \@ifstar\@sgls@link\@gls@@link } % \end{macrocode} %\end{macro} -% -% \cs{GLS} behaves like \ics{gls}, but the link -% text is converted to uppercase: -%\changes{3.01}{2011/04/12}{made robust} -%\begin{macro}{\GLS} +%\begin{macro}{\@sgls@link} +% The starred version of \cs{glslink} calls the unstarred version +% with hyperlinks disabled. % \begin{macrocode} -\newrobustcmd*{\GLS}{\@ifstar\@sGLS\@GLS} +\newcommand*{\@sgls@link}[1][]{\@gls@@link[hyper=false,#1]} % \end{macrocode} %\end{macro} -% Define the starred form: +%\begin{macro}{\@gls@@link} +%\changes{2.03}{2009 Sep 23}{new} +% The unstarred version of \cs{glslink} checks for the existance +% of the term. The main part of the business is in \cs{@gls@link} +% which shouldn't check if the term is defined as it's called by +% \cs{gls} etc which also perform that check. % \begin{macrocode} -\newcommand*{\@sGLS}[1][]{\@GLS[hyper=false,#1]} +\newcommand*{\@gls@@link}[3][]{% + \ifglsentryexists{#2}% + {% + \@gls@link[#1]{#2}{#3}% + }{% + \PackageError{glossaries}{Glossary entry `#2' has not been + defined}{You need to define a glossary entry before you + can use it.}% % \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument +% Display the specified text. (The entry doesn't exist so +% there's nothing to link it to.) % \begin{macrocode} -\newcommand*{\@GLS}[2][]{% - \new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}% + \glstextformat{#3}% + }% } % \end{macrocode} -%\begin{macro}{\@GLS@} -% Read in the final optional argument: +%\end{macro} +%\begin{macro}{\@gls@link} +%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} +%\changes{1.15}{2008 August 15}{added \cs{glslabel}} % \begin{macrocode} -\def\@GLS@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@link[#1]#2#3{% % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +%\changes{2.03}{2009 Sep 23}{Moved entry existence check to +% avoid duplicate code} +% Inserting \cs{leavevmode} suggested by Donald~Arseneau (avoids +% problem with tabularx). +%\changes{2.03}{2009 Sep 23}{added \cs{leavevmode}} % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + \leavevmode + \def\glslabel{#2}% + \def\@glsnumberformat{glsnumberformat}% + \edef\@gls@counter{\csname glo@#2@counter\endcsname}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}). +%\changes{3.05}{2013-04-21}{added check for ``nohypertypes''}% +%\changes{3.07}{2013-07-05}{fixed bug that failed to find entry in list}% +% If this is in one of the ``nohypertypes'' glossaries, suppress the +% hyperlink by default % \begin{macrocode} - \ifglsused{#2}% + \edef\gls@type{\csname glo@#2@type\endcsname}% + \expandafter\DTLifinlist\expandafter + {\gls@type}{\@gls@nohyperlist}% {% - \def\@glo@text{% - \csname gls@\@glo@type @display\endcsname - {\glsentrytext{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}% - }% + \KV@glslink@hyperfalse }% {% - \def\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {\glsentryfirst{#2}}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{#3}% - }% + \KV@glslink@hypertrue }% + \setkeys{glslink}{#1}% % \end{macrocode} -% Call \cs{@gls@link} -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} +% Store the entry's counter in \cs{theglsentrycounter} +%\changes{3.0}{2011/04/02}{added \cs{@gls@saveentrycounter}} % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse - {% - \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) - \OR \NOT\boolean{glshyperfirst}}{% - \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% - }% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - }% + \@gls@saveentrycounter % \end{macrocode} -% Indicate that this entry has now been used +%\changes{3.0}{2011/04/02}{added \cs{@gls@setsort}} +% Define sort key if necessary: % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% + \@gls@setsort{#2}% +% \end{macrocode} +%\changes{2.01}{2009 May 30}{moved \cs{@do@wrglossary} before term is displayed +% to prevent unwanted whatsit} +% \begin{macrocode} + \@do@wrglossary{#2}% + \ifKV@glslink@hyper + \@glslink{\glolinkprefix#2}{\glstextformat{#3}}% \else - \glsunset{#2}% +% \end{macrocode} +%\changes{3.13a}{2013-11-05}{removed \cs{relax}} +% \begin{macrocode} + \glstextformat{#3}% \fi - }% } % \end{macrocode} %\end{macro} % -% \cs{glspl} behaves in the same way as \ics{gls} except -% it uses the plural form. -%\begin{macro}{\glspl} -%\changes{3.01}{2011/04/12}{made robust} +%\begin{macro}{\glolinkprefix} % \begin{macrocode} -\newrobustcmd*{\glspl}{\@ifstar\@sglspl\@glspl} +\newcommand*{\glolinkprefix}{glo:} % \end{macrocode} %\end{macro} -% Define the starred form: +% +%\begin{macro}{\glsentrycounter} +% Set default value of entry counter +%\changes{3.02}{2012/05/21}{set default value} % \begin{macrocode} -\newcommand*{\@sglspl}[1][]{\@glspl[hyper=false,#1]} +\def\glsentrycounter{\glscounter}% % \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@glspl}[2][]{% - \new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}% -} -% \end{macrocode} -%\begin{macro}{\@glspl@} -% Read in the final optional argument: +%\end{macro} +% +%\begin{macro}{\@gls@saveentrycounter} +%\changes{3.0}{2011/04/02}{new} +% Need to check if using \ctr{equation} counter in \env{align} +% environment: % \begin{macrocode} -\def\@glspl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% +\newcommand*{\@gls@saveentrycounter}{% + \def\@gls@Hcounter{}% % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% Are we using \ctr{equation} counter? % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + \ifthenelse{\equal{\@gls@counter}{equation}}% + { % \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} +% If we in \env{align} environment, \cs{xatlevel@} will be defined. +% (Can't test for \cs{@currenvir} as may be inside an inner +% environment.) % \begin{macrocode} - \ifglsused{#2}% + \ifcsundef{xatlevel@}% {% - \def\@glo@text{% - \csname gls@\@glo@type @display\endcsname - {\glsentryplural{#2}}{\glsentrydescplural{#2}}% - {\glsentrysymbolplural{#2}}{#3}}% + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% }% {% - \def\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}% - {\glsentrysymbolplural{#2}}{#3}}% + \ifx\xatlevel@\@empty + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% + \else + \savecounters@ + \advance\c@equation by 1\relax + \edef\theglsentrycounter{\csname the\@gls@counter\endcsname}% +% \end{macrocode} +% Check if hyperref version of this counter +% \begin{macrocode} + \ifcsundef{theH\@gls@counter}% + {% + \def\@gls@Hcounter{\theglsentrycounter}% + }% + {% + \def\@gls@Hcounter{\csname theH\@gls@counter\endcsname}% + }% + \protected@edef\theHglsentrycounter{\@gls@Hcounter}% + \restorecounters@ + \fi }% + }% + {% % \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} +% Not using \ctr{equation} counter so no special measures: % \begin{macrocode} - \ifglsused{#2}% + \edef\theglsentrycounter{\expandafter\noexpand + \csname the\@gls@counter\endcsname}% + }% +% \end{macrocode} +% Check if hyperref version of this counter +% \begin{macrocode} + \ifx\@gls@Hcounter\@empty + \ifcsundef{theH\@gls@counter}% {% - \@gls@link[#1]{#2}{\@glo@text}% + \def\theHglsentrycounter{\theglsentrycounter}% }% {% - \gls@checkisacronymlist\@glo@type - \ifthenelse - {% - \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) - \OR \NOT\boolean{glshyperfirst}% - }% - {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% - }% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% + \protected@edef\theHglsentrycounter{\expandafter\noexpand + \csname theH\@gls@counter\endcsname}% }% -% \end{macrocode} -% Indicate that this entry has now been used -% \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% + \fi } % \end{macrocode} %\end{macro} % -% \cs{Glspl} behaves in the same way as \ics{glspl}, except -% that the first letter of the link text is converted to uppercase -% (as with \ics{Gls}, if the first letter has an accent, it -% will need to be grouped). -%\begin{macro}{\Glspl} -%\changes{3.01}{2011/04/12}{made robust} +%\changes{1.01}{2007 May 17}{Added range facility in format key}% +%\begin{macro}{\@set@glo@numformat} +% Set the formatting information in the format required by +% \app{makeindex}. The first argument is the format specified +% by the user (via the format key), the second argument is the +% name of the counter used to indicate the location, the third +% argument is a control sequence which stores the required format +% and the fourth argument (new to v3.0) is the hyper-prefix. +%\changes{3.0}{2010/03/31}{added 4th argument} % \begin{macrocode} -\newrobustcmd*{\Glspl}{\@ifstar\@sGlspl\@Glspl} +\def\@set@glo@numformat#1#2#3#4{% + \expandafter\@glo@check@mkidxrangechar#3\@nil + \protected@edef#1{% + \@glo@prefix setentrycounter[#4]{#2}% + \expandafter\string\csname\@glo@suffix\endcsname + }% + \@gls@checkmkidxchars#1% +} % \end{macrocode} %\end{macro} -% Define the starred form: +% Check to see if the given string starts with a ( or ). If it +% does set \cs{@glo@prefix} to the starting character, +% and \cs{@glo@suffix} to the rest (or "glsnumberformat" +% if there is nothing else), +% otherwise set \cs{@glo@prefix} to nothing and +% \cs{@glo@suffix} to all of it. % \begin{macrocode} -\newcommand*{\@sGlspl}[1][]{\@Glspl[hyper=false,#1]} +\def\@glo@check@mkidxrangechar#1#2\@nil{% +\if#1(\relax + \def\@glo@prefix{(}% + \if\relax#2\relax + \def\@glo@suffix{glsnumberformat}% + \else + \def\@glo@suffix{#2}% + \fi +\else + \if#1)\relax + \def\@glo@prefix{)}% + \if\relax#2\relax + \def\@glo@suffix{glsnumberformat}% + \else + \def\@glo@suffix{#2}% + \fi + \else + \def\@glo@prefix{}\def\@glo@suffix{#1#2}% + \fi +\fi} % \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument +% +%\begin{macro}{\@gls@escbsdq} +% Escape backslashes and double quote marks. The argument must be +% a control sequence. % \begin{macrocode} -\newcommand*{\@Glspl}[2][]{% - \new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}% -} +\newcommand*{\@gls@escbsdq}[1]{% + \def\@gls@checkedmkidx{}% + \let\gls@xdystring=#1\relax + \@onelevel@sanitize\gls@xdystring + \edef\do@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash\gls@xdystring\noexpand\@nil + \@backslashchar\@backslashchar\noexpand\null}% + \do@gls@xdycheckbackslash + \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@xdycheckquote\gls@xdystring\@nil""\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{\gls@xdystring}% % \end{macrocode} -%\begin{macro}{\@Glspl@} -% Read in the final optional argument: +%\changes{3.04}{2012-11-18}{unsanitize \cs{gls@numberpage}, +%\cs{gls@alphpage}, \cs{gls@Alphpage} and \cs{gls@romanpage}} +% Unsanitize \cs{gls@numberpage}, \cs{gls@alphpage}, +% \cs{gls@Alphpage} and \cs{glsromanpage} (thanks to David~Carlise +% for the suggestion.) % \begin{macrocode} -\def\@Glspl@#1#2[#3]{% - \glsdoifexists{#2}% + \@for\@gls@tmp:=\gls@protected@pagefmts\do {% - \edef\@glo@type{\glsentrytype{#2}}% -% \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} -% \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% - \def\glslabel{#2}% -% \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}). This needs to be expanded so that the -% \cs{@glo@text} can be passed to \cs{xmakefirstuc}. -%\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}}{\glsentrydescplural{#2}}% - {\glsentrysymbolplural{#2}}{#3}}% - }% - {% - \protected@edef\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}% - {\glsentrysymbolplural{#2}}{#3}}% - }% -% \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} -% \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse - {% - \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) - \OR \NOT\boolean{glshyperfirst}% - }% - {% - \@gls@link[#1,hyper=false]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}}% - }% - {% - \@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}}% - }% + \edef\@gls@sanitized@tmp{\expandafter\@gobble\string\\\expandonce\@gls@tmp}% + \@onelevel@sanitize\@gls@sanitized@tmp + \edef\gls@dosubst{% + \noexpand\DTLsubstituteall\noexpand\gls@xdystring + {\@gls@sanitized@tmp}{\expandonce\@gls@tmp}% }% + \gls@dosubst + }% % \end{macrocode} -% Indicate that this entry has now been used +% Assign to required control sequence % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% - \else - \glsunset{#2}% - \fi - }% + \let#1=\gls@xdystring } % \end{macrocode} %\end{macro} -% -% \cs{GLSpl} behaves like \ics{glspl} except that all the -% link text is converted to uppercase. -%\begin{macro}{\GLSpl} -%\changes{3.01}{2011/04/12}{made robust} +% Catch special characters\mkidxspch (argument must be a +% control sequence): +%\begin{macro}{\@gls@checkmkidxchars} % \begin{macrocode} -\newrobustcmd*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl} +\newcommand{\@gls@checkmkidxchars}[1]{% + \ifglsxindy + \@gls@escbsdq{#1}% + \else + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkquote#1\@nil""\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescquote#1\@nil\"\"\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescactual#1\@nil\?\?\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkactual#1\@nil??\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkbar#1\@nil||\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checkescbar#1\@nil\|\|\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \def\@gls@checkedmkidx{}% + \expandafter\@gls@checklevel#1\@nil!!\null + \expandafter\@gls@updatechecked\@gls@checkedmkidx{#1}% + \fi +} % \end{macrocode} %\end{macro} -% Define the starred form: -% \begin{macrocode} -\newcommand*{\@sGLSpl}[1][]{\@GLSpl[hyper=false,#1]} -% \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@GLSpl}[2][]{% - \new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}% -} -% \end{macrocode} -%\begin{macro}{\@GLSpl} -% Read in the final optional argument: +% Update the control sequence and strip trailing \cs{@nil}: +%\begin{macro}{\@gls@updatechecked} % \begin{macrocode} -\def\@GLSpl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@updatechecked#1\@nil#2{\def#2{#1}} % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +%\end{macro} +%\begin{macro}{\@gls@tmpb} +%\changes{1.1}{2008 Feb 22}{changed \cs{toksdef} to \cs{newtoks}} +% Define temporary token % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% +\newtoks\@gls@tmpb % \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} +%\end{macro} +%\begin{macro}{\@gls@checkquote} +% Replace \verb|"| with \verb|""| since \verb|"| is a makeindex +% special character\mkidxspch. % \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{% - \csname gls@\@glo@type @display\endcsname - {\glsentryplural{#2}}{\glsentrydescplural{#2}}% - {\glsentrysymbolplural{#2}}{#3}% - }% - }% - {% - \def\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {\glsentryfirstplural{#2}}{\glsentrydescplural{#2}}% - {\glsentrysymbolplural{#2}}{#3}% - }% - }% +\def\@gls@checkquote#1"#2"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@quotechar\@gls@quotechar\@gls@quotechar}% + \def\@@gls@checkquote{\@gls@checkquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@quotechar}% + \ifx\null#3\null + \def\@@gls@checkquote{\@gls@checkquote#2""\null}% + \else + \def\@@gls@checkquote{\@gls@checkquote#2"#3\null}% + \fi + \fi + \@@gls@checkquote +} % \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} +%\end{macro} +%\begin{macro}{\@gls@checkescquote} +% Do the same for \verb|\"|: % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse - {% - \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) - \OR \NOT\boolean{glshyperfirst}% - }% - {% - \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% - }% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - }% +\def\@gls@checkescquote#1\"#2\"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@quotechar + \@gls@quotechar\string\"\@gls@quotechar}% + \def\@@gls@checkescquote{\@gls@checkescquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@quotechar}% + \ifx\null#3\null + \def\@@gls@checkescquote{\@gls@checkescquote#2\"\"\null}% + \else + \def\@@gls@checkescquote{\@gls@checkescquote#2\"#3\null}% + \fi + \fi +\@@gls@checkescquote +} % \end{macrocode} -% Indicate that this entry has now been used +%\end{macro} +%\begin{macro}{\@gls@checkescactual} +% Similarly for \verb|\?| (which is replaces @ as +% \app{makeindex}'s special character): % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% +\def\@gls@checkescactual#1\?#2\?#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescactual{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@actualchar + \@gls@quotechar\string\"\@gls@actualchar}% + \def\@@gls@checkescactual{\@gls@checkescactual#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@actualchar}% + \ifx\null#3\null + \def\@@gls@checkescactual{\@gls@checkescactual#2\?\?\null}% \else - \glsunset{#2}% - \fi - }% + \def\@@gls@checkescactual{\@gls@checkescactual#2\?#3\null}% + \fi + \fi +\@@gls@checkescactual } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsdisp} -%\changes{1.19}{2009 Mar 2}{new} -%\cs{glsdisp}\oarg{options}\marg{label}\marg{text} -% This is like \cs{gls} except that the link text is provided. -% This differs from \cs{glslink} in that it uses -% \cs{glsdisplay} or \cs{glsdisplayfirst} and unsets the first use -% flag. -% -% First determine if we are using the starred form: +%\begin{macro}{\@gls@checkescbar} +% Similarly for \verb"\|": % \begin{macrocode} -\newrobustcmd*{\glsdisp}{\@ifstar\@sglsdisp\@glsdisp} +\def\@gls@checkescbar#1\|#2\|#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkescbar{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@encapchar + \@gls@quotechar\string\"\@gls@encapchar}% + \def\@@gls@checkescbar{\@gls@checkescbar#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@encapchar}% + \ifx\null#3\null + \def\@@gls@checkescbar{\@gls@checkescbar#2\|\|\null}% + \else + \def\@@gls@checkescbar{\@gls@checkescbar#2\|#3\null}% + \fi + \fi +\@@gls@checkescbar +} % \end{macrocode} %\end{macro} -% Define the starred form: -%\begin{macro}{\@sgls} +%\begin{macro}{\@gls@checkesclevel} +% Similarly for \verb"\!": % \begin{macrocode} -\newcommand*{\@sglsdisp}[1][]{\@glsdisp[hyper=false,#1]} +\def\@gls@checkesclevel#1\!#2\!#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkesclevel{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@levelchar + \@gls@quotechar\string\"\@gls@levelchar}% + \def\@@gls@checkesclevel{\@gls@checkesclevel#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\string\"\@gls@levelchar}% + \ifx\null#3\null + \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!\!\null}% + \else + \def\@@gls@checkesclevel{\@gls@checkesclevel#2\!#3\null}% + \fi + \fi +\@@gls@checkesclevel +} % \end{macrocode} %\end{macro} -% Defined the un-starred form. -%\begin{macro}{\@glsdisp} -% \begin{macrocode} -\newcommand*{\@glsdisp}[3][]{% - \glsdoifexists{#2}{% -% \end{macrocode} -%\changes{2.05}{2010 Feb 6}{Added closing brace. Patch provided by Sergiu Dotenco} -% \begin{macrocode} - \edef\@glo@type{\glsentrytype{#2}}% -% \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} -% \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% -% \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) -% \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{% - \csname gls@\@glo@type @display\endcsname - {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}% - }% - {% - \def\@glo@text{% - \csname gls@\@glo@type @displayfirst\endcsname - {#3}{\glsentrydesc{#2}}{\glsentrysymbol{#2}}{}}% - }% -% \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used and the glossary -% type is \cs{acronymtype}, suppress -% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} -% package option is used. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} -%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} -%\changes{2.04}{2009 November 10}{Changed test to check if glossary type -%has been identified as a list of acronyms} +%\begin{macro}{\@gls@checkbar} +% and for \verb"|": % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse{\(\boolean{@glsisacronymlist}\AND - \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}% - {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% - }% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - }% +\def\@gls@checkbar#1|#2|#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkbar{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@encapchar\@gls@quotechar\@gls@encapchar}% + \def\@@gls@checkbar{\@gls@checkbar#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@encapchar}% + \ifx\null#3\null + \def\@@gls@checkbar{\@gls@checkbar#2||\null}% + \else + \def\@@gls@checkbar{\@gls@checkbar#2|#3\null}% + \fi + \fi + \@@gls@checkbar +} % \end{macrocode} -% Indicate that this entry has now been used -%\changes{2.05}{2010 Feb 6}{Removed spurious brace. Patch provided by Sergiu Dotenco} +%\end{macro} +%\begin{macro}{\@gls@checklevel} +% and for \verb"!": % \begin{macrocode} - \ifKV@glslink@local - \glslocalunset{#2}% +\def\@gls@checklevel#1!#2!#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checklevel{\relax}% \else - \glsunset{#2}% + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@levelchar\@gls@quotechar\@gls@levelchar}% + \def\@@gls@checklevel{\@gls@checklevel#3\null}% \fi - }% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@levelchar}% + \ifx\null#3\null + \def\@@gls@checklevel{\@gls@checklevel#2!!\null}% + \else + \def\@@gls@checklevel{\@gls@checklevel#2!#3\null}% + \fi + \fi + \@@gls@checklevel } % \end{macrocode} %\end{macro} -% -% \cs{glstext} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{text} key and it doesn't mark the entry as -% used. -%\begin{macro}{\glstext} -%\changes{3.01}{2011/04/12}{made robust} +%\begin{macro}{\@gls@checkactual} +% and for \verb"?": % \begin{macrocode} -\newrobustcmd*{\glstext}{\@ifstar\@sglstext\@glstext} +\def\@gls@checkactual#1?#2?#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@checkactual{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@actualchar\@gls@quotechar\@gls@actualchar}% + \def\@@gls@checkactual{\@gls@checkactual#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \@gls@quotechar\@gls@actualchar}% + \ifx\null#3\null + \def\@@gls@checkactual{\@gls@checkactual#2??\null}% + \else + \def\@@gls@checkactual{\@gls@checkactual#2?#3\null}% + \fi + \fi + \@@gls@checkactual +} % \end{macrocode} %\end{macro} -% Define the starred form: -% \begin{macrocode} -\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]} -% \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@glstext}[2][]{% -\new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} -% \end{macrocode} -% Read in the final optional argument: -% \begin{macrocode} -\def\@glstext@#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 ('glstext shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrytext{#2}}% -% \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% +%\begin{macro}{\@gls@xdycheckquote} +% As before but for use with \app{xindy} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% +\def\@gls@xdycheckquote#1"#2"#3\null{% + \@gls@tmpb=\expandafter{\@gls@checkedmkidx}% + \toks@={#1}% + \ifx\null#2\null + \ifx\null#3\null + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@}% + \def\@@gls@xdycheckquote{\relax}% + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \string\"\string\"}% + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#3\null}% + \fi + \else + \edef\@gls@checkedmkidx{\the\@gls@tmpb\the\toks@ + \string\"}% + \ifx\null#3\null + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2""\null}% + \else + \def\@@gls@xdycheckquote{\@gls@xdycheckquote#2"#3\null}% + \fi + \fi + \@@gls@xdycheckquote } % \end{macrocode} +%\end{macro} % -% \cs{GLStext} behaves like \cs{glstext} except the text is converted -% to uppercase. -%\begin{macro}{\GLStext} -% \begin{macrocode} -\newrobustcmd*{\GLStext}{\@ifstar\@sGLStext\@GLStext} -% \end{macrocode} -%\end{macro} -% Define the starred form: -% \begin{macrocode} -\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]} -% \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument +%\begin{macro}{\@gls@xdycheckbackslash} +% Need to escape all backslashes for \app{xindy}. +% Define command that will define \cs{@gls@xdycheckbackslash} % \begin{macrocode} -\newcommand*{\@GLStext}[2][]{% -\new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} +\edef\def@gls@xdycheckbackslash{% + \noexpand\def\noexpand\@gls@xdycheckbackslash##1\@backslashchar + ##2\@backslashchar##3\noexpand\null{% + \noexpand\@gls@tmpb=\noexpand\expandafter + {\noexpand\@gls@checkedmkidx}% + \noexpand\toks@={##1}% + \noexpand\ifx\noexpand\null##2\noexpand\null + \noexpand\ifx\noexpand\null##3\noexpand\null + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@}% + \noexpand\def\noexpand\@@gls@xdycheckbackslash{\relax}% + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \@backslashchar\@backslashchar\@backslashchar\@backslashchar}% + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##3\noexpand\null}% + \noexpand\fi + \noexpand\else + \noexpand\edef\noexpand\@gls@checkedmkidx{% + \noexpand\the\noexpand\@gls@tmpb\noexpand\the\noexpand\toks@ + \@backslashchar\@backslashchar}% + \noexpand\ifx\noexpand\null##3\noexpand\null + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##2\@backslashchar + \@backslashchar\noexpand\null}% + \noexpand\else + \noexpand\def\noexpand\@@gls@xdycheckbackslash{% + \noexpand\@gls@xdycheckbackslash##2\@backslashchar + ##3\noexpand\null}% + \noexpand\fi + \noexpand\fi + \noexpand\@@gls@xdycheckbackslash + }% +} % \end{macrocode} -% Read in the final optional argument: +% Now go ahead and define \cs{@gls@xdycheckbackslash} % \begin{macrocode} -\def\@GLStext@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def@gls@xdycheckbackslash % \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)} +%\end{macro} +% +%\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}. +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} -\protected@edef\@glo@text{\glsentrytext{#2}}% +\ifcsundef{hyperlink}% +{% + \gdef\@glslink#1#2{#2}% +}% +{% + \gdef\@glslink#1#2{\hyperlink{#1}{#2}}% +} % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +%\end{macro} +%\changes{1.12}{2008 Mar 8}{added check for \cs{hypertarget} separate +% to \cs{hyperlink} (memoir defines \cs{hyperlink} but not +% \cs{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}. +%\changes{1.16}{2008 August 27}{raised the hypertarget so the target text doesn't +% scroll off the top of the page} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% +\newlength\gls@tmplen \ifcsundef{hypertarget}% +{% + \gdef\@glstarget#1#2{#2}% }% +{% + \gdef\@glstarget#1#2{% + \settoheight{\gls@tmplen}{#2}% + \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2% + }% } % \end{macrocode} +%\end{macro} % -% \cs{Glstext} behaves like \cs{glstext} except that the first letter -% of the text is converted to uppercase. -%\begin{macro}{\Glstext} -%\changes{3.01}{2011/04/12}{made robust} +% Glossary hyperlinks can be disabled using \cs{glsdisablehyper} +% (effect can be localised): +%\begin{macro}{\glsdisablehyper} % \begin{macrocode} -\newrobustcmd*{\Glstext}{\@ifstar\@sGlstext\@Glstext} +\newcommand{\glsdisablehyper}{% + \renewcommand*\@glslink[2]{##2}% + \renewcommand*\@glstarget[2]{##2}% +} % \end{macrocode} %\end{macro} -% Define the starred form: -% \begin{macrocode} -\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]} -% \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@Glstext}[2][]{% -\new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} -% \end{macrocode} -% Read in the final optional argument: -% \begin{macrocode} -\def\@Glstext@#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 ('Glstext shouldn't use -% 'gls@\meta{type}@display)} +% Glossary hyperlinks can be enabled using \cs{glsenablehyper} +% (effect can be localised): +%\begin{macro}{\glsenablehyper} % \begin{macrocode} -\protected@edef\@glo@text{\glsentrytext{#2}}% +\newcommand{\glsenablehyper}{% +\renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}% +\renewcommand*\@glstarget[2]{% + \settoheight{\gls@tmplen}{##2}% + \raisebox{\gls@tmplen}{\hypertarget{##1}{}}##2}} % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +%\end{macro} +% +% Provide some convenience commands if not already defined: % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% -} +\providecommand{\@firstofthree}[3]{#1} +\providecommand{\@secondofthree}[3]{#2} +\providecommand{\@thirdofthree}[3]{#3} % \end{macrocode} % -% \cs{glsfirst} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{first} key and it doesn't mark the entry as -% used. -%\begin{macro}{\glsfirst} -%\changes{3.01}{2011/04/12}{made robust} +%Syntax: +%\begin{definition} +% \cs{gls}\oarg{options}\marg{label}\oarg{insert text} +%\end{definition} +% Link to glossary entry using singular form. The link text +% is taken from the value of the \gloskey{text} or \gloskey{first} +% keys used when the entry was defined. +% +% The first optional argument is a key-value list, the same as +% \ics{glslink}\igloskey[glslink]{hyper}\igloskey[glslink]{format}\igloskey[glslink]{counter}, +% the mandatory argument is the entry label. +% After the mandatory argument, there is another optional argument +% to insert extra text in the link text (the location of the inserted +% text is governed by \ics{glsdisplay} and +% \ics{glsdisplayfirst}). As with \cs{glslink} +% there is a starred version which is the same as the unstarred +% version but with the \gloskey[glslink]{hyper} key set to \texttt{false}. +% (Additional options can also be specified +% in the first optional argument.) +% +% First determine if we are using the starred form: +%\begin{macro}{\gls} % \begin{macrocode} -\newrobustcmd*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst} +\newrobustcmd*{\gls}{\@ifstar\@sgls\@gls} % \end{macrocode} %\end{macro} % Define the starred form: +%\begin{macro}{\@sgls} % \begin{macrocode} -\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]} +\newcommand*{\@sgls}[1][]{\@gls[hyper=false,#1]} % \end{macrocode} +%\end{macro} % Defined the un-starred form. Need to determine if there is % a final optional argument +%\begin{macro}{\@gls} % \begin{macrocode} -\newcommand*{\@glsfirst}[2][]{% -\new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} +\newcommand*{\@gls}[2][]{% + \new@ifnextchar[{\@gls@{#1}{#2}}{\@gls@{#1}{#2}[]}% +} % \end{macrocode} +%\end{macro} +%\begin{macro}{\@gls@} % Read in the final optional argument: % \begin{macrocode} -\def\@glsfirst@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@gls@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{add \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} +% \begin{macrocode} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% % \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)} +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryfirst{#2}}% + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Call \cs{@gls@link}. +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse + {\(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) + \OR \NOT\boolean{glshyperfirst} + }% + {% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% +% \end{macrocode} +% Indicate that this entry has now been used +% \begin{macrocode} + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{Glsfirst} behaves like \ics{glsfirst} except it displays the -% first letter in uppercase. -%\begin{macro}{\Glsfirst} +% \cs{Gls} behaves like \cs{gls}, but the first letter +% of the link text is converted to uppercase (note that if the +% first letter has an accent, the accented letter will need to +% be grouped when you define the entry). It is mainly intended +% for terms that start a sentence: +%\begin{macro}{\Gls} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst} +\newrobustcmd*{\Gls}{\@ifstar\@sGls\@Gls} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]} +\newcommand*{\@sGls}[1][]{\@Gls[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsfirst}[2][]{% -\new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} +\newcommand*{\@Gls}[2][]{% + \new@ifnextchar[{\@Gls@{#1}{#2}}{\@Gls@{#1}{#2}[]}% +} % \end{macrocode} +%\begin{macro}{\@Gls@} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsfirst@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@Gls@#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 ('Glsfirst shouldn't use -% 'gls@\meta{type}@display)} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryfirst{#2}}% + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% + \def\glslabel{#2}% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +%\changes{3.11a}{2013-10-15}{add \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% -} + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% % \end{macrocode} -% -% \cs{GLSfirst} behaves like \ics{Glsfirst} except it displays the -% text in uppercase. -%\begin{macro}{\GLSfirst} +% Determine what the link text should be (this is stored in +% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\newrobustcmd*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst} + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} -%\end{macro} -% Define the starred form: -% \begin{macrocode} -\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[hyper=false,#1]} -% \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@GLSfirst}[2][]{% -\new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} -% \end{macrocode} -% Read in the final optional argument: -% \begin{macrocode} -\def\@GLSfirst@#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 ('GLSfirst shouldn't use -% 'gls@\meta{type}@display)} +% Call \cs{@gls@link} +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} +%\changes{3.11a}{2013-10-15}{removed \cs{makefirstuc} (now dealt +%with in \cs{glsentryfmt})} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryfirst{#2}}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse + {% + \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) + \OR \NOT\boolean{glshyperfirst}% + }% + {% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Indicate that this entry has now been used % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{glsplural} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{plural} key and it doesn't mark the entry as -% used. -%\begin{macro}{\glsplural} +% \cs{GLS} behaves like \ics{gls}, but the link +% text is converted to uppercase: +%\changes{3.01}{2011/04/12}{made robust} +%\begin{macro}{\GLS} % \begin{macrocode} -\newrobustcmd*{\glsplural}{\@ifstar\@sglsplural\@glsplural} +\newrobustcmd*{\GLS}{\@ifstar\@sGLS\@GLS} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsplural}[1][]{\@glsplural[hyper=false,#1]} +\newcommand*{\@sGLS}[1][]{\@GLS[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsplural}[2][]{% -\new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#1}{#2}[]}} -% \end{macrocode} -% Read in the final optional argument: -% \begin{macrocode} -\def\@glsplural@#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 ('glsplural shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentryplural{#2}}% -% \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} -% \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% +\newcommand*{\@GLS}[2][]{% + \new@ifnextchar[{\@GLS@{#1}{#2}}{\@GLS@{#1}{#2}[]}% } % \end{macrocode} -% -% \cs{Glsplural} behaves like \ics{glsplural} except that the first -% letter is converted to uppercase. -%\begin{macro}{\Glsplural} -% \begin{macrocode} -\newrobustcmd*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural} -% \end{macrocode} -%\end{macro} -% Define the starred form: +%\begin{macro}{\@GLS@} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\@sGlsplural}[1][]{\@Glsplural[hyper=false,#1]} +\def\@GLS@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} % \begin{macrocode} -\newcommand*{\@Glsplural}[2][]{% -\new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#1}{#2}[]}} + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% % \end{macrocode} -% Read in the final optional argument: +%\changes{3.11a}{2013-10-15}{add \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} % \begin{macrocode} -\def\@Glsplural@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% % \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)} +% \cs{@glo@text}). +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryplural{#2}}% + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} +%\changes{3.11a}{2013-10-15}{removed \cs{MakeUppercase} (now moved +%to \cs{glsentryfmt})} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse + {% + \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) + \OR \NOT\boolean{glshyperfirst}}{% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% +% \end{macrocode} +% Indicate that this entry has now been used +% \begin{macrocode} + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{GLSplural} behaves like \ics{glsplural} except that the -% text is converted to uppercase. -%\begin{macro}{\GLSplural} +% \cs{glspl} behaves in the same way as \ics{gls} except +% it uses the plural form. +%\begin{macro}{\glspl} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural} +\newrobustcmd*{\glspl}{\@ifstar\@sglspl\@glspl} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]} +\newcommand*{\@sglspl}[1][]{\@glspl[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSplural}[2][]{% -\new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} +\newcommand*{\@glspl}[2][]{% + \new@ifnextchar[{\@glspl@{#1}{#2}}{\@glspl@{#1}{#2}[]}% +} % \end{macrocode} +%\begin{macro}{\@glspl@} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSplural@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@glspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{add \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} +% \begin{macrocode} + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% % 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)} +%\changes{1.12}{2008 Mar 8}{now uses \cs{glsentrydescplural} and +% \cs{glsentrysymbolplural} instead of \cs{glsentrydesc} and +% \cs{glsentrysymbol}} +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryplural{#2}}% + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Call \cs{@gls@link}. +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse + {% + \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) + \OR \NOT\boolean{glshyperfirst}% + }% + {% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% +% \end{macrocode} +% Indicate that this entry has now been used +% \begin{macrocode} + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{glsfirstplural} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{firstplural} key and it doesn't mark the entry as -% used. -%\begin{macro}{\glsfirstplural} +% \cs{Glspl} behaves in the same way as \ics{glspl}, except +% that the first letter of the link text is converted to uppercase +% (as with \ics{Gls}, if the first letter has an accent, it +% will need to be grouped). +%\begin{macro}{\Glspl} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural} +\newrobustcmd*{\Glspl}{\@ifstar\@sGlspl\@Glspl} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]} +\newcommand*{\@sGlspl}[1][]{\@Glspl[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsfirstplural}[2][]{% -\new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} +\newcommand*{\@Glspl}[2][]{% + \new@ifnextchar[{\@Glspl@{#1}{#2}}{\@Glspl@{#1}{#2}[]}% +} % \end{macrocode} +%\begin{macro}{\@Glspl@} % Read in the final optional argument: % \begin{macrocode} -\def\@glsfirstplural@#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 ('glsfirstplural shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentryfirstplural{#2}}% +\def\@Glspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% -} + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% + \def\glslabel{#2}% % \end{macrocode} -% -% \cs{Glsfirstplural} behaves like \ics{glsfirstplural} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsfirstplural} -%\changes{3.01}{2011/04/12}{made robust} +%\changes{3.11a}{2013-10-15}{add \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} % \begin{macrocode} -\newrobustcmd*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural} + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% % \end{macrocode} -%\end{macro} -% Define the starred form: +% Determine what the link text should be (this is stored in +% \cs{@glo@text}). This needs to be expanded so that the +% \cs{@glo@text} can be passed to \cs{xmakefirstuc}. +%\changes{1.12}{2008 Mar 8}{now uses \cs{glsentrydescplural} and +% \cs{glsentrysymbolplural} instead of \cs{glsentrydesc} and +% \cs{glsentrysymbol}} +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]} + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument -% \begin{macrocode} -\newcommand*{\@Glsfirstplural}[2][]{% -\new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} -% \end{macrocode} -% Read in the final optional argument: -% \begin{macrocode} -\def\@Glsfirstplural@#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 ('Glsfirstplural shouldn't use -% 'gls@\meta{type}@display)} +% Call \cs{@gls@link}. +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} +%\changes{3.11a}{2013-10-15}{removed \cs{makefirstuc} (now dealt +%with in \cs{glsentryfmt})} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryfirstplural{#2}}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse + {% + \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) + \OR \NOT\boolean{glshyperfirst}% + }% + {% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Indicate that this entry has now been used % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{GLSfirstplural} behaves like \ics{glsfirstplural} except that the +% \cs{GLSpl} behaves like \ics{glspl} except that all the % link text is converted to uppercase. -%\begin{macro}{\GLSfirstplural} +%\begin{macro}{\GLSpl} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural} +\newrobustcmd*{\GLSpl}{\@ifstar\@sGLSpl\@GLSpl} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[hyper=false,#1]} +\newcommand*{\@sGLSpl}[1][]{\@GLSpl[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSfirstplural}[2][]{% -\new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#1}{#2}[]}} +\newcommand*{\@GLSpl}[2][]{% + \new@ifnextchar[{\@GLSpl@{#1}{#2}}{\@GLSpl@{#1}{#2}[]}% +} % \end{macrocode} +%\begin{macro}{\@GLSpl} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSfirstplural@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@GLSpl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{add \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} +% \begin{macrocode} + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glscustomtext\@empty + \def\glsinsert{#3}% % \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)} +%\changes{1.12}{2008 Mar 8}{now uses \cs{glsentrydescplural} and +% \cs{glsentrysymbolplural} instead of \cs{glsentrydesc} and +% \cs{glsentrysymbol}} +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryfirstplural{#2}}% + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Call \cs{@gls@link}. +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} +%\changes{3.11a}{2013-10-15}{removed \cs{MakeUppercase} as now dealt +%with in \cs{glsentryfmt}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse + {% + \(\boolean{@glsisacronymlist}\AND \boolean{glsacrfootnote}\) + \OR \NOT\boolean{glshyperfirst}% + }% + {% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% +% \end{macrocode} +% Indicate that this entry has now been used +% \begin{macrocode} + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{glsname} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{name} key and it doesn't mark the entry as -% used. -%\begin{macro}{\glsname} -%\changes{3.01}{2011/04/12}{made robust} +%\begin{macro}{\glsdisp} +%\changes{1.19}{2009 Mar 2}{new} +%\cs{glsdisp}\oarg{options}\marg{label}\marg{text} +% This is like \cs{gls} except that the link text is provided. +% This differs from \cs{glslink} in that it uses +% \cs{glsdisplay} or \cs{glsdisplayfirst} and unsets the first use +% flag. +% +% First determine if we are using the starred form: % \begin{macrocode} -\newrobustcmd*{\glsname}{\@ifstar\@sglsname\@glsname} +\newrobustcmd*{\glsdisp}{\@ifstar\@sglsdisp\@glsdisp} % \end{macrocode} %\end{macro} % Define the starred form: +%\begin{macro}{\@sgls} % \begin{macrocode} -\newcommand*{\@sglsname}[1][]{\@glsname[hyper=false,#1]} +\newcommand*{\@sglsdisp}[1][]{\@glsdisp[hyper=false,#1]} % \end{macrocode} -% Defined the un-starred form. Need to determine if there is -% a final optional argument +%\end{macro} +% Defined the un-starred form. +%\begin{macro}{\@glsdisp} % \begin{macrocode} -\newcommand*{\@glsname}[2][]{% -\new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#1}{#2}[]}} +\newcommand*{\@glsdisp}[3][]{% + \glsdoifexists{#2}{% % \end{macrocode} -% Read in the final optional argument: +%\changes{2.05}{2010 Feb 6}{Added closing brace. Patch provided by Sergiu Dotenco} % \begin{macrocode} -\def\@glsname@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% + \edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% \begin{macrocode} + \def\@gls@link@opts{#1}% + \def\@gls@link@label{#2}% +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{add \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glscustomtext} and \cs{glsinsert}} +% \begin{macrocode} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \def\glscustomtext{#3}% + \def\glsinsert{}% % \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)} +%\changes{3.11a}{2013-10-15}{change to using \cs{glsentryfmt} style +%commands} % \begin{macrocode} -\protected@edef\@glo@text{\glsentryname{#2}}% + \def\@glo@text{\csname gls@\@glo@type @entryfmt\endcsname}% % \end{macrocode} -% Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% Call \cs{@gls@link}. +% If \pkgopt{footnote} package option has been used and the glossary +% type is \cs{acronymtype}, suppress +% hyperlink for first use. Likewise if the \pkgopt[false]{hyperfirst} +% package option is used. +%\changes{1.16}{2008 August 27}{Test glossary type is +%\cs{acronymtype} in addition to +%checking if footnote option has been used} +%\changes{2.03}{2009 Sep 23}{Added check for hyperfirst} +%\changes{2.04}{2009 November 10}{Changed test to check if glossary type +%has been identified as a list of acronyms} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \ifglsused{#2}% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + {% + \gls@checkisacronymlist\@glo@type + \ifthenelse{\(\boolean{@glsisacronymlist}\AND + \boolean{glsacrfootnote}\) \OR \NOT\boolean{glshyperfirst}}% + {% + \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + }% + {% + \@gls@link[#1]{#2}{\@glo@text}% + }% + }% +% \end{macrocode} +% Indicate that this entry has now been used +%\changes{2.05}{2010 Feb 6}{Removed spurious brace. Patch provided by Sergiu Dotenco} +% \begin{macrocode} + \ifKV@glslink@local + \glslocalunset{#2}% + \else + \glsunset{#2}% + \fi + }% } % \end{macrocode} +%\end{macro} % -% \cs{Glsname} behaves like \ics{glsname} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsname} +% \cs{glstext} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{text} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glstext} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsname}{\@ifstar\@sGlsname\@Glsname} +\newrobustcmd*{\glstext}{\@ifstar\@sglstext\@glstext} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsname}[1][]{\@Glsname[hyper=false,#1]} +\newcommand*{\@sglstext}[1][]{\@glstext[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsname}[2][]{% -\new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#1}{#2}[]}} +\newcommand*{\@glstext}[2][]{% + \new@ifnextchar[{\@glstext@{#1}{#2}}{\@glstext@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsname@#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 ('glsname shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentryname{#2}}% +\def\@glstext@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrytext}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentrytext{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSname} behaves like \ics{glsname} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSname} -%\changes{3.01}{2011/04/12}{made robust} +% \cs{GLStext} behaves like \cs{glstext} except the text is converted +% to uppercase. +%\begin{macro}{\GLStext} % \begin{macrocode} -\newrobustcmd*{\GLSname}{\@ifstar\@sGLSname\@GLSname} +\newrobustcmd*{\GLStext}{\@ifstar\@sGLStext\@GLStext} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]} +\newcommand*{\@sGLStext}[1][]{\@GLStext[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSname}[2][]{% -\new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} +\newcommand*{\@GLStext}[2][]{% + \new@ifnextchar[{\@GLStext@{#1}{#2}}{\@GLStext@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSname@#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 ('GLSname shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentryname{#2}}% +\def\@GLStext@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentrytext{#2}#3}}% + }% } % \end{macrocode} % -% \cs{glsdesc} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{description} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsdesc} +% \cs{Glstext} behaves like \cs{glstext} except that the first letter +% of the text is converted to uppercase. +%\begin{macro}{\Glstext} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc} +\newrobustcmd*{\Glstext}{\@ifstar\@sGlstext\@Glstext} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]} +\newcommand*{\@sGlstext}[1][]{\@Glstext[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsdesc}[2][]{% -\new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} +\newcommand*{\@Glstext}[2][]{% + \new@ifnextchar[{\@Glstext@{#1}{#2}}{\@Glstext@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsdesc@#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 ('glsdesc shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrydesc{#2}}% +\def\@Glstext@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{Changed to just use \cs{Glsentrytext}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\Glsentrytext{#2}#3}% + }% } % \end{macrocode} % -% \cs{Glsdesc} behaves like \ics{glsdesc} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsdesc} +% \cs{glsfirst} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{first} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsfirst} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc} +\newrobustcmd*{\glsfirst}{\@ifstar\@sglsfirst\@glsfirst} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]} +\newcommand*{\@sglsfirst}[1][]{\@glsfirst[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsdesc}[2][]{% -\new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} +\newcommand*{\@glsfirst}[2][]{% + \new@ifnextchar[{\@glsfirst@{#1}{#2}}{\@glsfirst@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsdesc@#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 ('Glsdesc shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrydesc{#2}}% +\def\@glsfirst@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryfirst}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentryfirst{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSdesc} behaves like \ics{glsdesc} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSdesc} -%\changes{3.01}{2011/04/12}{made robust} +% \cs{Glsfirst} behaves like \ics{glsfirst} except it displays the +% first letter in uppercase. +%\begin{macro}{\Glsfirst} % \begin{macrocode} -\newrobustcmd*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc} +\newrobustcmd*{\Glsfirst}{\@ifstar\@sGlsfirst\@Glsfirst} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]} +\newcommand*{\@sGlsfirst}[1][]{\@Glsfirst[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSdesc}[2][]{% -\new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} +\newcommand*{\@Glsfirst}[2][]{% + \new@ifnextchar[{\@Glsfirst@{#1}{#2}}{\@Glsfirst@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSdesc@#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 ('GLSdesc shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrydesc{#2}}% +\def\@Glsfirst@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryfirst}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentryfirst{#2}#3}}% } % \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} -%\changes{3.01}{2011/04/12}{made robust} +% \cs{GLSfirst} behaves like \ics{Glsfirst} except it displays the +% text in uppercase. +%\begin{macro}{\GLSfirst} % \begin{macrocode} -\newrobustcmd*{\glsdescplural}{\@ifstar\@sglsdescplural\@glsdescplural} +\newrobustcmd*{\GLSfirst}{\@ifstar\@sGLSfirst\@GLSfirst} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsdescplural}[1][]{\@glsdescplural[hyper=false,#1]} +\newcommand*{\@sGLSfirst}[1][]{\@GLSfirst[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}[]}} +\newcommand*{\@GLSfirst}[2][]{% + \new@ifnextchar[{\@GLSfirst@{#1}{#2}}{\@GLSfirst@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsdescplural@#1#2[#3]{% -\glsdoifexists{#2}{\edef\@glo@type{\glsentrytype{#2}}% +\def\@GLSfirst@#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} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryfirst}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryfirst{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsdescplural} behaves like \ics{glsdescplural} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsdescplural} -%\changes{3.01}{2011/04/12}{made robust} +% \cs{glsplural} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{plural} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsplural} % \begin{macrocode} -\newrobustcmd*{\Glsdescplural}{\@ifstar\@sGlsdescplural\@Glsdescplural} +\newrobustcmd*{\glsplural}{\@ifstar\@sglsplural\@glsplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsdescplural}[1][]{\@Glsdescplural[hyper=false,#1]} +\newcommand*{\@sglsplural}[1][]{\@glsplural[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}[]}} +\newcommand*{\@glsplural}[2][]{% + \new@ifnextchar[{\@glsplural@{#1}{#2}}{\@glsplural@{#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}}% +\def\@glsplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentryplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSdescplural} behaves like \ics{glsdescplural} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSdescplural} -%\changes{3.01}{2011/04/12}{made robust} +% \cs{Glsplural} behaves like \ics{glsplural} except that the first +% letter is converted to uppercase. +%\begin{macro}{\Glsplural} % \begin{macrocode} -\newrobustcmd*{\GLSdescplural}{\@ifstar\@sGLSdescplural\@GLSdescplural} +\newrobustcmd*{\Glsplural}{\@ifstar\@sGlsplural\@Glsplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSdescplural}[1][]{\@GLSdescplural[hyper=false,#1]} +\newcommand*{\@sGlsplural}[1][]{\@Glsplural[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}[]}} +\newcommand*{\@Glsplural}[2][]{% + \new@ifnextchar[{\@Glsplural@{#1}{#2}}{\@Glsplural@{#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}}% +\def\@Glsplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentryplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{glssymbol} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{symbol} key and it doesn't mark the entry as -% used. -%\begin{macro}{\glssymbol} +% \cs{GLSplural} behaves like \ics{glsplural} except that the +% text is converted to uppercase. +%\begin{macro}{\GLSplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol} +\newrobustcmd*{\GLSplural}{\@ifstar\@sGLSplural\@GLSplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]} +\newcommand*{\@sGLSplural}[1][]{\@GLSplural[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glssymbol}[2][]{% -\new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} +\newcommand*{\@GLSplural}[2][]{% + \new@ifnextchar[{\@GLSplural@{#1}{#2}}{\@GLSplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glssymbol@#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 ('glssymbol shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrysymbol{#2}}% +\def\@GLSplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryplural{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glssymbol} behaves like \ics{glssymbol} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glssymbol} +% \cs{glsfirstplural} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{firstplural} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsfirstplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol} +\newrobustcmd*{\glsfirstplural}{\@ifstar\@sglsfirstplural\@glsfirstplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]} +\newcommand*{\@sglsfirstplural}[1][]{\@glsfirstplural[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glssymbol}[2][]{% -\new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} +\newcommand*{\@glsfirstplural}[2][]{% + \new@ifnextchar[{\@glsfirstplural@{#1}{#2}}{\@glsfirstplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glssymbol@#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 ('Glssymbol shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrysymbol{#2}}% +\def\@glsfirstplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{glsentryfirstplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentryfirstplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSsymbol} behaves like \ics{glssymbol} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSsymbol} +% \cs{Glsfirstplural} behaves like \ics{glsfirstplural} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsfirstplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol} +\newrobustcmd*{\Glsfirstplural}{\@ifstar\@sGlsfirstplural\@Glsfirstplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]} +\newcommand*{\@sGlsfirstplural}[1][]{\@Glsfirstplural[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSsymbol}[2][]{% -\new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} +\newcommand*{\@Glsfirstplural}[2][]{% + \new@ifnextchar[{\@Glsfirstplural@{#1}{#2}}{\@Glsfirstplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSsymbol@#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 ('GLSsymbol shouldn't use -% 'gls@\meta{type}@display)} -% \begin{macrocode} -\protected@edef\@glo@text{\glsentrysymbol{#2}}% +\def\@Glsfirstplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{Glsentryfirstplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentryfirstplural{#2}#3}% + }% } % \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} +% \cs{GLSfirstplural} behaves like \ics{glsfirstplural} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSfirstplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glssymbolplural}{\@ifstar\@sglssymbolplural\@glssymbolplural} +\newrobustcmd*{\GLSfirstplural}{\@ifstar\@sGLSfirstplural\@GLSfirstplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglssymbolplural}[1][]{\@glssymbolplural[hyper=false,#1]} +\newcommand*{\@sGLSfirstplural}[1][]{\@GLSfirstplural[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}[]}} +\newcommand*{\@GLSfirstplural}[2][]{% + \new@ifnextchar[{\@GLSfirstplural@{#1}{#2}}{\@GLSfirstplural@{#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}}% +\def\@GLSfirstplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{glsentryfirstplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryfirstplural{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glssymbolplural} behaves like \ics{glssymbolplural} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glssymbolplural} +% \cs{glsname} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{name} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glsname} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glssymbolplural}{\@ifstar\@sGlssymbolplural\@Glssymbolplural} +\newrobustcmd*{\glsname}{\@ifstar\@sglsname\@glsname} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlssymbolplural}[1][]{\@Glssymbolplural[hyper=false,#1]} +\newcommand*{\@sglsname}[1][]{\@glsname[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}[]}} +\newcommand*{\@glsname}[2][]{% + \new@ifnextchar[{\@glsname@{#1}{#2}}{\@glsname@{#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}}% +\def\@glsname@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryname}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentryname{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSsymbolplural} behaves like \ics{glssymbolplural} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSsymbolplural} +% \cs{Glsname} behaves like \ics{glsname} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsname} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSsymbolplural}{\@ifstar\@sGLSsymbolplural\@GLSsymbolplural} +\newrobustcmd*{\Glsname}{\@ifstar\@sGlsname\@Glsname} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSsymbolplural}[1][]{\@GLSsymbolplural[hyper=false,#1]} +\newcommand*{\@sGlsname}[1][]{\@Glsname[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}[]}} +\newcommand*{\@Glsname}[2][]{% + \new@ifnextchar[{\@Glsname@{#1}{#2}}{\@Glsname@{#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}}% +\def\@Glsname@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} -% \changes{1.13}{2008 May 10}{fixed bug that ignores 3rd parameter} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryname}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentryname{#2}#3}% + }% } % \end{macrocode} % -% \cs{glsuseri} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{user1} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsuseri} +% \cs{GLSname} behaves like \ics{glsname} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSname} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsuseri}{\@ifstar\@sglsuseri\@glsuseri} +\newrobustcmd*{\GLSname}{\@ifstar\@sGLSname\@GLSname} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsuseri}[1][]{\@glsuseri[hyper=false,#1]} +\newcommand*{\@sGLSname}[1][]{\@GLSname[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsuseri}[2][]{% -\new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}} +\newcommand*{\@GLSname}[2][]{% + \new@ifnextchar[{\@GLSname@{#1}{#2}}{\@GLSname@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsuseri@#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{\glsentryuseri{#2}}% +\def\@GLSname@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryname}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryname{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsuseri} behaves like \ics{glsuseri} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsuseri} +% \cs{glsdesc} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{description} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsdesc} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsuseri}{\@ifstar\@sGlsuseri\@Glsuseri} +\newrobustcmd*{\glsdesc}{\@ifstar\@sglsdesc\@glsdesc} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsuseri}[1][]{\@Glsuseri[hyper=false,#1]} +\newcommand*{\@sglsdesc}[1][]{\@glsdesc[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsuseri}[2][]{% -\new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}} +\newcommand*{\@glsdesc}[2][]{% + \new@ifnextchar[{\@glsdesc@{#1}{#2}}{\@glsdesc@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsuseri@#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{\glsentryuseri{#2}}% +\def\@glsdesc@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrydesc}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentrydesc{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSuseri} behaves like \ics{glsuseri} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSuseri} +% \cs{Glsdesc} behaves like \ics{glsdesc} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsdesc} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSuseri}{\@ifstar\@sGLSuseri\@GLSuseri} +\newrobustcmd*{\Glsdesc}{\@ifstar\@sGlsdesc\@Glsdesc} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSuseri}[1][]{\@GLSuseri[hyper=false,#1]} +\newcommand*{\@sGlsdesc}[1][]{\@Glsdesc[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSuseri}[2][]{% -\new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}} +\newcommand*{\@Glsdesc}[2][]{% + \new@ifnextchar[{\@Glsdesc@{#1}{#2}}{\@Glsdesc@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSuseri@#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{\glsentryuseri{#2}}% +\def\@Glsdesc@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentrydesc}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentrydesc{#2}#3}% + }% } % \end{macrocode} % -% \cs{glsuserii} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{user2} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsuserii} +% \cs{GLSdesc} behaves like \ics{glsdesc} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSdesc} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsuserii}{\@ifstar\@sglsuserii\@glsuserii} +\newrobustcmd*{\GLSdesc}{\@ifstar\@sGLSdesc\@GLSdesc} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsuserii}[1][]{\@glsuserii[hyper=false,#1]} +\newcommand*{\@sGLSdesc}[1][]{\@GLSdesc[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsuserii}[2][]{% -\new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}} +\newcommand*{\@GLSdesc}[2][]{% + \new@ifnextchar[{\@GLSdesc@{#1}{#2}}{\@GLSdesc@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsuserii@#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{\glsentryuserii{#2}}% +\def\@GLSdesc@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrydesc}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentrydesc{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsuserii} behaves like \ics{glsuserii} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsuserii} +% \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} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsuserii}{\@ifstar\@sGlsuserii\@Glsuserii} +\newrobustcmd*{\glsdescplural}{\@ifstar\@sglsdescplural\@glsdescplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsuserii}[1][]{\@Glsuserii[hyper=false,#1]} +\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*{\@Glsuserii}[2][]{% -\new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}} +\newcommand*{\@glsdescplural}[2][]{% + \new@ifnextchar[{\@glsdescplural@{#1}{#2}}{\@glsdescplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsuserii@#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{\glsentryuserii{#2}}% +\def\@glsdescplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{glsentrydescplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentrydescplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSuserii} behaves like \ics{glsuserii} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSuserii} +% \cs{Glsdescplural} behaves like \ics{glsdescplural} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsdescplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSuserii}{\@ifstar\@sGLSuserii\@GLSuserii} +\newrobustcmd*{\Glsdescplural}{\@ifstar\@sGlsdescplural\@Glsdescplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSuserii}[1][]{\@GLSuserii[hyper=false,#1]} +\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*{\@GLSuserii}[2][]{% -\new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}} +\newcommand*{\@Glsdescplural}[2][]{% + \new@ifnextchar[{\@Glsdescplural@{#1}{#2}}{\@Glsdescplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSuserii@#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{\glsentryuserii{#2}}% +\def\@Glsdescplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{Glsentrydescplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentrydescplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{glsuseriii} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{user3} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsuseriii} +% \cs{GLSdescplural} behaves like \ics{glsdescplural} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSdescplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsuseriii}{\@ifstar\@sglsuseriii\@glsuseriii} +\newrobustcmd*{\GLSdescplural}{\@ifstar\@sGLSdescplural\@GLSdescplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsuseriii}[1][]{\@glsuseriii[hyper=false,#1]} +\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*{\@glsuseriii}[2][]{% -\new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}} +\newcommand*{\@GLSdescplural}[2][]{% + \new@ifnextchar[{\@GLSdescplural@{#1}{#2}}{\@GLSdescplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsuseriii@#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{\glsentryuseriii{#2}}% +\def\@GLSdescplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{glsentrydescplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentrydescplural{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsuseriii} behaves like \ics{glsuseriii} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsuseriii} +% \cs{glssymbol} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{symbol} key and it doesn't mark the entry as +% used. +%\begin{macro}{\glssymbol} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsuseriii}{\@ifstar\@sGlsuseriii\@Glsuseriii} +\newrobustcmd*{\glssymbol}{\@ifstar\@sglssymbol\@glssymbol} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsuseriii}[1][]{\@Glsuseriii[hyper=false,#1]} +\newcommand*{\@sglssymbol}[1][]{\@glssymbol[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsuseriii}[2][]{% -\new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}} +\newcommand*{\@glssymbol}[2][]{% + \new@ifnextchar[{\@glssymbol@{#1}{#2}}{\@glssymbol@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsuseriii@#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{\glsentryuseriii{#2}}% +\def\@glssymbol@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrysymbol}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentrysymbol{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSuseriii} behaves like \ics{glsuseriii} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSuseriii} +% \cs{Glssymbol} behaves like \ics{glssymbol} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glssymbol} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSuseriii}{\@ifstar\@sGLSuseriii\@GLSuseriii} +\newrobustcmd*{\Glssymbol}{\@ifstar\@sGlssymbol\@Glssymbol} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSuseriii}[1][]{\@GLSuseriii[hyper=false,#1]} +\newcommand*{\@sGlssymbol}[1][]{\@Glssymbol[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSuseriii}[2][]{% -\new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}} +\newcommand*{\@Glssymbol}[2][]{% + \new@ifnextchar[{\@Glssymbol@{#1}{#2}}{\@Glssymbol@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSuseriii@#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{\glsentryuseriii{#2}}% +\def\@Glssymbol@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentrysymbol}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentrysymbol{#2}#3}% + }% } % \end{macrocode} % -% \cs{glsuseriv} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{user4} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsuseriv} +% \cs{GLSsymbol} behaves like \ics{glssymbol} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSsymbol} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsuseriv}{\@ifstar\@sglsuseriv\@glsuseriv} +\newrobustcmd*{\GLSsymbol}{\@ifstar\@sGLSsymbol\@GLSsymbol} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsuseriv}[1][]{\@glsuseriv[hyper=false,#1]} +\newcommand*{\@sGLSsymbol}[1][]{\@GLSsymbol[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsuseriv}[2][]{% -\new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}} +\newcommand*{\@GLSsymbol}[2][]{% + \new@ifnextchar[{\@GLSsymbol@{#1}{#2}}{\@GLSsymbol@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsuseriv@#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{\glsentryuseriv{#2}}% +\def\@GLSsymbol@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentrysymbol}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentrysymbol{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsuseriv} behaves like \ics{glsuseriv} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsuseriv} +% \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} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsuseriv}{\@ifstar\@sGlsuseriv\@Glsuseriv} +\newrobustcmd*{\glssymbolplural}{\@ifstar\@sglssymbolplural\@glssymbolplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsuseriv}[1][]{\@Glsuseriv[hyper=false,#1]} +\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*{\@Glsuseriv}[2][]{% -\new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}} +\newcommand*{\@glssymbolplural}[2][]{% + \new@ifnextchar[{\@glssymbolplural@{#1}{#2}}{\@glssymbolplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsuseriv@#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{\glsentryuseriv{#2}}% +\def\@glssymbolplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{glsentrysymbolplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentrysymbolplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSuseriv} behaves like \ics{glsuseriv} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSuseriv} +% \cs{Glssymbolplural} behaves like \ics{glssymbolplural} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glssymbolplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSuseriv}{\@ifstar\@sGLSuseriv\@GLSuseriv} +\newrobustcmd*{\Glssymbolplural}{\@ifstar\@sGlssymbolplural\@Glssymbolplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSuseriv}[1][]{\@GLSuseriv[hyper=false,#1]} +\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*{\@GLSuseriv}[2][]{% -\new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}} +\newcommand*{\@Glssymbolplural}[2][]{% + \new@ifnextchar[{\@Glssymbolplural@{#1}{#2}}{\@Glssymbolplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSuseriv@#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{\glsentryuseriv{#2}}% +\def\@Glssymbolplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{Glsentrysymbolplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentrysymbolplural{#2}#3}% + }% } % \end{macrocode} % -% \cs{glsuserv} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{user5} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsuserv} +% \cs{GLSsymbolplural} behaves like \ics{glssymbolplural} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSsymbolplural} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsuserv}{\@ifstar\@sglsuserv\@glsuserv} +\newrobustcmd*{\GLSsymbolplural}{\@ifstar\@sGLSsymbolplural\@GLSsymbolplural} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsuserv}[1][]{\@glsuserv[hyper=false,#1]} +\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*{\@glsuserv}[2][]{% -\new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}} +\newcommand*{\@GLSsymbolplural}[2][]{% + \new@ifnextchar[{\@GLSsymbolplural@{#1}{#2}}{\@GLSsymbolplural@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsuserv@#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{\glsentryuserv{#2}}% +\def\@GLSsymbolplural@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Call \cs{@gls@link} +% \changes{1.13}{2008 May 10}{fixed bug that ignored 3rd parameter} +%\changes{3.11a}{2013-10-15}{changed to just use +%\cs{glsentrysymbolplural}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentrysymbolplural{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsuserv} behaves like \ics{glsuserv} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsuserv} +% \cs{glsuseri} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{user1} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsuseri} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsuserv}{\@ifstar\@sGlsuserv\@Glsuserv} +\newrobustcmd*{\glsuseri}{\@ifstar\@sglsuseri\@glsuseri} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsuserv}[1][]{\@Glsuserv[hyper=false,#1]} +\newcommand*{\@sglsuseri}[1][]{\@glsuseri[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsuserv}[2][]{% -\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}} +\newcommand*{\@glsuseri}[2][]{% + \new@ifnextchar[{\@glsuseri@{#1}{#2}}{\@glsuseri@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsuserv@#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{\glsentryuserv{#2}}% +\def\@glsuseri@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseri}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentryuseri{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSuserv} behaves like \ics{glsuserv} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSuserv} +% \cs{Glsuseri} behaves like \ics{glsuseri} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsuseri} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSuserv}{\@ifstar\@sGLSuserv\@GLSuserv} +\newrobustcmd*{\Glsuseri}{\@ifstar\@sGlsuseri\@Glsuseri} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSuserv}[1][]{\@GLSuserv[hyper=false,#1]} +\newcommand*{\@sGlsuseri}[1][]{\@Glsuseri[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSuserv}[2][]{% -\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}} +\newcommand*{\@Glsuseri}[2][]{% + \new@ifnextchar[{\@Glsuseri@{#1}{#2}}{\@Glsuseri@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSuserv@#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{\glsentryuserv{#2}}% +\def\@Glsuseri@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryuseri}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentryuseri{#2}#3}% + }% } % \end{macrocode} % -% \cs{glsuservi} behaves like \ics{gls} except it always uses the value -% given by the \gloskey{user6} key and it doesn't mark the entry -% as used. -%\begin{macro}{\glsuservi} +% \cs{GLSuseri} behaves like \ics{glsuseri} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSuseri} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsuservi}{\@ifstar\@sglsuservi\@glsuservi} +\newrobustcmd*{\GLSuseri}{\@ifstar\@sGLSuseri\@GLSuseri} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sglsuservi}[1][]{\@glsuservi[hyper=false,#1]} +\newcommand*{\@sGLSuseri}[1][]{\@GLSuseri[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@glsuservi}[2][]{% -\new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}} +\newcommand*{\@GLSuseri}[2][]{% + \new@ifnextchar[{\@GLSuseri@{#1}{#2}}{\@GLSuseri@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@glsuservi@#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{\glsentryuservi{#2}}% +\def\@GLSuseri@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseri}} % \begin{macrocode} -\@gls@link[#1]{#2}{\@glo@text#3}% -}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryuseri{#2}#3}}% + }% } % \end{macrocode} % -% \cs{Glsuservi} behaves like \ics{glsuservi} except that the -% first letter is converted to uppercase. -%\begin{macro}{\Glsuservi} +% \cs{glsuserii} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{user2} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsuserii} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Glsuservi}{\@ifstar\@sGlsuservi\@Glsuservi} +\newrobustcmd*{\glsuserii}{\@ifstar\@sglsuserii\@glsuserii} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGlsuservi}[1][]{\@Glsuservi[hyper=false,#1]} +\newcommand*{\@sglsuserii}[1][]{\@glsuserii[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@Glsuservi}[2][]{% -\new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}} +\newcommand*{\@glsuserii}[2][]{% + \new@ifnextchar[{\@glsuserii@{#1}{#2}}{\@glsuserii@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Glsuservi@#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{\glsentryuservi{#2}}% +\def\@glsuserii@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuserii}} % \begin{macrocode} -\@gls@link[#1]{#2}{% - \expandafter\makefirstuc\expandafter{\@glo@text}#3}% -}% + \@gls@link[#1]{#2}{\glsentryuserii{#2}#3}% + }% } % \end{macrocode} % -% \cs{GLSuservi} behaves like \ics{glsuservi} except that the -% link text is converted to uppercase. -%\begin{macro}{\GLSuservi} +% \cs{Glsuserii} behaves like \ics{glsuserii} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsuserii} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\GLSuservi}{\@ifstar\@sGLSuservi\@GLSuservi} +\newrobustcmd*{\Glsuserii}{\@ifstar\@sGlsuserii\@Glsuserii} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\@sGLSuservi}[1][]{\@GLSuservi[hyper=false,#1]} +\newcommand*{\@sGlsuserii}[1][]{\@Glsuserii[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\@GLSuservi}[2][]{% -\new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}} +\newcommand*{\@Glsuserii}[2][]{% + \new@ifnextchar[{\@Glsuserii@{#1}{#2}}{\@Glsuserii@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@GLSuservi@#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{\glsentryuservi{#2}}% +\def\@Glsuserii@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryuserii}} % \begin{macrocode} -\@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% -}% + \@gls@link[#1]{#2}{\Glsentryuserii{#2}#3}% + }% } % \end{macrocode} % -% Now deal with acronym related keys. First the short form: -%\begin{macro}{\acrshort} +% \cs{GLSuserii} behaves like \ics{glsuserii} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSuserii} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\acrshort}{\@ifstar\s@acrshort\ns@acrshort} +\newrobustcmd*{\GLSuserii}{\@ifstar\@sGLSuserii\@GLSuserii} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@acrshort}[2][]{% - \new@ifnextchar[{\@acrshort{hyper=false,#1}{#2}}% - {\@acrshort{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGLSuserii}[1][]{\@GLSuserii[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@acrshort}[2][]{% - \new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}% -} +\newcommand*{\@GLSuserii}[2][]{% + \new@ifnextchar[{\@GLSuserii@{#1}{#2}}{\@GLSuserii@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@acrshort#1#2[#3]{% +\def\@GLSuserii@#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{\glsentryshort{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuserii}} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryuserii{#2}#3}}% }% } % \end{macrocode} % -%\begin{macro}{\Acrshort} +% \cs{glsuseriii} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{user3} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsuseriii} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Acrshort}{\@ifstar\s@Acrshort\ns@Acrshort} +\newrobustcmd*{\glsuseriii}{\@ifstar\@sglsuseriii\@glsuseriii} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@Acrshort}[2][]{% - \new@ifnextchar[{\@Acrshort{hyper=false,#1}{#2}}% - {\@Acrshort{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sglsuseriii}[1][]{\@glsuseriii[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@Acrshort}[2][]{% - \new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}% -} +\newcommand*{\@glsuseriii}[2][]{% + \new@ifnextchar[{\@glsuseriii@{#1}{#2}}{\@glsuseriii@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Acrshort#1#2[#3]{% +\def\@glsuseriii@#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{\glsentryshort{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseriii}} % \begin{macrocode} - \@gls@link[#1]{#2}% - {% - \acronymfont{\expandafter\makefirstuc\expandafter{\@glo@text}}#3% - }% + \@gls@link[#1]{#2}{\glsentryuseriii{#2}#3}% }% } % \end{macrocode} % -%\begin{macro}{\ACRshort} +% \cs{Glsuseriii} behaves like \ics{glsuseriii} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsuseriii} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\ACRshort}{\@ifstar\s@ACRshort\ns@ACRshort} +\newrobustcmd*{\Glsuseriii}{\@ifstar\@sGlsuseriii\@Glsuseriii} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@ACRshort}[2][]{% - \new@ifnextchar[{\@ACRshort{hyper=false,#1}{#2}}% - {\@ACRshort{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGlsuseriii}[1][]{\@Glsuseriii[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@ACRshort}[2][]{% - \new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}% -} +\newcommand*{\@Glsuseriii}[2][]{% + \new@ifnextchar[{\@Glsuseriii@{#1}{#2}}{\@Glsuseriii@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@ACRshort#1#2[#3]{% +\def\@Glsuseriii@#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{\glsentryshort{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryuseriii}} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\MakeUppercase{\@glo@text#3}}}% + \@gls@link[#1]{#2}{\Glsentryuseriii{#2}#3}% }% } % \end{macrocode} % -% Short plural: -%\begin{macro}{\acrshortpl} +% \cs{GLSuseriii} behaves like \ics{glsuseriii} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSuseriii} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\acrshortpl}{\@ifstar\s@acrshortpl\ns@acrshortpl} +\newrobustcmd*{\GLSuseriii}{\@ifstar\@sGLSuseriii\@GLSuseriii} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@acrshortpl}[2][]{% - \new@ifnextchar[{\@acrshortpl{hyper=false,#1}{#2}}% - {\@acrshortpl{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGLSuseriii}[1][]{\@GLSuseriii[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@acrshortpl}[2][]{% - \new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}% -} +\newcommand*{\@GLSuseriii}[2][]{% + \new@ifnextchar[{\@GLSuseriii@{#1}{#2}}{\@GLSuseriii@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@acrshortpl#1#2[#3]{% +\def\@GLSuseriii@#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{\glsentryshortpl{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseriii}} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryuseriii{#2}#3}}% }% } % \end{macrocode} % -%\begin{macro}{\Acrshortpl} +% \cs{glsuseriv} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{user4} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsuseriv} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Acrshortpl}{\@ifstar\s@Acrshortpl\ns@Acrshortpl} +\newrobustcmd*{\glsuseriv}{\@ifstar\@sglsuseriv\@glsuseriv} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@Acrshortpl}[2][]{% - \new@ifnextchar[{\@Acrshortpl{hyper=false,#1}{#2}}% - {\@Acrshortpl{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sglsuseriv}[1][]{\@glsuseriv[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@Acrshortpl}[2][]{% - \new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}% -} +\newcommand*{\@glsuseriv}[2][]{% + \new@ifnextchar[{\@glsuseriv@{#1}{#2}}{\@glsuseriv@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Acrshortpl#1#2[#3]{% +\def\@glsuseriv@#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{\glsentryshortpl{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseriv}} % \begin{macrocode} - \@gls@link[#1]{#2}% - {% - \acronymfont{\expandafter\makefirstuc\expandafter{\@glo@text}}#3% - }% + \@gls@link[#1]{#2}{\glsentryuseriv{#2}#3}% }% } % \end{macrocode} % -%\begin{macro}{\ACRshortpl} +% \cs{Glsuseriv} behaves like \ics{glsuseriv} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsuseriv} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\ACRshortpl}{\@ifstar\s@ACRshortpl\ns@ACRshortpl} +\newrobustcmd*{\Glsuseriv}{\@ifstar\@sGlsuseriv\@Glsuseriv} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@ACRshortpl}[2][]{% - \new@ifnextchar[{\@ACRshortpl{hyper=false,#1}{#2}}% - {\@ACRshortpl{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGlsuseriv}[1][]{\@Glsuseriv[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@ACRshortpl}[2][]{% - \new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}% -} +\newcommand*{\@Glsuseriv}[2][]{% + \new@ifnextchar[{\@Glsuseriv@{#1}{#2}}{\@Glsuseriv@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@ACRshortpl#1#2[#3]{% +\def\@Glsuseriv@#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{\glsentryshortpl{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryuseriv}} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\MakeUppercase{\@glo@text#3}}}% + \@gls@link[#1]{#2}{\Glsentryuseriv{#2}#3}% }% } % \end{macrocode} % -%\begin{macro}{\acrlong} +% \cs{GLSuseriv} behaves like \ics{glsuseriv} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSuseriv} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\acrlong}{\@ifstar\s@acrlong\ns@acrlong} +\newrobustcmd*{\GLSuseriv}{\@ifstar\@sGLSuseriv\@GLSuseriv} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@acrlong}[2][]{% - \new@ifnextchar[{\@acrlong{hyper=false,#1}{#2}}% - {\@acrlong{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGLSuseriv}[1][]{\@GLSuseriv[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@acrlong}[2][]{% - \new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}% -} +\newcommand*{\@GLSuseriv}[2][]{% + \new@ifnextchar[{\@GLSuseriv@{#1}{#2}}{\@GLSuseriv@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@acrlong#1#2[#3]{% +\def\@GLSuseriv@#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{\glsentrylong{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuseriv}} % \begin{macrocode} - \@gls@link[#1]{#2}{\@glo@text#3}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryuseriv{#2}#3}}% }% } % \end{macrocode} % -%\begin{macro}{\Acrlong} +% \cs{glsuserv} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{user5} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsuserv} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Acrlong}{\@ifstar\s@Acrlong\ns@Acrlong} +\newrobustcmd*{\glsuserv}{\@ifstar\@sglsuserv\@glsuserv} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@Acrlong}[2][]{% - \new@ifnextchar[{\@Acrlong{hyper=false,#1}{#2}}% - {\@Acrlong{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sglsuserv}[1][]{\@glsuserv[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@Acrlong}[2][]{% - \new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}% -} +\newcommand*{\@glsuserv}[2][]{% + \new@ifnextchar[{\@glsuserv@{#1}{#2}}{\@glsuserv@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Acrlong#1#2[#3]{% +\def\@glsuserv@#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{\glsentrylong{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuserv}} % \begin{macrocode} - \@gls@link[#1]{#2}% - {% - \expandafter\makefirstuc\expandafter{\@glo@text}#3% - }% + \@gls@link[#1]{#2}{\glsentryuserv{#2}#3}% }% } % \end{macrocode} % -%\begin{macro}{\ACRlong} +% \cs{Glsuserv} behaves like \ics{glsuserv} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsuserv} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\ACRlong}{\@ifstar\s@ACRlong\ns@ACRlong} +\newrobustcmd*{\Glsuserv}{\@ifstar\@sGlsuserv\@Glsuserv} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@ACRlong}[2][]{% - \new@ifnextchar[{\@ACRlong{hyper=false,#1}{#2}}% - {\@ACRlong{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGlsuserv}[1][]{\@Glsuserv[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@ACRlong}[2][]{% - \new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}% -} +\newcommand*{\@Glsuserv}[2][]{% +\new@ifnextchar[{\@Glsuserv@{#1}{#2}}{\@Glsuserv@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@ACRlong#1#2[#3]{% +\def\@Glsuserv@#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{\glsentrylong{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryuserv}} % \begin{macrocode} - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% + \@gls@link[#1]{#2}{\Glsentryuserv{#2}#3}% }% } % \end{macrocode} % -% Short plural: -%\begin{macro}{\acrlongpl} +% \cs{GLSuserv} behaves like \ics{glsuserv} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSuserv} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\acrlongpl}{\@ifstar\s@acrlongpl\ns@acrlongpl} +\newrobustcmd*{\GLSuserv}{\@ifstar\@sGLSuserv\@GLSuserv} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@acrlongpl}[2][]{% - \new@ifnextchar[{\@acrlongpl{hyper=false,#1}{#2}}% - {\@acrlongpl{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGLSuserv}[1][]{\@GLSuserv[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@acrlongpl}[2][]{% - \new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}% -} +\newcommand*{\@GLSuserv}[2][]{% +\new@ifnextchar[{\@GLSuserv@{#1}{#2}}{\@GLSuserv@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@acrlongpl#1#2[#3]{% +\def\@GLSuserv@#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{\glsentrylongpl{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuserv}} % \begin{macrocode} - \@gls@link[#1]{#2}{\@glo@text#3}% + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryuserv{#2}#3}}% }% } % \end{macrocode} % -%\begin{macro}{\Acrlongpl} +% \cs{glsuservi} behaves like \ics{gls} except it always uses the value +% given by the \gloskey{user6} key and it doesn't mark the entry +% as used. +%\begin{macro}{\glsuservi} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\Acrlongpl}{\@ifstar\s@Acrlongpl\ns@Acrlongpl} +\newrobustcmd*{\glsuservi}{\@ifstar\@sglsuservi\@glsuservi} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@Acrlongpl}[2][]{% - \new@ifnextchar[{\@Acrlongpl{hyper=false#1}{#2}}% - {\@Acrlongpl{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sglsuservi}[1][]{\@glsuservi[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@Acrlongpl}[2][]{% - \new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}% -} +\newcommand*{\@glsuservi}[2][]{% + \new@ifnextchar[{\@glsuservi@{#1}{#2}}{\@glsuservi@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@Acrlongpl#1#2[#3]{% +\def\@glsuservi@#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{\glsentrylongpl{#2}}% -% \end{macrocode} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuservi}} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}% - {% - \expandafter\makefirstuc\expandafter{\@glo@text}#3% - }% + \@gls@link[#1]{#2}{\glsentryuservi{#2}#3}% }% } % \end{macrocode} % -%\begin{macro}{\ACRlongpl} +% \cs{Glsuservi} behaves like \ics{glsuservi} except that the +% first letter is converted to uppercase. +%\begin{macro}{\Glsuservi} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\ACRlongpl}{\@ifstar\s@ACRlongpl\ns@ACRlongpl} +\newrobustcmd*{\Glsuservi}{\@ifstar\@sGlsuservi\@Glsuservi} % \end{macrocode} %\end{macro} % Define the starred form: % \begin{macrocode} -\newcommand*{\s@ACRlongpl}[2][]{% - \new@ifnextchar[{\@ACRlongpl{hyper=false,#1}{#2}}% - {\@ACRlongpl{hyper=false,#1}{#2}[]}% -} +\newcommand*{\@sGlsuservi}[1][]{\@Glsuservi[hyper=false,#1]} % \end{macrocode} % Defined the un-starred form. Need to determine if there is % a final optional argument % \begin{macrocode} -\newcommand*{\ns@ACRlongpl}[2][]{% - \new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}% -} +\newcommand*{\@Glsuservi}[2][]{% + \new@ifnextchar[{\@Glsuservi@{#1}{#2}}{\@Glsuservi@{#1}{#2}[]}} % \end{macrocode} % Read in the final optional argument: % \begin{macrocode} -\def\@ACRlongpl#1#2[#3]{% +\def\@Glsuservi@#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{\glsentrylongpl{#2}}% -% \end{macrocode} % Call \cs{@gls@link} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{Glsentryuservi}} % \begin{macrocode} - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text#3}}% + \@gls@link[#1]{#2}{\Glsentryuservi{#2}#3}% }% } % \end{macrocode} % -% \subsubsection{Displaying entry details without adding -% information to the glossary} -%\label{sec:code:glsnolink} -% -% These commands merely display entry information without adding -% entries in the associated file or having hyperlinks. -% -% Get the entry name (as specified by the \gloskey{name} key -% 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 contains -% any commands. -%\begin{macro}{\glsentryname} -% \begin{macrocode} -\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryname} +% \cs{GLSuservi} behaves like \ics{glsuservi} except that the +% link text is converted to uppercase. +%\begin{macro}{\GLSuservi} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\Glsentryname}[1]{% -\protected@edef\@glo@text{\csname glo@#1@name\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newrobustcmd*{\GLSuservi}{\@ifstar\@sGLSuservi\@GLSuservi} % \end{macrocode} %\end{macro} -% -% Get the entry description (as specified by the -% \gloskey{description} when the entry was defined). The argument -% is the label associated with the entry. Note that unless you -% used \texttt{description=false} in the \pkgopt{sanitize} package -% option you may get unexpected results if the \gloskey{description} -% key contained any commands. -%\begin{macro}{\glsentrydesc} +% Define the starred form: % \begin{macrocode} -\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname} +\newcommand*{\@sGLSuservi}[1][]{\@GLSuservi[hyper=false,#1]} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrydesc} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\Glsentrydesc}[1]{% -\protected@edef\@glo@text{\csname glo@#1@desc\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newcommand*{\@GLSuservi}[2][]{% + \new@ifnextchar[{\@GLSuservi@{#1}{#2}}{\@GLSuservi@{#1}{#2}[]}} % \end{macrocode} -%\end{macro} -% Plural form: -%\begin{macro}{\glsentrydescplural} -%\changes{1.12}{2008 Mar 8}{New} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glsentrydescplural}[1]{% -\csname glo@#1@descplural\endcsname} +\def\@GLSuservi@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrydescplural} -%\changes{1.12}{2008 Mar 8}{New} +%\changes{3.11a}{2013-10-15}{changed to just use \cs{glsentryuservi}} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentrydescplural}[1]{% -\protected@edef\@glo@text{\csname glo@#1@descplural\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} + \@gls@link[#1]{#2}{\mfirstucMakeUppercase{\glsentryuservi{#2}#3}}% + }% +} % \end{macrocode} -%\end{macro} % -% Get the entry text, as specified by the \gloskey{text} key when -% the entry was defined. The argument -% is the label associated with the entry: -%\begin{macro}{\glsentrytext} +% Now deal with acronym related keys. First the short form: +%\begin{macro}{\acrshort} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname} +\newrobustcmd*{\acrshort}{\@ifstar\s@acrshort\ns@acrshort} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentrytext} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentrytext}[1]{% -\protected@edef\@glo@text{\csname glo@#1@text\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newcommand*{\s@acrshort}[2][]{% + \new@ifnextchar[{\@acrshort{hyper=false,#1}{#2}}% + {\@acrshort{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -% Get the plural form: -%\begin{macro}{\glsentryplural} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname} +\newcommand*{\ns@acrshort}[2][]{% + \new@ifnextchar[{\@acrshort{#1}{#2}}{\@acrshort{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryplural} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentryplural}[1]{% -\protected@edef\@glo@text{\csname glo@#1@plural\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\def\@acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -% Get the symbol associated with this entry. The argument -% is the label associated with the entry. Note that unless you -% used \texttt{symbol=false} in the \pkgopt{sanitize} package -% option you may get unexpected results if the \gloskey{symbol} -% key contained any commands. -%\begin{macro}{\glsentrysymbol} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentryshort{#2}}#3% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrysymbol} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentrysymbol}[1]{% -\protected@edef\@glo@text{\csname glo@#1@symbol\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\end{macro} -% Plural form: -%\begin{macro}{\glsentrysymbolplural} -%\changes{1.12}{2008 Mar 8}{New} +% +%\begin{macro}{\Acrshort} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsentrysymbolplural}[1]{% -\csname glo@#1@symbolplural\endcsname} +\newrobustcmd*{\Acrshort}{\@ifstar\s@Acrshort\ns@Acrshort} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentrysymbolplural} -%\changes{1.12}{2008 Mar 8}{New} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentrysymbolplural}[1]{% -\protected@edef\@glo@text{\csname glo@#1@symbolplural\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newcommand*{\s@Acrshort}[2][]{% + \new@ifnextchar[{\@Acrshort{hyper=false,#1}{#2}}% + {\@Acrshort{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -% Get the entry text to be used when the entry is first used in -% the document (as specified by the \gloskey{first} key when -% the entry was defined). -%\begin{macro}{\glsentryfirst} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} +\newcommand*{\ns@Acrshort}[2][]{% + \new@ifnextchar[{\@Acrshort{#1}{#2}}{\@Acrshort{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryfirst} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentryfirst}[1]{% -\protected@edef\@glo@text{\csname glo@#1@first\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\def\@Acrshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -% Get the plural form (as specified by the \gloskey{firstplural} -% key when the entry was defined). -%\begin{macro}{\glsentryfirstplural} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\newcommand*{\glsentryfirstplural}[1]{% -\csname glo@#1@firstpl\endcsname} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentryshort{#2}}#3% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryfirstplural} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentryfirstplural}[1]{% -\protected@edef\@glo@text{\csname glo@#1@firstpl\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\end{macro} % -% Display the glossary type with which this entry is associated -% (as specified by the \gloskey{type} key used when the entry was -% defined) -%\begin{macro}{\glsentrytype} +%\begin{macro}{\ACRshort} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname} +\newrobustcmd*{\ACRshort}{\@ifstar\s@ACRshort\ns@ACRshort} % \end{macrocode} %\end{macro} -% -% Display the sort text used for this entry. Note that the -% \gloskey{sort} key is sanitize, so unexpected results may -% occur if the \gloskey{sort} key contained commands. -%\begin{macro}{\glsentrysort} +% Define the starred form: % \begin{macrocode} -\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname} +\newcommand*{\s@ACRshort}[2][]{% + \new@ifnextchar[{\@ACRshort{hyper=false,#1}{#2}}% + {\@ACRshort{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryuseri} -% Get the first user key (as specified by the -% \gloskey{user1} when the entry was defined). The argument -% is the label associated with the entry. -%\changes{2.04}{2009 November 10}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentryuseri}[1]{\csname glo@#1@useri\endcsname} +\newcommand*{\ns@ACRshort}[2][]{% + \new@ifnextchar[{\@ACRshort{#1}{#2}}{\@ACRshort{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryuseri} -%\changes{2.04}{2009 November 10}{new} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentryuseri}[1]{% -\protected@edef\@glo@text{\csname glo@#1@useri\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\def\@ACRshort#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryuserii} -% Get the second user key (as specified by the -% \gloskey{user2} when the entry was defined). The argument -% is the label associated with the entry. -%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\newcommand*{\glsentryuserii}[1]{\csname glo@#1@userii\endcsname} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshort{#2}}#3}% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryuserii} -%\changes{2.04}{2009 November 10}{new} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentryuserii}[1]{% -\protected@edef\@glo@text{\csname glo@#1@userii\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsentryuseriii} -% Get the third user key (as specified by the -% \gloskey{user3} when the entry was defined). The argument -% is the label associated with the entry. -%\changes{2.04}{2009 November 10}{new} +% Short plural: +%\begin{macro}{\acrshortpl} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsentryuseriii}[1]{\csname glo@#1@useriii\endcsname} +\newrobustcmd*{\acrshortpl}{\@ifstar\s@acrshortpl\ns@acrshortpl} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentryuseriii} -%\changes{2.04}{2009 November 10}{new} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentryuseriii}[1]{% -\protected@edef\@glo@text{\csname glo@#1@useriii\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newcommand*{\s@acrshortpl}[2][]{% + \new@ifnextchar[{\@acrshortpl{hyper=false,#1}{#2}}% + {\@acrshortpl{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryuseriv} -% Get the fourth user key (as specified by the -% \gloskey{user4} when the entry was defined). The argument -% is the label associated with the entry. -%\changes{2.04}{2009 November 10}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentryuseriv}[1]{\csname glo@#1@useriv\endcsname} +\newcommand*{\ns@acrshortpl}[2][]{% + \new@ifnextchar[{\@acrshortpl{#1}{#2}}{\@acrshortpl{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryuseriv} -%\changes{2.04}{2009 November 10}{new} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentryuseriv}[1]{% -\protected@edef\@glo@text{\csname glo@#1@useriv\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\def\@acrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryuserv} -% Get the fifth user key (as specified by the -% \gloskey{user5} when the entry was defined). The argument -% is the label associated with the entry. -%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\newcommand*{\glsentryuserv}[1]{\csname glo@#1@userv\endcsname} + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentryshortpl{#2}}#3% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryuserv} -%\changes{2.04}{2009 November 10}{new} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentryuserv}[1]{% -\protected@edef\@glo@text{\csname glo@#1@userv\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsentryuservi} -% Get the sixth user key (as specified by the -% \gloskey{user6} when the entry was defined). The argument -% is the label associated with the entry. -%\changes{2.04}{2009 November 10}{new} +%\begin{macro}{\Acrshortpl} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsentryuservi}[1]{\csname glo@#1@uservi\endcsname} +\newrobustcmd*{\Acrshortpl}{\@ifstar\s@Acrshortpl\ns@Acrshortpl} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentryuservi} -%\changes{2.04}{2009 November 10}{new} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentryuservi}[1]{% -\protected@edef\@glo@text{\csname glo@#1@uservi\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newcommand*{\s@Acrshortpl}[2][]{% + \new@ifnextchar[{\@Acrshortpl{hyper=false,#1}{#2}}% + {\@Acrshortpl{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryshort} -% Get the short key (as specified by the -% \gloskey{short} the entry was defined). The argument -% is the label associated with the entry. -%\changes{3.0}{2011/04/02}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentryshort}[1]{\csname glo@#1@short\endcsname} +\newcommand*{\ns@Acrshortpl}[2][]{% + \new@ifnextchar[{\@Acrshortpl{#1}{#2}}{\@Acrshortpl{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryshort} -%\changes{3.0}{2011/04/02}{new} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentryshort}[1]{% -\protected@edef\@glo@text{\csname glo@#1@short\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\def\@Acrshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentryshortpl} -% Get the short plural key (as specified by the -% \gloskey{shortplural} the entry was defined). The argument -% is the label associated with the entry. -%\changes{3.0}{2011/04/02}{new} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\newcommand*{\glsentryshortpl}[1]{\csname glo@#1@shortpl\endcsname} + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentryshortpl{#2}}#3% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryshortpl} -%\changes{3.0}{2011/04/02}{new} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentryshortpl}[1]{% -\protected@edef\@glo@text{\csname glo@#1@shortpl\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsentrylong} -% Get the long key (as specified by the -% \gloskey{long} the entry was defined). The argument -% is the label associated with the entry. -%\changes{3.0}{2011/04/02}{new} +%\begin{macro}{\ACRshortpl} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsentrylong}[1]{\csname glo@#1@long\endcsname} +\newrobustcmd*{\ACRshortpl}{\@ifstar\s@ACRshortpl\ns@ACRshortpl} % \end{macrocode} %\end{macro} -%\begin{macro}{\Glsentrylong} -%\changes{3.0}{2011/04/02}{new} +% Define the starred form: % \begin{macrocode} -\newcommand*{\Glsentrylong}[1]{% -\protected@edef\@glo@text{\csname glo@#1@long\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\newcommand*{\s@ACRshortpl}[2][]{% + \new@ifnextchar[{\@ACRshortpl{hyper=false,#1}{#2}}% + {\@ACRshortpl{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentrylongpl} -% Get the long plural key (as specified by the -% \gloskey{longplural} the entry was defined). The argument -% is the label associated with the entry. -%\changes{3.0}{2011/04/02}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glsentrylongpl}[1]{\csname glo@#1@longpl\endcsname} +\newcommand*{\ns@ACRshortpl}[2][]{% + \new@ifnextchar[{\@ACRshortpl{#1}{#2}}{\@ACRshortpl{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentrylongpl} -%\changes{3.0}{2011/04/02}{new} +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\Glsentrylongpl}[1]{% -\protected@edef\@glo@text{\csname glo@#1@longpl\endcsname}% -\expandafter\makefirstuc\expandafter{\@glo@text}} +\def\@ACRshortpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -% Short cut macros to access full form: -%\begin{macro}{\glsentryfull} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\newcommand*{\glsentryfull}[1]{% - \glsentrylong{#1}\space(\glsentryshort{#1})% -} + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentryshortpl{#2}}#3}% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryfull} -%\changes{3.02}{2012/05/21}{fixed bug (replaced \cs{glsentryshortpl} -%with \cs{glsentryshort})} +% Call \cs{@gls@link} % \begin{macrocode} -\newcommand*{\Glsentryfull}[1]{% - \Glsentrylong{#1}\space(\glsentryshort{#1})% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% } % \end{macrocode} +% +%\begin{macro}{\acrlong} +%\changes{3.01}{2011/04/12}{made robust} +% \begin{macrocode} +\newrobustcmd*{\acrlong}{\@ifstar\s@acrlong\ns@acrlong} +% \end{macrocode} %\end{macro} -%\begin{macro}{\glsentryfullpl} -%\changes{3.02}{2012/05/21}{fixed bug (replaced \cs{glsentryshort} -%with \cs{glsentryshortpl})} +% Define the starred form: % \begin{macrocode} -\newcommand*{\glsentryfullpl}[1]{% - \glsentrylongpl{#1}\space(\glsentryshortpl{#1})% +\newcommand*{\s@acrlong}[2][]{% + \new@ifnextchar[{\@acrlong{hyper=false,#1}{#2}}% + {\@acrlong{hyper=false,#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -%\begin{macro}{\Glsentryfullpl} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\Glsentryfullpl}[1]{% - \Glsentrylongpl{#1}\space(\glsentryshortpl{#1})% +\newcommand*{\ns@acrlong}[2][]{% + \new@ifnextchar[{\@acrlong{#1}{#2}}{\@acrlong{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentrynumberlist} -%\changes{3.02}{2012/05/21}{new} -%Displays the number list as is. +% Read in the final optional argument: % \begin{macrocode} -\newcommand*{\glsentrynumberlist}[1]{% - \glsdoifexists{#1}% +\def\@acrlong#1#2[#3]{% + \glsdoifexists{#2}% {% - \csname glo@#1@numberlist\endcsname - }% -} + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsdisplaynumberlist} -%\changes{3.02}{2012/05/21}{new} -% Formats the number list for the given entry label. -% Doesn't work with hyperref. +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\@ifpackageloaded{hyperref} -{% - \newcommand*{\glsdisplaynumberlist}[1]{% - \GlossariesWarning - {% - \string\glsdisplaynumberlist\space - doesn't work with hyperref.^^JUsing - \string\glsentrynumberlist\space instead% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentrylong{#2}}#3% }% - \glsentrynumberlist{#1}% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% -}% -{% - \newcommand*{\glsdisplaynumberlist}[1]{% - \glsdoifexists{#1}% - {% - \bgroup - \def\@glo@label{#1}% - \let\@org@glsnumberformat\glsnumberformat - \def\glsnumberformat##1{##1}% - \protected@edef\the@numberlist{\csname glo@\@glo@label @numberlist\endcsname}% - \def\@gls@numlist@sep{}% - \def\@gls@numlist@nextsep{}% - \def\@gls@numlist@lastsep{}% - \def\@gls@thislist{}% - \def\@gls@donext@def{}% - \renewcommand\do[1]{% - \protected@edef\@gls@thislist{% - \@gls@thislist - \noexpand\@gls@numlist@sep - ##1% - }% - \let\@gls@numlist@sep\@gls@numlist@nextsep - \def\@gls@numlist@nextsep{\glsnumlistsep}% - \@gls@donext@def - \def\@gls@donext@def{% - \def\@gls@numlist@lastsep{\glsnumlistlastsep}% - }% - }% - \expandafter \glsnumlistparser \expandafter{\the@numberlist}% - \let\@gls@numlist@sep\@gls@numlist@lastsep - \@gls@thislist - \egroup - }% - } } % \end{macrocode} -%\end{macro} % -%\begin{macro}{\glsnumlistsep} -%\changes{3.02}{21012/05/19}{new} +%\begin{macro}{\Acrlong} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\glsnumlistsep}{, } +\newrobustcmd*{\Acrlong}{\@ifstar\s@Acrlong\ns@Acrlong} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsnumlistlastsep} -%\changes{3.02}{21012/05/19}{new} +% Define the starred form: % \begin{macrocode} -\newcommand*{\glsnumlistlastsep}{ \& } +\newcommand*{\s@Acrlong}[2][]{% + \new@ifnextchar[{\@Acrlong{hyper=false,#1}{#2}}% + {\@Acrlong{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glshyperlink} -% Provide a hyperlink to a glossary entry without adding information -% to the glossary file. The entry needs to be added using a -% command like \ics{glslink} or \ics{glsadd} to ensure that -% the target is defined. The first (optional) argument specifies -% the link text. The entry name is used by default. The second -% argument is the entry label. -%\changes{1.17}{2008 December 26}{new} -%\changes{3.0}{2011/04/02}{changed default from \cs{glsentryname} -%to \cs{glsentrytext}} +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% -\def\@glo@label{#2}% -\@glslink{\glolinkprefix#2}{#1}} +\newcommand*{\ns@Acrlong}[2][]{% + \new@ifnextchar[{\@Acrlong{#1}{#2}}{\@Acrlong{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\subsection{Adding an entry to the glossary without generating -% text} -% The following keys are provided for \cs{glsadd} and -% \cs{glsaddall}: +% Read in the final optional argument: % \begin{macrocode} -\define@key{glossadd}{counter}{\def\@gls@counter{#1}} +\def\@Acrlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\changes{2.07}{2010 Jul 10}{glssadd format key stored in \cs{@glsnumberformat} -%(was mistakenly stored in \cs{@glo@format})} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\define@key{glossadd}{format}{\def\@glsnumberformat{#1}} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentrylong{#2}}#3% + }% % \end{macrocode} -% This key is only used by \cs{glsaddall}: +% Call \cs{@gls@link} % \begin{macrocode} -\define@key{glossadd}{types}{\def\@glo@type{#1}} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\vskip5pt -%\cs{glsadd}\oarg{options}\marg{label}\\[10pt] -% Add a term to the glossary without generating any link text. -% The optional argument indicates which counter to use, -% and how to format it (using a key-value list) -% the second argument is the entry label. Note that \meta{options} -% only has two keys: \gloskey[glsadd]{counter} and \gloskey[glsadd]{format} (the \gloskey[glsaddall]{types} key will be ignored). -%\begin{macro}{\glsadd} -%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} -%\changes{2.04}{2009 November 10}{fixed bug that ignored counter} +% +%\begin{macro}{\ACRlong} %\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newrobustcmd*{\glsadd}[2][]{% - \glsdoifexists{#2}% - {% - \def\@glsnumberformat{glsnumberformat}% - \edef\@gls@counter{\csname glo@#2@counter\endcsname}% - \setkeys{glossadd}{#1}% -% \end{macrocode} -% Store the entry's counter in \cs{theglsentrycounter} -%\changes{3.0}{2011/04/02}{added \cs{@gls@saveentrycounter}} -% \begin{macrocode} - \@gls@saveentrycounter - \@do@wrglossary{#2}% - }% -} +\newrobustcmd*{\ACRlong}{\@ifstar\s@ACRlong\ns@ACRlong} % \end{macrocode} %\end{macro} -%\vskip5pt -%\cs{glsaddall}\oarg{option list}\\[10pt] -% Add all terms defined for the listed glossaries (without displaying -% any text). If \gloskey[glsaddall]{types} key is omitted, apply to all -% glossary types. -%\begin{macro}{\glsaddall} -%\changes{3.01}{2011/04/12}{made robust} +% Define the starred form: % \begin{macrocode} -\newrobustcmd*{\glsaddall}[1][]{% -\edef\@glo@type{\@glo@types}% -\setkeys{glossadd}{#1}% -\forallglsentries[\@glo@type]{\@glo@entry}{% -\glsadd[#1]{\@glo@entry}}% +\newcommand*{\s@ACRlong}[2][]{% + \new@ifnextchar[{\@ACRlong{hyper=false,#1}{#2}}% + {\@ACRlong{hyper=false,#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\subsection{Creating associated files} -% The \cs{writeist} command creates the associated -% customized \filetype{.ist} \app{makeindex} style file. -% While defining this command, some characters have their -% catcodes temporarily changed to ensure they get written to -% the \filetype{.ist} file correctly. The \app{makeindex} -% actual character (usually "@") is redefined to be a "?", to allow -% internal commands to be written to the glossary file output file. -% -% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar}, -% \cs{@gls@encapchar}, \cs{@glsl@levelchar} and -% \cs{@gls@quotechar} to make them easier to use later, -% but don't change these values, because the characters are -% encoded in the command definitions that are used to escape -% the special characters (which means that the user no longer -% needs to worry about \app{makeindex} special characters). -% -% The symbols and numbers label for group headings are hardwired into -% the \filetype{.ist} file as \texttt{glssymbols} and -% \texttt{glsnumbers}, the group titles can be translated -% (so that \ics{glssymbolsgroupname} replaces \texttt{glssymbols} -% and \ics{glsnumbersgroupname} replaces \texttt{glsnumbers}) -% using the command \ics{glsgetgrouptitle} which is -% defined in \isty{glossary-hypernav}. This is done to prevent -% any problem characters in \ics{glssymbolsgroupname} -% and \ics{glsnumbersgroupname} from breaking hyperlinks. -% -%\begin{macro}{\glsopenbrace} -% Define \cs{glsopenbrace} to make it easier to write an opening -% brace to a file. +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\edef\glsopenbrace{\expandafter\@gobble\string\{} +\newcommand*{\ns@ACRlong}[2][]{% + \new@ifnextchar[{\@ACRlong{#1}{#2}}{\@ACRlong{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsclosebrace} -% Define \cs{glsclosebrace} to make it easier to write an opening -% brace to a file. +% Read in the final optional argument: % \begin{macrocode} -\edef\glsclosebrace{\expandafter\@gobble\string\}} +\def\@ACRlong#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsquote} -% Define command that makes it easier to write quote marks to -% a file in the event that the double quote character has been -% made active. +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\edef\glsquote#1{\string"#1\string"} + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentrylong{#2}}#3}% + }% +% \end{macrocode} +% Call \cs{@gls@link} +% \begin{macrocode} + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\@glsfirstletter} -% Define the first letter to come after the digits 0,\ldots,9. -% Only required for \app{xindy}. +% Short plural: +%\begin{macro}{\acrlongpl} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\ifglsxindy - \newcommand*{\@glsfirstletter}{A} -\fi +\newrobustcmd*{\acrlongpl}{\@ifstar\s@acrlongpl\ns@acrlongpl} % \end{macrocode} %\end{macro} -%\begin{macro}{\GlsSetXdyFirstLetterAfterDigits} -% Sets the first letter to come after the digits 0,\ldots,9. +% Define the starred form: % \begin{macrocode} -\ifglsxindy - \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{% - \renewcommand*{\@glsfirstletter}{#1}} -\else - \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{% - \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits} -\fi +\newcommand*{\s@acrlongpl}[2][]{% + \new@ifnextchar[{\@acrlongpl{hyper=false,#1}{#2}}% + {\@acrlongpl{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glsminrange} -% Define the minimum number of successive location references -% to merge into a range. +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} -\newcommand*{\@glsminrange}{2} +\newcommand*{\ns@acrlongpl}[2][]{% + \new@ifnextchar[{\@acrlongpl{#1}{#2}}{\@acrlongpl{#1}{#2}[]}% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\GlsSetXdyMinRangeLength} -% Set the minimum range length. The value must either be "none" -% or a positive integer. The \sty{glossaries} package doesn't -% check if the argument is valid, that is left to \app{xindy}. +% Read in the final optional argument: % \begin{macrocode} -\ifglsxindy - \newcommand*{\GlsSetXdyMinRangeLength}[1]{% - \renewcommand*{\@glsminrange}{#1}} -\else - \newcommand*{\GlsSetXdyMinRangeLength}[1]{% - \glsnoxindywarning\GlsSetXdyMinRangeLength} -\fi +\def\@acrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -%\end{macro} - -%\begin{macro}{\writeist} -%\changes{1.17}{2008 December 26}{added xindy support} -%\changes{1.01}{2007 May 17}{Added spaces after 'delimN and 'delimR in ist file}% -%\changes{3.0}{2011/04/02}{modified to support new format} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} -\ifglsxindy + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsentrylongpl{#2}}#3% + }% % \end{macrocode} -% Code to use if \app{xindy} is required. +% Call \cs{@gls@link} % \begin{macrocode} - \def\writeist{% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -% Update attributes list +% +%\begin{macro}{\Acrlongpl} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} - \@gls@addpredefinedattributes +\newrobustcmd*{\Acrlongpl}{\@ifstar\s@Acrlongpl\ns@Acrlongpl} % \end{macrocode} -% Open the file. +%\end{macro} +% Define the starred form: % \begin{macrocode} - \openout\glswrite=\istfilename +\newcommand*{\s@Acrlongpl}[2][]{% + \new@ifnextchar[{\@Acrlongpl{hyper=false#1}{#2}}% + {\@Acrlongpl{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -% Write header comment at the start of the file +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \write\glswrite{;; xindy style file created by the glossaries - package}% - \write\glswrite{;; for document '\jobname' on - \the\year-\the\month-\the\day}% +\newcommand*{\ns@Acrlongpl}[2][]{% + \new@ifnextchar[{\@Acrlongpl{#1}{#2}}{\@Acrlongpl{#1}{#2}[]}% +} % \end{macrocode} -% Specify the required styles +% Read in the final optional argument: % \begin{macrocode} - \write\glswrite{^^J; required styles^^J} - \@for\@xdystyle:=\@xdyrequiredstyles\do{% - \ifx\@xdystyle\@empty - \else - \protected@write\glswrite{}{(require - \string"\@xdystyle.xdy\string")}% - \fi +\def\@Acrlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% +% \end{macrocode} +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} +% \begin{macrocode} + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\Glsentrylongpl{#2}}#3% }% % \end{macrocode} -% List the allowed attributes (possible values used by the -% \gloskey{format} key) +% Call \cs{@gls@link} % \begin{macrocode} - \write\glswrite{^^J% - ; list of allowed attributes (number formats)^^J}% - \write\glswrite{(define-attributes ((\@xdyattributes)))}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -% Define any additional alphabets +% +%\begin{macro}{\ACRlongpl} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} - \write\glswrite{^^J; user defined alphabets^^J}% - \write\glswrite{\@xdyuseralphabets}% +\newrobustcmd*{\ACRlongpl}{\@ifstar\s@ACRlongpl\ns@ACRlongpl} % \end{macrocode} -% Define location classes. +%\end{macro} +% Define the starred form: % \begin{macrocode} - \write\glswrite{^^J; location class definitions^^J}% +\newcommand*{\s@ACRlongpl}[2][]{% + \new@ifnextchar[{\@ACRlongpl{hyper=false,#1}{#2}}% + {\@ACRlongpl{hyper=false,#1}{#2}[]}% +} % \end{macrocode} -% As from version 3.0, locations are now specified as -% \marg{Hprefix}\marg{number}, so need to add all possible -% combinations of location types. +% Defined the un-starred form. Need to determine if there is +% a final optional argument % \begin{macrocode} - \@for\@gls@classI:=\@gls@xdy@locationlist\do{% +\newcommand*{\ns@ACRlongpl}[2][]{% + \new@ifnextchar[{\@ACRlongpl{#1}{#2}}{\@ACRlongpl{#1}{#2}[]}% +} % \end{macrocode} -% Case were \meta{Hprefix} is empty: +% Read in the final optional argument: % \begin{macrocode} - \protected@write\glswrite{}{(define-location-class - \string"\@gls@classI\string"^^J\space\space\space - ( - :sep "{}{" - \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space - :sep "}" - ) - ^^J\space\space\space - :min-range-length \@glsminrange^^J% - ) - }% +\def\@ACRlongpl#1#2[#3]{% + \glsdoifexists{#2}% + {% + \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Nested iteration over all classes: +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - {% - \@for\@gls@classII:=\@gls@xdy@locationlist\do{% - \protected@write\glswrite{}{(define-location-class - \string"\@gls@classII-\@gls@classI\string" - ^^J\space\space\space - ( - :sep "{" - \csname @gls@xdy@Lclass@\@gls@classII\endcsname\space - :sep "}{" - \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space - :sep "}" - ) - ^^J\space\space\space - :min-range-length \@glsminrange^^J% - ) - }% - }% - }% + \def\glslabel{#2}% + \let\glsifplural\@firstoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \mfirstucMakeUppercase{\acronymfont{\glsentrylongpl{#2}}#3}% }% % \end{macrocode} -% User defined location classes (needs checking for new location format). +% Call \cs{@gls@link} % \begin{macrocode} - \write\glswrite{^^J; user defined location classes}% - \write\glswrite{\@xdyuserlocationdefs}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% + }% +} % \end{macrocode} -% Cross-reference class. (The unverified option is used as the -% cross-references are supplied using the list of labels along with -% the optional argument for \ics{glsseeformat} which -% \app{xindy} won't recognise.) +% +% \subsubsection{Displaying entry details without adding +% information to the glossary} +%\label{sec:code:glsnolink} +% +% These commands merely display entry information without adding +% entries in the associated file or having hyperlinks. +% +% Get the entry name (as specified by the \gloskey{name} key +% 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 contains +% any commands. +%\begin{macro}{\glsentryname} % \begin{macrocode} - \write\glswrite{^^J; define cross-reference class^^J}% - \write\glswrite{(define-crossref-class \string"see\string" - :unverified )}% +\newcommand*{\glsentryname}[1]{\csname glo@#1@name\endcsname} % \end{macrocode} -% Define how cross-references should be displayed. This adds an -% empty set of braces after the cross-referencing information -% allowing for the final argument of \cs{glsseeformat} which -% gets ignored. (When using \app{makeindex} this final argument -% contains the location information which is not required.) +%\end{macro} +%\begin{macro}{\Glsentryname} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{(markup-crossref-list - :class \string"see\string"^^J\space\space\space - :open \string"\string\glsseeformat\string" - :close \string"{}\string")}% +\newrobustcmd*{\Glsentryname}[1]{% + \protected@edef\@glo@text{\csname glo@#1@name\endcsname}% + \expandafter\makefirstuc\expandafter{\@glo@text}% +} % \end{macrocode} -% List the order to sort the classes. +%\end{macro} +% +% Get the entry description (as specified by the +% \gloskey{description} when the entry was defined). The argument +% is the label associated with the entry. Note that unless you +% used \texttt{description=false} in the \pkgopt{sanitize} package +% option you may get unexpected results if the \gloskey{description} +% key contained any commands. +%\begin{macro}{\glsentrydesc} % \begin{macrocode} - \write\glswrite{^^J; define the order of the location classes}% - \write\glswrite{(define-location-class-order - (\@xdylocationclassorder))}% +\newcommand*{\glsentrydesc}[1]{\csname glo@#1@desc\endcsname} % \end{macrocode} -% Specify what to write to the start and end of the glossary file. +%\end{macro} +%\begin{macro}{\Glsentrydesc} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{^^J; define the glossary markup^^J}% +\newrobustcmd*{\Glsentrydesc}[1]{% + \protected@edef\@glo@text{\csname glo@#1@desc\endcsname}% + \expandafter\makefirstuc\expandafter{\@glo@text}% +} % \end{macrocode} -%\changes{3.0}{2011/04/02}{added xindy-only macro definitions to -%glossary open tag} +%\end{macro} +% Plural form: +%\begin{macro}{\glsentrydescplural} +%\changes{1.12}{2008 Mar 8}{New} % \begin{macrocode} - \write\glswrite{(markup-index^^J\space\space\space - :open \string"\string - \glossarysection[\string\glossarytoctitle]{\string - \glossarytitle}\string\glossarypreamble}% +\newcommand*{\glsentrydescplural}[1]{% + \csname glo@#1@descplural\endcsname} % \end{macrocode} -% Add all the xindy-only macro definitions (needed to prevent errors -% in the event that the user changes from \pkgopt{xindy} to -% \pkgopt{makeindex}) +%\end{macro} +%\begin{macro}{\Glsentrydescplural} +%\changes{1.12}{2008 Mar 8}{New} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \@for\@this@ctr:=\@xdycounters\do{% - {% - \@for\@this@attr:=\@xdyattributelist\do{% - \protected@write\glswrite{}{\string\providecommand*% - \expandafter\string - \csname glsX\@this@ctr X\@this@attr\endcsname[2]% - {% - \string\setentrycounter - [\expandafter\@gobble\string\#1]{\@this@ctr}% - \expandafter\string - \csname\@this@attr\endcsname - {\expandafter\@gobble\string\#2}% - }% - }% - }% - }% - }% +\newrobustcmd*{\Glsentrydescplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@descplural\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Add the end part of the open tag and the rest of the markup-index -% information: +%\end{macro} +% +% Get the entry text, as specified by the \gloskey{text} key when +% the entry was defined. The argument +% is the label associated with the entry: +%\begin{macro}{\glsentrytext} % \begin{macrocode} - \write\glswrite{% - \string\begin - {theglossary}\string\glossaryheader\string~n\string" ^^J\space - \space\space:close \string"\expandafter\@gobble - \string\%\string~n\string - \end{theglossary}\string\glossarypostamble - \string~n\string" ^^J\space\space\space - :tree)}% +\newcommand*{\glsentrytext}[1]{\csname glo@#1@text\endcsname} % \end{macrocode} -% Specify what to put between letter groups +%\end{macro} +%\begin{macro}{\Glsentrytext} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{(markup-letter-group-list - :sep \string"\string\glsgroupskip\string~n\string")}% +\newrobustcmd*{\Glsentrytext}[1]{% + \protected@edef\@glo@text{\csname glo@#1@text\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Specify what to put between entries +%\end{macro} +% +% Get the plural form: +%\begin{macro}{\glsentryplural} % \begin{macrocode} - \write\glswrite{(markup-indexentry - :open \string"\string\relax \string\glsresetentrylist - \string~n\string")}% +\newcommand*{\glsentryplural}[1]{\csname glo@#1@plural\endcsname} % \end{macrocode} -% Specify how to format entries +%\end{macro} +%\begin{macro}{\Glsentryplural} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{(markup-locclass-list :open - \string"\glsopenbrace\string\glossaryentrynumbers - \glsopenbrace\string\relax\space \string"^^J\space\space\space - :sep \string", \string" - :close \string"\glsclosebrace\glsclosebrace\string")}% +\newrobustcmd*{\Glsentryplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@plural\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Specify how to separate location numbers +%\end{macro} +% +% Get the symbol associated with this entry. The argument +% is the label associated with the entry. Note that unless you +% used \texttt{symbol=false} in the \pkgopt{sanitize} package +% option you may get unexpected results if the \gloskey{symbol} +% key contained any commands. +%\begin{macro}{\glsentrysymbol} % \begin{macrocode} - \write\glswrite{(markup-locref-list - :sep \string"\string\delimN\space\string")}% +\newcommand*{\glsentrysymbol}[1]{\csname glo@#1@symbol\endcsname} % \end{macrocode} -% Specify how to indicate location ranges +%\end{macro} +%\begin{macro}{\Glsentrysymbol} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{(markup-range - :sep \string"\string\delimR\space\string")}% +\newrobustcmd*{\Glsentrysymbol}[1]{% +\protected@edef\@glo@text{\csname glo@#1@symbol\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Specify 2-page and 3-page suffixes, if defined. -% First, the values must be sanitized to write them explicity. +%\end{macro} +% Plural form: +%\begin{macro}{\glsentrysymbolplural} +%\changes{1.12}{2008 Mar 8}{New} % \begin{macrocode} - \@onelevel@sanitize\gls@suffixF - \@onelevel@sanitize\gls@suffixFF +\newcommand*{\glsentrysymbolplural}[1]{% + \csname glo@#1@symbolplural\endcsname} % \end{macrocode} +%\end{macro} +%\begin{macro}{\Glsentrysymbolplural} +%\changes{1.12}{2008 Mar 8}{New} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \ifx\gls@suffixF\@empty - \else - \write\glswrite{(markup-range - :close "\gls@suffixF" :length 1 :ignore-end)}% - \fi - \ifx\gls@suffixFF\@empty - \else - \write\glswrite{(markup-range - :close "\gls@suffixFF" :length 2 :ignore-end)}% - \fi +\newrobustcmd*{\Glsentrysymbolplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@symbolplural\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Specify how to format locations. +%\end{macro} +% +% Get the entry text to be used when the entry is first used in +% the document (as specified by the \gloskey{first} key when +% the entry was defined). +%\begin{macro}{\glsentryfirst} % \begin{macrocode} - \write\glswrite{^^J; define format to use for locations^^J}% - \write\glswrite{\@xdylocref}% +\newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} % \end{macrocode} -% Specify how to separate letter groups. +%\end{macro} +%\begin{macro}{\Glsentryfirst} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{^^J; define letter group list format^^J}% - \write\glswrite{(markup-letter-group-list - :sep \string"\string\glsgroupskip\string~n\string")}% +\newrobustcmd*{\Glsentryfirst}[1]{% +\protected@edef\@glo@text{\csname glo@#1@first\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Define letter group headings. +%\end{macro} +% +% Get the plural form (as specified by the \gloskey{firstplural} +% key when the entry was defined). +%\begin{macro}{\glsentryfirstplural} % \begin{macrocode} - \write\glswrite{^^J; letter group headings^^J}% - \write\glswrite{(markup-letter-group - :open-head \string"\string\glsgroupheading - \glsopenbrace\string"^^J\space\space\space - :close-head \string"\glsclosebrace\string")}% +\newcommand*{\glsentryfirstplural}[1]{% + \csname glo@#1@firstpl\endcsname} % \end{macrocode} -% Define additional letter groups. +%\end{macro} +%\begin{macro}{\Glsentryfirstplural} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \write\glswrite{^^J; additional letter groups^^J}% - \write\glswrite{\@xdylettergroups}% +\newrobustcmd*{\Glsentryfirstplural}[1]{% +\protected@edef\@glo@text{\csname glo@#1@firstpl\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Define additional sort rules +%\end{macro} +% +% Display the glossary type with which this entry is associated +% (as specified by the \gloskey{type} key used when the entry was +% defined) +%\begin{macro}{\glsentrytype} % \begin{macrocode} - \write\glswrite{^^J; additional sort rules^^J} - \write\glswrite{\@xdysortrules}% +\newcommand*{\glsentrytype}[1]{\csname glo@#1@type\endcsname} % \end{macrocode} -% Close the style file +%\end{macro} +% +% Display the sort text used for this entry. Note that the +% \gloskey{sort} key is sanitize, so unexpected results may +% occur if the \gloskey{sort} key contained commands. +%\begin{macro}{\glsentrysort} % \begin{macrocode} - \closeout\glswrite +\newcommand*{\glsentrysort}[1]{\csname glo@#1@sort\endcsname} % \end{macrocode} -% Suppress any further calls. +%\end{macro} +% +%\begin{macro}{\glsentryuseri} +% Get the first user key (as specified by the +% \gloskey{user1} when the entry was defined). The argument +% is the label associated with the entry. +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} - \let\writeist\relax - } -\else +\newcommand*{\glsentryuseri}[1]{\csname glo@#1@useri\endcsname} % \end{macrocode} -% Code to use if \app{makeindex} is required. -%\changes{2.01}{2009 May 30}{removed item\_02 - no such makeindex key} +%\end{macro} +%\begin{macro}{\Glsentryuseri} +%\changes{2.04}{2009 November 10}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \edef\@gls@actualchar{\string?} - \edef\@gls@encapchar{\string|} - \edef\@gls@levelchar{\string!} - \edef\@gls@quotechar{\string"} - \def\writeist{\relax - \openout\glswrite=\istfilename - \write\glswrite{\expandafter\@gobble\string\% makeindex style file - created by the glossaries package} - \write\glswrite{\expandafter\@gobble\string\% for document - '\jobname' on \the\year-\the\month-\the\day} - \write\glswrite{actual '\@gls@actualchar'} - \write\glswrite{encap '\@gls@encapchar'} - \write\glswrite{level '\@gls@levelchar'} - \write\glswrite{quote '\@gls@quotechar'} - \write\glswrite{keyword \string"\string\\glossaryentry\string"} - \write\glswrite{preamble \string"\string\\glossarysection[\string - \\glossarytoctitle]{\string\\glossarytitle}\string - \\glossarypreamble\string\n\string\\begin{theglossary}\string - \\glossaryheader\string\n\string"} - \write\glswrite{postamble \string"\string\%\string\n\string - \\end{theglossary}\string\\glossarypostamble\string\n - \string"} - \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n - \string"} - \write\glswrite{item_0 \string"\string\%\string\n\string"} - \write\glswrite{item_1 \string"\string\%\string\n\string"} - \write\glswrite{item_2 \string"\string\%\string\n\string"} - \write\glswrite{item_01 \string"\string\%\string\n\string"} - \write\glswrite{item_x1 - \string"\string\\relax \string\\glsresetentrylist\string\n - \string"} - \write\glswrite{item_12 \string"\string\%\string\n\string"} - \write\glswrite{item_x2 - \string"\string\\relax \string\\glsresetentrylist\string\n - \string"} -% \end{macrocode} -%\changes{2.05}{2010 Feb 6}{Added \cs{string} before opening -% and closing braces. Patch provided by Segiu Dotenco} -% \begin{macrocode} - \write\glswrite{delim_0 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_1 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_2 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_t \string"\string\}\string\}\string"} - \write\glswrite{delim_n \string"\string\\delimN \string"} - \write\glswrite{delim_r \string"\string\\delimR \string"} - \write\glswrite{headings_flag 1} - \write\glswrite{heading_prefix - \string"\string\\glsgroupheading\string\{\string"} - \write\glswrite{heading_suffix - \string"\string\}\string\\relax - \string\\glsresetentrylist \string"} - \write\glswrite{symhead_positive \string"glssymbols\string"} - \write\glswrite{numhead_positive \string"glsnumbers\string"} - \write\glswrite{page_compositor \string"\glscompositor\string"} - \@gls@escbsdq\gls@suffixF - \@gls@escbsdq\gls@suffixFF - \ifx\gls@suffixF\@empty - \else - \write\glswrite{suffix_2p \string"\gls@suffixF\string"} - \fi - \ifx\gls@suffixFF\@empty - \else - \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} - \fi - \closeout\glswrite - \let\writeist\relax - } -\fi +\newrobustcmd*{\Glsentryuseri}[1]{% +\protected@edef\@glo@text{\csname glo@#1@useri\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % -%The command \cs{noist} will suppress the creation of -% the \filetype{.ist} file. Obviously you need to use this -% command before \cs{writeist} to have any effect. -%\begin{macro}{\noist} +%\begin{macro}{\glsentryuserii} +% Get the second user key (as specified by the +% \gloskey{user2} when the entry was defined). The argument +% is the label associated with the entry. +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} -\newcommand{\noist}{% +\newcommand*{\glsentryuserii}[1]{\csname glo@#1@userii\endcsname} % \end{macrocode} -% Update attributes list +%\end{macro} +%\begin{macro}{\Glsentryuserii} +%\changes{2.04}{2009 November 10}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \@gls@addpredefinedattributes - \let\writeist\relax -} +\newrobustcmd*{\Glsentryuserii}[1]{% +\protected@edef\@glo@text{\csname glo@#1@userii\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % -% \cs{@makeglossary} is an internal command that takes an -% argument indicating the glossary type. This command will -% create the glossary file required by \app{makeindex} for the -% given glossary type, using the extension supplied by the -% \meta{out-ext} parameter used in \ics{newglossary} -% (and it will also activate the \ics{glossary} command, -% and create the customized \filetype{.ist} \app{makeindex} -% style file). -% -% Note that you can't use \cs{@makeglossary} for only some of the -% defined glossaries. You either need to have a \cs{makeglossary} -% for all glossaries or none (otherwise you will end up with a -% situation where \TeX\ is trying to write to a non-existant -% file). The relevant glossary must be -% defined prior to using \cs{@makeglossary}. -%\begin{macro}{\@makeglossary} +%\begin{macro}{\glsentryuseriii} +% Get the third user key (as specified by the +% \gloskey{user3} when the entry was defined). The argument +% is the label associated with the entry. +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} -\newcommand*{\@makeglossary}[1]{% - \ifglossaryexists{#1}% - {% +\newcommand*{\glsentryuseriii}[1]{\csname glo@#1@useriii\endcsname} % \end{macrocode} -% Only create a new write if \pkgopt[false]{savewrites} otherwise -% create a token to collect the information. -%\changes{3.0}{2010 Jul 12}{Added check for \pkgopt{savewrites}} +%\end{macro} +%\begin{macro}{\Glsentryuseriii} +%\changes{2.04}{2009 November 10}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \ifglssavewrites - \expandafter\newtoks\csname glo@#1@filetok\endcsname - \else - \expandafter\newwrite\csname glo@#1@file\endcsname - \expandafter\@glsopenfile\csname glo@#1@file\endcsname{#1}% - \fi - \@gls@renewglossary - \writeist - }% - {% - \PackageError{glossaries}% - {Glossary type `#1' not defined}% - {New glossaries must be defined before using \string\makeglossary}% - }% -} +\newrobustcmd*{\Glsentryuseriii}[1]{% +\protected@edef\@glo@text{\csname glo@#1@useriii\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\@glsopenfile} -% Open write file associated with the given glossary. +%\begin{macro}{\glsentryuseriv} +% Get the fourth user key (as specified by the +% \gloskey{user4} when the entry was defined). The argument +% is the label associated with the entry. +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} -\newcommand*{\@glsopenfile}[2]{% - \immediate\openout#1=\jobname.\csname @glotype@#2@out\endcsname - \PackageInfo{glossaries}{Writing glossary file - \jobname.\csname @glotype@#2@out\endcsname}% -} +\newcommand*{\glsentryuseriv}[1]{\csname glo@#1@useriv\endcsname} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\warn@nomakeglossaries} -% Issue warning that \cs{makeglossaries} hasn't been used. +%\begin{macro}{\Glsentryuseriv} +%\changes{2.04}{2009 November 10}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} -\newcommand*{\warn@nomakeglossaries}{% - \GlossariesWarningNoLine{\string\makeglossaries\space - hasn't been used,^^Jthe glossaries will not be updated}% -} +\newrobustcmd*{\Glsentryuseriv}[1]{% +\protected@edef\@glo@text{\csname glo@#1@useriv\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % -% \cs{makeglossaries} will use \cs{@makeglossary} -% for each glossary type that has been defined. New glossaries -% need to be defined before using \cs{makeglossary}, so -% have \cs{makeglossaries} redefine \cs{newglossary} -% to prevent it being used afterwards. -%\begin{macro}{\makeglossaries} +%\begin{macro}{\glsentryuserv} +% Get the fifth user key (as specified by the +% \gloskey{user5} when the entry was defined). The argument +% is the label associated with the entry. +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} -\newcommand*{\makeglossaries}{% +\newcommand*{\glsentryuserv}[1]{\csname glo@#1@userv\endcsname} % \end{macrocode} -% Write the name of the style file to the aux file -% (needed by \app{makeglossaries}) +%\end{macro} +%\begin{macro}{\Glsentryuserv} +%\changes{2.04}{2009 November 10}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% - \protected@write\@auxout{}{\string\@glsorder{\glsorder}} +\newrobustcmd*{\Glsentryuserv}[1]{% +\protected@edef\@glo@text{\csname glo@#1@userv\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Iterate through each glossary type and activate it. +%\end{macro} +% +%\begin{macro}{\glsentryuservi} +% Get the sixth user key (as specified by the +% \gloskey{user6} when the entry was defined). The argument +% is the label associated with the entry. +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} - \@for\@glo@type:=\@glo@types\do{% - \ifthenelse{\equal{\@glo@type}{}}{}{% - \@makeglossary{\@glo@type}}% - }% +\newcommand*{\glsentryuservi}[1]{\csname glo@#1@uservi\endcsname} % \end{macrocode} -% New glossaries must be created before \cs{makeglossaries} -% so disable \ics{newglossary}. +%\end{macro} +%\begin{macro}{\Glsentryuservi} +%\changes{2.04}{2009 November 10}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \renewcommand*\newglossary[4][]{% - \PackageError{glossaries}{New glossaries - must be created before \string\makeglossaries}{You need - to move \string\makeglossaries\space after all your - \string\newglossary\space commands}}% +\newrobustcmd*{\Glsentryuservi}[1]{% +\protected@edef\@glo@text{\csname glo@#1@uservi\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Any subsequence instances of this command should have no effect +%\end{macro} +% +%\begin{macro}{\glsentryshort} +% Get the short key (as specified by the +% \gloskey{short} the entry was defined). The argument +% is the label associated with the entry. +%\changes{3.0}{2011/04/02}{new} % \begin{macrocode} - \let\@makeglossary\relax - \let\makeglossary\relax - \let\makeglossaries\relax +\newcommand*{\glsentryshort}[1]{\csname glo@#1@short\endcsname} % \end{macrocode} -% Disable all commands that have no effect after \cs{makeglossaries} +%\end{macro} +%\begin{macro}{\Glsentryshort} +%\changes{3.0}{2011/04/02}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \@disable@onlypremakeg +\newrobustcmd*{\Glsentryshort}[1]{% +\protected@edef\@glo@text{\csname glo@#1@short\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} -% Suppress warning about no \cs{makeglossaries} +%\end{macro} +% +%\begin{macro}{\glsentryshortpl} +% Get the short plural key (as specified by the +% \gloskey{shortplural} the entry was defined). The argument +% is the label associated with the entry. +%\changes{3.0}{2011/04/02}{new} % \begin{macrocode} - \let\warn@nomakeglossaries\relax +\newcommand*{\glsentryshortpl}[1]{\csname glo@#1@shortpl\endcsname} % \end{macrocode} -% Declare list parser for \cs{glsdisplaynumberlist} -%\changes{3.02}{2012/05/21}{added list parser} +%\end{macro} +%\begin{macro}{\Glsentryshortpl} +%\changes{3.0}{2011/04/02}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} - \ifglssavenumberlist - \edef\@gls@dodeflistparser{\noexpand\DeclareListParser - {\noexpand\glsnumlistparser}{\delimN}}% - \@gls@dodeflistparser - \fi -} +\newrobustcmd*{\Glsentryshortpl}[1]{% +\protected@edef\@glo@text{\csname glo@#1@shortpl\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % -% The \cs{makeglossary} command is redefined to be -% identical to \cs{makeglossaries}. (This is done to -% reinforce the message that you must either use -% \cs{@makeglossary} for all the glossaries or for none -% of them.) -%\begin{macro}{\makeglossary} +%\begin{macro}{\glsentrylong} +% Get the long key (as specified by the +% \gloskey{long} the entry was defined). The argument +% is the label associated with the entry. +%\changes{3.0}{2011/04/02}{new} % \begin{macrocode} -\let\makeglossary\makeglossaries +\newcommand*{\glsentrylong}[1]{\csname glo@#1@long\endcsname} % \end{macrocode} %\end{macro} -% -% If \ics{makeglossaries} hasn't been used, issue a warning. -% Also issue a warning if neither \ics{printglossaries} nor -% \ics{printglossary} have been used. +%\begin{macro}{\Glsentrylong} +%\changes{3.0}{2011/04/02}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} -\AtEndDocument{% - \warn@nomakeglossaries - \warn@noprintglossary -} +\newrobustcmd*{\Glsentrylong}[1]{% + \protected@edef\@glo@text{\csname glo@#1@long\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} +%\end{macro} % -%\subsection{Writing information to associated files} -% -% -%\begin{macro}{\glswrite} -% The write used for style file also used for all other output files -% if \pkgopt[true]{savewrites}. +%\begin{macro}{\glsentrylongpl} +% Get the long plural key (as specified by the +% \gloskey{longplural} the entry was defined). The argument +% is the label associated with the entry. +%\changes{3.0}{2011/04/02}{new} % \begin{macrocode} -\newwrite\glswrite +\newcommand*{\glsentrylongpl}[1]{\csname glo@#1@longpl\endcsname} % \end{macrocode} %\end{macro} -%\begin{macro}{\istfile} -%\changes{3.0}{2011/04/02}{deprecated} -% Deprecated. +%\begin{macro}{\Glsentrylongpl} +%\changes{3.0}{2011/04/02}{new} +%\changes{3.09a}{2013-10-09}{made robust} % \begin{macrocode} -\def\istfile{\glswrite} +\newrobustcmd*{\Glsentrylongpl}[1]{% +\protected@edef\@glo@text{\csname glo@#1@longpl\endcsname}% +\expandafter\makefirstuc\expandafter{\@glo@text}} % \end{macrocode} %\end{macro} % -% At the end of the document, the files should be created if -% \pkgopt[true]{savewrites}. +% Short cut macros to access full form: +%\begin{macro}{\glsentryfull} +%\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} % \begin{macrocode} -\AtEndDocument{% - \glswritefiles +\newcommand*{\glsentryfull}[1]{% + \acrfullformat{\glsentrylong{#1}}{\glsentryshort{#1}}% } % \end{macrocode} -%\begin{macro}{\glswritefiles} -% Only write the files if \pkgopt[true]{savewrites} -% \begin{macrocode} -\ifglssavewrites - \newcommand*{\glswritefiles}{% -% \end{macrocode} -% Iterate through all the glossaries -%\changes{3.01}{2011/04/12}{added check for empty glossaries} -%\changes{3.02}{2012/05/21}{added check for existence of token -% in case \cs{makeglossaries has been omitted}} -% \begin{macrocode} - \forallglossaries{\@glo@type}{% -% \end{macrocode} -% Check for empty glossaries (patch provided by Patrick H\"acker) -% \begin{macrocode} - \ifcsundef{glo@\@glo@type @filetok}% - {% - \def\gls@tmp{}% - }% - {% - \edef\gls@tmp{\expandafter\the - \csname glo@\@glo@type @filetok\endcsname}% - }% - \ifx\gls@tmp\@empty - \ifx\@glo@type\glsdefaulttype - \GlossariesWarningNoLine{Glossary `\@glo@type' has no - entries.^^JRemember to use package option `nomain' if -you - don't want to^^Juse the main glossary}% - \else - \GlossariesWarningNoLine{Glossary `\@glo@type' has no - entries}% - \fi - \else - \@glsopenfile{\glswrite}{\@glo@type}% - \immediate\write\glswrite{% - \expandafter\the - \csname glo@\@glo@type @filetok\endcsname}% - \immediate\closeout\glswrite - \fi - }% - } -\else - \let\glswritefiles\relax -\fi -% \end{macrocode} %\end{macro} -% -% The \cs{glossary} command is redefined so that it takes an -% optional argument \meta{type} to specify the glossary type (use -% \cs{glsdefaulttype} glossary by default). -% This shouldn't be used at user level -% as \cs{glslink} sets the correct format. The associated -% number should be stored in \cs{theglsentrycounter} -% before using \cs{glossary}. -%\begin{macro}{\glossary} +%\begin{macro}{\Glsentryfull} +%\changes{3.09a}{2013-10-09}{made robust} +%\changes{3.02}{2012/05/21}{fixed bug (replaced \cs{glsentryshortpl} +%with \cs{glsentryshort})} +%\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} % \begin{macrocode} -\renewcommand*{\glossary}[1][\glsdefaulttype]{% - \@glossary[#1]% +\newrobustcmd*{\Glsentryfull}[1]{% + \acrfullformat{\Glsentrylong{#1}}{\glsentryshort{#1}}% } % \end{macrocode} %\end{macro} -% -% Define internal \cs{@glossary} to ignore its argument. -% This gets redefined in \cs{@makeglossary}. This is -% defined to just \cs{index} as \cls{memoir} changes the definition of -% \cs{@index}. (Thanks to Dan Luecking for pointing this out.) -%\begin{macro}{\@glossary} -%\changes{1.17}{2008 December 26}{changed definition to use -%\cs{index} instead of \cs{@index}} +%\begin{macro}{\glsentryfullpl} +%\changes{3.02}{2012/05/21}{fixed bug (replaced \cs{glsentryshort} +%with \cs{glsentryshortpl})} +%\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} % \begin{macrocode} -\def\@glossary[#1]{\index} +\newcommand*{\glsentryfullpl}[1]{% + \acrfullformat{\glsentrylongpl{#1}}{\glsentryshortpl{#1}}% +} % \end{macrocode} %\end{macro} -% This is a convenience command to set \cs{@glossary}. -% It is used by \cs{@makeglossary} and then redefined to -% do nothing, as it only needs to be done once. -%\begin{macro}{\@gls@renewglossary} +%\begin{macro}{\Glsentryfullpl} +%\changes{3.09a}{2013-10-09}{made robust} +%\changes{3.13a}{2013-11-05}{changed to use \cs{acrfullformat}} % \begin{macrocode} -\newcommand{\@gls@renewglossary}{% - \gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}% - \let\@gls@renewglossary\@empty +\newrobustcmd*{\Glsentryfullpl}[1]{% + \acrfullformat{\Glsentrylongpl{#1}}{\glsentryshortpl{#1}}% } % \end{macrocode} %\end{macro} -% The \cs{@wrglossary} command is redefined to have -% two arguments. The first argument is the glossary type, -% the second argument is the glossary entry -% (the format of which is set in \cs{glslink}). -%\begin{macro}{\@wrglossary} -%\changes{1.17}{2008 December 26}{modified to allow for xindy support} -%\changes{3.0}{2010 Jul 12}{modified to take into account -%\pkgopt{savewrites}} +% +%\begin{macro}{\glsentrynumberlist} +%\changes{3.02}{2012/05/21}{new} +%Displays the number list as is. % \begin{macrocode} -\renewcommand*{\@wrglossary}[2]{% - \ifglssavewrites - \protected@edef\@gls@tmp{\the\csname glo@#1@filetok\endcsname#2}% - \expandafter\global\expandafter\csname glo@#1@filetok\endcsname - \expandafter{\@gls@tmp^^J}% - \else +\newcommand*{\glsentrynumberlist}[1]{% + \glsdoifexists{#1}% + {% + \csname glo@#1@numberlist\endcsname + }% +} % \end{macrocode} -%\changes{3.02}{2012/05/21}{added check for glossary file defined}% +%\end{macro} +% +%\begin{macro}{\glsdisplaynumberlist} +%\changes{3.02}{2012/05/21}{new} +% Formats the number list for the given entry label. +% Doesn't work with hyperref. % \begin{macrocode} - \ifcsdef{glo@#1@file}% +\@ifpackageloaded{hyperref} {% + \newcommand*{\glsdisplaynumberlist}[1]{% + \GlossariesWarning {% - \expandafter\protected@write\csname glo@#1@file\endcsname{% - \gls@disablepagerefexpansion}{#2}% + \string\glsdisplaynumberlist\space + doesn't work with hyperref.^^JUsing + \string\glsentrynumberlist\space instead% }% + \glsentrynumberlist{#1}% + }% +}% +{% + \newcommand*{\glsdisplaynumberlist}[1]{% + \glsdoifexists{#1}% {% - \GlossariesWarning{No file defined for glossary `#1'}% + \bgroup + \def\@glo@label{#1}% + \let\@org@glsnumberformat\glsnumberformat + \def\glsnumberformat##1{##1}% + \protected@edef\the@numberlist{\csname glo@\@glo@label @numberlist\endcsname}% + \def\@gls@numlist@sep{}% + \def\@gls@numlist@nextsep{}% + \def\@gls@numlist@lastsep{}% + \def\@gls@thislist{}% + \def\@gls@donext@def{}% + \renewcommand\do[1]{% + \protected@edef\@gls@thislist{% + \@gls@thislist + \noexpand\@gls@numlist@sep + ##1% + }% + \let\@gls@numlist@sep\@gls@numlist@nextsep + \def\@gls@numlist@nextsep{\glsnumlistsep}% + \@gls@donext@def + \def\@gls@donext@def{% + \def\@gls@numlist@lastsep{\glsnumlistlastsep}% + }% + }% + \expandafter \glsnumlistparser \expandafter{\the@numberlist}% + \let\@gls@numlist@sep\@gls@numlist@lastsep + \@gls@thislist + \egroup }% - \fi - \endgroup\@esphack -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@do@wrglossary} -%\changes{3.02}{2012/05/21}{changed \cs{@do@wr@glossary} to test for -%\pkgopt{indexonlyfirst} option; put old \cs{@do@wr@glossary} code -%into \cs{@@do@wrglossary}} -% \begin{macrocode} -\newcommand*{\@do@wrglossary}[1]{% - \ifglsindexonlyfirst - \ifglsused{#1}{}{\@@do@wrglossary{#1}}% - \else - \@@do@wrglossary{#1}% - \fi + } } % \end{macrocode} %\end{macro} % -%\begin{macro}{\gls@protected@pagefmts} -%\changes{3.04}{2012-11-18}{new} -%\changes{3.05}{2013-04-21}{added Roman to list} -% List of page formats to be protected against expansion. +%\begin{macro}{\glsnumlistsep} +%\changes{3.02}{21012/05/19}{new} % \begin{macrocode} -\newcommand{\gls@protected@pagefmts}{% - \gls@numberpage,\gls@alphpage,\gls@Alphpage,\gls@romanpage,\gls@Romanpage% -} +\newcommand*{\glsnumlistsep}{, } % \end{macrocode} %\end{macro} -%\begin{macro}{\gls@disablepagerefexpansion} -%\changes{3.04}{2012-11-18}{new} +%\begin{macro}{\glsnumlistlastsep} +%\changes{3.02}{21012/05/19}{new} % \begin{macrocode} -\newcommand*{\gls@disablepagerefexpansion}{% - \@for\@gls@this:=\gls@protected@pagefmts\do - {% - \expandafter\let\@gls@this\relax - }% -} +\newcommand*{\glsnumlistlastsep}{ \& } % \end{macrocode} %\end{macro} -%\begin{macro}{\gls@alphpage} -%\changes{3.04}{2012-11-18}{new} +% +%\begin{macro}{\glshyperlink} +% Provide a hyperlink to a glossary entry without adding information +% to the glossary file. The entry needs to be added using a +% command like \ics{glslink} or \ics{glsadd} to ensure that +% the target is defined. The first (optional) argument specifies +% the link text. The entry name is used by default. The second +% argument is the entry label. +%\changes{1.17}{2008 December 26}{new} +%\changes{3.0}{2011/04/02}{changed default from \cs{glsentryname} +%to \cs{glsentrytext}} % \begin{macrocode} -\newcommand*{\gls@alphpage}{\@alph\c@page} +\newcommand*{\glshyperlink}[2][\glsentrytext{\@glo@label}]{% +\def\@glo@label{#2}% +\@glslink{\glolinkprefix#2}{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\gls@Alphpage} -%\changes{3.04}{2012-11-18}{new} +% +%\subsection{Adding an entry to the glossary without generating +% text} +% The following keys are provided for \cs{glsadd} and +% \cs{glsaddall}: % \begin{macrocode} -\newcommand*{\gls@Alphpage}{\@Alph\c@page} +\define@key{glossadd}{counter}{\def\@gls@counter{#1}} % \end{macrocode} -%\end{macro} -%\begin{macro}{\gls@numberpage} -%\changes{3.04}{2012-11-18}{new} +%\changes{2.07}{2010 Jul 10}{glssadd format key stored in \cs{@glsnumberformat} +%(was mistakenly stored in \cs{@glo@format})} % \begin{macrocode} -\newcommand*{\gls@numberpage}{\number\c@page} +\define@key{glossadd}{format}{\def\@glsnumberformat{#1}} % \end{macrocode} -%\end{macro} -%\begin{macro}{\gls@romanpage} -%\changes{3.04}{2012-11-18}{new} +% This key is only used by \cs{glsaddall}: % \begin{macrocode} -\newcommand*{\gls@romanpage}{\romannumeral\c@page} +\define@key{glossadd}{types}{\def\@glo@type{#1}} % \end{macrocode} -%\end{macro} -%\begin{macro}{\gls@Romanpage} -%\changes{3.05}{2013-04-21}{new} -% \begin{macrocode} -\newcommand*{\gls@Romanpage}{\@Roman\c@page} +% +%\begin{definition} +%\cs{glsadd}\oarg{options}\marg{label} +%\end{definition} +% Add a term to the glossary without generating any link text. +% The optional argument indicates which counter to use, +% and how to format it (using a key-value list) +% the second argument is the entry label. Note that \meta{options} +% only has two keys: \gloskey[glsadd]{counter} and \gloskey[glsadd]{format} (the \gloskey[glsaddall]{types} key will be ignored). +%\begin{macro}{\glsadd} +%\changes{1.07}{2007 Sep 13}{fixed bug caused by \cs{theglsentrycounter} setting the page number too soon} +%\changes{2.04}{2009 November 10}{fixed bug that ignored counter} +%\changes{3.01}{2011/04/12}{made robust} +% \begin{macrocode} +\newrobustcmd*{\glsadd}[2][]{% + \glsdoifexists{#2}% + {% + \def\@glsnumberformat{glsnumberformat}% + \edef\@gls@counter{\csname glo@#2@counter\endcsname}% + \setkeys{glossadd}{#1}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@@do@wrglossary} -%\changes{1.17}{2008 December 26}{new} -% Write the glossary entry in the appropriate format. -% (Need to set \cs{@glsnumberformat} and \cs{@gls@counter} prior to use.) -% The argument is the entry's label. -%\changes{3.0}{2011/04/02}{modified to use new format} +% Store the entry's counter in \cs{theglsentrycounter} +%\changes{3.0}{2011/04/02}{added \cs{@gls@saveentrycounter}} % \begin{macrocode} -\newcommand*{\@@do@wrglossary}[1]{% - \begingroup + \@gls@saveentrycounter + \@do@wrglossary{#2}% + }% +} % \end{macrocode} -% First a bit of hackery to prevent premature -% expansion of \cs{c@page}. Store original definitions: -%\changes{3.04}{2012-11-18}{modified to compensate for possible -%incorrect page number} +%\end{macro} +% +%\begin{definition} +%\cs{glsaddall}\oarg{option list} +%\end{definition} +% Add all terms defined for the listed glossaries (without displaying +% any text). If \gloskey[glsaddall]{types} key is omitted, apply to all +% glossary types. +%\begin{macro}{\glsaddall} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} - \let\orgthe\the - \let\orgnumber\number - \let\orgromannumeral\romannumeral - \let\orgalph\@alph - \let\orgAlph\@Alph - \let\orgRoman\@Roman +\newrobustcmd*{\glsaddall}[1][]{% + \edef\@glo@type{\@glo@types}% + \setkeys{glossadd}{#1}% + \forallglsentries[\@glo@type]{\@glo@entry}{% + \glsadd[#1]{\@glo@entry}% + }% +} % \end{macrocode} -% Redefine: -%\changes{3.05}{2013-04-21}{add Roman case. Fixed bugs in the else statements} +%\end{macro} +%\begin{macro}{\glsaddallunused} +%\begin{definition} +%\cs{glsaddallunused}\oarg{glossary type} +%\end{definition} +% Add all used terms defined for the listed glossaries (without displaying +% any text). If optional argument is omitted, apply to all +% glossary types. This should typically go at the end of the +% document. +%\changes{3.08a}{2013-09-28}{new} +%\changes{3.13a}{2013-11-05}{set default to \cs{@glo@types}} +% \begin{macrocode} +\newrobustcmd*{\glsaddallunused}[1][\@glo@types]{% + \forallglsentries[#1]{\@glo@entry}% + {% + \ifglsused{\@glo@entry}{}{\glsadd[format=@gobble]{\@glo@entry}}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\subsection{Creating associated files} +% The \cs{writeist} command creates the associated +% customized \filetype{.ist} \app{makeindex} style file. +% While defining this command, some characters have their +% catcodes temporarily changed to ensure they get written to +% the \filetype{.ist} file correctly. The \app{makeindex} +% actual character (usually "@") is redefined to be a "?", to allow +% internal commands to be written to the glossary file output file. +% +% The special characters\mkidxspch\ are stored in \cs{@gls@actualchar}, +% \cs{@gls@encapchar}, \cs{@glsl@levelchar} and +% \cs{@gls@quotechar} to make them easier to use later, +% but don't change these values, because the characters are +% encoded in the command definitions that are used to escape +% the special characters (which means that the user no longer +% needs to worry about \app{makeindex} special characters). +% +% The symbols and numbers label for group headings are hardwired into +% the \filetype{.ist} file as \texttt{glssymbols} and +% \texttt{glsnumbers}, the group titles can be translated +% (so that \ics{glssymbolsgroupname} replaces \texttt{glssymbols} +% and \ics{glsnumbersgroupname} replaces \texttt{glsnumbers}) +% using the command \ics{glsgetgrouptitle} which is +% defined in \isty{glossary-hypernav}. This is done to prevent +% any problem characters in \ics{glssymbolsgroupname} +% and \ics{glsnumbersgroupname} from breaking hyperlinks. +% +%\begin{macro}{\glsopenbrace} +% Define \cs{glsopenbrace} to make it easier to write an opening +% brace to a file. % \begin{macrocode} - \def\the##1{% - \ifx##1\c@page \gls@numberpage\else\orgthe##1\fi}% - \def\number##1{% - \ifx##1\c@page \gls@numberpage\else\orgnumber##1\fi}% - \def\romannumeral##1{% - \ifx##1\c@page \gls@romanpage\else\orgromannumeral##1\fi}% - \def\@Roman##1{% - \ifx##1\c@page \gls@Romanpage\else\orgRoman##1\fi}% - \def\@alph##1{% - \ifx##1\c@page \gls@alphpage\else\orgalph##1\fi}% - \def\@Alph##1{% - \ifx##1\c@page \gls@Alphpage\else\orgAlph##1\fi}% +\edef\glsopenbrace{\expandafter\@gobble\string\{} % \end{macrocode} -% Prevent expansion: +%\end{macro} +%\begin{macro}{\glsclosebrace} +% Define \cs{glsclosebrace} to make it easier to write an opening +% brace to a file. % \begin{macrocode} - \gls@disablepagerefexpansion +\edef\glsclosebrace{\expandafter\@gobble\string\}} % \end{macrocode} -% Now store location in \cs{@glslocref}: +%\end{macro} +%\begin{macro}{\glsquote} +% Define command that makes it easier to write quote marks to +% a file in the event that the double quote character has been +% made active. % \begin{macrocode} - \protected@xdef\@glslocref{\theglsentrycounter}% - \endgroup +\edef\glsquote#1{\string"#1\string"} % \end{macrocode} -% Escape any special characters +%\end{macro} +% +%\begin{macro}{\@glsfirstletter} +% Define the first letter to come after the digits 0,\ldots,9. +% Only required for \app{xindy}. % \begin{macrocode} - \@gls@checkmkidxchars\@glslocref +\ifglsxindy + \newcommand*{\@glsfirstletter}{A} +\fi % \end{macrocode} -% Check if the hyper-location is the same as the location and set -% the hyper prefix. -%\changes{3.0}{2011/04/02}{added check for hyper location prefix} +%\end{macro} +%\begin{macro}{\GlsSetXdyFirstLetterAfterDigits} +% Sets the first letter to come after the digits 0,\ldots,9. % \begin{macrocode} - \expandafter\ifx\theHglsentrycounter\theglsentrycounter - \def\@glo@counterprefix{}% - \else - \protected@edef\@glsHlocref{\theHglsentrycounter}% - \@gls@checkmkidxchars\@glsHlocref - \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix - {\@glslocref}{\@glsHlocref}% - }% - \@do@gls@getcounterprefix - \fi +\ifglsxindy + \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{% + \renewcommand*{\@glsfirstletter}{#1}} +\else + \newcommand*{\GlsSetXdyFirstLetterAfterDigits}[1]{% + \glsnoxindywarning\GlsSetXdyFirstLetterAfterDigits} +\fi % \end{macrocode} -% Determine whether to use \app{xindy} or \app{makeindex} -% syntax +%\end{macro} +% +%\begin{macro}{\@glsminrange} +% Define the minimum number of successive location references +% to merge into a range. % \begin{macrocode} - \ifglsxindy +\newcommand*{\@glsminrange}{2} % \end{macrocode} -% Need to determine if the formatting information starts with -% a ( or ) indicating a range. +%\end{macro} +%\begin{macro}{\GlsSetXdyMinRangeLength} +% Set the minimum range length. The value must either be "none" +% or a positive integer. The \sty{glossaries} package doesn't +% check if the argument is valid, that is left to \app{xindy}. % \begin{macrocode} - \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil - \def\@glo@range{}% - \expandafter\if\@glo@prefix(\relax - \def\@glo@range{:open-range}% - \else - \expandafter\if\@glo@prefix)\relax - \def\@glo@range{:close-range}% - \fi - \fi +\ifglsxindy + \newcommand*{\GlsSetXdyMinRangeLength}[1]{% + \renewcommand*{\@glsminrange}{#1}} +\else + \newcommand*{\GlsSetXdyMinRangeLength}[1]{% + \glsnoxindywarning\GlsSetXdyMinRangeLength} +\fi % \end{macrocode} -% Write to the glossary file using \app{xindy} syntax. +%\end{macro} + +%\begin{macro}{\writeist} +%\changes{1.17}{2008 December 26}{added xindy support} +%\changes{1.01}{2007 May 17}{Added spaces after \cs{delimN} and +%\cs{delimR} in ist file}% +%\changes{3.0}{2011/04/02}{modified to support new format} % \begin{macrocode} - \glossary[\csname glo@#1@type\endcsname]{% - (indexentry :tkey (\csname glo@#1@index\endcsname) +\ifglsxindy % \end{macrocode} -%\changes{3.02}{2012/05/21}{changed \cs{@glslocref} to \cs{theglsentrycounter}} -%\changes{3.04}{2012-11-18}{changed \cs{theglsentrycounter} back to \cs{@glslocref}} +% Code to use if \app{xindy} is required. % \begin{macrocode} - :locref \string"{\@glo@counterprefix}{\@glslocref}\string" % - :attr \string"\@gls@counter\@glo@suffix\string" - \@glo@range - ) - }% - \else + \def\writeist{% % \end{macrocode} -% Convert the format information into the format required for -% \app{makeindex} +% Update attributes list % \begin{macrocode} - \@set@glo@numformat{\@glo@numfmt}{\@gls@counter}{\@glsnumberformat}% - {\@glo@counterprefix}% + \@gls@addpredefinedattributes % \end{macrocode} -% Write to the glossary file using \app{makeindex} syntax. +% Open the file. % \begin{macrocode} - \glossary[\csname glo@#1@type\endcsname]{% - \string\glossaryentry{\csname glo@#1@index\endcsname - \@gls@encapchar\@glo@numfmt}{\@glslocref}}% - \fi -} + \openout\glswrite=\istfilename % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@getcounterprefix} -% Get the prefix that needs to be prepended to counter in order to -% get the hyper counter. (For example, with the standard -% \cls{article} class and \sty{hyperref}, \ics{theequation} needs to -% be prefixed with \meta{section num}|.| to get the equivalent -% \ics{theHequation}.) NB this assumes that the prefix ends with a -% dot, which is the standard. (Otherwise it makes the xindy location -% classes more complicated.) +% Write header comment at the start of the file % \begin{macrocode} -\newcommand*\@gls@getcounterprefix[2]{% - \edef\@gls@thisloc{#1}\edef\@gls@thisHloc{#2}% - \ifx\@gls@thisloc\@gls@thisHloc - \def\@glo@counterprefix{}% - \else - \def\@gls@get@counterprefix##1.#1##2\end@getprefix{% - \def\@glo@tmp{##2}% - \ifx\@glo@tmp\@empty - \def\@glo@counterprefix{}% - \else - \def\@glo@counterprefix{##1}% - \fi - }% - \@gls@get@counterprefix#2.#1\end@getprefix - \fi -} + \write\glswrite{;; xindy style file created by the glossaries + package}% + \write\glswrite{;; for document '\jobname' on + \the\year-\the\month-\the\day}% % \end{macrocode} -%\end{macro} -% -%\subsection{Glossary Entry Cross-References} -%\begin{macro}{\@do@seeglossary} -%\changes{1.17}{2008 December 26}{new} -% Write the glossary entry with a cross reference. -% The first argument is the entry's label, the second must be in -% the form \oarg{tag}\marg{list}, where \meta{tag} is a tag -% such as ``see'' and \meta{list} is a list of labels. -%\changes{3.0}{2011/04/02}{Sanitize and escape cross-referencing -%information} +% Specify the required styles % \begin{macrocode} -\newcommand{\@do@seeglossary}[2]{% -\def\@gls@xref{#2}% -\@onelevel@sanitize\@gls@xref -\@gls@checkmkidxchars\@gls@xref -\ifglsxindy - \glossary[\csname glo@#1@type\endcsname]{% - (indexentry - :tkey (\csname glo@#1@index\endcsname) - :xref (\string"\@gls@xref\string") - :attr \string"see\string" - ) - }% -\else - \glossary[\csname glo@#1@type\endcsname]{% - \string\glossaryentry{\csname glo@#1@index\endcsname - \@gls@encapchar glsseeformat\@gls@xref}{Z}}% -\fi -} + \write\glswrite{^^J; required styles^^J} + \@for\@xdystyle:=\@xdyrequiredstyles\do{% + \ifx\@xdystyle\@empty + \else + \protected@write\glswrite{}{(require + \string"\@xdystyle.xdy\string")}% + \fi + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@fixbraces} -% If no optional argument is specified, list needs to be enclosed -% in a set of braces. +% List the allowed attributes (possible values used by the +% \gloskey{format} key) % \begin{macrocode} -\def\@gls@fixbraces#1#2#3\@nil{% - \ifx#2[\relax - \def#1{#2#3}% - \else - \def#1{{#2#3}}% - \fi -} + \write\glswrite{^^J% + ; list of allowed attributes (number formats)^^J}% + \write\glswrite{(define-attributes ((\@xdyattributes)))}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glssee} -%\cs{glssee}\marg{label}\marg{cross-ref list} -%\changes{1.17}{2008 December 26}{new} +% Define any additional alphabets % \begin{macrocode} -\newcommand*{\glssee}[3][\seename]{% - \@do@seeglossary{#2}{[#1]{#3}}} -\newcommand*{\@glssee}[3][\seename]{% - \glssee[#1]{#3}{#2}} + \write\glswrite{^^J; user defined alphabets^^J}% + \write\glswrite{\@xdyuseralphabets}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsseeformat} -%\changes{1.17}{2008 December 26}{new} -% The first argument specifies what tag to use (e.g.\ ``see''), -% the second argument is a comma-separated list of labels. -% The final argument (the location) is ignored. +% Define location classes. % \begin{macrocode} -\newcommand*{\glsseeformat}[3][\seename]{\emph{#1} \glsseelist{#2}} + \write\glswrite{^^J; location class definitions^^J}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsseelist} -%\cs{glsseelist}\marg{list} formats list of entry labels. +% As from version 3.0, locations are now specified as +% \marg{Hprefix}\marg{number}, so need to add all possible +% combinations of location types. % \begin{macrocode} -\newcommand*{\glsseelist}[1]{% + \@for\@gls@classI:=\@gls@xdy@locationlist\do{% % \end{macrocode} -% If there is only one item in the list, set the last separator -% to do nothing. +% Case were \meta{Hprefix} is empty: % \begin{macrocode} - \let\@gls@dolast\relax + \protected@write\glswrite{}{(define-location-class + \string"\@gls@classI\string"^^J\space\space\space + ( + :sep "{}{" + \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space + :sep "}" + ) + ^^J\space\space\space + :min-range-length \@glsminrange^^J% + ) + }% % \end{macrocode} -% Don't display separator on the first iteration of the loop +% Nested iteration over all classes: % \begin{macrocode} - \let\@gls@donext\relax + {% + \@for\@gls@classII:=\@gls@xdy@locationlist\do{% + \protected@write\glswrite{}{(define-location-class + \string"\@gls@classII-\@gls@classI\string" + ^^J\space\space\space + ( + :sep "{" + \csname @gls@xdy@Lclass@\@gls@classII\endcsname\space + :sep "}{" + \csname @gls@xdy@Lclass@\@gls@classI\endcsname\space + :sep "}" + ) + ^^J\space\space\space + :min-range-length \@glsminrange^^J% + ) + }% + }% + }% + }% % \end{macrocode} -% Iterate through the labels +% User defined location classes (needs checking for new location format). % \begin{macrocode} - \@for\@gls@thislabel:=#1\do{% + \write\glswrite{^^J; user defined location classes}% + \write\glswrite{\@xdyuserlocationdefs}% % \end{macrocode} -% Check if on last iteration of loop +% Cross-reference class. (The unverified option is used as the +% cross-references are supplied using the list of labels along with +% the optional argument for \ics{glsseeformat} which +% \app{xindy} won't recognise.) % \begin{macrocode} - \ifx\@xfor@nextelement\@nnil - \@gls@dolast - \else - \@gls@donext - \fi + \write\glswrite{^^J; define cross-reference class^^J}% + \write\glswrite{(define-crossref-class \string"see\string" + :unverified )}% % \end{macrocode} -% display the entry for this label +% Define how cross-references should be displayed. This adds an +% empty set of braces after the cross-referencing information +% allowing for the final argument of \cs{glsseeformat} which +% gets ignored. (When using \app{makeindex} this final argument +% contains the location information which is not required.) % \begin{macrocode} - \glsseeitem{\@gls@thislabel}% + \write\glswrite{(markup-crossref-list + :class \string"see\string"^^J\space\space\space + :open \string"\string\glsseeformat\string" + :close \string"{}\string")}% % \end{macrocode} -% Update separators +% List the order to sort the classes. % \begin{macrocode} - \let\@gls@dolast\glsseelastsep - \let\@gls@donext\glsseesep - }% -} + \write\glswrite{^^J; define the order of the location classes}% + \write\glswrite{(define-location-class-order + (\@xdylocationclassorder))}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsseelastsep} -% Separator to use between penultimate and ultimate entries in a -% cross-referencing list. +% Specify what to write to the start and end of the glossary file. % \begin{macrocode} -\newcommand*{\glsseelastsep}{\space\andname\space} + \write\glswrite{^^J; define the glossary markup^^J}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsseesep} -% Separator to use between entires in a cross-referencing list. +%\changes{3.0}{2011/04/02}{added xindy-only macro definitions to +%glossary open tag} % \begin{macrocode} -\newcommand*{\glsseesep}{, } + \write\glswrite{(markup-index^^J\space\space\space + :open \string"\string + \glossarysection[\string\glossarytoctitle]{\string + \glossarytitle}\string\glossarypreamble}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsseeitem} -%\cs{glsseeitem}\marg{label} formats individual entry in a -% cross-referencing list. -%\changes{3.0}{2011/04/02}{hyperlink uses \cs{glsseeitemformat} instead -%of \cs{glsentryname}} +% Add all the xindy-only macro definitions (needed to prevent errors +% in the event that the user changes from \pkgopt{xindy} to +% \pkgopt{makeindex}) % \begin{macrocode} -\newcommand*{\glsseeitem}[1]{\glshyperlink[\glsseeitemformat{#1}]{#1}} + \@for\@this@ctr:=\@xdycounters\do{% + {% + \@for\@this@attr:=\@xdyattributelist\do{% + \protected@write\glswrite{}{\string\providecommand*% + \expandafter\string + \csname glsX\@this@ctr X\@this@attr\endcsname[2]% + {% + \string\setentrycounter + [\expandafter\@gobble\string\#1]{\@this@ctr}% + \expandafter\string + \csname\@this@attr\endcsname + {\expandafter\@gobble\string\#2}% + }% + }% + }% + }% + }% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsseeitemformat} -%\changes{3.0}{2011/04/02}{new} -% As from v3.0, default is to use \ics{glsentrytext} instead of -% \ics{glsentryname}. (To avoid problems with the \gloskey{name} key being -% sanitized.) +% Add the end part of the open tag and the rest of the markup-index +% information: % \begin{macrocode} -\newcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}} + \write\glswrite{% + \string\begin + {theglossary}\string\glossaryheader\string~n\string" ^^J\space + \space\space:close \string"\expandafter\@gobble + \string\%\string~n\string + \end{theglossary}\string\glossarypostamble + \string~n\string" ^^J\space\space\space + :tree)}% % \end{macrocode} -%\end{macro} -% -% \subsection{Displaying the glossary}\label{sec:code:printglos} -% An individual glossary is displayed in the text using -% \cs{printglossary}\oarg{key-val list}. If the -% \gloskey[printglossary]{type} key is omitted, the default glossary is displayed. -% The optional argument can be used to specify an alternative -% glossary, and can also be used to set the style, title and -% entry in the table of contents. Available keys are defined below. -% -%\begin{macro}{\gls@save@numberlist} -%\changes{3.02}{2012/05/21}{new} -% Provide command to store number list. +% Specify what to put between letter groups % \begin{macrocode} -\newcommand*{\gls@save@numberlist}[1]{% - \ifglssavenumberlist - \toks@{#1}% - \edef\@do@writeaux@info{% - \noexpand\csgdef{glo@\glscurrententrylabel @numberlist}{\the\toks@}% - }% - \@onelevel@sanitize\@do@writeaux@info - \protected@write\@auxout{}{\@do@writeaux@info}% - \fi -} + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\warn@noprintglossary} -% Warn the user if they have forgotten \ics{printglossaries} -% or \ics{printglossary}. (Will be suppressed if there is at -% least one occurance of \ics{printglossary}. There is no check -% to ensure that there is a \ics{printglossary} for each defined -% glossary.) +% Specify what to put between entries % \begin{macrocode} -\def\warn@noprintglossary{% - \GlossariesWarningNoLine{No \string\printglossary\space - or \string\printglossaries\space - found.^^JThis document will not have a glossary}% -} + \write\glswrite{(markup-indexentry + :open \string"\string\relax \string\glsresetentrylist + \string~n\string")}% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\printglossary} -%\changes{1.17}{2008 December 26}{added print language to aux file} -%\changes{1.15}{2008 August 15}{changed the way the TOC title is set} -%\changes{1.17}{2008 December 26}{added check to determine if 'printglossary is already -% defined} -% The TOC title needs to be processed in a different manner -% to the main title in case the \sty{translator} and \sty{hyperref} packages -% are both being used. -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +% Specify how to format entries % \begin{macrocode} -\ifcsundef{printglossary}{}% -{% + \write\glswrite{(markup-locclass-list :open + \string"\glsopenbrace\string\glossaryentrynumbers + \glsopenbrace\string\relax\space \string"^^J\space\space\space + :sep \string", \string" + :close \string"\glsclosebrace\glsclosebrace\string")}% % \end{macrocode} -% If \cs{printglossary} is already defined, issue a warning -% and undefine it. +% Specify how to separate location numbers % \begin{macrocode} - \GlossariesWarning{Overriding \string\printglossary}% - \undef\printglossary -} + \write\glswrite{(markup-locref-list + :sep \string"\string\delimN\space\string")}% % \end{macrocode} -% \cs{printglossary} has an optional argument. The default -% value is to set the glossary type to the main glossary. +% Specify how to indicate location ranges % \begin{macrocode} -\newcommand*{\printglossary}[1][type=\glsdefaulttype]{% + \write\glswrite{(markup-range + :sep \string"\string\delimR\space\string")}% % \end{macrocode} -% Set up defaults. +% Specify 2-page and 3-page suffixes, if defined. +% First, the values must be sanitized to write them explicity. % \begin{macrocode} - \def\@glo@type{\glsdefaulttype}% - \def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% + \@onelevel@sanitize\gls@suffixF + \@onelevel@sanitize\gls@suffixFF % \end{macrocode} -%\changes{3.03}{2012/09/21}{allow title to override default toctitle} % \begin{macrocode} - \def\glossarytoctitle{\glossarytitle}% - \let\org@glossarytitle\glossarytitle - \def\@glossarystyle{}% - \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% + \ifx\gls@suffixF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixF" :length 1 :ignore-end)}% + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixFF" :length 2 :ignore-end)}% + \fi % \end{macrocode} -% Store current value of \ics{glossaryentrynumbers}. (This may -% be changed via the optional argument) +% Specify how to format locations. % \begin{macrocode} - \let\@org@glossaryentrynumbers\glossaryentrynumbers + \write\glswrite{^^J; define format to use for locations^^J}% + \write\glswrite{\@xdylocref}% % \end{macrocode} -% Localise the effects of the optional argument +% Specify how to separate letter groups. % \begin{macrocode} - \bgroup + \write\glswrite{^^J; define letter group list format^^J}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% % \end{macrocode} -% Determine settings specified in the optional argument. +% Define letter group headings. % \begin{macrocode} - \setkeys{printgloss}{#1}% + \write\glswrite{^^J; letter group headings^^J}% + \write\glswrite{(markup-letter-group + :open-head \string"\string\glsgroupheading + \glsopenbrace\string"^^J\space\space\space + :close-head \string"\glsclosebrace\string")}% % \end{macrocode} -% If title has been set, but toctitle hasn't, make toctitle the same -% as given title (rather than the title used when the glossary was -% defined) -%\changes{3.0}{2011/04/02}{make toctitle default to title} +% Define additional letter groups. % \begin{macrocode} - \ifx\glossarytitle\org@glossarytitle - \else - \expandafter\let\csname @glotype@\@glo@type @title\endcsname - \glossarytitle - \fi + \write\glswrite{^^J; additional letter groups^^J}% + \write\glswrite{\@xdylettergroups}% % \end{macrocode} -% Allow a high-level user command to indicate the current glossary -%\changes{3.0}{2011/04/02}{added \cs{currentglossary}} +% Define additional sort rules % \begin{macrocode} - \let\currentglossary\@glo@type + \write\glswrite{^^J; additional sort rules^^J} + \write\glswrite{\@xdysortrules}% % \end{macrocode} -%Enable individual number lists to be suppressed. +% Close the style file % \begin{macrocode} - \let\org@glossaryentrynumbers\glossaryentrynumbers - \let\glsnonextpages\@glsnonextpages + \closeout\glswrite % \end{macrocode} -% Enable individual number list to be activated: -%\changes{3.0}{2011/04/02}{added \cs{glsnextpages}} +% Suppress any further calls. % \begin{macrocode} - \let\glsnextpages\@glsnextpages + \let\writeist\relax + } +\else % \end{macrocode} -% Enable suppression of description terminators. +% Code to use if \app{makeindex} is required. +%\changes{2.01}{2009 May 30}{removed item\_02 - no such makeindex key} % \begin{macrocode} - \let\nopostdesc\@nopostdesc + \edef\@gls@actualchar{\string?} + \edef\@gls@encapchar{\string|} + \edef\@gls@levelchar{\string!} + \edef\@gls@quotechar{\string"} + \def\writeist{\relax + \openout\glswrite=\istfilename + \write\glswrite{\expandafter\@gobble\string\% makeindex style file + created by the glossaries package} + \write\glswrite{\expandafter\@gobble\string\% for document + '\jobname' on \the\year-\the\month-\the\day} + \write\glswrite{actual '\@gls@actualchar'} + \write\glswrite{encap '\@gls@encapchar'} + \write\glswrite{level '\@gls@levelchar'} + \write\glswrite{quote '\@gls@quotechar'} + \write\glswrite{keyword \string"\string\\glossaryentry\string"} + \write\glswrite{preamble \string"\string\\glossarysection[\string + \\glossarytoctitle]{\string\\glossarytitle}\string + \\glossarypreamble\string\n\string\\begin{theglossary}\string + \\glossaryheader\string\n\string"} + \write\glswrite{postamble \string"\string\%\string\n\string + \\end{theglossary}\string\\glossarypostamble\string\n + \string"} + \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n + \string"} + \write\glswrite{item_0 \string"\string\%\string\n\string"} + \write\glswrite{item_1 \string"\string\%\string\n\string"} + \write\glswrite{item_2 \string"\string\%\string\n\string"} + \write\glswrite{item_01 \string"\string\%\string\n\string"} + \write\glswrite{item_x1 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{item_12 \string"\string\%\string\n\string"} + \write\glswrite{item_x2 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} % \end{macrocode} -% Set up the entry for the TOC +%\changes{2.05}{2010 Feb 6}{Added \cs{string} before opening +% and closing braces. Patch provided by Segiu Dotenco} % \begin{macrocode} - \gls@dotoctitle + \write\glswrite{delim_0 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_1 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_2 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_t \string"\string\}\string\}\string"} + \write\glswrite{delim_n \string"\string\\delimN \string"} + \write\glswrite{delim_r \string"\string\\delimR \string"} + \write\glswrite{headings_flag 1} + \write\glswrite{heading_prefix + \string"\string\\glsgroupheading\string\{\string"} + \write\glswrite{heading_suffix + \string"\string\}\string\\relax + \string\\glsresetentrylist \string"} + \write\glswrite{symhead_positive \string"glssymbols\string"} + \write\glswrite{numhead_positive \string"glsnumbers\string"} + \write\glswrite{page_compositor \string"\glscompositor\string"} + \@gls@escbsdq\gls@suffixF + \@gls@escbsdq\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{suffix_2p \string"\gls@suffixF\string"} + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} + \fi + \closeout\glswrite + \let\writeist\relax + } +\fi % \end{macrocode} -% Set the glossary style +%\end{macro} +% +%The command \cs{noist} will suppress the creation of +% the \filetype{.ist} file. Obviously you need to use this +% command before \cs{writeist} to have any effect. +%\begin{macro}{\noist} % \begin{macrocode} - \@glossarystyle +\newcommand{\noist}{% % \end{macrocode} -%\changes{3.02}{2012/05/21}{add a way to fetch current entry label} -% added a way to fetch the current entry label: +% Update attributes list % \begin{macrocode} - \let\gls@org@glossaryentryfield\glossaryentryfield - \let\gls@org@glossarysubentryfield\glossarysubentryfield - \renewcommand{\glossaryentryfield}[1]{% - \gdef\glscurrententrylabel{##1}% - \gls@org@glossaryentryfield{##1}% - }% - \renewcommand{\glossarysubentryfield}[2]{% - \gdef\glscurrententrylabel{##2}% - \gls@org@glossarysubentryfield{##1}{##2}% - }% + \@gls@addpredefinedattributes + \let\writeist\relax +} % \end{macrocode} -% Some macros may end up being expanded into internals in the -% glossary, so need to make @ a letter. +%\end{macro} +% +% \cs{@makeglossary} is an internal command that takes an +% argument indicating the glossary type. This command will +% create the glossary file required by \app{makeindex} for the +% given glossary type, using the extension supplied by the +% \meta{out-ext} parameter used in \ics{newglossary} +% (and it will also activate the \ics{glossary} command, +% and create the customized \filetype{.ist} \app{makeindex} +% style file). +% +% Note that you can't use \cs{@makeglossary} for only some of the +% defined glossaries. You either need to have a \cs{makeglossary} +% for all glossaries or none (otherwise you will end up with a +% situation where \TeX\ is trying to write to a non-existant +% file). The relevant glossary must be +% defined prior to using \cs{@makeglossary}. +%\begin{macro}{\@makeglossary} % \begin{macrocode} - \makeatletter +\newcommand*{\@makeglossary}[1]{% + \ifglossaryexists{#1}% + {% % \end{macrocode} -% Input the glossary file, if it exists. +% Only create a new write if \pkgopt[false]{savewrites} otherwise +% create a token to collect the information. +%\changes{3.0}{2010 Jul 12}{Added check for \pkgopt{savewrites}} % \begin{macrocode} - \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% + \ifglssavewrites + \expandafter\newtoks\csname glo@#1@filetok\endcsname + \else + \expandafter\newwrite\csname glo@#1@file\endcsname + \expandafter\@glsopenfile\csname glo@#1@file\endcsname{#1}% + \fi + \@gls@renewglossary + \writeist + }% + {% + \PackageError{glossaries}% + {Glossary type `#1' not defined}% + {New glossaries must be defined before using \string\makeglossary}% + }% +} % \end{macrocode} -% If the glossary file doesn't exist, do \cs{null}. (This ensures -% that the page is shipped out and all write commands are done.) -% This might produce an empty page, but at this point the document -% isn't complete, so it shouldn't matter. +%\end{macro} +% +%\begin{macro}{\@glsopenfile} +% Open write file associated with the given glossary. % \begin{macrocode} - \IfFileExists{\jobname.\csname @glotype@\@glo@type @in\endcsname}% - {}% - {\null}% -% \end{macrocode} -% If \app{xindy} is being used, need to write the language -% dependent information to the \filetype{.aux} file for -% \app{makeglossaries}. -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} -%\changes{3.04}{2012-11-18}{Moved aux write to end of document to -%prevent unwanted whatsit occurring here.} -% \begin{macrocode} - \ifglsxindy - \ifcsundef{@xdy@\@glo@type @language}% - {% - \edef\@do@auxoutstuff{% - \noexpand\AtEndDocument{% - \noexpand\immediate\noexpand\write\@auxout{% - \string\@xdylanguage{\@glo@type}{\@xdy@main@language}}% - }% - }% - }% - {% - \edef\@do@auxoutstuff{% - \noexpand\AtEndDocument{% - \noexpand\immediate\noexpand\write\@auxout{% - \string\@xdylanguage{\@glo@type}{\csname @xdy@\@glo@type - @language\endcsname}}% - }% - }% - }% - \@do@auxoutstuff - \edef\@do@auxoutstuff{% - \noexpand\AtEndDocument{% - \noexpand\immediate\noexpand\write\@auxout{% - \string\@gls@codepage{\@glo@type}{\gls@codepage}}% - }% - }% - \@do@auxoutstuff - \fi - \egroup -% \end{macrocode} -% Reset \ics{glossaryentrynumbers} -% \begin{macrocode} - \global\let\glossaryentrynumbers\@org@glossaryentrynumbers -% \end{macrocode} -% Suppress warning about no \ics{printglossary} -%\changes{2.02}{2007 July 13}{suppressed warning globally rather than locally} -% \begin{macrocode} - \global\let\warn@noprintglossary\relax +\newcommand*{\@glsopenfile}[2]{% + \immediate\openout#1=\jobname.\csname @glotype@#2@out\endcsname + \PackageInfo{glossaries}{Writing glossary file + \jobname.\csname @glotype@#2@out\endcsname}% } % \end{macrocode} %\end{macro} % -% The \cs{printglossaries} command will do \cs{printglossary} -% for each glossary type that has been defined. It is better -% to use \cs{printglossaries} rather than individual -% \cs{printglossary} commands to ensure that you don't forget -% any new glossaries you may have created. It also makes it easier to -% chop and change the value of the \pkgopt{acronym} package option. -% However, if you want to list the glossaries in a different order, -% or if you want to set the title or table of contents entry, or -% if you want to use different glossary styles for each glossary, you -% will need to use \cs{printglossary} explicitly for each -% glossary type. -%\begin{macro}{\printglossaries} +%\begin{macro}{\warn@nomakeglossaries} +% Issue warning that \cs{makeglossaries} hasn't been used. % \begin{macrocode} -\newcommand*{\printglossaries}{% - \forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}% +\newcommand*{\warn@nomakeglossaries}{% + \GlossariesWarningNoLine{\string\makeglossaries\space + hasn't been used,^^Jthe glossaries will not be updated}% } % \end{macrocode} %\end{macro} -% The keys that can be used in the optional argument to -% \ics{printglossary} are as follows: -% The \gloskey[printglossary]{type} key sets the glossary type. +% +% \cs{makeglossaries} will use \cs{@makeglossary} +% for each glossary type that has been defined. New glossaries +% need to be defined before using \cs{makeglossary}, so +% have \cs{makeglossaries} redefine \cs{newglossary} +% to prevent it being used afterwards. +%\begin{macro}{\makeglossaries} % \begin{macrocode} -\define@key{printgloss}{type}{\def\@glo@type{#1}} +\newcommand*{\makeglossaries}{% % \end{macrocode} -% The \gloskey[printglossary]{title} key sets the title used in the glossary section -% header. This overrides the title used in \ics{newglossary}. -%\changes{3.03}{2012/09/21}{allow title to set toctitle} +%\changes{3.10a}{2013-10-13}{Added providecommand code to aux file} +% If the user removes the glossary package from their document, +% ensure the next run doesn't throw a load of undefined control +% sequence errors when the aux file is parsed. % \begin{macrocode} -\define@key{printgloss}{title}{% - \def\glossarytitle{#1}% - \let\gls@dotoctitle\relax -} -% \end{macrocode} -% The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry -% in the table of contents. + \protected@write\@auxout{}{\string\providecommand\string\@glsorder[1]{}} + \protected@write\@auxout{}{\string\providecommand\string\@istfilename[1]{}} +% Write the name of the style file to the aux file +% (needed by \app{makeglossaries}) % \begin{macrocode} -\define@key{printgloss}{toctitle}{% - \def\glossarytoctitle{#1}% - \let\gls@dotoctitle\relax -} + \protected@write\@auxout{}{\string\@istfilename{\istfilename}}% + \protected@write\@auxout{}{\string\@glsorder{\glsorder}} % \end{macrocode} -% The \gloskey[printglossary]{style} key sets the glossary style (but only for -% the given glossary). -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +% Iterate through each glossary type and activate it. % \begin{macrocode} -\define@key{printgloss}{style}{% - \ifcsundef{@glsstyle@#1}% - {% - \PackageError{glossaries}% - {Glossary style `#1' undefined}{}% - }% - {% - \def\@glossarystyle{\csname @glsstyle@#1\endcsname}% + \@for\@glo@type:=\@glo@types\do{% + \ifthenelse{\equal{\@glo@type}{}}{}{% + \@makeglossary{\@glo@type}}% }% -} % \end{macrocode} -% \changes{1.14}{2008 June 17}{added numberedsection key to 'printglossary} -% The \gloskey[printglossary]{numberedsection} key determines if this -% glossary should be in a numbered section. +% New glossaries must be created before \cs{makeglossaries} +% so disable \ics{newglossary}. % \begin{macrocode} -\define@choicekey{printgloss}{numberedsection}[\val\nr]{% -false,nolabel,autolabel}[nolabel]{% -\ifcase\nr\relax - \renewcommand*{\@@glossarysecstar}{*}% - \renewcommand*{\@@glossaryseclabel}{}% -\or - \renewcommand*{\@@glossarysecstar}{}% - \renewcommand*{\@@glossaryseclabel}{}% -\or - \renewcommand*{\@@glossarysecstar}{}% - \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}% -\fi} + \renewcommand*\newglossary[4][]{% + \PackageError{glossaries}{New glossaries + must be created before \string\makeglossaries}{You need + to move \string\makeglossaries\space after all your + \string\newglossary\space commands}}% % \end{macrocode} -% \changes{1.14}{2008 June 17}{added nonumberlist key to 'printglossary} -% The \gloskey[printglossary]{nonumberlist} key determines if this -% glossary should have a number list. +% Any subsequence instances of this command should have no effect % \begin{macrocode} -\define@boolkey{printgloss}[gls]{nonumberlist}[true]{% -\ifglsnonumberlist - \def\glossaryentrynumbers##1{}% -\else - \def\glossaryentrynumbers##1{##1}% -\fi} + \let\@makeglossary\relax + \let\makeglossary\relax + \let\makeglossaries\relax % \end{macrocode} -% -%\begin{macro}{\@glsnonextpages} -%\changes{1.17}{2008 December 26}{new}% -% Suppresses the next number list only. Global assignments required -% as it may not occur in the same level of grouping as the -% next numberlist. (For example, if \cs{glsnonextpages} is place -% in the entry's description and 3 column tabular style glossary -% is used.) \cs{org@glossaryentrynumbers} needs to be set at -% the start of each glossary, in the event that -% \ics{glossaryentrynumber} is redefined. +% Disable all commands that have no effect after \cs{makeglossaries} % \begin{macrocode} -\newcommand*{\@glsnonextpages}{% - \gdef\glossaryentrynumbers##1{% - \glsresetentrylist - }% + \@disable@onlypremakeg +% \end{macrocode} +% Allow \gloskey{see} key: +% \begin{macrocode} + \let\gls@checkseeallowed\relax +% \end{macrocode} +% Suppress warning about no \cs{makeglossaries} +% \begin{macrocode} + \let\warn@nomakeglossaries\relax +% \end{macrocode} +% Declare list parser for \cs{glsdisplaynumberlist} +%\changes{3.02}{2012/05/21}{added list parser} +% \begin{macrocode} + \ifglssavenumberlist + \edef\@gls@dodeflistparser{\noexpand\DeclareListParser + {\noexpand\glsnumlistparser}{\delimN}}% + \@gls@dodeflistparser + \fi } % \end{macrocode} %\end{macro} -%\begin{macro}{\@glsnextpages} -%\changes{3.0}{2011/04/02}{new}% -% Activate the next number list only. Global assignments required -% as it may not occur in the same level of grouping as the -% next numberlist. (For example, if \cs{glsnextpages} is place -% in the entry's description and 3 column tabular style glossary -% is used.) \cs{org@glossaryentrynumbers} needs to be set at -% the start of each glossary, in the event that -% \ics{glossaryentrynumber} is redefined. +% +% The \cs{makeglossary} command is redefined to be +% identical to \cs{makeglossaries}. (This is done to +% reinforce the message that you must either use +% \cs{@makeglossary} for all the glossaries or for none +% of them.) +%\begin{macro}{\makeglossary} % \begin{macrocode} -\newcommand*{\@glsnextpages}{% - \gdef\glossaryentrynumbers##1{% - ##1\glsresetentrylist}} +\let\makeglossary\makeglossaries % \end{macrocode} %\end{macro} -%\begin{macro}{\glsresetentrylist} -% Resets \cs{glossaryentrynumbers} +% +% If \ics{makeglossaries} hasn't been used, issue a warning. +% Also issue a warning if neither \ics{printglossaries} nor +% \ics{printglossary} have been used. % \begin{macrocode} -\newcommand*{\glsresetentrylist}{% - \global\let\glossaryentrynumbers\org@glossaryentrynumbers} +\AtEndDocument{% + \warn@nomakeglossaries + \warn@noprintglossary +} % \end{macrocode} -%\end{macro} +% +%\subsection{Writing information to associated files} % % -%\begin{macro}{\glsnonextpages} -% Outside of \cs{printglossary} this does nothing. +%\begin{macro}{\glswrite} +% The write used for style file also used for all other output files +% if \pkgopt[true]{savewrites}. % \begin{macrocode} -\newcommand*{\glsnonextpages}{} +\newwrite\glswrite % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsnextpages} -% Outside of \cs{printglossary} this does nothing. +%\begin{macro}{\istfile} +%\changes{3.0}{2011/04/02}{deprecated} +% Deprecated. % \begin{macrocode} -\newcommand*{\glsnextpages}{} +\def\istfile{\glswrite} % \end{macrocode} %\end{macro} % -%\begin{counter}{glossaryentry} -%\changes{3.0}{2011/04/02}{new} -% If the \pkgopt{entrycounter} package option has been used, define -% a counter to number each level~0 entry. +% At the end of the document, the files should be created if +% \pkgopt[true]{savewrites}. % \begin{macrocode} -\ifglsentrycounter - \ifx\@gls@counterwithin\@empty - \newcounter{glossaryentry} - \else - \newcounter{glossaryentry}[\@gls@counterwithin] - \fi - \def\theHglossaryentry{\currentglossary.\theglossaryentry} -\fi +\AtEndDocument{% + \glswritefiles +} % \end{macrocode} -%\end{counter} -% -%\begin{counter}{glossarysubentry} -%\changes{3.0}{2011/04/02}{new} -% If the \pkgopt{subentrycounter} package option has been used, define -% a counter to number each level~1 entry. +%\begin{macro}{\@glswritefiles} +% Only write the files if \pkgopt[true]{savewrites} +%\changes{3.14a}{2013-11-12}{renamed \cs{glswritefiles} to +%\cs{@glswritefiles} and used ``savewrites'' option to set +%\cs{glswritefiles}} % \begin{macrocode} -\ifglssubentrycounter - \ifglsentrycounter - \newcounter{glossarysubentry}[glossaryentry] - \else - \newcounter{glossarysubentry} - \fi - \def\theHglossarysubentry{\currentglssubentry.\theglossarysubentry} -\fi +\newcommand*{\@glswritefiles}{% % \end{macrocode} -%\end{counter} -% -%\begin{macro}{\glsresetsubentrycounter} -%\changes{3.0}{2011/04/02}{new} -% Resets the \ctr{glossarysubentry} counter. +% Iterate through all the glossaries +%\changes{3.01}{2011/04/12}{added check for empty glossaries} +%\changes{3.02}{2012/05/21}{added check for existence of token +% in case \cs{makeglossaries has been omitted}} % \begin{macrocode} -\ifglssubentrycounter - \newcommand*{\glsresetsubentrycounter}{% - \setcounter{glossarysubentry}{0}% - } -\else - \newcommand*{\glsresetsubentrycounter}{} -\fi + \forallglossaries{\@glo@type}{% +% \end{macrocode} +% Check for empty glossaries (patch provided by Patrick H\"acker) +% \begin{macrocode} + \ifcsundef{glo@\@glo@type @filetok}% + {% + \def\gls@tmp{}% + }% + {% + \edef\gls@tmp{\expandafter\the + \csname glo@\@glo@type @filetok\endcsname}% + }% + \ifx\gls@tmp\@empty + \ifx\@glo@type\glsdefaulttype + \GlossariesWarningNoLine{Glossary `\@glo@type' has no + entries.^^JRemember to use package option `nomain' if +you + don't want to^^Juse the main glossary}% + \else + \GlossariesWarningNoLine{Glossary `\@glo@type' has no + entries}% + \fi + \else + \@glsopenfile{\glswrite}{\@glo@type}% + \immediate\write\glswrite{% + \expandafter\the + \csname glo@\@glo@type @filetok\endcsname}% + \immediate\closeout\glswrite + \fi + }% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsresetsubentrycounter} -%\changes{3.02}{2012/05/21}{new} -% Resets the \ctr{glossarentry} counter. +% The \cs{glossary} command is redefined so that it takes an +% optional argument \meta{type} to specify the glossary type (use +% \cs{glsdefaulttype} glossary by default). +% This shouldn't be used at user level +% as \cs{glslink} sets the correct format. The associated +% number should be stored in \cs{theglsentrycounter} +% before using \cs{glossary}. +%\begin{macro}{\glossary} % \begin{macrocode} -\ifglsentrycounter - \newcommand*{\glsresetentrycounter}{% - \setcounter{glossaryentry}{0}% - } -\else - \newcommand*{\glsresetentrycounter}{} -\fi +\renewcommand*{\glossary}[1][\glsdefaulttype]{% + \@glossary[#1]% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsstepentry} -%\changes{3.0}{2011/04/02}{new} -% Advance the \ctr{glossaryentry} counter if in use. The argument is -% the label associated with the entry. +% Define internal \cs{@glossary} to ignore its argument. +% This gets redefined in \cs{@makeglossary}. This is +% defined to just \cs{index} as \cls{memoir} changes the definition of +% \cs{@index}. (Thanks to Dan Luecking for pointing this out.) +%\begin{macro}{\@glossary} +%\changes{1.17}{2008 December 26}{changed definition to use +%\cs{index} instead of \cs{@index}} % \begin{macrocode} -\ifglsentrycounter - \newcommand*{\glsstepentry}[1]{% - \refstepcounter{glossaryentry}% - \label{glsentry-#1}% - } -\else - \newcommand*{\glsstepentry}[1]{} -\fi +\def\@glossary[#1]{\index} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsstepsubentry} -%\changes{3.0}{2011/04/02}{new} -% Advance the \ctr{glossarysubentry} counter if in use. The argument is -% the label associated with the subentry. +% This is a convenience command to set \cs{@glossary}. +% It is used by \cs{@makeglossary} and then redefined to +% do nothing, as it only needs to be done once. +%\begin{macro}{\@gls@renewglossary} % \begin{macrocode} -\ifglssubentrycounter - \newcommand*{\glsstepsubentry}[1]{% - \def\currentglssubentry{#1}% - \refstepcounter{glossarysubentry}% - \label{glsentry-#1}% - } -\else - \newcommand*{\glsstepsubentry}[1]{} -\fi +\newcommand{\@gls@renewglossary}{% + \gdef\@glossary[##1]{\@bsphack\begingroup\@wrglossary{##1}}% + \let\@gls@renewglossary\@empty +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsrefentry} -%\changes{3.0}{2011/04/02}{new} -% Reference the entry or sub-entry counter if in use, otherwise just do -% \ics{gls}. +% The \cs{@wrglossary} command is redefined to have +% two arguments. The first argument is the glossary type, +% the second argument is the glossary entry +% (the format of which is set in \cs{glslink}). +%\begin{macro}{\@wrglossary} +%\changes{1.17}{2008 December 26}{modified to allow for xindy support} +%\changes{3.0}{2010 Jul 12}{modified to take into account +%\pkgopt{savewrites}} % \begin{macrocode} -\ifglsentrycounter - \newcommand*{\glsrefentry}[1]{\ref{glsentry-#1}} -\else - \ifglssubentrycounter - \newcommand*{\glsrefentry}[1]{\ref{glsentry-#1}} +\renewcommand*{\@wrglossary}[2]{% + \ifglssavewrites + \protected@edef\@gls@tmp{\the\csname glo@#1@filetok\endcsname#2}% + \expandafter\global\expandafter\csname glo@#1@filetok\endcsname + \expandafter{\@gls@tmp^^J}% \else - \newcommand*{\glsrefentry}[1]{\gls{#1}} - \fi -\fi % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsentrycounterlabel} -%\changes{3.0}{2011/04/02}{new} -% Defines how to display the \ctr{glossaryentry} counter. +%\changes{3.02}{2012/05/21}{added check for glossary file defined}% % \begin{macrocode} -\ifglsentrycounter - \newcommand*{\glsentrycounterlabel}{\theglossaryentry.\space} -\else - \newcommand*{\glsentrycounterlabel}{} -\fi + \ifcsdef{glo@#1@file}% + {% + \expandafter\protected@write\csname glo@#1@file\endcsname{% + \gls@disablepagerefexpansion}{#2}% + }% + {% + \GlossariesWarning{No file defined for glossary `#1'}% + }% + \fi + \endgroup\@esphack +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glssubentrycounterlabel} -%\changes{3.0}{2011/04/02}{new} -% Defines how to display the \ctr{glossarysubentry} counter. +%\begin{macro}{\@do@wrglossary} +%\changes{3.02}{2012/05/21}{changed \cs{@do@wr@glossary} to test for +%\pkgopt{indexonlyfirst} option; put old \cs{@do@wr@glossary} code +%into \cs{@@do@wrglossary}} % \begin{macrocode} -\ifglssubentrycounter - \newcommand*{\glssubentrycounterlabel}{\theglossarysubentry)\space} -\else - \newcommand*{\glssubentrycounterlabel}{} -\fi +\newcommand*{\@do@wrglossary}[1]{% + \ifglsindexonlyfirst + \ifglsused{#1}{}{\@@do@wrglossary{#1}}% + \else + \@@do@wrglossary{#1}% + \fi +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsentryitem} -% Step and display \ctr{glossaryentry} counter, if appropriate. -%\changes{3.0}{2011/04/02}{new} +%\begin{macro}{\gls@protected@pagefmts} +%\changes{3.04}{2012-11-18}{new} +%\changes{3.05}{2013-04-21}{added Roman to list} +% List of page formats to be protected against expansion. % \begin{macrocode} -\ifglsentrycounter - \newcommand*{\glsentryitem}[1]{% - \glsstepentry{#1}\glsentrycounterlabel - } -\else - \newcommand*{\glsentryitem}[1]{\glsresetsubentrycounter} -\fi +\newcommand{\gls@protected@pagefmts}{% + \gls@numberpage,\gls@alphpage,\gls@Alphpage,\gls@romanpage,\gls@Romanpage% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glssubentryitem} -% Step and display \ctr{glossarysubentry} counter, if appropriate. -%\changes{3.0}{2011/04/02}{new} +%\begin{macro}{\gls@disablepagerefexpansion} +%\changes{3.04}{2012-11-18}{new} % \begin{macrocode} -\ifglssubentrycounter - \newcommand*{\glssubentryitem}[1]{% - \glsstepsubentry{#1}\glssubentrycounterlabel - } -\else - \newcommand*{\glssubentryitem}[1]{} -\fi +\newcommand*{\gls@disablepagerefexpansion}{% + \@for\@gls@this:=\gls@protected@pagefmts\do + {% + \expandafter\let\@gls@this\relax + }% +} % \end{macrocode} %\end{macro} -% -%\begin{environment}{theglossary} -% If the \env{theglossary} environment has -% already been defined, a warning will be issued. -% This environment should be redefined by glossary styles. -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +%\begin{macro}{\gls@alphpage} +%\changes{3.04}{2012-11-18}{new} % \begin{macrocode} -\ifcsundef{theglossary}% -{% - \newenvironment{theglossary}{}{}% -}% -{% - \GlossariesWarning{overriding `theglossary' environment}% - \renewenvironment{theglossary}{}{}% -} +\newcommand*{\gls@alphpage}{\@alph\c@page} % \end{macrocode} -%\end{environment} -% -% The glossary header is given by \cs{glossaryheader}. -% This forms part of the glossary style, and -% must indicate what should appear immediately after the start of the -% \env{theglossary} environment. (For example, if the glossary -% uses a tabular-like environment, it may be used to set the -% header row.) Note that if you don't want a header row, the glossary -% style must redefine \cs{glossaryheader} to do nothing. -%\begin{macro}{\glossaryheader} +%\end{macro} +%\begin{macro}{\gls@Alphpage} +%\changes{3.04}{2012-11-18}{new} % \begin{macrocode} -\newcommand*{\glossaryheader}{} +\newcommand*{\gls@Alphpage}{\@Alph\c@page} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glstarget} -%\changes{1.18}{2009 January 14}{new} -%\cs{glstarget}\marg{label}\marg{name}\\[10pt] -% Provide user interface to \cs{@glstarget} to make it easier to -% modify the glossary style in the document. +%\begin{macro}{\gls@numberpage} +%\changes{3.04}{2012-11-18}{new} % \begin{macrocode} -\newcommand*{\glstarget}[2]{\@glstarget{\glolinkprefix#1}{#2}} +\newcommand*{\gls@numberpage}{\number\c@page} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glossaryentryfield} -% \cs{glossaryentryfield}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt] -% This command governs how each entry row should be formatted -% in the glossary. Glossary styles need to redefine this command. -% Most of the predefined styles ignore \meta{symbol}. +%\begin{macro}{\gls@romanpage} +%\changes{3.04}{2012-11-18}{new} % \begin{macrocode} -\newcommand*{\glossaryentryfield}[5]{% -\noindent\textbf{\glstarget{#1}{#2}} #4 #3. #5\par} +\newcommand*{\gls@romanpage}{\romannumeral\c@page} % \end{macrocode} %\end{macro} -%\begin{macro}{\glossaryentryfield} -% \cs{glossarysubentryfield}\marg{level}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt] -% This command governs how each subentry should be formatted -% in the glossary. Glossary styles need to redefine this command. -% Most of the predefined styles ignore \meta{symbol}. The first -% argument is a number indicating the level. (The level should -% be greater than or equal to 1.) +%\begin{macro}{\gls@Romanpage} +%\changes{3.05}{2013-04-21}{new} % \begin{macrocode} -\newcommand*{\glossarysubentryfield}[6]{% -\glstarget{#2}{\strut}#4. #6\par} +\newcommand*{\gls@Romanpage}{\@Roman\c@page} % \end{macrocode} %\end{macro} -% -% Within each glossary, the entries form distinct groups -% which are determined by the first character of the \gloskey{sort} -% key. When using \app{makeindex}, there will be a maximum of 28 groups: symbols, numbers, -% and the 26 alphabetical groups A, \ldots, Z\@. If you use -% \app{xindy} the groups will depend on whatever alphabet -% is used. This is determined by the language or custom -% alphabets can be created in the \app{xindy} style file. -% The command \cs{glsgroupskip} -% specifies what to do between glossary groups. Glossary styles -% must redefine this command. (Note that \cs{glsgroupskip} -% only occurs between groups, not at the start or end of the -% glossary.) -%\begin{macro}{\glsgroupskip} +%\begin{macro}{\@@do@wrglossary} +%\changes{1.17}{2008 December 26}{new} +% Write the glossary entry in the appropriate format. +% (Need to set \cs{@glsnumberformat} and \cs{@gls@counter} prior to use.) +% The argument is the entry's label. +%\changes{3.0}{2011/04/02}{modified to use new format} % \begin{macrocode} -\newcommand*{\glsgroupskip}{} +\newcommand*{\@@do@wrglossary}[1]{% + \begingroup % \end{macrocode} -%\end{macro} -% -% Each of the 28 glossary groups described above is preceded by a -% group heading. -% This is formatted by the command \cs{glsgroupheading} -% which takes one argument which is the \emph{label} assigned to that -% group (not the title). The corresponding labels are: \texttt{glssymbols}, -% \texttt{glsnumbers}, \texttt{A}, \ldots, \texttt{Z}. -% Glossary styles must redefined this command. (In between groups, -% \cs{glsgroupheading} comes immediately after \cs{glsgroupskip}.) -%\begin{macro}{\glsgroupheading} +% First a bit of hackery to prevent premature +% expansion of \cs{c@page}. Store original definitions: +%\changes{3.04}{2012-11-18}{modified to compensate for possible +%incorrect page number} % \begin{macrocode} -\newcommand*{\glsgroupheading}[1]{} + \let\orgthe\the + \let\orgnumber\number + \let\orgromannumeral\romannumeral + \let\orgalph\@alph + \let\orgAlph\@Alph + \let\orgRoman\@Roman % \end{macrocode} -%\end{macro} -% It is possible to ``trick'' \app{makeindex} into -% treating entries as though they belong to the same group, -% even if the terms don't start with the same letter, by -% modifying the \gloskey{sort} key. For example, all entries -% belonging to one -% group could be defined so that the \gloskey{sort} key starts with an -% "a", while entries belonging to another group could be defined -% so that the \gloskey{sort} key starts with a "b", and so on. If -% you want each group to have a heading, you would then need to -% modify the translation control sequences \cs{glsgetgrouptitle} -% and \cs{glsgetgrouplabel} so that the label is translated -% into the required title (and vice-versa). -%\\[10pt] -%\cs{glsgetgrouptitle}\marg{label}\\[10pt] -% This command produces the title for the glossary group -% whose label is given by \meta{label}. By default, the group -% labelled \texttt{glssymbols} produces -% \ics{glssymbolsgroupname}, the group labelled -% \texttt{glsnumbers} produces \ics{glsnumbersgroupname} -% and all the other groups simply produce their label. -% As mentioned above, the group labels are: \texttt{glssymbols}, \texttt{glsnumbers}, -% \texttt{A}, \ldots, \texttt{Z}\@. If you want to redefine -% the group titles, you will need to redefine this command. -%\begin{macro}{\glsgetgrouptitle} -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +% Redefine: +%\changes{3.05}{2013-04-21}{add Roman case. Fixed bugs in the else statements} % \begin{macrocode} -\newcommand*{\glsgetgrouptitle}[1]{% - \ifcsundef{#1groupname}{#1}{\csname #1groupname\endcsname}% -} + \def\the##1{% + \ifx##1\c@page \gls@numberpage\else\orgthe##1\fi}% + \def\number##1{% + \ifx##1\c@page \gls@numberpage\else\orgnumber##1\fi}% + \def\romannumeral##1{% + \ifx##1\c@page \gls@romanpage\else\orgromannumeral##1\fi}% + \def\@Roman##1{% + \ifx##1\c@page \gls@Romanpage\else\orgRoman##1\fi}% + \def\@alph##1{% + \ifx##1\c@page \gls@alphpage\else\orgalph##1\fi}% + \def\@Alph##1{% + \ifx##1\c@page \gls@Alphpage\else\orgAlph##1\fi}% % \end{macrocode} -%\end{macro} -%\vskip5pt -%\cs{glsgetgrouplabel}\marg{title}\\[10pt] -%This command does the reverse to the previous command. The -% argument is the group title, and it produces the group label. -% Note that if you redefine \cs{glsgetgrouptitle}, you -% will also need to redefine \cs{glsgetgrouplabel}. -%\begin{macro}{\glsgetgrouplabel} -%\changes{3.05}{2013-04-21}{fixed bug (typo in \cs{equal})} +% Prevent expansion: % \begin{macrocode} -\newcommand*{\glsgetgrouplabel}[1]{% -\ifthenelse{\equal{#1}{\glssymbolsgroupname}}{glssymbols}{% -\ifthenelse{\equal{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} + \gls@disablepagerefexpansion +% \end{macrocode} +% Now store location in \cs{@glslocref}: +% \begin{macrocode} + \protected@xdef\@glslocref{\theglsentrycounter}% + \endgroup +% \end{macrocode} +% Escape any special characters +% \begin{macrocode} + \@gls@checkmkidxchars\@glslocref +% \end{macrocode} +% Check if the hyper-location is the same as the location and set +% the hyper prefix. +%\changes{3.0}{2011/04/02}{added check for hyper location prefix} +% \begin{macrocode} + \expandafter\ifx\theHglsentrycounter\theglsentrycounter + \def\@glo@counterprefix{}% + \else + \protected@edef\@glsHlocref{\theHglsentrycounter}% + \@gls@checkmkidxchars\@glsHlocref + \edef\@do@gls@getcounterprefix{\noexpand\@gls@getcounterprefix + {\@glslocref}{\@glsHlocref}% + }% + \@do@gls@getcounterprefix + \fi +% \end{macrocode} +% Determine whether to use \app{xindy} or \app{makeindex} +% syntax +% \begin{macrocode} + \ifglsxindy +% \end{macrocode} +% Need to determine if the formatting information starts with +% a ( or ) indicating a range. +% \begin{macrocode} + \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil + \def\@glo@range{}% + \expandafter\if\@glo@prefix(\relax + \def\@glo@range{:open-range}% + \else + \expandafter\if\@glo@prefix)\relax + \def\@glo@range{:close-range}% + \fi + \fi +% \end{macrocode} +% Write to the glossary file using \app{xindy} syntax. +% \begin{macrocode} + \glossary[\csname glo@#1@type\endcsname]{% + (indexentry :tkey (\csname glo@#1@index\endcsname) +% \end{macrocode} +%\changes{3.02}{2012/05/21}{changed \cs{@glslocref} to \cs{theglsentrycounter}} +%\changes{3.04}{2012-11-18}{changed \cs{theglsentrycounter} back to \cs{@glslocref}} +% \begin{macrocode} + :locref \string"{\@glo@counterprefix}{\@glslocref}\string" % + :attr \string"\@gls@counter\@glo@suffix\string" + \@glo@range + ) + }% + \else +% \end{macrocode} +% Convert the format information into the format required for +% \app{makeindex} +% \begin{macrocode} + \@set@glo@numformat{\@glo@numfmt}{\@gls@counter}{\@glsnumberformat}% + {\@glo@counterprefix}% +% \end{macrocode} +% Write to the glossary file using \app{makeindex} syntax. +% \begin{macrocode} + \glossary[\csname glo@#1@type\endcsname]{% + \string\glossaryentry{\csname glo@#1@index\endcsname + \@gls@encapchar\@glo@numfmt}{\@glslocref}}% + \fi +} % \end{macrocode} %\end{macro} % -% The command \cs{setentrycounter} sets the entry's -% associated counter (required by -% \cs{glshypernumber} etc.) \ics{glslink} and -% \ics{glsadd} encode the -% \ics{glossary} argument so that the relevant counter is -% set prior to the formatting command. -%\begin{macro}{\setentrycounter} -%\changes{3.0}{2011/04/02}{added optional argument} +%\begin{macro}{\@gls@getcounterprefix} +% Get the prefix that needs to be prepended to counter in order to +% get the hyper counter. (For example, with the standard +% \cls{article} class and \sty{hyperref}, \ics{theequation} needs to +% be prefixed with \meta{section num}|.| to get the equivalent +% \ics{theHequation}.) NB this assumes that the prefix ends with a +% dot, which is the standard. (Otherwise it makes the xindy location +% classes more complicated.) % \begin{macrocode} -\newcommand*{\setentrycounter}[2][]{% - \def\@glo@counterprefix{#1}% - \ifx\@glo@counterprefix\@empty - \def\@glo@counterprefix{.}% +\newcommand*\@gls@getcounterprefix[2]{% + \edef\@gls@thisloc{#1}\edef\@gls@thisHloc{#2}% + \ifx\@gls@thisloc\@gls@thisHloc + \def\@glo@counterprefix{}% \else - \def\@glo@counterprefix{.#1.}% + \def\@gls@get@counterprefix##1.#1##2\end@getprefix{% + \def\@glo@tmp{##2}% + \ifx\@glo@tmp\@empty + \def\@glo@counterprefix{}% + \else + \def\@glo@counterprefix{##1}% + \fi + }% + \@gls@get@counterprefix#2.#1\end@getprefix \fi - \def\glsentrycounter{#2}% } % \end{macrocode} %\end{macro} % -% The current glossary style can be set using -% \cs{glossarystyle}\marg{style}. -%\begin{macro}{\glossarystyle} -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +%\subsection{Glossary Entry Cross-References} +%\begin{macro}{\@do@seeglossary} +%\changes{1.17}{2008 December 26}{new} +% Write the glossary entry with a cross reference. +% The first argument is the entry's label, the second must be in +% the form \oarg{tag}\marg{list}, where \meta{tag} is a tag +% such as ``see'' and \meta{list} is a list of labels. +%\changes{3.0}{2011/04/02}{Sanitize and escape cross-referencing +%information} % \begin{macrocode} -\newcommand*{\glossarystyle}[1]{% - \ifcsundef{@glsstyle@#1}% - {% - \PackageError{glossaries}{Glossary style `#1' undefined}{}% - }% - {% - \csname @glsstyle@#1\endcsname +\newcommand{\@do@seeglossary}[2]{% +\def\@gls@xref{#2}% +\@onelevel@sanitize\@gls@xref +\@gls@checkmkidxchars\@gls@xref +\ifglsxindy + \glossary[\csname glo@#1@type\endcsname]{% + (indexentry + :tkey (\csname glo@#1@index\endcsname) + :xref (\string"\@gls@xref\string") + :attr \string"see\string" + ) }% +\else + \glossary[\csname glo@#1@type\endcsname]{% + \string\glossaryentry{\csname glo@#1@index\endcsname + \@gls@encapchar glsseeformat\@gls@xref}{Z}}% +\fi } % \end{macrocode} %\end{macro} % -%\begin{macro}{\newglossarystyle} -% New glossary styles can be defined using:\\[10pt] -% \cs{newglossarystyle}\marg{name}\marg{definition}\\[10pt] -% The \meta{definition} argument should redefine -% \env{theglossary}, \ics{glossaryheader}, -% \ics{glsgroupheading}, \ics{glossaryentryfield} and -% \ics{glsgroupskip} (see \autoref{sec:code:styles} for the -% definitions of predefined styles). Glossary styles should not -% redefine \ics{glossarypreamble} and -% \ics{glossarypostamble}, as -% the user should be able to switch between styles without affecting -% the pre- and postambles. -%\changes{1.17}{2008 December 26}{made 'newglossarystyle long} -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +%\begin{macro}{\@gls@fixbraces} +% If no optional argument is specified, list needs to be enclosed +% in a set of braces. % \begin{macrocode} -\newcommand{\newglossarystyle}[2]{% - \ifcsundef{@glsstyle@#1}% - {% - \expandafter\def\csname @glsstyle@#1\endcsname{#2}% - }% - {% - \PackageError{glossaries}{Glossary style `#1' is already defined}{}% - }% +\def\@gls@fixbraces#1#2#3\@nil{% + \ifx#2[\relax + \def#1{#2#3}% + \else + \def#1{{#2#3}}% + \fi } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\renewglossarystyle} -%\changes{3.02}{2012/05/21}{new} -%Code for this macro supplied by Marco Daniel. +%\begin{macro}{\glssee} +%\cs{glssee}\marg{label}\marg{cross-ref list} +%\changes{1.17}{2008 December 26}{new} +%\changes{3.08a}{2013-09-28}{made robust} % \begin{macrocode} -\newcommand{\renewglossarystyle}[2]{% - \ifcsundef{@glsstyle@#1}% - {% - \PackageError{glossaries}{Glossary style `#1' isn't already defined}{}% - }% - {% - \csdef{@glsstyle@#1}{#2}% - }% -} +\DeclareRobustCommand*{\glssee}[3][\seename]{% + \@do@seeglossary{#2}{[#1]{#3}}} +\newcommand*{\@glssee}[3][\seename]{% + \glssee[#1]{#3}{#2}} % \end{macrocode} %\end{macro} % -% Glossary entries are encoded so that the second argument -% to \ics{glossaryentryfield} is always specified as -% \cs{glsnamefont}\marg{name}. This allows the -% user to change the font used to display the name term -% without having to redefine \ics{glossaryentryfield}. -% The default uses the surrounding font, so in the list type -% styles (which place the name in the optional argument to -% \ics{item}) the name will appear in bold. -%\begin{macro}{\glsnamefont} +%\begin{macro}{\glsseeformat} +%\changes{1.17}{2008 December 26}{new} +%\changes{3.08a}{2013-09-28}{made robust} +% The first argument specifies what tag to use (e.g.\ ``see''), +% the second argument is a comma-separated list of labels. +% The final argument (the location) is ignored. % \begin{macrocode} -\newcommand*{\glsnamefont}[1]{#1} +\DeclareRobustCommand*{\glsseeformat}[3][\seename]{% + \emph{#1} \glsseelist{#2}} % \end{macrocode} %\end{macro} -% -% Each glossary entry has an associated number list (usually page -% numbers) that indicate where in the document the entry has been -% used. The format for these number lists can be changed using the -% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \ics{glslink}. -% The default format is given by \cs{glshypernumber}. This takes -% a single argument which may be a single number, a number range -% or a number list. The number ranges are delimited with -% \ics{delimR}, the number lists are delimited with -% \ics{delimN}. -% -% If the document doesn't have hyperlinks, the numbers can be -% displayed just as they are, but if the document supports -% hyperlinks, the numbers should link to the relevant location. -% This means extracting the individual numbers from the list or -% ranges. The \isty{hyperref} package does this with the -% \ics{hyperpage} command, but this is encoded for comma and -% dash delimiters and only for the page counter, but this code needs -% to be more general. So I have adapted the code used in the -% \isty{hyperref} package. -%\begin{macro}{\glshypernumber} -%\changes{1.17}{2008 December 26}{modified to allow material -% to be attached to location} -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +%\begin{macro}{\glsseelist} +%\cs{glsseelist}\marg{list} formats list of entry labels. +%\changes{3.08a}{2013-09-28}{made robust} % \begin{macrocode} -\ifcsundef{hyperlink}% -{% - \def\glshypernumber#1{#1}% -}% -{% - \def\glshypernumber#1{\@glshypernumber#1\nohyperpage{}\@nil} -} +\DeclareRobustCommand*{\glsseelist}[1]{% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@glshypernumber} -% This code was provided by Heiko~Oberdiek to allow material -% to be attached to the location. -%\changes{1.17}{2008 December 26}{new} +% If there is only one item in the list, set the last separator +% to do nothing. % \begin{macrocode} -\def\@glshypernumber#1\nohyperpage#2#3\@nil{% - \ifx\\#1\\% - \else - \@delimR#1\delimR\delimR\\% - \fi - \ifx\\#2\\% - \else - #2% - \fi - \ifx\\#3\\% - \else - \@glshypernumber#3\@nil - \fi -} + \let\@gls@dolast\relax % \end{macrocode} -%\end{macro} -% \cs{@delimR} displays a range of numbers for the counter -% whose name is given by -% \cs{@gls@counter} (which must be set prior to using -% \cs{glshypernumber}). -%\begin{macro}{\@delimR} +% Don't display separator on the first iteration of the loop % \begin{macrocode} -\def\@delimR#1\delimR #2\delimR #3\\{% -\ifx\\#2\\% - \@delimN{#1}% -\else - \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% -\fi} + \let\@gls@donext\relax % \end{macrocode} -%\end{macro} -% \cs{@delimN} displays a list of individual numbers, -% instead of a range: -%\begin{macro}{\@delimN} +% Iterate through the labels % \begin{macrocode} -\def\@delimN#1{\@@delimN#1\delimN \delimN\\} -\def\@@delimN#1\delimN #2\delimN#3\\{% -\ifx\\#3\\% - \@gls@numberlink{#1}% -\else - \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}% -\fi -} + \@for\@gls@thislabel:=#1\do{% % \end{macrocode} -%\end{macro} -% The following code is modified from hyperref's -% \cs{HyInd@pagelink} where -% the name of the counter being used is given by -% \cs{@gls@counter}. +% Check if on last iteration of loop % \begin{macrocode} -\def\@gls@numberlink#1{% -\begingroup - \toks@={}% - \@gls@removespaces#1 \@nil -\endgroup} + \ifx\@xfor@nextelement\@nnil + \@gls@dolast + \else + \@gls@donext + \fi % \end{macrocode} +% display the entry for this label % \begin{macrocode} -\def\@gls@removespaces#1 #2\@nil{% - \toks@=\expandafter{\the\toks@#1}% - \ifx\\#2\\% - \edef\x{\the\toks@}% - \ifx\x\empty - \else + \glsseeitem{\@gls@thislabel}% % \end{macrocode} -%\changes{3.0}{2011/04/02}{added prefix to hyperlink} +% Update separators % \begin{macrocode} - \hyperlink{\glsentrycounter\@glo@counterprefix\the\toks@}% - {\the\toks@}% - \fi - \else - \@gls@ReturnAfterFi{% - \@gls@removespaces#2\@nil - }% - \fi + \let\@gls@dolast\glsseelastsep + \let\@gls@donext\glsseesep + }% } -\long\def\@gls@ReturnAfterFi#1\fi{\fi#1} % \end{macrocode} +%\end{macro} % -% The following commands will switch to the -% appropriate font, and create a hyperlink, if hyperlinks are -% supported. If hyperlinks are not supported, they will just -% display their argument in the appropriate font. -%\begin{macro}{\hyperrm} +%\begin{macro}{\glsseelastsep} +% Separator to use between penultimate and ultimate entries in a +% cross-referencing list. % \begin{macrocode} -\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} +\newcommand*{\glsseelastsep}{\space\andname\space} % \end{macrocode} %\end{macro} -%\begin{macro}{\hypersf} +%\begin{macro}{\glsseesep} +% Separator to use between entires in a cross-referencing list. % \begin{macrocode} -\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} +\newcommand*{\glsseesep}{, } % \end{macrocode} %\end{macro} -%\begin{macro}{\hypertt} +%\begin{macro}{\glsseeitem} +%\cs{glsseeitem}\marg{label} formats individual entry in a +% cross-referencing list. +%\changes{3.0}{2011/04/02}{hyperlink uses \cs{glsseeitemformat} instead +%of \cs{glsentryname}} +%\changes{3.08a}{2013-09-28}{made robust} % \begin{macrocode} -\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} +\DeclareRobustCommand*{\glsseeitem}[1]{\glshyperlink[\glsseeitemformat{#1}]{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\hyperbf} +%\begin{macro}{\glsseeitemformat} +%\changes{3.0}{2011/04/02}{new} +% As from v3.0, default is to use \ics{glsentrytext} instead of +% \ics{glsentryname}. (To avoid problems with the \gloskey{name} key being +% sanitized.) % \begin{macrocode} -\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} +\newcommand*{\glsseeitemformat}[1]{\glsentrytext{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\hypermd} +% +% \subsection{Displaying the glossary}\label{sec:code:printglos} +% An individual glossary is displayed in the text using +% \cs{printglossary}\oarg{key-val list}. If the +% \gloskey[printglossary]{type} key is omitted, the default glossary is displayed. +% The optional argument can be used to specify an alternative +% glossary, and can also be used to set the style, title and +% entry in the table of contents. Available keys are defined below. +% +%\begin{macro}{\gls@save@numberlist} +%\changes{3.02}{2012/05/21}{new} +% Provide command to store number list. % \begin{macrocode} -\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} +\newcommand*{\gls@save@numberlist}[1]{% + \ifglssavenumberlist + \toks@{#1}% + \edef\@do@writeaux@info{% + \noexpand\csgdef{glo@\glscurrententrylabel @numberlist}{\the\toks@}% + }% + \@onelevel@sanitize\@do@writeaux@info + \protected@write\@auxout{}{\@do@writeaux@info}% + \fi +} % \end{macrocode} %\end{macro} -%\begin{macro}{\hyperit} +% +%\begin{macro}{\warn@noprintglossary} +% Warn the user if they have forgotten \ics{printglossaries} +% or \ics{printglossary}. (Will be suppressed if there is at +% least one occurance of \ics{printglossary}. There is no check +% to ensure that there is a \ics{printglossary} for each defined +% glossary.) % \begin{macrocode} -\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} +\def\warn@noprintglossary{% + \GlossariesWarningNoLine{No \string\printglossary\space + or \string\printglossaries\space + found.^^JThis document will not have a glossary}% +} % \end{macrocode} %\end{macro} -%\begin{macro}{\hypersl} -% \begin{macrocode} -\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} +% +%\begin{macro}{\printglossary} +%\changes{1.17}{2008 December 26}{added print language to aux file} +%\changes{1.15}{2008 August 15}{changed the way the TOC title is set} +%\changes{1.17}{2008 December 26}{added check to determine if +%\cs{printglossary} is already +% defined} +% The TOC title needs to be processed in a different manner +% to the main title in case the \sty{translator} and \sty{hyperref} packages +% are both being used. +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} +% \begin{macrocode} +\ifcsundef{printglossary}{}% +{% % \end{macrocode} -%\end{macro} -%\begin{macro}{\hyperup} +% If \cs{printglossary} is already defined, issue a warning +% and undefine it. % \begin{macrocode} -\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} + \GlossariesWarning{Overriding \string\printglossary}% + \undef\printglossary +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\hypersc} +% \cs{printglossary} has an optional argument. The default +% value is to set the glossary type to the main glossary. % \begin{macrocode} -\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} +\newcommand*{\printglossary}[1][type=\glsdefaulttype]{% % \end{macrocode} -%\end{macro} -%\begin{macro}{\hyperemph} +% Set up defaults. % \begin{macrocode} -\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} + \def\@glo@type{\glsdefaulttype}% + \def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% % \end{macrocode} -%\end{macro} -% -%\subsection{Acronyms}\label{sec:acronym} -%If the \pkgopt{acronym} package option is used, a -% new glossary called "acronym" is created +%\changes{3.03}{2012/09/21}{allow title to override default toctitle} % \begin{macrocode} -\ifglsacronym - \newglossary[alg]{acronym}{acr}{acn}{\acronymname} + \def\glossarytoctitle{\glossarytitle}% + \let\org@glossarytitle\glossarytitle + \def\@glossarystyle{}% + \def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% % \end{macrocode} -%and \ics{acronymtype} is set to the name of this new glossary. +% Store current value of \ics{glossaryentrynumbers}. (This may +% be changed via the optional argument) % \begin{macrocode} - \renewcommand*{\acronymtype}{acronym} -\fi + \let\@org@glossaryentrynumbers\glossaryentrynumbers % \end{macrocode} -%\begin{macro}{\oldacronym} -%\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list}\\[10pt] -% This emulates the way the old \isty{glossary} package defined -% acronyms. It is equivalent to \ics{newacronym}\oarg{key-val -% list}\marg{label}\marg{abbrv}\marg{long} and it additionally -% defines the command \cs{}\meta{label} which is equivalent to -% \cs{gls}\marg{label} (thus \meta{label} must only contain -% alphabetical characters). If \meta{label} is omitted, \meta{abbrv} -% is used. This only emulates the syntax of the old \isty{glossary} -% package. The way the acronyms appear in the list of acronyms is -% determined by the definition of \ics{newacronym} and the -% glossary style. -% -% Note that \cs{}\meta{label} can't have an optional -% argument if the \isty{xspace} package is loaded. If -% \isty{xspace} hasn't been loaded then you can do -% \cs{}\meta{label}\oarg{insert} but you can't do -% \cs{}\meta{label}\oarg{key-val list}. For example if you define the -% acronym svm, then you can do "\svm['s]" but you can't do -% "\svm[format=textbf]". If the \isty{xspace} package is loaded, -% "\svm['s]" will appear as "svm ['s]" which is unlikely to be -% the desired result. In this case, you will need to use -% \cs{gls} explicitly, e.g.\ "\gls{svm}['s]". Note that it is -% up to the user to load \isty{xspace} if desired. -%\changes{1.18}{2009 January 14}{new} -%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with -%\cs{ifcsundef}} +% Localise the effects of the optional argument % \begin{macrocode} -\newcommand{\oldacronym}[4][\gls@label]{% - \def\gls@label{#2}% - \newacronym[#4]{#1}{#2}{#3}% - \ifcsundef{xspace}% - {% - \expandafter\edef\csname#1\endcsname{% - \noexpand\@ifstar{\noexpand\Gls{#1}}{\noexpand\gls{#1}}% - }% - }% - {% - \expandafter\edef\csname#1\endcsname{% - \noexpand\@ifstar{\noexpand\Gls{#1}\noexpand\xspace}{% - \noexpand\gls{#1}\noexpand\xspace}% - }% - }% -} + \bgroup % \end{macrocode} -%\end{macro} -%\vskip5pt -% \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long}\\[10pt] -% This is a quick way of defining acronyms, all it does -% is call \ics{newglossaryentry} with the appropriate -% values. It sets the -% glossary type to \ics{acronymtype} which will be -% "acronym" if the package option \pkgopt{acronym} has -% been used, otherwise it will be the default glossary. -% Since \cs{newacronym} merely calls \ics{newglossaryentry}, -% the acronym is treated like any other glossary entry. -% -% If you prefer a different format, you -% can redefine \cs{newacronym} as required. The optional -% argument can be used to override any of the settings. -% -% This is just a stub. It's redefined by commands like -% \cs{SetDefaultAcronymStyle}. -%\begin{macro}{\newacronym} +% Determine settings specified in the optional argument. % \begin{macrocode} - \newcommand{\newacronym}[4][]{} + \setkeys{printgloss}{#1}% % \end{macrocode} -%\changes{1.13}{2008 May 10}{Removed restriction on only using -% 'newacronym in the preamble} -%\end{macro} -% Set up some convenient short cuts. These need to be changed if -% \cs{newacronym} is changed (or if the \gloskey{description} key -% is changed). -% -%\begin{macro}{\acrpluralsuffix} -%\changes{1.13}{2008 May 10}{New} -% Plural suffix used by \cs{newacronym}. This just defaults to -% \cs{glspluralsuffix} but is changed to include \cs{textup} -% if the smallcaps option is used, so that the suffix doesn't appear -% in small caps as it doesn't look right. For example, -% \textsc{abcs} looks as though the ``s'' is part of the acronym, but -% \textsc{abc}s looks as though the ``s'' is a plural suffix. Since -% the entire text \texttt{abcs} is set in \cs{textsc}, \cs{textup} -% is need to cancel it out. +% If title has been set, but toctitle hasn't, make toctitle the same +% as given title (rather than the title used when the glossary was +% defined) +%\changes{3.0}{2011/04/02}{make toctitle default to title} % \begin{macrocode} -\newcommand*{\acrpluralsuffix}{\glspluralsuffix} + \ifx\glossarytitle\org@glossarytitle + \else + \expandafter\let\csname @glotype@\@glo@type @title\endcsname + \glossarytitle + \fi % \end{macrocode} -%\end{macro} -% -% The following are defined for compatibility with version 2.07 and -% earlier. -%\begin{macro}{\glsshortkey} +% Allow a high-level user command to indicate the current glossary +%\changes{3.0}{2011/04/02}{added \cs{currentglossary}} % \begin{macrocode} -\newcommand*{\glsshortkey}{short} + \let\currentglossary\@glo@type % \end{macrocode} -%\end{macro} -%\begin{macro}{\glsshortpluralkey} +%Enable individual number lists to be suppressed. % \begin{macrocode} -\newcommand*{\glsshortpluralkey}{shortplural} + \let\org@glossaryentrynumbers\glossaryentrynumbers + \let\glsnonextpages\@glsnonextpages % \end{macrocode} -%\end{macro} -%\begin{macro}{\glslongkey} +% Enable individual number list to be activated: +%\changes{3.0}{2011/04/02}{added \cs{glsnextpages}} % \begin{macrocode} -\newcommand*{\glslongkey}{long} + \let\glsnextpages\@glsnextpages % \end{macrocode} -%\end{macro} -%\begin{macro}{\glslongpluralkey} +% Enable suppression of description terminators. % \begin{macrocode} -\newcommand*{\glslongpluralkey}{longplural} + \let\nopostdesc\@nopostdesc % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\acrfull} -% Full form of the acronym. -%\changes{3.01}{2011/04/12}{made robust} +% Set up the entry for the TOC % \begin{macrocode} -\newrobustcmd*{\acrfull}{% - \@ifstar\s@acrfull\ns@acrfull -} + \gls@dotoctitle % \end{macrocode} -%\changes{3.0}{2011/04/02}{added starred version} +% Set the glossary style % \begin{macrocode} -\newcommand*\s@acrfull[2][]{% - \new@ifnextchar[{\@acrfull{hyper=false,#1}{#2}}% - {\@acrfull{hyper=false,#1}{#2}[]}% -} -\newcommand*\ns@acrfull[2][]{% - \new@ifnextchar[{\@acrfull{#1}{#2}}% - {\@acrfull{#1}{#2}[]}% -} + \@glossarystyle % \end{macrocode} -% Low-level macro: +%\changes{3.02}{2012/05/21}{add a way to fetch current entry label} +% added a way to fetch the current entry label (v3.08 updated for +% new \cs{glossentry} and \cs{subglossentry}): % \begin{macrocode} -\def\@acrfull#1#2[#3]{% - \acrlinkfullformat{\@acrlong}{\@acrshort}{#1}{#2}{#3}% -} + \let\gls@org@glossaryentryfield\glossentry + \let\gls@org@glossarysubentryfield\subglossentry + \renewcommand{\glossentry}[1]{% + \gdef\glscurrententrylabel{##1}% + \gls@org@glossaryentryfield{##1}% + }% + \renewcommand{\subglossentry}[2]{% + \gdef\glscurrententrylabel{##2}% + \gls@org@glossarysubentryfield{##1}{##2}% + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\acrlinkfullformat} -% Format for full links like \ics{acrfull}. Syntax: -% \cs{acrlinkfullformat}\marg{long cs}\marg{short -% cs}\marg{options}\marg{label}\marg{insert} +% Some macros may end up being expanded into internals in the +% glossary, so need to make @ a letter. % \begin{macrocode} -\newcommand{\acrlinkfullformat}[5]{% - \acrfullformat{#1{#3}{#4}[#5]}{#2{#3}{#4}[]}% -} + \makeatletter % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\acrfullformat} -% Default full form is \meta{long} \parg{short}. -%\changes{3.01}{2011/04/12}{removed \cs{acronymfont} as it should -%already be set in the second argument.} +% Input the glossary file, if it exists. % \begin{macrocode} -\newcommand{\acrfullformat}[2]{#1\space(#2)} + \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% % \end{macrocode} -%\end{macro} -% -% Default format for full acronym -%\begin{macro}{\Acrfull} -%\changes{3.01}{2011/04/12}{made robust} +% If the glossary file doesn't exist, do \cs{null}. (This ensures +% that the page is shipped out and all write commands are done.) +% This might produce an empty page, but at this point the document +% isn't complete, so it shouldn't matter. % \begin{macrocode} -\newrobustcmd*{\Acrfull}{% - \@ifstar\s@Acrfull\ns@Acrfull -} + \IfFileExists{\jobname.\csname @glotype@\@glo@type @in\endcsname}% + {}% + {\null}% % \end{macrocode} -%\changes{3.0}{2011/04/02}{added starred version} +% If \app{xindy} is being used, need to write the language +% dependent information to the \filetype{.aux} file for +% \app{makeglossaries}. +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} +%\changes{3.04}{2012-11-18}{Moved aux write to end of document to +%prevent unwanted whatsit occurring here.} % \begin{macrocode} -\newcommand*\s@Acrfull[2][]{% - \new@ifnextchar[{\@Acrfull{hyper=false,#1}{#2}}% - {\@Acrfull{hyper=false,#1}{#2}[]}% -} -\newcommand*\ns@Acrfull[2][]{% - \new@ifnextchar[{\@Acrfull{#1}{#2}}% - {\@Acrfull{#1}{#2}[]}% -} + \ifglsxindy + \ifcsundef{@xdy@\@glo@type @language}% + {% + \edef\@do@auxoutstuff{% + \noexpand\AtEndDocument{% % \end{macrocode} -% Low-level macro: +%\changes{3.10a}{2013-10-13}{Added providecommand code to aux file} +% If the user removes the glossary package from their document, +% ensure the next run doesn't throw a load of undefined control +% sequence errors when the aux file is parsed. % \begin{macrocode} -\def\@Acrfull#1#2[#3]{% - \acrlinkfullformat{\@Acrlong}{\@acrshort}{#1}{#2}{#3}% -} + \noexpand\immediate\noexpand\write\@auxout{% + \string\providecommand\string\@xdylanguage[2]{}}% + \noexpand\immediate\noexpand\write\@auxout{% + \string\@xdylanguage{\@glo@type}{\@xdy@main@language}}% + }% + }% + }% + {% + \edef\@do@auxoutstuff{% + \noexpand\AtEndDocument{% + \noexpand\immediate\noexpand\write\@auxout{% + \string\providecommand\string\@xdylanguage[2]{}}% + \noexpand\immediate\noexpand\write\@auxout{% + \string\@xdylanguage{\@glo@type}{\csname @xdy@\@glo@type + @language\endcsname}}% + }% + }% + }% + \@do@auxoutstuff + \edef\@do@auxoutstuff{% + \noexpand\AtEndDocument{% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\ACRfull} -%\changes{3.01}{2011/04/12}{made robust} +%\changes{3.10a}{2013-10-13}{Added providecommand code to aux file} +% If the user removes the glossary package from their document, +% ensure the next run doesn't throw a load of undefined control +% sequence errors when the aux file is parsed. % \begin{macrocode} -\newrobustcmd*{\ACRfull}{% - \@ifstar\s@ACRfull\ns@ACRfull -} + \noexpand\immediate\noexpand\write\@auxout{% + \string\providecommand\string\@gls@codepage[2]{}}% + \noexpand\immediate\noexpand\write\@auxout{% + \string\@gls@codepage{\@glo@type}{\gls@codepage}}% + }% + }% + \@do@auxoutstuff + \fi + \egroup % \end{macrocode} -%\changes{3.0}{2011/04/02}{added starred version} +% Reset \ics{glossaryentrynumbers} % \begin{macrocode} -\newcommand*\s@ACRfull[2][]{% - \new@ifnextchar[{\@ACRfull{hyper=false,#1}{#2}}% - {\@ACRfull{hyper=false,#1}{#2}[]}% -} -\newcommand*\ns@ACRfull[2][]{% - \new@ifnextchar[{\@ACRfull{#1}{#2}}% - {\@ACRfull{#1}{#2}[]}% -} + \global\let\glossaryentrynumbers\@org@glossaryentrynumbers % \end{macrocode} -% Low-level macro: +% Suppress warning about no \ics{printglossary} +%\changes{2.02}{2007 July 13}{suppressed warning globally rather than locally} % \begin{macrocode} -\def\@ACRfull#1#2[#3]{% - \acrlinkfullformat{\@ACRlong}{\@ACRshort}{#1}{#2}{#3}% + \global\let\warn@noprintglossary\relax } % \end{macrocode} %\end{macro} % -% Plural: -%\begin{macro}{\acrfullpl} -%\changes{1.13}{2008 May 10}{new} -%\changes{3.01}{2011/04/12}{made robust} +% The \cs{printglossaries} command will do \cs{printglossary} +% for each glossary type that has been defined. It is better +% to use \cs{printglossaries} rather than individual +% \cs{printglossary} commands to ensure that you don't forget +% any new glossaries you may have created. It also makes it easier to +% chop and change the value of the \pkgopt{acronym} package option. +% However, if you want to list the glossaries in a different order, +% or if you want to set the title or table of contents entry, or +% if you want to use different glossary styles for each glossary, you +% will need to use \cs{printglossary} explicitly for each +% glossary type. +%\begin{macro}{\printglossaries} % \begin{macrocode} -\newrobustcmd*{\acrfullpl}{% - \@ifstar\s@acrfullpl\ns@acrfullpl +\newcommand*{\printglossaries}{% + \forallglossaries{\@@glo@type}{\printglossary[type=\@@glo@type]}% } % \end{macrocode} -%\changes{3.0}{2011/04/02}{added starred version} +%\end{macro} +% The keys that can be used in the optional argument to +% \ics{printglossary} are as follows: +% The \gloskey[printglossary]{type} key sets the glossary type. % \begin{macrocode} -\newcommand*\s@acrfullpl[2][]{% - \new@ifnextchar[{\@acrfullpl{hyper=false,#1}{#2}}% - {\@acrfullpl{hyper=false,#1}{#2}[]}% -} -\newcommand*\ns@acrfullpl[2][]{% - \new@ifnextchar[{\@acrfullpl{#1}{#2}}% - {\@acrfullpl{#1}{#2}[]}% -} +\define@key{printgloss}{type}{\def\@glo@type{#1}} % \end{macrocode} -% Low-level macro: +% The \gloskey[printglossary]{title} key sets the title used in the glossary section +% header. This overrides the title used in \ics{newglossary}. +%\changes{3.03}{2012/09/21}{allow title to set toctitle} % \begin{macrocode} -\def\@acrfullpl#1#2[#3]{% - \acrlinkfullformat{\@acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% +\define@key{printgloss}{title}{% + \def\glossarytitle{#1}% + \let\gls@dotoctitle\relax } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\Acrfullpl} -%\changes{1.13}{2008 May 10}{new} -%\changes{3.01}{2011/04/12}{made robust} +% The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry +% in the table of contents. % \begin{macrocode} -\newrobustcmd*{\Acrfullpl}{% - \@ifstar\s@Acrfullpl\ns@Acrfullpl +\define@key{printgloss}{toctitle}{% + \def\glossarytoctitle{#1}% + \let\gls@dotoctitle\relax } % \end{macrocode} -%\changes{3.0}{2011/04/02}{added starred version} +% The \gloskey[printglossary]{style} key sets the glossary style (but only for +% the given glossary). +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} -\newcommand*\s@Acrfullpl[2][]{% - \new@ifnextchar[{\@Acrfullpl{hyper=false,#1}{#2}}% - {\@Acrfullpl{hyper=false,#1}{#2}[]}% -} -\newcommand*\ns@Acrfullpl[2][]{% - \new@ifnextchar[{\@Acrfullpl{#1}{#2}}% - {\@Acrfullpl{#1}{#2}[]}% +\define@key{printgloss}{style}{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}% + {Glossary style `#1' undefined}{}% + }% + {% + \def\@glossarystyle{\setglossentrycompatibility + \csname @glsstyle@#1\endcsname}% + }% } % \end{macrocode} -% Low-level macro: +% \changes{1.14}{2008 June 17}{added numberedsection key to +% \cs{printglossary}} +% The \gloskey[printglossary]{numberedsection} key determines if this +% glossary should be in a numbered section. % \begin{macrocode} -\def\@Acrfullpl#1#2[#3]{% - \acrlinkfullformat{\@Acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% -} +\define@choicekey{printgloss}{numberedsection}[\val\nr]{% +false,nolabel,autolabel}[nolabel]{% +\ifcase\nr\relax + \renewcommand*{\@@glossarysecstar}{*}% + \renewcommand*{\@@glossaryseclabel}{}% +\or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{}% +\or + \renewcommand*{\@@glossarysecstar}{}% + \renewcommand*{\@@glossaryseclabel}{\label{\glsautoprefix\@glo@type}}% +\fi} % \end{macrocode} -%\end{macro} % -%\begin{macro}{\ACRfullpl} -%\changes{1.13}{2008 May 10}{new} -%\changes{3.01}{2011/04/12}{made robust} -% \begin{macrocode} -\newrobustcmd*{\ACRfullpl}{% - \@ifstar\s@ACRfullpl\ns@ACRfullpl -} -% \end{macrocode} -%\changes{3.0}{2011/04/02}{added starred version} +%\changes{3.08a}{2013-09-28}{added nogroupskip key to \cs{printglossary}} +% The \gloskey[printglossary]{nogroupskip} key determines whether or +% not there should be a vertical gap between glossary groups. % \begin{macrocode} -\newcommand*\s@ACRfullpl[2][]{% - \new@ifnextchar[{\@ACRfullpl{hyper=false,#1}{#2}}% - {\@ACRfullpl{hyper=false,#1}{#2}[]}% -} -\newcommand*\ns@ACRfullpl[2][]{% - \new@ifnextchar[{\@ACRfullpl{#1}{#2}}% - {\@ACRfullpl{#1}{#2}[]}% +\define@choicekey{printgloss}{nogroupskip}{true,false}[true]{% + \csuse{glsnogroupskip#1}% } % \end{macrocode} -% Low-level macro: +% \changes{1.14}{2008 June 17}{added nonumberlist key to +% \cs{printglossary}} +% The \gloskey[printglossary]{nonumberlist} key determines if this +% glossary should have a number list. % \begin{macrocode} -\def\@ACRfullpl#1#2[#3]{% - \acrlinkfullformat{\@ACRlongpl}{\@ACRshortpl}{#1}{#2}{#3}% -} +\define@boolkey{printgloss}[gls]{nonumberlist}[true]{% +\ifglsnonumberlist + \def\glossaryentrynumbers##1{}% +\else + \def\glossaryentrynumbers##1{##1}% +\fi} % \end{macrocode} -%\end{macro} % -%\subsection{Predefined acronym styles} -%\begin{macro}{\acronymfont} -%This is only used with the additional acronym styles: +%\begin{macro}{\@glsnonextpages} +%\changes{1.17}{2008 December 26}{new}% +% Suppresses the next number list only. Global assignments required +% as it may not occur in the same level of grouping as the +% next numberlist. (For example, if \cs{glsnonextpages} is place +% in the entry's description and 3 column tabular style glossary +% is used.) \cs{org@glossaryentrynumbers} needs to be set at +% the start of each glossary, in the event that +% \ics{glossaryentrynumber} is redefined. % \begin{macrocode} -\newcommand{\acronymfont}[1]{#1} +\newcommand*{\@glsnonextpages}{% + \gdef\glossaryentrynumbers##1{% + \glsresetentrylist + }% +} % \end{macrocode} %\end{macro} -%\begin{macro}{\firstacronymfont} -%This is only used with the additional acronym styles: -%\changes{1.14}{2008 June 17}{new} +%\begin{macro}{\@glsnextpages} +%\changes{3.0}{2011/04/02}{new}% +% Activate the next number list only. Global assignments required +% as it may not occur in the same level of grouping as the +% next numberlist. (For example, if \cs{glsnextpages} is place +% in the entry's description and 3 column tabular style glossary +% is used.) \cs{org@glossaryentrynumbers} needs to be set at +% the start of each glossary, in the event that +% \ics{glossaryentrynumber} is redefined. % \begin{macrocode} -\newcommand{\firstacronymfont}[1]{\acronymfont{#1}} +\newcommand*{\@glsnextpages}{% + \gdef\glossaryentrynumbers##1{% + ##1\glsresetentrylist}} % \end{macrocode} %\end{macro} -%\begin{macro}{\acrnameformat} -% The styles that allow an additional description use -% \cs{acrnameformat}\marg{short}\marg{long} to determine what -% information is displayed in the name. +%\begin{macro}{\glsresetentrylist} +% Resets \cs{glossaryentrynumbers} % \begin{macrocode} -\newcommand*{\acrnameformat}[2]{\acronymfont{#1}} +\newcommand*{\glsresetentrylist}{% + \global\let\glossaryentrynumbers\org@glossaryentrynumbers} % \end{macrocode} %\end{macro} % -% Define some tokens used by \cs{newacronym}: -%\begin{macro}{\glskeylisttok} +% +%\begin{macro}{\glsnonextpages} +% Outside of \cs{printglossary} this does nothing. % \begin{macrocode} -\newtoks\glskeylisttok +\newcommand*{\glsnonextpages}{} % \end{macrocode} %\end{macro} -%\begin{macro}{\glslabeltok} +% +%\begin{macro}{\glsnextpages} +% Outside of \cs{printglossary} this does nothing. % \begin{macrocode} -\newtoks\glslabeltok +\newcommand*{\glsnextpages}{} % \end{macrocode} %\end{macro} -%\begin{macro}{\glsshorttok} +% +%\begin{counter}{glossaryentry} +%\changes{3.0}{2011/04/02}{new} +% If the \pkgopt{entrycounter} package option has been used, define +% a counter to number each level~0 entry. % \begin{macrocode} -\newtoks\glsshorttok +\ifglsentrycounter + \ifx\@gls@counterwithin\@empty + \newcounter{glossaryentry} + \else + \newcounter{glossaryentry}[\@gls@counterwithin] + \fi + \def\theHglossaryentry{\currentglossary.\theglossaryentry} +\fi % \end{macrocode} -%\end{macro} -%\begin{macro}{\glslongtok} +%\end{counter} +% +%\begin{counter}{glossarysubentry} +%\changes{3.0}{2011/04/02}{new} +% If the \pkgopt{subentrycounter} package option has been used, define +% a counter to number each level~1 entry. % \begin{macrocode} -\newtoks\glslongtok -% \end{macrocode} -%\end{macro} -%\begin{macro}{\newacronymhook} -% Provide a hook for \cs{newacronym}: +\ifglssubentrycounter + \ifglsentrycounter + \newcounter{glossarysubentry}[glossaryentry] + \else + \newcounter{glossarysubentry} + \fi + \def\theHglossarysubentry{\currentglssubentry.\theglossarysubentry} +\fi +% \end{macrocode} +%\end{counter} +% +%\begin{macro}{\glsresetsubentrycounter} +%\changes{3.0}{2011/04/02}{new} +% Resets the \ctr{glossarysubentry} counter. % \begin{macrocode} -\newcommand*{\newacronymhook}{} +\ifglssubentrycounter + \newcommand*{\glsresetsubentrycounter}{% + \setcounter{glossarysubentry}{0}% + } +\else + \newcommand*{\glsresetsubentrycounter}{} +\fi % \end{macrocode} %\end{macro} -%\begin{macro}{\SetDefaultAcronymDisplayStyle} -% Sets the default acronym display style for given glossary. -%\changes{2.04}{2009 November 10}{new} +% +%\begin{macro}{\glsresetsubentrycounter} +%\changes{3.02}{2012/05/21}{new} +% Resets the \ctr{glossarentry} counter. % \begin{macrocode} -\newcommand*{\SetDefaultAcronymDisplayStyle}[1]{% - \defglsdisplay[#1]{##1##4}% - \defglsdisplayfirst[#1]{##1##4}% -} +\ifglsentrycounter + \newcommand*{\glsresetentrycounter}{% + \setcounter{glossaryentry}{0}% + } +\else + \newcommand*{\glsresetentrycounter}{} +\fi % \end{macrocode} %\end{macro} -%\begin{macro}{\DefaultNewAcronymDef} -% Sets up the acronym definition for the default style. -% The information is provided by the tokens \cs{glslabeltok}, -% \cs{glsshorttok}, \cs{glslongtok} and \cs{glskeylisttok}. +% +%\begin{macro}{\glsstepentry} +%\changes{3.0}{2011/04/02}{new} +% Advance the \ctr{glossaryentry} counter if in use. The argument is +% the label associated with the entry. % \begin{macrocode} -\newcommand*{\DefaultNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glsshorttok},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - firstplural={\acrfullformat{\noexpand\@glo@longpl}% - {\noexpand\@glo@shortpl}},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% +\ifglsentrycounter + \newcommand*{\glsstepentry}[1]{% + \refstepcounter{glossaryentry}% + \label{glsentry-#1}% + } +\else + \newcommand*{\glsstepentry}[1]{} +\fi % \end{macrocode} -% Remaining options specified by the user: +%\end{macro} +% +%\begin{macro}{\glsstepsubentry} +%\changes{3.0}{2011/04/02}{new} +% Advance the \ctr{glossarysubentry} counter if in use. The argument is +% the label associated with the subentry. % \begin{macrocode} - \the\glskeylisttok - }% - }% - \@do@newglossaryentry -} +\ifglssubentrycounter + \newcommand*{\glsstepsubentry}[1]{% + \def\currentglssubentry{#1}% + \refstepcounter{glossarysubentry}% + \label{glsentry-#1}% + } +\else + \newcommand*{\glsstepsubentry}[1]{} +\fi % \end{macrocode} %\end{macro} -%\begin{macro}{\SetDefaultAcronymStyle} -%\changes{2.04}{2009 November 10}{new} -% Set up the default acronym style: +% +%\begin{macro}{\glsrefentry} +%\changes{3.0}{2011/04/02}{new} +% Reference the entry or sub-entry counter if in use, otherwise just do +% \ics{gls}. % \begin{macrocode} -\newcommand*{\SetDefaultAcronymStyle}{% +\ifglsentrycounter + \newcommand*{\glsrefentry}[1]{\ref{glsentry-#1}} +\else + \ifglssubentrycounter + \newcommand*{\glsrefentry}[1]{\ref{glsentry-#1}} + \else + \newcommand*{\glsrefentry}[1]{\gls{#1}} + \fi +\fi % \end{macrocode} -% Set the display style: +%\end{macro} +% +%\begin{macro}{\glsentrycounterlabel} +%\changes{3.0}{2011/04/02}{new} +% Defines how to display the \ctr{glossaryentry} counter. % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDefaultAcronymDisplayStyle{\@gls@type}% - }% +\ifglsentrycounter + \newcommand*{\glsentrycounterlabel}{\theglossaryentry.\space} +\else + \newcommand*{\glsentrycounterlabel}{} +\fi % \end{macrocode} -% Set up the definition of \cs{newacronym}: +%\end{macro} +% +%\begin{macro}{\glssubentrycounterlabel} +%\changes{3.0}{2011/04/02}{new} +% Defines how to display the \ctr{glossarysubentry} counter. % \begin{macrocode} - \renewcommand{\newacronym}[4][]{% +\ifglssubentrycounter + \newcommand*{\glssubentrycounterlabel}{\theglossarysubentry)\space} +\else + \newcommand*{\glssubentrycounterlabel}{} +\fi % \end{macrocode} -% If user is just using the main glossary and hasn't identified it -% as a list of acronyms, then update. (This is done to ensure -% backwards compatibility with versions prior to 2.04). +%\end{macro} +% +%\begin{macro}{\glsentryitem} +% Step and display \ctr{glossaryentry} counter, if appropriate. +%\changes{3.0}{2011/04/02}{new} % \begin{macrocode} - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDefaultAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DefaultNewAcronymDef - }% - \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% -} +\ifglsentrycounter + \newcommand*{\glsentryitem}[1]{% + \glsstepentry{#1}\glsentrycounterlabel + } +\else + \newcommand*{\glsentryitem}[1]{\glsresetsubentrycounter} +\fi % \end{macrocode} %\end{macro} % -%\begin{macro}{\acrfootnote} +%\begin{macro}{\glssubentryitem} +% Step and display \ctr{glossarysubentry} counter, if appropriate. %\changes{3.0}{2011/04/02}{new} -% Used by the footnote acronym styles. % \begin{macrocode} -\newcommand*{\acrfootnote}[3]{\acrlinkfootnote{#1}{#2}{#3}} +\ifglssubentrycounter + \newcommand*{\glssubentryitem}[1]{% + \glsstepsubentry{#1}\glssubentrycounterlabel + } +\else + \newcommand*{\glssubentryitem}[1]{} +\fi % \end{macrocode} %\end{macro} -%\begin{macro}{\acrlinkfootnote} -%\changes{3.0}{2011/04/02}{new} +% +%\begin{environment}{theglossary} +% If the \env{theglossary} environment has +% already been defined, a warning will be issued. +% This environment should be redefined by glossary styles. +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} -\newcommand*{\acrlinkfootnote}[3]{% - \footnote{\glslink[#1]{#2}{#3}}% +\ifcsundef{theglossary}% +{% + \newenvironment{theglossary}{}{}% +}% +{% + \GlossariesWarning{overriding `theglossary' environment}% + \renewenvironment{theglossary}{}{}% } % \end{macrocode} +%\end{environment} +% +% The glossary header is given by \cs{glossaryheader}. +% This forms part of the glossary style, and +% must indicate what should appear immediately after the start of the +% \env{theglossary} environment. (For example, if the glossary +% uses a tabular-like environment, it may be used to set the +% header row.) Note that if you don't want a header row, the glossary +% style must redefine \cs{glossaryheader} to do nothing. +%\begin{macro}{\glossaryheader} +% \begin{macrocode} +\newcommand*{\glossaryheader}{} +% \end{macrocode} %\end{macro} -%\begin{macro}{\acrnolinkfootnote} -%\changes{3.0}{2011/04/02}{new} +% +%\begin{macro}{\glstarget} +%\changes{1.18}{2009 January 14}{new} +%\cs{glstarget}\marg{label}\marg{name}\\[10pt] +% Provide user interface to \cs{@glstarget} to make it easier to +% modify the glossary style in the document. % \begin{macrocode} -\newcommand*{\acrnolinkfootnote}[3]{% - \footnote{#3}% +\newcommand*{\glstarget}[2]{\@glstarget{\glolinkprefix#1}{#2}} +% \end{macrocode} +%\end{macro} +% +% As from version 3.08, glossary information is now written to the +% external files using \ics{glossentry} and \ics{subglossentry} +% instead of \cs{glossaryentryfield} and \cs{glossarysubentryfield}. +% The default definition provides backward compatibility for +% glossary styles that use the old forms. +%\begin{macro}{\compatibleglossentry} +%\changes{3.08a}{2013-09-28}{new} +%\begin{definition} +% \cs{glossentry}\marg{label}\marg{page-list} +%\end{definition} +% \begin{macrocode} +\providecommand*{\compatibleglossentry}[2]{% + \toks@{#2}% + \protected@edef\@do@glossentry{\noexpand\glossaryentryfield{#1}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@#1@name\endcsname}}% + {\expandafter\expandonce\csname glo@#1@desc\endcsname}% + {\expandafter\expandonce\csname glo@#1@symbol\endcsname}% + {\the\toks@}% + }% + \@do@glossentry } % \end{macrocode} %\end{macro} % -%\begin{macro}{\SetDescriptionFootnoteAcronymDisplayStyle} -% Sets the acronym display style for given glossary for the -% description and footnote combination. -%\changes{2.04}{2009 November 10}{new} -%\changes{3.0}{2011/04/02}{expanded options link options} +%\begin{macro}{\glossentryname} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\SetDescriptionFootnoteAcronymDisplayStyle}[1]{% - \defglsdisplayfirst[#1]{% - \firstacronymfont{##1}##4% - \expandafter\protect\expandafter\acrfootnote\expandafter - {\@gls@link@opts}{\@gls@link@label}{##3}% +\newcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \letcs{\glo@name}{glo@#1@name}% + \expandafter\glsnamefont\expandafter{\glo@name}% }% - \defglsdisplay[#1]{\acronymfont{##1}##4}% } % \end{macrocode} %\end{macro} -%\begin{macro}{\DescriptionFootnoteNewAcronymDef} +% +%\begin{macro}{\Glossentryname} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\DescriptionFootnoteNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - symbol={\the\glslongtok},% - symbolplural={\the\glslongtok\noexpand\acrpluralsuffix},% - \the\glskeylisttok - }% - }% - \@do@newglossaryentry +\newcommand*{\Glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\Glsentryname{#1}}% + }% } % \end{macrocode} %\end{macro} -%\begin{macro}{\SetDescriptionFootnoteAcronymStyle} -% If a description and footnote are both required, store the long form -% in the \gloskey{symbol} key. Store the short form in \gloskey{text} -% key. Note that since the long form is stored in the symbol key, -% if you want the long form to appear in the list of acronyms, you -% need to use a glossary style that displays the symbol key. +% +%\begin{macro}{\glossentrydesc} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\SetDescriptionFootnoteAcronymStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDescriptionFootnoteAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DescriptionFootnoteNewAcronymDef +\newcommand*{\glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsentrydesc{#1}% }% +} % \end{macrocode} +%\end{macro} % -% 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{macro}{\Glossentrydesc} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDescriptionFootnoteAcronymDisplayStyle{\@gls@type}% +\newcommand*{\Glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \Glsentrydesc{#1}% }% -% \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead -%of 'smaller} -% \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand*{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{% - \textup{\glspluralsuffix}}% - \else - \ifglsacrsmaller - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% - \fi - \fi -% \end{macrocode} -% Check for package option clash -% \begin{macrocode} - \ifglsacrdua - \PackageError{glossaries}{Option clash: `footnote' and `dua' - can't both be set}{}% - \fi -}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\SetDescriptionDUAAcronymDisplayStyle} -% Sets the acronym display style for given glossary with -% description and dua combination. -%\changes{2.04}{2009 November 10}{new} +%\begin{macro}{\glossentrysymbol} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\SetDescriptionDUAAcronymDisplayStyle}[1]{% - \defglsdisplay[#1]{##1##4}% - \defglsdisplayfirst[#1]{##1##4}% +\newcommand*{\glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glsentrysymbol{#1}% + }% } % \end{macrocode} %\end{macro} -%\begin{macro}{\DescriptionDUANewAcronymDef} +% +%\begin{macro}{\Glossentrysymbol} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\DescriptionDUANewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glslongtok},% - sort={\the\glslongtok}, - text={\the\glslongtok},% - plural={\the\glslongtok\noexpand\acrpluralsuffix},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - symbol={\the\glsshorttok},% - symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - \the\glskeylisttok - }% +\newcommand*{\Glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \Glsentrysymbol{#1}% }% - \@do@newglossaryentry } % \end{macrocode} %\end{macro} -%\begin{macro}{\SetDescriptionDUAAcronymStyle} -% Description, don't use acronym and no footnote. -% Note that the short form is stored in the \gloskey{symbol} key, -% so if the short form needs to be displayed in the glossary, -% use a style the displays the symbol. -% \begin{macrocode} -\newcommand*{\SetDescriptionDUAAcronymStyle}{% - \ifglsacrsmallcaps - \PackageError{glossaries}{Option clash: `smallcaps' and `dua' - can't both be set}{}% - \else - \ifglsacrsmaller - \PackageError{glossaries}{Option clash: `smaller' and `dua' - can't both be set}{}% - \fi - \fi - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDescriptionDUAAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DescriptionDUANewAcronymDef - }% -% \end{macrocode} -% Set display. +% +% +%\begin{macro}{\compatiblesubglossentry} +%\changes{3.08a}{2013-09-28}{new} +%\begin{definition} +% \cs{subglossentry}\marg{level}\marg{label}\marg{page-list} +%\end{definition} % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDescriptionDUAAcronymDisplayStyle{\@gls@type}% +\providecommand*{\compatiblesubglossentry}[3]{% + \toks@{#3}% + \protected@edef\@do@subglossentry{\noexpand\glossarysubentryfield{\number#1}% + {#2}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@#2@name\endcsname}}% + {\expandafter\expandonce\csname glo@#2@desc\endcsname}% + {\expandafter\expandonce\csname glo@#2@symbol\endcsname}% + {\the\toks@}% }% -}% + \@do@subglossentry +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\SetDescriptionAcronymDisplayStyle} -% Sets the acronym display style for given glossary using -% the description setting (but not \pkgopt{footnote} or \pkgopt{dua}). -%\changes{2.04}{2009 November 10}{new} -%\changes{3.07}{2013-07-05}{now using \cs{glsdoparenifnotempty}} +%\begin{macro}{\setglossentrycompatibility} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\newcommand*{\SetDescriptionAcronymDisplayStyle}[1]{% - \defglsdisplayfirst[#1]{% - ##1##4\glsdoparenifnotempty{##3}{\protect\firstacronymfont}}% - \defglsdisplay[#1]{\acronymfont{##1}##4}% +\newcommand*{\setglossentrycompatibility}{% + \let\glossentry\compatibleglossentry + \let\subglossentry\compatiblesubglossentry } +\setglossentrycompatibility % \end{macrocode} %\end{macro} -%\begin{macro}{\DescriptionNewAcronymDef} +% +% +%\begin{macro}{\glossaryentryfield} +% \cs{glossaryentryfield}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt] +% This command formerly governed how each entry row should be formatted +% in the glossary. Now deprecated. +%\changes{3.08a}{2013-09-28}{deprecated} % \begin{macrocode} -\newcommand*{\DescriptionNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand - \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% - sort={\the\glsshorttok},% - first={\the\glslongtok},% - firstplural={\the\glslongtok\noexpand\acrpluralsuffix},% - text={\the\glsshorttok},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - symbol={\noexpand\@glo@text},% - symbolplural={\noexpand\@glo@plural},% - \the\glskeylisttok}% - }% - \@do@newglossaryentry -} +\newcommand{\glossaryentryfield}[5]{% + \GlossariesWarning + {Deprecated use of \string\glossaryentryfield.^^J + I recommend you change to \string\glossentry.^^J + If you've just upgraded, try removing your gls auxiliary + files^^J and recompile}% + \noindent\textbf{\glstarget{#1}{#2}} #4 #3. #5\par} % \end{macrocode} %\end{macro} -%\begin{macro}{\SetDescriptionAcronymStyle} -% Option \pkgopt{description} is used, but not \pkgopt{dua} -% or \pkgopt{footnote}. -% Store long form in \gloskey{first} key -% and short form in \gloskey{text} and \gloskey{symbol} key. -% The name is stored using \ics{acrnameformat} to allow the -% user to override the way the name is displayed in the -% list of acronyms. +%\begin{macro}{\glossarysubentryfield} +% \cs{glossarysubentryfield}\marg{level}\marg{label}\marg{name}\marg{description}\marg{symbol}\marg{page-list}\\[10pt] +% This command governs how each subentry should be formatted +% in the glossary. Glossary styles need to redefine this command. +% Most of the predefined styles ignore \meta{symbol}. The first +% argument is a number indicating the level. (The level should +% be greater than or equal to 1.) % \begin{macrocode} -\newcommand*{\SetDescriptionAcronymStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDescriptionAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DescriptionNewAcronymDef - }% +\newcommand*{\glossarysubentryfield}[6]{% + \GlossariesWarning + {Deprecated use of \string\glossarysubentryfield.^^J + I recommend you change to \string\subglossentry.^^J + If you've just upgraded, try removing your gls auxiliary + files^^J and recompile}% + \glstarget{#2}{\strut}#4. #6\par} % \end{macrocode} -% Set display. +%\end{macro} +% +% Within each glossary, the entries form distinct groups +% which are determined by the first character of the \gloskey{sort} +% key. When using \app{makeindex}, there will be a maximum of 28 groups: symbols, numbers, +% and the 26 alphabetical groups A, \ldots, Z\@. If you use +% \app{xindy} the groups will depend on whatever alphabet +% is used. This is determined by the language or custom +% alphabets can be created in the \app{xindy} style file. +% The command \cs{glsgroupskip} +% specifies what to do between glossary groups. Glossary styles +% must redefine this command. (Note that \cs{glsgroupskip} +% only occurs between groups, not at the start or end of the +% glossary.) +%\begin{macro}{\glsgroupskip} % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDescriptionAcronymDisplayStyle{\@gls@type}% - }% +\newcommand*{\glsgroupskip}{} % \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead -%of 'smaller} +%\end{macro} +% +% Each of the 28 glossary groups described above is preceded by a +% group heading. +% This is formatted by the command \cs{glsgroupheading} +% which takes one argument which is the \emph{label} assigned to that +% group (not the title). The corresponding labels are: \texttt{glssymbols}, +% \texttt{glsnumbers}, \texttt{A}, \ldots, \texttt{Z}. +% Glossary styles must redefined this command. (In between groups, +% \cs{glsgroupheading} comes immediately after \cs{glsgroupskip}.) +%\begin{macro}{\glsgroupheading} % \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand{\acronymfont}[1]{\textsc{##1}} - \renewcommand*{\acrpluralsuffix}{% - \textup{\glspluralsuffix}}% - \else - \ifglsacrsmaller - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% - \fi - \fi -}% +\newcommand*{\glsgroupheading}[1]{} % \end{macrocode} %\end{macro} +% It is possible to ``trick'' \app{makeindex} into +% treating entries as though they belong to the same group, +% even if the terms don't start with the same letter, by +% modifying the \gloskey{sort} key. For example, all entries +% belonging to one +% group could be defined so that the \gloskey{sort} key starts with an +% "a", while entries belonging to another group could be defined +% so that the \gloskey{sort} key starts with a "b", and so on. If +% you want each group to have a heading, you would then need to +% modify the translation control sequences \cs{glsgetgrouptitle} +% and \cs{glsgetgrouplabel} so that the label is translated +% into the required title (and vice-versa). % -%\begin{macro}{\SetFootnoteAcronymDisplayStyle} -% Sets the acronym display style for given glossary with -% footnote setting (but not \pkgopt{description} or \pkgopt{dua}). -%\changes{2.04}{2009 November 10}{new} +%\begin{definition} +%\cs{glsgetgrouptitle}\marg{label} +%\end{definition} +% This command produces the title for the glossary group +% whose label is given by \meta{label}. By default, the group +% labelled \texttt{glssymbols} produces +% \ics{glssymbolsgroupname}, the group labelled +% \texttt{glsnumbers} produces \ics{glsnumbersgroupname} +% and all the other groups simply produce their label. +% As mentioned above, the group labels are: \texttt{glssymbols}, \texttt{glsnumbers}, +% \texttt{A}, \ldots, \texttt{Z}\@. If you want to redefine +% the group titles, you will need to redefine this command. +% Languages other than English may produce labels that are +% non-expandable, so we need to check for that otherwise it will +% create a \qt{missing \cs{endcsname} inserted} error. +%\begin{macro}{\glsgetgrouptitle} +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} +%\changes{3.11a}{2013-10-15}{Added check in case non-Latin alphabet +%in use} % \begin{macrocode} -\newcommand*{\SetFootnoteAcronymDisplayStyle}[1]{% - \defglsdisplayfirst[#1]{% - \firstacronymfont{##1}##4% - \expandafter\protect\expandafter\acrfootnote\expandafter - {\@gls@link@opts}{\@gls@link@label}{##2}% - }% - \defglsdisplay[#1]{\acronymfont{##1}##4}% +\newcommand*{\glsgetgrouptitle}[1]{% + \@gls@getgrouptitle{#1}{\@gls@grptitle}% + \@gls@grptitle } % \end{macrocode} %\end{macro} -%\begin{macro}{\FootnoteNewAcronymDef} +%\begin{macro}{\@gls@getgrouptitle} +% Gets the group title specified by the label (first argument) and +% stores in the second argument, which must be a control sequence. % \begin{macrocode} -\newcommand*{\FootnoteNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\the\glsshorttok},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - descriptionplural={\the\glslongtok\noexpand\acrpluralsuffix},% - \the\glskeylisttok - }% - }% - \@do@newglossaryentry -} +\newcommand*{\@gls@getgrouptitle}[2]{% % \end{macrocode} -%\end{macro} -%\begin{macro}{\SetFootnoteAcronymStyle} -% If \pkgopt{footnote} package option is specified, set the first -% use to append the long form (stored in \gloskey{description}) as a -% footnote. -% Use the \gloskey{description} key to store the long form. +% Even if the argument appears to be a single letter, it won't be +% considered a single letter by \cs{dtl@ifsingle} if it's an active +% character. % \begin{macrocode} -\newcommand*{\SetFootnoteAcronymStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetFootnoteAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \FootnoteNewAcronymDef - }% + \dtl@ifsingle{#1}% + {% + \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% + }% + {% + \ifboolexpr{test{\ifstrequal{#1}{glssymbols}} + or test{\ifstrequal{#1}{glsnumbers}}}% + {% + \ifcsundef{#1groupname}{\def#2{#1}}{\letcs#2{#1groupname}}% + }% + {% + \def#2{#1}% + }% + }% +} % \end{macrocode} -% Set display -%\changes{1.12}{2008 Mar 8}{Added 'protect before 'footnote and -% 'glslink} +%\end{macro} +% +%\begin{definition} +%\cs{glsgetgrouplabel}\marg{title} +%\end{definition} +%This command does the reverse to the previous command. The +% argument is the group title, and it produces the group label. +% Note that if you redefine \cs{glsgetgrouptitle}, you +% will also need to redefine \cs{glsgetgrouplabel}. +%\begin{macro}{\glsgetgrouplabel} +%\changes{3.05}{2013-04-21}{fixed bug (typo in \cs{equal})} % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetFootnoteAcronymDisplayStyle{\@gls@type}% - }% +\newcommand*{\glsgetgrouplabel}[1]{% +\ifthenelse{\equal{#1}{\glssymbolsgroupname}}{glssymbols}{% +\ifthenelse{\equal{#1}{\glsnumbersgroupname}}{glsnumbers}{#1}}} % \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead -%of 'smaller} +%\end{macro} +% +% The command \cs{setentrycounter} sets the entry's +% associated counter (required by +% \cs{glshypernumber} etc.) \ics{glslink} and +% \ics{glsadd} encode the +% \ics{glossary} argument so that the relevant counter is +% set prior to the formatting command. +%\begin{macro}{\setentrycounter} +%\changes{3.0}{2011/04/02}{added optional argument} % \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand*{\acronymfont}[1]{\textsc{##1}}% - \renewcommand*{\acrpluralsuffix}{% - \textup{\glspluralsuffix}}% +\newcommand*{\setentrycounter}[2][]{% + \def\@glo@counterprefix{#1}% + \ifx\@glo@counterprefix\@empty + \def\@glo@counterprefix{.}% \else - \ifglsacrsmaller - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% - \fi - \fi -% \end{macrocode} -% Check for option clash -% \begin{macrocode} - \ifglsacrdua - \PackageError{glossaries}{Option clash: `footnote' and `dua' - can't both be set}{}% + \def\@glo@counterprefix{.#1.}% \fi -}% + \def\glsentrycounter{#2}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsdoparenifnotempty} -% Do a space followed by the argument if the argument doesn't expand -% to empty or \cs{relax}. If argument isn't empty (or \cs{relax}), apply -% the macro to it given in the second argument. +% The current glossary style can be set using +% \cs{setglossarystyle}\marg{style}. +%\begin{macro}{\setglossarystyle} +%\changes{3.08a}{2013-09-28}{new} % \begin{macrocode} -\DeclareRobustCommand*{\glsdoparenifnotempty}[2]{% - \protected@edef\gls@tmp{#1}% - \ifdefempty\gls@tmp - {}% +\newcommand*{\setglossarystyle}[1]{% + \ifcsundef{@glsstyle@#1}% {% - \if\gls@tmp\relax - \else - \space (#2{#1})% - \fi + \PackageError{glossaries}{Glossary style `#1' undefined}{}% + }% + {% + \csname @glsstyle@#1\endcsname }% } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\SetSmallAcronymDisplayStyle} -% Sets the acronym display style for given glossary where neither -% footnote nor description is required, but smallcaps or smaller -% specified. -%\changes{2.04}{2009 November 10}{new} -% \begin{macrocode} -\newcommand*{\SetSmallAcronymDisplayStyle}[1]{% - \defglsdisplayfirst[#1]{##1##4\glsdoparenifnotempty{##3}{\protect\firstacronymfont}} - \defglsdisplay[#1]{\acronymfont{##1}##4}% -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\SmallNewAcronymDef} -%\changes{3.02}{2012/05/21}{fixed broken short and long plural} -% \begin{macrocode} -\newcommand*{\SmallNewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\noexpand\acronymfont{\the\glsshorttok}},% - sort={\the\glsshorttok},% - text={\noexpand\@glo@symbol},% -% \end{macrocode} -% Default to the short plural. -% \begin{macrocode} - plural={\noexpand\@glo@shortpl},% - first={\the\glslongtok},% -% \end{macrocode} -% Default to the long plural. +%\begin{macro}{\glossarystyle} +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} - firstplural={\noexpand\@glo@longpl},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\noexpand\@glo@first},% - descriptionplural={\noexpand\@glo@firstplural},% - symbol={\the\glsshorttok},% +\newcommand*{\glossarystyle}[1]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}{Glossary style `#1' undefined}{}% + }% + {% + \GlossariesWarning + {Deprecated command \string\glossarystyle.^^J + I recommend you switch to \string\setglossarystyle\space unless + you want to maintain backward compatibility}% + \setglossentrycompatibility + \csname @glsstyle@#1\endcsname % \end{macrocode} -% Default to the short plural. +%\changes{3.13a}{2013-11-05}{fixed bug caused by using \cs{ifdef} instead of +%\cs{ifcsdef}} % \begin{macrocode} - symbolplural={\noexpand\@glo@shortpl},% - \the\glskeylisttok - }% + \ifcsdef{@glscompstyle@#1}% + {\setglossentrycompatibility\csuse{@glscompstyle@#1}}% + {}% }% - \@do@newglossaryentry } % \end{macrocode} %\end{macro} -%\begin{macro}{\SetSmallAcronymStyle} -% Neither footnote nor description required, but smallcaps or -% smaller specified. -% Use the \gloskey{symbol} key to store the short form and -% \gloskey{first} to store the long form. +% +%\begin{macro}{\newglossarystyle} +% New glossary styles can be defined using:\\[10pt] +% \cs{newglossarystyle}\marg{name}\marg{definition}\\[10pt] +% The \meta{definition} argument should redefine +% \env{theglossary}, \ics{glossaryheader}, +% \ics{glsgroupheading}, \ics{glossaryentryfield} and +% \ics{glsgroupskip} (see \autoref{sec:code:styles} for the +% definitions of predefined styles). Glossary styles should not +% redefine \ics{glossarypreamble} and +% \ics{glossarypostamble}, as +% the user should be able to switch between styles without affecting +% the pre- and postambles. +%\changes{1.17}{2008 December 26}{made \cs{newglossarystyle} long} +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} -\newcommand*{\SetSmallAcronymStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetSmallAcronymDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \SmallNewAcronymDef +\newcommand{\newglossarystyle}[2]{% + \ifcsundef{@glsstyle@#1}% + {% + \expandafter\def\csname @glsstyle@#1\endcsname{#2}% }% -% \end{macrocode} -% Change the display since \gloskey{first} only contains long form. -% \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetSmallAcronymDisplayStyle{\@gls@type}% + {% + \PackageError{glossaries}{Glossary style `#1' is already defined}{}% }% -% \end{macrocode} -% Redefine \ics{acronymfont} if small caps required. The plural suffix -% is set in an upright font so that it remains in normal lower case, -% otherwise it looks as though it's part of the acronym. -%\changes{1.19}{2009 Mar 2}{changed 'acronymfont to use 'textsmaller instead -%of 'smaller} -% \begin{macrocode} - \ifglsacrsmallcaps - \renewcommand*{\acronymfont}[1]{\textsc{##1}} - \renewcommand*{\acrpluralsuffix}{% - \textup{\glspluralsuffix}}% - \else - \renewcommand*{\acronymfont}[1]{\textsmaller{##1}} - \fi -% \end{macrocode} -% check for option clash -% \begin{macrocode} - \ifglsacrdua - \ifglsacrsmallcaps - \PackageError{glossaries}{Option clash: `smallcaps' and `dua' - can't both be set}{}% - \else - \PackageError{glossaries}{Option clash: `smaller' and `dua' - can't both be set}{}% - \fi - \fi -}% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\SetDUADisplayStyle} -% Sets the acronym display style for given glossary with dua -% setting. -%\changes{2.04}{2009 November 10}{new} +%\begin{macro}{\renewglossarystyle} +%\changes{3.02}{2012/05/21}{new} +%Code for this macro supplied by Marco Daniel. % \begin{macrocode} -\newcommand*{\SetDUADisplayStyle}[1]{% - \defglsdisplay[#1]{##1##4}% - \defglsdisplayfirst[#1]{##1##4}% +\newcommand{\renewglossarystyle}[2]{% + \ifcsundef{@glsstyle@#1}% + {% + \PackageError{glossaries}{Glossary style `#1' isn't already defined}{}% + }% + {% + \csdef{@glsstyle@#1}{#2}% + }% } % \end{macrocode} %\end{macro} -%\begin{macro}{\DUANewAcronymDef} -% \begin{macrocode} -\newcommand*{\DUANewAcronymDef}{% - \edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - name={\the\glsshorttok},% - text={\the\glslongtok},% - plural={\the\glslongtok\noexpand\acrpluralsuffix},% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - description={\the\glslongtok},% - symbol={\the\glsshorttok},% - symbolplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - \the\glskeylisttok - }% - }% - \@do@newglossaryentry -} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\SetDUAStyle} -% Always expand acronyms. +% +% Glossary entries are encoded so that the second argument +% to \ics{glossaryentryfield} is always specified as +% \cs{glsnamefont}\marg{name}. This allows the +% user to change the font used to display the name term +% without having to redefine \ics{glossaryentryfield}. +% The default uses the surrounding font, so in the list type +% styles (which place the name in the optional argument to +% \ics{item}) the name will appear in bold. +%\begin{macro}{\glsnamefont} % \begin{macrocode} -\newcommand*{\SetDUAStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetDUADisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \DUANewAcronymDef - }% +\newcommand*{\glsnamefont}[1]{#1} % \end{macrocode} -% Set the display +%\end{macro} +% +% Each glossary entry has an associated number list (usually page +% numbers) that indicate where in the document the entry has been +% used. The format for these number lists can be changed using the +% \gloskey[glslink]{format}\igloskey[glsadd]{format} key in commands like \ics{glslink}. +% The default format is given by \cs{glshypernumber}. This takes +% a single argument which may be a single number, a number range +% or a number list. The number ranges are delimited with +% \ics{delimR}, the number lists are delimited with +% \ics{delimN}. +% +% If the document doesn't have hyperlinks, the numbers can be +% displayed just as they are, but if the document supports +% hyperlinks, the numbers should link to the relevant location. +% This means extracting the individual numbers from the list or +% ranges. The \isty{hyperref} package does this with the +% \ics{hyperpage} command, but this is encoded for comma and +% dash delimiters and only for the page counter, but this code needs +% to be more general. So I have adapted the code used in the +% \isty{hyperref} package. +%\begin{macro}{\glshypernumber} +%\changes{1.17}{2008 December 26}{modified to allow material +% to be attached to location} +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetDUADisplayStyle{\@gls@type}% - }% +\ifcsundef{hyperlink}% +{% + \def\glshypernumber#1{#1}% +}% +{% + \def\glshypernumber#1{\@glshypernumber#1\nohyperpage{}\@nil} } % \end{macrocode} %\end{macro} % -%\begin{macro}{\SetAcronymStyle} +%\begin{macro}{\@glshypernumber} +% This code was provided by Heiko~Oberdiek to allow material +% to be attached to the location. +%\changes{1.17}{2008 December 26}{new} % \begin{macrocode} -\newcommand*{\SetAcronymStyle}{% - \SetDefaultAcronymStyle - \ifglsacrdescription - \ifglsacrfootnote - \SetDescriptionFootnoteAcronymStyle - \else - \ifglsacrdua - \SetDescriptionDUAAcronymStyle - \else - \SetDescriptionAcronymStyle - \fi - \fi +\def\@glshypernumber#1\nohyperpage#2#3\@nil{% + \ifx\\#1\\% \else - \ifglsacrfootnote - \SetFootnoteAcronymStyle - \else - \ifthenelse{\boolean{glsacrsmallcaps}\OR - \boolean{glsacrsmaller}}% - {% - \SetSmallAcronymStyle - }% - {% - \ifglsacrdua - \SetDUAStyle - \fi - }% - \fi + \@delimR#1\delimR\delimR\\% + \fi + \ifx\\#2\\% + \else + #2% + \fi + \ifx\\#3\\% + \else + \@glshypernumber#3\@nil \fi } % \end{macrocode} -% Set the acronym style according to the package options -% \begin{macrocode} -\SetAcronymStyle -% \end{macrocode} %\end{macro} -% -% Allow user to define their own custom acronyms. -% (For compatibility with versions before v3.0, the short form is -% stored in the user1 key, the plural short form is stored in the -% user2 key, the long form is stored in the user3 key and the -% plural long form is stored in the user4 key.) Defaults to -% displaying only the acronym with the long form as the description. -%\begin{macro}{\SetCustomDisplayStyle} -% Sets the acronym display style. -%\changes{2.06}{2010 June 14}{new} +% \cs{@delimR} displays a range of numbers for the counter +% whose name is given by +% \cs{@gls@counter} (which must be set prior to using +% \cs{glshypernumber}). +%\begin{macro}{\@delimR} % \begin{macrocode} -\newcommand*{\SetCustomDisplayStyle}[1]{% - \defglsdisplay[#1]{##1##4}% - \defglsdisplayfirst[#1]{##1##4}% -} +\def\@delimR#1\delimR #2\delimR #3\\{% +\ifx\\#2\\% + \@delimN{#1}% +\else + \@gls@numberlink{#1}\delimR\@gls@numberlink{#2}% +\fi} % \end{macrocode} %\end{macro} -%\begin{macro}{\CustomAcronymFields} -%\changes{2.06}{2010 June 14}{new} +% \cs{@delimN} displays a list of individual numbers, +% instead of a range: +%\begin{macro}{\@delimN} % \begin{macrocode} -\newcommand*{\CustomAcronymFields}{% - name={\the\glsshorttok},% - description={\the\glslongtok},% - first={\noexpand\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% - firstplural={\noexpand\acrfullformat - {\the\glslongtok\noexpand\acrpluralsuffix}{\the\glsshorttok}}% - text={\the\glsshorttok},% - plural={\the\glsshorttok\noexpand\acrpluralsuffix}% +\def\@delimN#1{\@@delimN#1\delimN \delimN\\} +\def\@@delimN#1\delimN #2\delimN#3\\{% +\ifx\\#3\\% + \@gls@numberlink{#1}% +\else + \@gls@numberlink{#1}\delimN\@gls@numberlink{#2}% +\fi } % \end{macrocode} %\end{macro} -%\begin{macro}{\CustomNewAcronymDef} -%\changes{2.06}{2010 June 14}{new} +% The following code is modified from hyperref's +% \cs{HyInd@pagelink} where +% the name of the counter being used is given by +% \cs{@gls@counter}. % \begin{macrocode} -\newcommand*{\CustomNewAcronymDef}{% - \protected@edef\@do@newglossaryentry{% - \noexpand\newglossaryentry{\the\glslabeltok}% - {% - type=\acronymtype,% - short={\the\glsshorttok},% - shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% - long={\the\glslongtok},% - longplural={\the\glslongtok\noexpand\acrpluralsuffix},% - user1={\the\glsshorttok},% - user2={\the\glsshorttok\noexpand\acrpluralsuffix},% - user3={\the\glslongtok},% - user4={\the\glslongtok\noexpand\acrpluralsuffix},% - \CustomAcronymFields,% - \the\glskeylisttok - }% - }% - \@do@newglossaryentry -} +\def\@gls@numberlink#1{% +\begingroup + \toks@={}% + \@gls@removespaces#1 \@nil +\endgroup} % \end{macrocode} -%\end{macro} -%\begin{macro}{\SetCustomStyle} -%\changes{2.06}{2010 June 14}{new} % \begin{macrocode} -\newcommand*{\SetCustomStyle}{% - \renewcommand{\newacronym}[4][]{% - \ifx\@glsacronymlists\@empty - \def\@glo@type{\acronymtype}% - \setkeys{glossentry}{##1}% - \DeclareAcronymList{\@glo@type}% - \SetCustomDisplayStyle{\@glo@type}% - \fi - \glskeylisttok{##1}% - \glslabeltok{##2}% - \glsshorttok{##3}% - \glslongtok{##4}% - \newacronymhook - \CustomNewAcronymDef - }% +\def\@gls@removespaces#1 #2\@nil{% + \toks@=\expandafter{\the\toks@#1}% + \ifx\\#2\\% + \edef\x{\the\toks@}% + \ifx\x\empty + \else % \end{macrocode} -% Set the display +%\changes{3.0}{2011/04/02}{added prefix to hyperlink} % \begin{macrocode} - \@for\@gls@type:=\@glsacronymlists\do{% - \SetCustomDisplayStyle{\@gls@type}% - }% + \hyperlink{\glsentrycounter\@glo@counterprefix\the\toks@}% + {\the\toks@}% + \fi + \else + \@gls@ReturnAfterFi{% + \@gls@removespaces#2\@nil + }% + \fi } +\long\def\@gls@ReturnAfterFi#1\fi{\fi#1} % \end{macrocode} -%\end{macro} % -% -%\begin{macro}{\DefineAcronymSynonyms} -%\changes{2.04}{2009 November 10}{new} +% The following commands will switch to the +% appropriate font, and create a hyperlink, if hyperlinks are +% supported. If hyperlinks are not supported, they will just +% display their argument in the appropriate font. +%\begin{macro}{\hyperrm} % \begin{macrocode} -\newcommand*{\DefineAcronymSynonyms}{% +\newcommand*{\hyperrm}[1]{\textrm{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% Short form -%\begin{macro}{\acs} +%\begin{macro}{\hypersf} % \begin{macrocode} - \let\acs\acrshort +\newcommand*{\hypersf}[1]{\textsf{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% First letter uppercase short form -%\begin{macro}{\Acs} +%\begin{macro}{\hypertt} % \begin{macrocode} - \let\Acs\Acrshort +\newcommand*{\hypertt}[1]{\texttt{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% Plural short form -%\begin{macro}{\acsp} +%\begin{macro}{\hyperbf} % \begin{macrocode} - \let\acsp\acrshortpl +\newcommand*{\hyperbf}[1]{\textbf{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% First letter uppercase plural short form -%\begin{macro}{\Acsp} +%\begin{macro}{\hypermd} % \begin{macrocode} - \let\Acsp\Acrshortpl +\newcommand*{\hypermd}[1]{\textmd{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% Long form -%\begin{macro}{\acl} +%\begin{macro}{\hyperit} % \begin{macrocode} - \let\acl\acrlong +\newcommand*{\hyperit}[1]{\textit{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% Plural long form -%\begin{macro}{\aclp} +%\begin{macro}{\hypersl} % \begin{macrocode} - \let\aclp\acrlongpl +\newcommand*{\hypersl}[1]{\textsl{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% First letter upper case long form -%\begin{macro}{\Acl} +%\begin{macro}{\hyperup} % \begin{macrocode} - \let\Acl\Acrlong +\newcommand*{\hyperup}[1]{\textup{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% First letter upper case plural long form -%\begin{macro}{\Aclp} +%\begin{macro}{\hypersc} % \begin{macrocode} - \let\Aclp\Acrlongpl +\newcommand*{\hypersc}[1]{\textsc{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% Full form -%\begin{macro}{\acf} +%\begin{macro}{\hyperemph} % \begin{macrocode} - \let\acf\acrfull +\newcommand*{\hyperemph}[1]{\emph{\glshypernumber{#1}}} % \end{macrocode} %\end{macro} -% Plural full form -%\begin{macro}{\acfp} +% +%\subsection{Acronyms}\label{sec:acronym} +%\begin{macro}{\oldacronym} +%\cs{oldacronym}\oarg{label}\marg{abbrv}\marg{long}\marg{key-val list}\\[10pt] +% This emulates the way the old \isty{glossary} package defined +% acronyms. It is equivalent to \ics{newacronym}\oarg{key-val +% list}\marg{label}\marg{abbrv}\marg{long} and it additionally +% defines the command \cs{}\meta{label} which is equivalent to +% \cs{gls}\marg{label} (thus \meta{label} must only contain +% alphabetical characters). If \meta{label} is omitted, \meta{abbrv} +% is used. This only emulates the syntax of the old \isty{glossary} +% package. The way the acronyms appear in the list of acronyms is +% determined by the definition of \ics{newacronym} and the +% glossary style. +% +% Note that \cs{}\meta{label} can't have an optional +% argument if the \isty{xspace} package is loaded. If +% \isty{xspace} hasn't been loaded then you can do +% \cs{}\meta{label}\oarg{insert} but you can't do +% \cs{}\meta{label}\oarg{key-val list}. For example if you define the +% acronym svm, then you can do "\svm['s]" but you can't do +% "\svm[format=textbf]". If the \isty{xspace} package is loaded, +% "\svm['s]" will appear as "svm ['s]" which is unlikely to be +% the desired result. In this case, you will need to use +% \cs{gls} explicitly, e.g.\ "\gls{svm}['s]". Note that it is +% up to the user to load \isty{xspace} if desired. +%\changes{1.18}{2009 January 14}{new} +%\changes{3.0}{2011/04/02}{replaced \cs{@ifundefined} with +%\cs{ifcsundef}} % \begin{macrocode} - \let\acfp\acrfullpl +\newcommand{\oldacronym}[4][\gls@label]{% + \def\gls@label{#2}% + \newacronym[#4]{#1}{#2}{#3}% + \ifcsundef{xspace}% + {% + \expandafter\edef\csname#1\endcsname{% + \noexpand\@ifstar{\noexpand\Gls{#1}}{\noexpand\gls{#1}}% + }% + }% + {% + \expandafter\edef\csname#1\endcsname{% + \noexpand\@ifstar{\noexpand\Gls{#1}\noexpand\xspace}{% + \noexpand\gls{#1}\noexpand\xspace}% + }% + }% +} % \end{macrocode} %\end{macro} -% First letter upper case full form -%\begin{macro}{\Acf} +%\vskip5pt +% \cs{newacronym}\oarg{key-val list}\marg{label}\marg{abbrev}\marg{long}\\[10pt] +% This is a quick way of defining acronyms, all it does +% is call \ics{newglossaryentry} with the appropriate +% values. It sets the +% glossary type to \ics{acronymtype} which will be +% "acronym" if the package option \pkgopt{acronym} has +% been used, otherwise it will be the default glossary. +% Since \cs{newacronym} merely calls \ics{newglossaryentry}, +% the acronym is treated like any other glossary entry. +% +% If you prefer a different format, you +% can redefine \cs{newacronym} as required. The optional +% argument can be used to override any of the settings. +% +% This is just a stub. It's redefined by commands like +% \cs{SetDefaultAcronymStyle}. +%\begin{macro}{\newacronym} % \begin{macrocode} - \let\Acf\Acrfull + \newcommand{\newacronym}[4][]{} % \end{macrocode} +%\changes{1.13}{2008 May 10}{Removed restriction on only using +% \cs{newacronym} in the preamble} %\end{macro} -% First letter upper case plural full form -%\begin{macro}{\Acfp} +% Set up some convenient short cuts. These need to be changed if +% \cs{newacronym} is changed (or if the \gloskey{description} key +% is changed). +% +%\begin{macro}{\acrpluralsuffix} +%\changes{1.13}{2008 May 10}{New} +% Plural suffix used by \cs{newacronym}. This just defaults to +% \cs{glspluralsuffix} but is changed to include \cs{textup} +% if the smallcaps option is used, so that the suffix doesn't appear +% in small caps as it doesn't look right. For example, +% \textsc{abcs} looks as though the ``s'' is part of the acronym, but +% \textsc{abc}s looks as though the ``s'' is a plural suffix. Since +% the entire text \texttt{abcs} is set in \cs{textsc}, \cs{textup} +% is need to cancel it out. % \begin{macrocode} - \let\Acfp\Acrfullpl +\newcommand*{\acrpluralsuffix}{\glspluralsuffix} % \end{macrocode} %\end{macro} -% Standard form -%\begin{macro}{\ac} +% If \sty{garamondx} has been loaded, need to use \cs{textulc} +% instead of \cs{textup}. +%\begin{macro}{\glstextup} +%\changes{3.09a}{2013-10-09}{new} % \begin{macrocode} - \let\ac\gls +\newrobustcmd*{\glstextup}[1]{\ifdef\textulc{\textulc{#1}}{\textup{#1}}} % \end{macrocode} %\end{macro} -% First upper case standard form -%\begin{macro}{\Ac} +% +% The following are defined for compatibility with version 2.07 and +% earlier. +%\begin{macro}{\glsshortkey} % \begin{macrocode} - \let\Ac\Gls +\newcommand*{\glsshortkey}{short} % \end{macrocode} %\end{macro} -% Standard plural form -%\begin{macro}{\acp} +%\begin{macro}{\glsshortpluralkey} % \begin{macrocode} - \let\acp\glspl +\newcommand*{\glsshortpluralkey}{shortplural} % \end{macrocode} %\end{macro} -% Standard first letter upper case plural form -%\begin{macro}{\Acp} +%\begin{macro}{\glslongkey} % \begin{macrocode} - \let\Acp\Glspl +\newcommand*{\glslongkey}{long} % \end{macrocode} %\end{macro} +%\begin{macro}{\glslongpluralkey} % \begin{macrocode} -} -% \end{macrocode} -% Define synonyms if required -% \begin{macrocode} -\ifglsacrshortcuts - \DefineAcronymSynonyms -\fi +\newcommand*{\glslongpluralkey}{longplural} % \end{macrocode} +%\end{macro} % -% \subsection{Predefined Glossary Styles}\label{sec:code:styles} -% The \sty{glossaries} bundle comes with some predefined glossary -% styles. These need to be loaded now for the \pkgopt{style} option -% to use them. -% -% First, the glossary hyper-navigation commands need to be loaded. -% \begin{macrocode} -\RequirePackage{glossary-hypernav} -% \end{macrocode} -% The styles that use list-like environments. These are not loaded -% if the \pkgopt{nolist} option is used: -% \begin{macrocode} -\@gls@loadlist -% \end{macrocode} -% The styles that use the \env{longtable} environment. These are -% not loaded if the \pkgopt{nolong} package option is used. -% \begin{macrocode} -\@gls@loadlong -% \end{macrocode} -% The styles that use the \env{supertabular} environment. These are -% not loaded if the \pkgopt{nosuper} package option is used or if -% the \isty{supertabular} package isn't installed. -% \begin{macrocode} -\@gls@loadsuper -% \end{macrocode} -% The tree-like styles. These are not loaded if the \pkgopt{notree} -% package option is used. +%\begin{macro}{\acrfull} +% Full form of the acronym. +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\@gls@loadtree +\newrobustcmd*{\acrfull}{% + \@ifstar\s@acrfull\ns@acrfull +} % \end{macrocode} -% The default glossary style is set according to the \pkgopt{style} package -% option, but can be overridden by \ics{glossarystyle}. The -% required style must be defined at this point. +%\changes{3.0}{2011/04/02}{added starred version} % \begin{macrocode} -\ifx\@glossary@default@style\relax -\else - \glossarystyle{\@glossary@default@style} -\fi +\newcommand*\s@acrfull[2][]{% + \new@ifnextchar[{\@acrfull{hyper=false,#1}{#2}}% + {\@acrfull{hyper=false,#1}{#2}[]}% +} +\newcommand*\ns@acrfull[2][]{% + \new@ifnextchar[{\@acrfull{#1}{#2}}% + {\@acrfull{#1}{#2}[]}% +} % \end{macrocode} -% -%\subsection{Debugging Commands} -% -%\begin{macro}{\showgloparent} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showgloparent}\marg{label} -%\end{definition} +% Low-level macro: % \begin{macrocode} -\newcommand*{\showgloparent}[1]{% - \expandafter\show\csname glo@#1@parent\endcsname +\def\@acrfull#1#2[#3]{% + \acrlinkfullformat{\@acrlong}{\@acrshort}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglolevel} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglolevel}\marg{label} -%\end{definition} +%\begin{macro}{\acrlinkfullformat} +% Format for full links like \ics{acrfull}. Syntax: +% \cs{acrlinkfullformat}\marg{long cs}\marg{short +% cs}\marg{options}\marg{label}\marg{insert} % \begin{macrocode} -\newcommand*{\showglolevel}[1]{% - \expandafter\show\csname glo@#1@level\endcsname +\newcommand{\acrlinkfullformat}[5]{% + \acrfullformat{#1{#3}{#4}[#5]}{#2{#3}{#4}[]}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglotext} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglotext}\marg{label} -%\end{definition} +%\begin{macro}{\acrfullformat} +% Default full form is \meta{long} \parg{short}. +%\changes{3.01}{2011/04/12}{removed \cs{acronymfont} as it should +%already be set in the second argument.} % \begin{macrocode} -\newcommand*{\showglotext}[1]{% - \expandafter\show\csname glo@#1@text\endcsname -} +\newcommand{\acrfullformat}[2]{#1\space(#2)} % \end{macrocode} %\end{macro} % -%\begin{macro}{\showgloplural} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showgloplural}\marg{label} -%\end{definition} +% Default format for full acronym +%\begin{macro}{\Acrfull} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\showgloplural}[1]{% - \expandafter\show\csname glo@#1@plural\endcsname +\newrobustcmd*{\Acrfull}{% + \@ifstar\s@Acrfull\ns@Acrfull } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglofirst} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglofirst}\marg{label} -%\end{definition} +%\changes{3.0}{2011/04/02}{added starred version} % \begin{macrocode} -\newcommand*{\showglofirst}[1]{% - \expandafter\show\csname glo@#1@first\endcsname +\newcommand*\s@Acrfull[2][]{% + \new@ifnextchar[{\@Acrfull{hyper=false,#1}{#2}}% + {\@Acrfull{hyper=false,#1}{#2}[]}% +} +\newcommand*\ns@Acrfull[2][]{% + \new@ifnextchar[{\@Acrfull{#1}{#2}}% + {\@Acrfull{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglofirstpl} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglofirstpl}\marg{label} -%\end{definition} +% Low-level macro: % \begin{macrocode} -\newcommand*{\showglofirstpl}[1]{% - \expandafter\show\csname glo@#1@firstpl\endcsname +\def\@Acrfull#1#2[#3]{% + \acrlinkfullformat{\@Acrlong}{\@acrshort}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglotype} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglotype}\marg{label} -%\end{definition} +%\begin{macro}{\ACRfull} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\showglotype}[1]{% - \expandafter\show\csname glo@#1@type\endcsname +\newrobustcmd*{\ACRfull}{% + \@ifstar\s@ACRfull\ns@ACRfull } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglocounter} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglocounter}\marg{label} -%\end{definition} +%\changes{3.0}{2011/04/02}{added starred version} % \begin{macrocode} -\newcommand*{\showglocounter}[1]{% - \expandafter\show\csname glo@#1@counter\endcsname +\newcommand*\s@ACRfull[2][]{% + \new@ifnextchar[{\@ACRfull{hyper=false,#1}{#2}}% + {\@ACRfull{hyper=false,#1}{#2}[]}% +} +\newcommand*\ns@ACRfull[2][]{% + \new@ifnextchar[{\@ACRfull{#1}{#2}}% + {\@ACRfull{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglouseri} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglouseri}\marg{label} -%\end{definition} +% Low-level macro: % \begin{macrocode} -\newcommand*{\showglouseri}[1]{% - \expandafter\show\csname glo@#1@useri\endcsname +\def\@ACRfull#1#2[#3]{% + \acrlinkfullformat{\@ACRlong}{\@ACRshort}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglouserii} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglouserii}\marg{label} -%\end{definition} +% Plural: +%\begin{macro}{\acrfullpl} +%\changes{1.13}{2008 May 10}{new} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\showglouserii}[1]{% - \expandafter\show\csname glo@#1@userii\endcsname +\newrobustcmd*{\acrfullpl}{% + \@ifstar\s@acrfullpl\ns@acrfullpl } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglouseriii} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglouseriii}\marg{label} -%\end{definition} +%\changes{3.0}{2011/04/02}{added starred version} % \begin{macrocode} -\newcommand*{\showglouseriii}[1]{% - \expandafter\show\csname glo@#1@useriii\endcsname +\newcommand*\s@acrfullpl[2][]{% + \new@ifnextchar[{\@acrfullpl{hyper=false,#1}{#2}}% + {\@acrfullpl{hyper=false,#1}{#2}[]}% +} +\newcommand*\ns@acrfullpl[2][]{% + \new@ifnextchar[{\@acrfullpl{#1}{#2}}% + {\@acrfullpl{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglouseriv} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglouseriv}\marg{label} -%\end{definition} +% Low-level macro: % \begin{macrocode} -\newcommand*{\showglouseriv}[1]{% - \expandafter\show\csname glo@#1@useriv\endcsname +\def\@acrfullpl#1#2[#3]{% + \acrlinkfullformat{\@acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglouserv} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglouserv}\marg{label} -%\end{definition} +%\begin{macro}{\Acrfullpl} +%\changes{1.13}{2008 May 10}{new} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\showglouserv}[1]{% - \expandafter\show\csname glo@#1@userv\endcsname +\newrobustcmd*{\Acrfullpl}{% + \@ifstar\s@Acrfullpl\ns@Acrfullpl } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglouservi} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglouservi}\marg{label} -%\end{definition} +%\changes{3.0}{2011/04/02}{added starred version} % \begin{macrocode} -\newcommand*{\showglouservi}[1]{% - \expandafter\show\csname glo@#1@uservi\endcsname +\newcommand*\s@Acrfullpl[2][]{% + \new@ifnextchar[{\@Acrfullpl{hyper=false,#1}{#2}}% + {\@Acrfullpl{hyper=false,#1}{#2}[]}% +} +\newcommand*\ns@Acrfullpl[2][]{% + \new@ifnextchar[{\@Acrfullpl{#1}{#2}}% + {\@Acrfullpl{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showgloname} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showgloname}\marg{label} -%\end{definition} +% Low-level macro: % \begin{macrocode} -\newcommand*{\showgloname}[1]{% - \expandafter\show\csname glo@#1@name\endcsname +\def\@Acrfullpl#1#2[#3]{% + \acrlinkfullformat{\@Acrlongpl}{\@acrshortpl}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglodesc} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglodesc}\marg{label} -%\end{definition} +%\begin{macro}{\ACRfullpl} +%\changes{1.13}{2008 May 10}{new} +%\changes{3.01}{2011/04/12}{made robust} % \begin{macrocode} -\newcommand*{\showglodesc}[1]{% - \expandafter\show\csname glo@#1@desc\endcsname +\newrobustcmd*{\ACRfullpl}{% + \@ifstar\s@ACRfullpl\ns@ACRfullpl } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglodescplural} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglodescplural}\marg{label} -%\end{definition} +%\changes{3.0}{2011/04/02}{added starred version} % \begin{macrocode} -\newcommand*{\showglodescplural}[1]{% - \expandafter\show\csname glo@#1@descplural\endcsname +\newcommand*\s@ACRfullpl[2][]{% + \new@ifnextchar[{\@ACRfullpl{hyper=false,#1}{#2}}% + {\@ACRfullpl{hyper=false,#1}{#2}[]}% +} +\newcommand*\ns@ACRfullpl[2][]{% + \new@ifnextchar[{\@ACRfullpl{#1}{#2}}% + {\@ACRfullpl{#1}{#2}[]}% } % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglosort} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglosort}\marg{label} -%\end{definition} +% Low-level macro: % \begin{macrocode} -\newcommand*{\showglosort}[1]{% - \expandafter\show\csname glo@#1@sort\endcsname +\def\@ACRfullpl#1#2[#3]{% + \acrlinkfullformat{\@ACRlongpl}{\@ACRshortpl}{#1}{#2}{#3}% } % \end{macrocode} %\end{macro} % -%\begin{macro}{\showglosymbol} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglosymbol}\marg{label} -%\end{definition} +%\subsection{Predefined acronym styles} +%\begin{macro}{\acronymfont} +%This is only used with the additional acronym styles: % \begin{macrocode} -\newcommand*{\showglosymbol}[1]{% - \expandafter\show\csname glo@#1@symbol\endcsname -} +\newcommand{\acronymfont}[1]{#1} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showglosymbolplural} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglosymbolplural}\marg{label} -%\end{definition} +%\begin{macro}{\firstacronymfont} +%This is only used with the additional acronym styles: +%\changes{1.14}{2008 June 17}{new} % \begin{macrocode} -\newcommand*{\showglosymbolplural}[1]{% - \expandafter\show\csname glo@#1@symbolplural\endcsname -} +\newcommand{\firstacronymfont}[1]{\acronymfont{#1}} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showgloindex} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showgloindex}\marg{label} -%\end{definition} +%\begin{macro}{\acrnameformat} +% The styles that allow an additional description use +% \cs{acrnameformat}\marg{short}\marg{long} to determine what +% information is displayed in the name. % \begin{macrocode} -\newcommand*{\showgloindex}[1]{% - \expandafter\show\csname glo@#1@index\endcsname -} +\newcommand*{\acrnameformat}[2]{\acronymfont{#1}} % \end{macrocode} %\end{macro} % -%\begin{macro}{\showgloflag} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showgloflag}\marg{label} -%\end{definition} +% Define some tokens used by \cs{newacronym}: +%\begin{macro}{\glskeylisttok} % \begin{macrocode} -\newcommand*{\showgloflag}[1]{% - \expandafter\show\csname ifglo@#1@flag\endcsname -} +\newtoks\glskeylisttok % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showacronymlists} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showacronymlists} -%\end{definition} -% Show list of glossaries that have been flagged as a list of -% acronyms. +%\begin{macro}{\glslabeltok} % \begin{macrocode} -\newcommand*{\showacronymlists}{% - \show\@glsacronymlists -} +\newtoks\glslabeltok % \end{macrocode} %\end{macro} -%\begin{macro}{\showglossaries} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglossaries} -%\end{definition} -% Show list of defined glossaries. +%\begin{macro}{\glsshorttok} % \begin{macrocode} -\newcommand*{\showglossaries}{% - \show\@glo@types -} +\newtoks\glsshorttok % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showglossaryin} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglossaryin}\marg{glossary-label} -%\end{definition} -% Show the `in' extension for the given glossary. +%\begin{macro}{\glslongtok} % \begin{macrocode} -\newcommand*{\showglossaryin}[1]{% - \expandafter\show\csname @glotype@#1@in\endcsname -} +\newtoks\glslongtok % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showglossaryout} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglossaryout}\marg{glossary-label} -%\end{definition} -% Show the `out' extension for the given glossary. +%\begin{macro}{\newacronymhook} +% Provide a hook for \cs{newacronym}: % \begin{macrocode} -\newcommand*{\showglossaryout}[1]{% - \expandafter\show\csname @glotype@#1@out\endcsname -} +\newcommand*{\newacronymhook}{} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showglossarytitle} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglossarytitle}\marg{glossary-label} -%\end{definition} -% Show the title for the given glossary. +%\begin{macro}{\SetDefaultAcronymDisplayStyle} +% Sets the default acronym display style for given glossary. +%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{changed to use \cs{defglsentryfmt}} % \begin{macrocode} -\newcommand*{\showglossarytitle}[1]{% - \expandafter\show\csname @glotype@#1@title\endcsname +\newcommand*{\SetDefaultAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\showglossarycounter} -%\changes{3.0}{2011/04/02}{new} -%\begin{definition} -%\cs{showglossarycounter}\marg{glossary-label} -%\end{definition} -% Show the counter for the given glossary. +%\begin{macro}{\DefaultNewAcronymDef} +% Sets up the acronym definition for the default style. +% The information is provided by the tokens \cs{glslabeltok}, +% \cs{glsshorttok}, \cs{glslongtok} and \cs{glskeylisttok}. % \begin{macrocode} -\newcommand*{\showglossarycounter}[1]{% - \expandafter\show\csname @glotype@#1@counter\endcsname -} +\newcommand*{\DefaultNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glsshorttok},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + first={\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + firstplural={\acrfullformat{\noexpand\expandonce\noexpand\@glo@longpl}% + {\noexpand\expandonce\noexpand\@glo@shortpl}},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\showglossaryentries} -%\changes{3.0}{2011/04/02}{new} -%\changes{3.02}{2012/05/21}{fixed misspelt command} -%\begin{definition} -%\cs{showglossaryentries}\marg{glossary-label} -%\end{definition} -% Show the list of entry labels for the given glossary. +% Remaining options specified by the user: % \begin{macrocode} -\newcommand*{\showglossaryentries}[1]{% - \expandafter\show\csname glolist@#1\endcsname + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } % \end{macrocode} %\end{macro} -% -%\subsection{Compatibility with version 2.07 and below} -% -% In order to fix some bugs in v3.0, it was necessary to change the -% way information is written to the \filetype{glo} file, which also meant -% a change in the format of the Xindy style file. The compatibility -% option is meant for documents that use a customised Xindy style -% file with \ics{noist}. With the compatibility option, hopefully -% \app{xindy} will still be able to process the old document, but -% the bugs will remain. The issues in versions 2.07 and below: -%\begin{itemize} -% \item With \pkgopt{xindy}, the counter used by the entry was -% hard-coded into the Xindy style file. This meant that you couldn't -% use the \gloskey[glslink]{counter} to swap counters. -% \item With both \pkgopt{xindy} and \pkgopt{makeindex}, if used -% with \sty{hyperref} and \cs{theH}\meta{counter} was different to -% \cs{thecounter}, the link in the location number would be -% undefined. -%\end{itemize} -% \begin{macrocode} -\csname ifglscompatible-2.07\endcsname - \RequirePackage{glossaries-compatible-207} -\fi -% \end{macrocode} -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*mfirstuc.sty> -% \end{macrocode} -%\fi -%\section{Mfirstuc Documented Code} -%\label{sec:code:mfirstuc} -% \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mfirstuc}[2012/05/21 v1.06 (NLCT)] -% \end{macrocode} -% Requires \sty{etoolbox}:\changes{1.06}{2012/05/21}{now requires -% etoolbox} +%\begin{macro}{\SetDefaultAcronymStyle} +%\changes{2.04}{2009 November 10}{new} +% Set up the default acronym style: % \begin{macrocode} -\RequirePackage{etoolbox} +\newcommand*{\SetDefaultAcronymStyle}{% % \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, unless the group -% is empty. -% 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}. +% Set the display style: % \begin{macrocode} -\newif\if@glscs -\newtoks\@glsmfirst -\newtoks\@glsmrest -\def\makefirstuc#1{% - \def\gls@argi{#1}% - \ifx\gls@argi\@empty + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDefaultAcronymDisplayStyle{\@gls@type}% + }% % \end{macrocode} -% If the argument is empty, do nothing. +% Set up the definition of \cs{newacronym}: % \begin{macrocode} - \else + \renewcommand{\newacronym}[4][]{% % \end{macrocode} -%\changes{1.03}{2008/12/22}{changed 'protected@edef to 'def} +% If user is just using the main glossary and hasn't identified it +% as a list of acronyms, then update. (This is done to ensure +% backwards compatibility with versions prior to 2.04). % \begin{macrocode} - \def\@gls@tmp{\ #1}% - \@onelevel@sanitize\@gls@tmp - \expandafter\@gls@checkcs\@gls@tmp\relax\relax - \if@glscs - \@gls@getbody #1{}\@nil - \ifx\@gls@rest\@empty - \glsmakefirstuc{#1}% - \else - \expandafter\@gls@split\@gls@rest\@nil - \ifx\@gls@first\@empty - \glsmakefirstuc{#1}% - \else - \expandafter\@glsmfirst\expandafter{\@gls@first}% - \expandafter\@glsmrest\expandafter{\@gls@rest}% - \edef\@gls@domfirstuc{\noexpand\@gls@body - {\noexpand\glsmakefirstuc\the\@glsmfirst}% - \the\@glsmrest}% - \@gls@domfirstuc - \fi - \fi - \else - \glsmakefirstuc{#1}% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDefaultAcronymDisplayStyle{\@glo@type}% \fi - \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DefaultNewAcronymDef + }% + \renewcommand*{\acrpluralsuffix}{\glspluralsuffix}% } % \end{macrocode} %\end{macro} -% Put first argument in \cs{@gls@first} and second argument in -% \cs{@gls@rest}: +% +%\begin{macro}{\acrfootnote} +%\changes{3.0}{2011/04/02}{new} +% Used by the footnote acronym styles. % \begin{macrocode} -\def\@gls@split#1#2\@nil{% - \def\@gls@first{#1}\def\@gls@rest{#2}% -} +\newcommand*{\acrfootnote}[3]{\acrlinkfootnote{#1}{#2}{#3}} % \end{macrocode} +%\end{macro} +%\begin{macro}{\acrlinkfootnote} +%\changes{3.0}{2011/04/02}{new} % \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 +\newcommand*{\acrlinkfootnote}[3]{% + \footnote{\glslink[#1]{#2}{#3}}% } % \end{macrocode} -% Make first thing upper case: -% \begin{macrocode} -\def\@gls@makefirstuc#1{\MakeUppercase #1} -% \end{macrocode} -%\begin{macro}{\glsmakefirstuc} -%\changes{1.05}{2011/04/02}{new} -% Provide a user command to make it easier to customise. +%\end{macro} +%\begin{macro}{\acrnolinkfootnote} +%\changes{3.0}{2011/04/02}{new} % \begin{macrocode} -\newcommand*{\glsmakefirstuc}[1]{\@gls@makefirstuc{#1}} +\newcommand*{\acrnolinkfootnote}[3]{% + \footnote{#3}% +} % \end{macrocode} %\end{macro} % -% 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{macro}{\SetDescriptionFootnoteAcronymDisplayStyle} +% Sets the acronym display style for given glossary for the +% description and footnote combination. +%\changes{2.04}{2009 November 10}{new} +%\changes{3.0}{2011/04/02}{expanded options link options} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} -\def\@gls@gobbletonil#1\@nil{\def\@gls@rest{#1}} -% \end{macrocode} -% -%\begin{macro}{\xmakefirstuc} -% Expand argument once before applying \cs{makefirstuc} -% (added v1.01). -% \begin{macrocode} -\newcommand*{\xmakefirstuc}[1]{% -\expandafter\makefirstuc\expandafter{#1}} +\newcommand*{\SetDescriptionFootnoteAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% + \ifglsused{\glslabel}% + {% + \acronymfont{\glsgenentryfmt}% + }% + {% + \firstacronymfont{\glsgenentryfmt}% + \ifglshassymbol{\glslabel}% + {% + \expandafter\protect\expandafter\acrfootnote\expandafter + {\@gls@link@opts}{\@gls@link@label}% + {% + \glsifplural + {\glsentrysymbolplural{\glslabel}}% + {\glsentrysymbol{\glslabel}}% + }% + }% + }% + }% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\capitalisewords} -%\changes{1.06}{2012/05/21}{new} -% Capitalise each word in the argument. Words are considered to be -% separated by plain spaces (i.e.\ non-breakable spaces won't be -% considered a word break). +%\begin{macro}{\DescriptionFootnoteNewAcronymDef} % \begin{macrocode} -\newcommand*{\capitalisewords}[1]{% - \def\gls@add@space{}% - \mfu@capitalisewords#1 \@nil\mfu@endcap - %\gls@add@space\makefirstuc{##1}\def\gls@add@space{ }% +\newcommand*{\DescriptionFootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + first={\the\glsshorttok},% + firstplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + symbol={\the\glslongtok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@longpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } % \end{macrocode} %\end{macro} -% +%\begin{macro}{\SetDescriptionFootnoteAcronymStyle} +% If a description and footnote are both required, store the long form +% in the \gloskey{symbol} key. Store the short form in \gloskey{text} +% key. Note that since the long form is stored in the symbol key, +% if you want the long form to appear in the list of acronyms, you +% need to use a glossary style that displays the symbol key. % \begin{macrocode} -\def\mfu@capitalisewords#1 #2\mfu@endcap{% - \def\mfu@cap@first{#1}% - \def\mfu@cap@second{#2}% - \gls@add@space - \makefirstuc{#1}% - \def\gls@add@space{ }% - \ifx\mfu@cap@second\@nnil - \let\next@mfu@cap\mfu@noop - \else - \let\next@mfu@cap\mfu@capitalisewords - \fi - \next@mfu@cap#2\mfu@endcap -} -\def\mfu@noop#1\mfu@endcap{} +\newcommand*{\SetDescriptionFootnoteAcronymStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDescriptionFootnoteAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DescriptionFootnoteNewAcronymDef + }% % \end{macrocode} % -%\begin{macro}{\xcapitalisewords} -%\changes{1.06}{2012/05/21}{new} -% Short-cut command: +% 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 \cs{protect} before \cs{footnote} +% and \cs{glslink}} % \begin{macrocode} -\newcommand*{\xcapitalisewords}[1]{% - \expandafter\capitalisewords\expandafter{#1}% -} + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDescriptionFootnoteAcronymDisplayStyle{\@gls@type}% + }% % \end{macrocode} -%\end{macro} -%\section{Glossary Styles} -%\iffalse +% Redefine \ics{acronymfont} if small caps required. The plural suffix +% is set in an upright font so that it remains in normal lower case, +% otherwise it looks as though it's part of the acronym. +%\changes{1.19}{2009 Mar 2}{changed \cs{acronymfont} to use +%\cs{textsmaller} instead +%of \cs{smaller}} % \begin{macrocode} -% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{##1}}% % \end{macrocode} -%\fi -%\iffalse % \begin{macrocode} -%<*glossary-hypernav.sty> + \renewcommand*{\acrpluralsuffix}{% + \glstextup{\glspluralsuffix}}% + \else + \ifglsacrsmaller + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% + \fi + \fi % \end{macrocode} -%\fi -% \subsection{Glossary hyper-navigation definitions (glossary-hypernav package)} -%\label{sec:code:hypernav} -% Package Definition: +% Check for package option clash % \begin{macrocode} -\ProvidesPackage{glossary-hypernav}[2007/07/04 v1.01 (NLCT)] + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi +}% % \end{macrocode} +%\end{macro} % -% The commands defined in this package are provided to -% help navigate around the groups within a glossary -% (see \autoref{sec:code:printglos}.) -% \ics{printglossary} (and \ics{printglossaries}) -% set \cs{@glo@type} to the label of the current -% glossary. This is used to create a unique hypertarget in -% the event of multiple glossaries. -%\\[10pt] -% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text}\\[10pt] -% This command makes \meta{text} a hyperlink to the glossary group -% whose label is given by \meta{label} for the glossary given -% by \meta{type}. -%\begin{macro}{\glsnavhyperlink} -%\changes{1.14}{2008 June 17}{changed 'edef to 'protected@edef} -%\changes{1.17}{2008 December 26}{replaced 'hyperlink to '@glslink} +%\begin{macro}{\SetDescriptionDUAAcronymDisplayStyle} +% Sets the acronym display style for given glossary with +% description and dua combination. +%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} -\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% - \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% - \@glslink{glsn:#1@#2}{#3}} +\newcommand*{\SetDescriptionDUAAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} % \end{macrocode} %\end{macro} -%\vskip5pt -% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text}\\[10pt] -% This command makes \meta{text} a hypertarget for the glossary group -% whose label is given by \meta{label} in the glossary given -% by \meta{type}. If \meta{type} is omitted, \cs{@glo@type} is -% used which is set by \ics{printglossary} to the current -% glossary label. -%\begin{macro}{\glsnavhypertarget} -%\changes{1.14}{2008 June 17}{added write to aux file} -%\changes{1.15}{2008 August 15}{added check if rerun required} -%\changes{1.17}{2008 December 26}{replaced 'hypertarget to '@glstarget} -% \begin{macrocode} -\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% -% \end{macrocode} -% Add this group to the aux file for re-run check. +%\begin{macro}{\DescriptionDUANewAcronymDef} % \begin{macrocode} - \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}% +\newcommand*{\DescriptionDUANewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glslongtok},% + sort={\the\glslongtok}, + text={\the\glslongtok},% + first={\the\glslongtok},% + plural={\noexpand\expandonce\noexpand\@glo@longpl},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + symbol={\the\glsshorttok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural +} % \end{macrocode} -% Add the target. +%\end{macro} +%\begin{macro}{\SetDescriptionDUAAcronymStyle} +% Description, don't use acronym and no footnote. +% Note that the short form is stored in the \gloskey{symbol} key, +% so if the short form needs to be displayed in the glossary, +% use a style the displays the symbol. % \begin{macrocode} - \@glstarget{glsn:#1@#2}{#3}% +\newcommand*{\SetDescriptionDUAAcronymStyle}{% + \ifglsacrsmallcaps + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \else + \ifglsacrsmaller + \PackageError{glossaries}{Option clash: `smaller' and `dua' + can't both be set}{}% + \fi + \fi + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDescriptionDUAAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DescriptionDUANewAcronymDef + }% % \end{macrocode} -% Check list of know groups to determine if a re-run is required. +% Set display. % \begin{macrocode} - \expandafter\let - \expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDescriptionDUAAcronymDisplayStyle{\@gls@type}% + }% +}% % \end{macrocode} -% Iterate through list and terminate loop if this group is found. +%\end{macro} +% +%\begin{macro}{\SetDescriptionAcronymDisplayStyle} +% Sets the acronym display style for given glossary using +% the description setting (but not \pkgopt{footnote} or \pkgopt{dua}). +%\changes{2.04}{2009 November 10}{new} +%\changes{3.07}{2013-07-05}{now using \cs{glsdoparenifnotempty}} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} - \@for\@gls@elem:=\@gls@list\do{% - \ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}% +\newcommand*{\SetDescriptionAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% + \ifglsused{\glslabel}% + {% % \end{macrocode} -% Check if list terminated prematurely. +% Move the inserted text outside of \cs{acronymfont} % \begin{macrocode} - \if@endfor - \else + \let\gls@org@insert\glsinsert + \let\glsinsert\@empty + \acronymfont{\glsgenentryfmt}\gls@org@insert + }% + {% + \glsgenentryfmt + \ifglshassymbol{\glslabel}% + {% + \glsifplural + {% + \def\@glo@symbol{\glsentrysymbolplural{\glslabel}}% + }% + {% + \def\@glo@symbol{\glsentrysymbol{\glslabel}}% + }% + \space(\protect\firstacronymfont + {\glscapscase + {\@glo@symbol} + {\@glo@symbol} + {\mfirstucMakeUppercase{\@glo@symbol}}})% + }% + {}% + }% + }% +} % \end{macrocode} -% This group was not included in the list, so issue a warning. +%\end{macro} +%\begin{macro}{\DescriptionNewAcronymDef} % \begin{macrocode} - \GlossariesWarningNoLine{Navigation panel - for glossary type `#1'^^Jmissing group `#2'}% - \gdef\gls@hypergrouprerun{% - \GlossariesWarningNoLine{Navigation panel - has changed. Rerun LaTeX}}% - \fi +\newcommand*{\DescriptionNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand + \acrnameformat{\the\glsshorttok}{\the\glslongtok}},% + sort={\the\glsshorttok},% + first={\the\glslongtok},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + symbol={\noexpand\@glo@text},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok}% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } % \end{macrocode} %\end{macro} -%\begin{macro}{\gls@hypergrouprerun} -% Give a warning at the end if re-run required -%\changes{1.15}{2008 August 15}{new} +%\begin{macro}{\SetDescriptionAcronymStyle} +% Option \pkgopt{description} is used, but not \pkgopt{dua} +% or \pkgopt{footnote}. +% Store long form in \gloskey{first} key +% and short form in \gloskey{text} and \gloskey{symbol} key. +% The name is stored using \ics{acrnameformat} to allow the +% user to override the way the name is displayed in the +% list of acronyms. % \begin{macrocode} -\let\gls@hypergrouprerun\relax -\AtEndDocument{\gls@hypergrouprerun} +\newcommand*{\SetDescriptionAcronymStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDescriptionAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DescriptionNewAcronymDef + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@hypergroup} -% This adds to (or creates) the command \cs{@gls@hypergrouplist@}\meta{glossary type} -% which lists all groups for a given glossary, so that -% the navigation bar only contains those groups that are present. -% However it requires at least 2 runs to ensure the information is -% up-to-date. -%\changes{1.14}{2008 June 17}{new} +% Set display. % \begin{macrocode} -\newcommand*{\@gls@hypergroup}[2]{% -\@ifundefined{@gls@hypergrouplist@#1}{% - \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}% -}{% - \expandafter\let\expandafter\@gls@tmp - \csname @gls@hypergrouplist@#1\endcsname - \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{% - \@gls@tmp,#2}% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDescriptionAcronymDisplayStyle{\@gls@type}% + }% +% \end{macrocode} +% Redefine \ics{acronymfont} if small caps required. The plural suffix +% is set in an upright font so that it remains in normal lower case, +% otherwise it looks as though it's part of the acronym. +%\changes{1.19}{2009 Mar 2}{changed \cs{acronymfont} to use +%\cs{textsmaller} instead +%of \cs{smaller}} +% \begin{macrocode} + \ifglsacrsmallcaps + \renewcommand{\acronymfont}[1]{\textsc{##1}} + \renewcommand*{\acrpluralsuffix}{% + \glstextup{\glspluralsuffix}}% + \else + \ifglsacrsmaller + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% + \fi + \fi }% -} % \end{macrocode} %\end{macro} % -% The \cs{glsnavigation} command displays a simple glossary -% group navigation. -% The symbol and number elements are defined separately, -% so that they can be suppressed if need be. Note that this -% command will produce a link to all 28 groups, but some groups -% may not be defined if there are groups that do not contain any -% terms, in which case you will get an undefined hyperlink warning. -% Now for the whole navigation bit: -%\begin{macro}{\glsnavigation} -% \changes{1.14}{2008 June 2008}{changed to only use labels for -% groups that are present} +%\begin{macro}{\SetFootnoteAcronymDisplayStyle} +% Sets the acronym display style for given glossary with +% footnote setting (but not \pkgopt{description} or \pkgopt{dua}). +%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} -\newcommand*{\glsnavigation}{% -\def\@gls@between{}% -\@ifundefined{@gls@hypergrouplist@\@glo@type}{% - \def\@gls@list{}% -}{% - \expandafter\let\expandafter\@gls@list - \csname @gls@hypergrouplist@\@glo@type\endcsname -}% -\@for\@gls@tmp:=\@gls@list\do{% - \@gls@between - \glsnavhyperlink{\@gls@tmp}{\glsgetgrouptitle{\@gls@tmp}}% - \let\@gls@between\glshypernavsep% -}% -} +\newcommand*{\SetFootnoteAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% % \end{macrocode} -%\end{macro} -%\begin{macro}{\glshypernavsep} -% Separator for the hyper navigation bar. +% Move the inserted text outside of \cs{acronymfont} % \begin{macrocode} -\newcommand*{\glshypernavsep}{\space\textbar\space} + \let\gls@org@insert\glsinsert + \let\glsinsert\@empty + \ifglsused{\glslabel}% + {% + \acronymfont{\glsgenentryfmt}\gls@org@insert + }% + {% + \firstacronymfont{\glsgenentryfmt}\gls@org@insert + \ifglshaslong{\glslabel}% + {% + \expandafter\protect\expandafter\acrfootnote\expandafter + {\@gls@link@opts}{\@gls@link@label}% + {% + \glsifplural + {\glsentrylongpl{\glslabel}}% + {\glsentrylong{\glslabel}}% + }% + }% % \end{macrocode} -%\end{macro} -% The \cs{glssymbolnav} produces a simple navigation set of -% links for just the symbol and number groups. This used to be used at -% the start of \cs{glsnavigation}. This command is no longer needed. -%\begin{macro}{\glssymbolnav} +%\changes{3.13a}{2013-11-05}{fixed missing argument bug} % \begin{macrocode} -\newcommand*{\glssymbolnav}{% -\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}}% -\glshypernavsep -\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}}% -\glshypernavsep + {}% + }% + }% } % \end{macrocode} %\end{macro} -%\iffalse +%\begin{macro}{\FootnoteNewAcronymDef} % \begin{macrocode} -% +\newcommand*{\FootnoteNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + first={\the\glsshorttok},% + firstplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@descplural\@org@gls@assign@descplural +} % \end{macrocode} -%\fi -%\iffalse +%\end{macro} +%\begin{macro}{\SetFootnoteAcronymStyle} +% If \pkgopt{footnote} package option is specified, set the first +% use to append the long form (stored in \gloskey{description}) as a +% footnote. +% Use the \gloskey{description} key to store the long form. % \begin{macrocode} -%<*glossary-inline.sty> +\newcommand*{\SetFootnoteAcronymStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetFootnoteAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \FootnoteNewAcronymDef + }% % \end{macrocode} -%\fi -% \subsection{In-line Style (glossary-inline.sty)} -% This defines an in-line style where the entries are -% comma-separated with just the name and description displayed. +% Set display +%\changes{1.12}{2008 Mar 8}{Added \cs{protect} before \cs{footnote} and +% \cs{glslink}} % \begin{macrocode} -\ProvidesPackage{glossary-inline}[2012/09/21 v3.03 (NLCT)] + \@for\@gls@type:=\@glsacronymlists\do{% + \SetFootnoteAcronymDisplayStyle{\@gls@type}% + }% % \end{macrocode} -% -%\begin{style}{inline} -% Define the inline style. +% Redefine \ics{acronymfont} if small caps required. The plural suffix +% is set in an upright font so that it remains in normal lower case, +% otherwise it looks as though it's part of the acronym. +%\changes{1.19}{2009 Mar 2}{changed \cs{acronymfont} to use +%\cs{textsmaller} instead +%of \cs{smaller}} % \begin{macrocode} -\newglossarystyle{inline}{% + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{##1}}% + \renewcommand*{\acrpluralsuffix}{% + \glstextup{\glspluralsuffix}}% + \else + \ifglsacrsmaller + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}}% + \fi + \fi % \end{macrocode} -% Start of glossary sets up first empty separator between entries. -% (This is then changed by \cs{glossaryentryfield}) +% Check for option clash % \begin{macrocode} - \renewenvironment{theglossary}% - {% - \def\gls@inlinesep{}% - \def\gls@inlinesubsep{}% - \def\gls@inlinepostchild{}% - }% - {\glspostinline}% + \ifglsacrdua + \PackageError{glossaries}{Option clash: `footnote' and `dua' + can't both be set}{}% + \fi +}% % \end{macrocode} -% No header: +%\end{macro} +% +%\begin{macro}{\glsdoparenifnotempty} +% Do a space followed by the argument if the argument doesn't expand +% to empty or \cs{relax}. If argument isn't empty (or \cs{relax}), apply +% the macro to it given in the second argument. % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\DeclareRobustCommand*{\glsdoparenifnotempty}[2]{% + \protected@edef\gls@tmp{#1}% + \ifdefempty\gls@tmp + {}% + {% + \ifx\gls@tmp\@gls@default@value + \else + \space (#2{#1})% + \fi + }% +} % \end{macrocode} -% No group headings (if heading is required, add -% \ics{glsinlinedopostchild} to start definition in case heading -% follows a child entry): +%\end{macro} +% +%\begin{macro}{\SetSmallAcronymDisplayStyle} +% Sets the acronym display style for given glossary where neither +% footnote nor description is required, but smallcaps or smaller +% specified. +%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newcommand*{\SetSmallAcronymDisplayStyle}[1]{% + \defglsentryfmt[#1]{% % \end{macrocode} -% Just display separator followed by name and description: +% Move the inserted text outside of \cs{acronymfont} % \begin{macrocode} - \renewcommand{\glossaryentryfield}[5]{% - \glsinlinedopostchild - \gls@inlinesep - \def\glo@desc{##3}% - \def\@no@post@desc{\nopostdesc}% - \glsentryitem{##1}\glsinlinenameformat{##1}{##2}% - \ifx\glo@desc\@no@post@desc - \glsinlineemptydescformat{##4}{##5}% - \else - \ifstrempty{##3}% - {\glsinlineemptydescformat{##4}{##5}}% - {\glsinlinedescformat{##3}{##4}{##5}}% - \fi - \ifglshaschildren{##1}% + \let\gls@org@insert\glsinsert + \let\glsinsert\@empty + \ifglsused{\glslabel}% {% - \glsresetsubentrycounter - \glsinlineparentchildseparator - \def\gls@inlinesubsep{}% - \def\gls@inlinepostchild{\glsinlinepostchild}% + \acronymfont{\glsgenentryfmt}\gls@org@insert + }% + {% + \glsgenentryfmt + \ifglshassymbol{\glslabel}% + {% + \glsifplural + {% + \def\@glo@symbol{\glsentrysymbolplural{\glslabel}}% + }% + {% + \def\@glo@symbol{\glsentrysymbol{\glslabel}}% + }% + \space + (\glscapscase + {\firstacronymfont{\@glo@symbol}}% + {\firstacronymfont{\@glo@symbol}}% + {\firstacronymfont{\mfirstucMakeUppercase{\@glo@symbol}}})% + }% + {}% }% - {}% - \def\gls@inlinesep{\glsinlineseparator}% }% +} % \end{macrocode} -% Sub-entries display description: +%\end{macro} +%\begin{macro}{\SmallNewAcronymDef} +%\changes{3.02}{2012/05/21}{fixed broken short and long plural} % \begin{macrocode} - \renewcommand{\glossarysubentryfield}[6]{% - \gls@inlinesubsep% - \glsinlinesubnameformat{##2}{##3}% - \glssubentryitem{##2}\glsinlinesubdescformat{##4}{##5}{##6}% - \def\gls@inlinesubsep{\glsinlinesubseparator}% - }% +\newcommand*{\SmallNewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\noexpand\acronymfont{\the\glsshorttok}},% + sort={\the\glsshorttok},% + text={\the\glsshorttok},% % \end{macrocode} -% Nothing special between groups: +% Default to the short plural. % \begin{macrocode} - \renewcommand*{\glsgroupskip}{}% -} + plural={\noexpand\expandonce\noexpand\@glo@shortpl},% + first={\the\glslongtok},% % \end{macrocode} -%\end{style} -% -%\begin{macro}{\glsinlinedopostchild} +% Default to the long plural. % \begin{macrocode} -\newcommand*{\glsinlinedopostchild}{% - \gls@inlinepostchild - \def\gls@inlinepostchild{}% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\noexpand\@glo@first},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + symbol={\the\glsshorttok},% +% \end{macrocode} +% Default to the short plural. +% \begin{macrocode} + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@descplural\gls@assign@descplural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@descplural\@org@gls@assign@descplural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural } % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsinlineseparator} -% Separator to use between entries. +%\begin{macro}{\SetSmallAcronymStyle} +% Neither footnote nor description required, but smallcaps or +% smaller specified. +% Use the \gloskey{symbol} key to store the short form and +% \gloskey{first} to store the long form. % \begin{macrocode} -\newcommand*{\glsinlineseparator}{;\space} +\newcommand*{\SetSmallAcronymStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetSmallAcronymDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \SmallNewAcronymDef + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsinlinesubseparator} -% Separator to use between sub-entries. +% Change the display since \gloskey{first} only contains long form. % \begin{macrocode} -\newcommand*{\glsinlinesubseparator}{,\space} + \@for\@gls@type:=\@glsacronymlists\do{% + \SetSmallAcronymDisplayStyle{\@gls@type}% + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsinlineparentchildseparator} -% Separator to use between parent and children. +% Redefine \ics{acronymfont} if small caps required. The plural suffix +% is set in an upright font so that it remains in normal lower case, +% otherwise it looks as though it's part of the acronym. +%\changes{1.19}{2009 Mar 2}{changed \cs{acronymfont} to use +%\cs{textsmaller} instead +%of \cs{smaller}} % \begin{macrocode} -\newcommand*{\glsinlineparentchildseparator}{:\space} + \ifglsacrsmallcaps + \renewcommand*{\acronymfont}[1]{\textsc{##1}} + \renewcommand*{\acrpluralsuffix}{% + \glstextup{\glspluralsuffix}}% + \else + \renewcommand*{\acronymfont}[1]{\textsmaller{##1}} + \fi % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsinlinepostchild} -%\changes{}{}{new} -% Hook to use between child and next entry +% check for option clash % \begin{macrocode} -\newcommand*{\glsinlinepostchild}{} + \ifglsacrdua + \ifglsacrsmallcaps + \PackageError{glossaries}{Option clash: `smallcaps' and `dua' + can't both be set}{}% + \else + \PackageError{glossaries}{Option clash: `smaller' and `dua' + can't both be set}{}% + \fi + \fi +}% % \end{macrocode} %\end{macro} % -%\begin{macro}{\glspostinline} -% Terminator for inline glossary. -%\changes{}{}{replaced ``.'' with \cs{glspostdescription}} +%\begin{macro}{\SetDUADisplayStyle} +% Sets the acronym display style for given glossary with dua +% setting. +%\changes{2.04}{2009 November 10}{new} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} -\newcommand*{\glspostinline}{\glspostdescription\space} +\newcommand*{\SetDUADisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsinlinenameformat} -%\changes{}{}{new} -% Formats the name of the entry (first argument label, second -% argument name): +%\begin{macro}{\DUANewAcronymDef} % \begin{macrocode} -\newcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{#2}} +\newcommand*{\DUANewAcronymDef}{% + \edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + name={\the\glsshorttok},% + text={\the\glslongtok},% + first={\the\glslongtok},% + plural={\noexpand\expandonce\noexpand\@glo@longpl},% + firstplural={\noexpand\expandonce\noexpand\@glo@longpl},% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + description={\the\glslongtok},% + descriptionplural={\noexpand\expandonce\noexpand\@glo@longpl},% + symbol={\the\glsshorttok},% + symbolplural={\noexpand\expandonce\noexpand\@glo@shortpl},% + \the\glskeylisttok + }% + }% + \let\@org@gls@assign@firstpl\gls@assign@firstpl + \let\@org@gls@assign@plural\gls@assign@plural + \let\@org@gls@assign@symbolplural\gls@assign@symbolplural + \let\@org@gls@assign@descplural\gls@assign@descplural + \def\gls@assign@firstpl##1##2{% + \@@gls@expand@field{##1}{firstpl}{##2}% + }% + \def\gls@assign@plural##1##2{% + \@@gls@expand@field{##1}{plural}{##2}% + }% + \def\gls@assign@symbolplural##1##2{% + \@@gls@expand@field{##1}{symbolplural}{##2}% + }% + \def\gls@assign@descplural##1##2{% + \@@gls@expand@field{##1}{descplural}{##2}% + }% + \@do@newglossaryentry + \let\gls@assign@firstpl\@org@gls@assign@firstpl + \let\gls@assign@plural\@org@gls@assign@plural + \let\gls@assign@symbolplural\@org@gls@assign@symbolplural + \let\gls@assign@descplural\@org@gls@assign@descplural +} % \end{macrocode} %\end{macro} -% -%\begin{macro}{\glsinlinedescformat} -%\changes{}{}{new} -% Formats the entry's description, symbol and location list: +%\begin{macro}{\SetDUAStyle} +% Always expand acronyms. % \begin{macrocode} -\newcommand*{\glsinlinedescformat}[3]{\space#1} +\newcommand*{\SetDUAStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetDUADisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \DUANewAcronymDef + }% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsinlineemptydescformat} -%\changes{}{}{new} -% Formats the entry's symbol and location list when the description -% is empty: +% Set the display % \begin{macrocode} -\newcommand*{\glsinlineemptydescformat}[2]{} + \@for\@gls@type:=\@glsacronymlists\do{% + \SetDUADisplayStyle{\@gls@type}% + }% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glsinlinesubnameformat} -%\changes{}{}{new} -% Formats the name of the subentry (first argument label, second -% argument name): +%\begin{macro}{\SetAcronymStyle} % \begin{macrocode} -\newcommand*{\glsinlinesubnameformat}[2]{\glstarget{#1}{}} +\newcommand*{\SetAcronymStyle}{% + \SetDefaultAcronymStyle + \ifglsacrdescription + \ifglsacrfootnote + \SetDescriptionFootnoteAcronymStyle + \else + \ifglsacrdua + \SetDescriptionDUAAcronymStyle + \else + \SetDescriptionAcronymStyle + \fi + \fi + \else + \ifglsacrfootnote + \SetFootnoteAcronymStyle + \else + \ifthenelse{\boolean{glsacrsmallcaps}\OR + \boolean{glsacrsmaller}}% + {% + \SetSmallAcronymStyle + }% + {% + \ifglsacrdua + \SetDUAStyle + \fi + }% + \fi + \fi +} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\glsinlinesubdescformat} -%\changes{}{}{new} -% Formats the subentry's description, symbol and location list: +% Set the acronym style according to the package options % \begin{macrocode} -\newcommand*{\glsinlinesubdescformat}[3]{#1} +\SetAcronymStyle % \end{macrocode} %\end{macro} % -% -%\iffalse -% \begin{macrocode} -% -% \end{macrocode} -%\fi -%\iffalse -% \begin{macrocode} -%<*glossary-list.sty> -% \end{macrocode} -%\fi -% \subsection{List Style (glossary-list.sty)} -% The \isty{glossary-list} style file defines glossary styles -% that use the \env{description} environment. Note that since -% the entry name is placed in the optional argument to the -% \ics{item} command, it will appear in a bold font by -% default. -% \begin{macrocode} -\ProvidesPackage{glossary-list}[2012/11/11 v3.04 (NLCT)] -% \end{macrocode} -%\begin{style}{list} -% The \glostyle{list} glossary style -% uses the \env{description} environment. The group separator -% \ics{glsgroupskip} is redefined as \cs{indexspace} -% which produces a gap between groups. The glossary heading -% and the group headings do nothing. Sub-entries immediately -% follow the main entry without the sub-entry name. This style -% does not use the entry's symbol. This is used as the default -% style for the \sty{glossaries} package. -% \begin{macrocode} -\newglossarystyle{list}{% -% \end{macrocode} -% Use \env{description} environment: +% Allow user to define their own custom acronyms. +% (For compatibility with versions before v3.0, the short form is +% stored in the user1 key, the plural short form is stored in the +% user2 key, the long form is stored in the user3 key and the +% plural long form is stored in the user4 key.) Defaults to +% displaying only the acronym with the long form as the description. +%\begin{macro}{\SetCustomDisplayStyle} +% Sets the acronym display style. +%\changes{2.06}{2010 June 14}{new} +%\changes{3.11a}{2013-10-15}{updated to use \cs{defglsentryfmt}} % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{description}}{\end{description}}% +\newcommand*{\SetCustomDisplayStyle}[1]{% + \defglsentryfmt[#1]{\glsgenentryfmt}% +} % \end{macrocode} -% No header at the start of the environment: +%\end{macro} +%\begin{macro}{\CustomAcronymFields} +%\changes{2.06}{2010 June 14}{new} % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\newcommand*{\CustomAcronymFields}{% + name={\the\glsshorttok},% + description={\the\glslongtok},% + first={\noexpand\acrfullformat{\the\glslongtok}{\the\glsshorttok}},% + firstplural={\noexpand\acrfullformat + {\noexpand\glsentrylongpl{\the\glslabeltok}}% + {\noexpand\glsentryshortpl{\the\glslabeltok}}}% + text={\the\glsshorttok},% + plural={\the\glsshorttok\noexpand\acrpluralsuffix}% +} % \end{macrocode} -% No group headings: +%\end{macro} +%\begin{macro}{\CustomNewAcronymDef} +%\changes{2.06}{2010 June 14}{new} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newcommand*{\CustomNewAcronymDef}{% + \protected@edef\@do@newglossaryentry{% + \noexpand\newglossaryentry{\the\glslabeltok}% + {% + type=\acronymtype,% + short={\the\glsshorttok},% + shortplural={\the\glsshorttok\noexpand\acrpluralsuffix},% + long={\the\glslongtok},% + longplural={\the\glslongtok\noexpand\acrpluralsuffix},% + user1={\the\glsshorttok},% + user2={\the\glsshorttok\noexpand\acrpluralsuffix},% + user3={\the\glslongtok},% + user4={\the\glslongtok\noexpand\acrpluralsuffix},% + \CustomAcronymFields,% + \the\glskeylisttok + }% + }% + \@do@newglossaryentry +} % \end{macrocode} -% Main (level 0) entries start a new item in the list: +%\end{macro} +%\begin{macro}{\SetCustomStyle} +%\changes{2.06}{2010 June 14}{new} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \item[\glsentryitem{##1}\glstarget{##1}{##2}] - ##3\glspostdescription\space ##5}% +\newcommand*{\SetCustomStyle}{% + \renewcommand{\newacronym}[4][]{% + \ifx\@glsacronymlists\@empty + \def\@glo@type{\acronymtype}% + \setkeys{glossentry}{##1}% + \DeclareAcronymList{\@glo@type}% + \SetCustomDisplayStyle{\@glo@type}% + \fi + \glskeylisttok{##1}% + \glslabeltok{##2}% + \glsshorttok{##3}% + \glslongtok{##4}% + \newacronymhook + \CustomNewAcronymDef + }% % \end{macrocode} -% Sub-entries continue on the same line: +% Set the display % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}% -% \end{macrocode} -% Add vertical space between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} -% \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + \@for\@gls@type:=\@glsacronymlists\do{% + \SetCustomDisplayStyle{\@gls@type}% + }% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{listgroup} -% The \glostyle{listgroup} style is like the \glostyle{list} -% style, but the glossary groups have headings. -%\changes{1.08}{2007 Oct 13}{changed listgroup style to use \cs{glsgetgrouptitle}} +% +%\begin{macro}{\DefineAcronymSynonyms} +%\changes{2.04}{2009 November 10}{new} % \begin{macrocode} -\newglossarystyle{listgroup}{% +\newcommand*{\DefineAcronymSynonyms}{% % \end{macrocode} -% Base it on the \glostyle{list} style: +%\end{macro} +% Short form +%\begin{macro}{\acs} % \begin{macrocode} - \glossarystyle{list}% + \let\acs\acrshort % \end{macrocode} -% Each group has a heading: +%\end{macro} +% First letter uppercase short form +%\begin{macro}{\Acs} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} + \let\Acs\Acrshort % \end{macrocode} -%\end{style} -% -%\begin{style}{listhypergroup} -% The \glostyle{listhypergroup} style is like the \glostyle{listgroup} -% style, but has a set of links to the groups at the -% start of the glossary. +%\end{macro} +% Plural short form +%\begin{macro}{\acsp} % \begin{macrocode} -\newglossarystyle{listhypergroup}{% + \let\acsp\acrshortpl % \end{macrocode} -% Base it on the \glostyle{list} style: +%\end{macro} +% First letter uppercase plural short form +%\begin{macro}{\Acsp} % \begin{macrocode} - \glossarystyle{list}% + \let\Acsp\Acrshortpl % \end{macrocode} -% Add navigation links at the start of the environment: +%\end{macro} +% Long form +%\begin{macro}{\acl} % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \item[\glsnavigation]}% + \let\acl\acrlong % \end{macrocode} -% Each group has a heading with a hypertarget: +%\end{macro} +% Plural long form +%\begin{macro}{\aclp} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{% - \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} + \let\aclp\acrlongpl % \end{macrocode} -%\end{style} -% -%\begin{style}{altlist} -% The \glostyle{altlist} glossary style is like the \glostyle{list} -% style, but places the description on a new line. Sub-entries -% follow in separate paragraphs without the sub-entry name. This -% style does not use the entry's symbol. +%\end{macro} +% First letter upper case long form +%\begin{macro}{\Acl} % \begin{macrocode} -\newglossarystyle{altlist}{% + \let\Acl\Acrlong % \end{macrocode} -% Base it on the \glostyle{list} style: +%\end{macro} +% First letter upper case plural long form +%\begin{macro}{\Aclp} % \begin{macrocode} - \glossarystyle{list}% + \let\Aclp\Acrlongpl % \end{macrocode} -% Main (level 0) entries start a new item in the list with a -% line break after the entry name: +%\end{macro} +% Full form +%\begin{macro}{\acf} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \item[\glsentryitem{##1}\glstarget{##1}{##2}]% + \let\acf\acrfull % \end{macrocode} -%\changes{3.04}{2012-11-11}{replaced \cs{newline} with paragraph break} -% Version 3.04 changed \cs{newline} to the following paragraph break -% stuff (thanks to Daniel Gebhardt for supplying the fix) to prevent -% a page break occurring at this point. +%\end{macro} +% Plural full form +%\begin{macro}{\acfp} % \begin{macrocode} - \mbox{}\par\nobreak\@afterheading - ##3\glspostdescription\space ##5}% + \let\acfp\acrfullpl % \end{macrocode} -% Sub-entries start a new paragraph: +%\end{macro} +% First letter upper case full form +%\begin{macro}{\Acf} % \begin{macrocode} - \renewcommand{\glossarysubentryfield}[6]{% - \par - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6}% -} + \let\Acf\Acrfull % \end{macrocode} -%\end{style} -%\begin{style}{altlistgroup} -% The \glostyle{altlistgroup} glossary style is like the -% \glostyle{altlist} style, but the glossary groups have headings. -%\changes{1.08}{2007 Oct 13}{changed altlistgroup style to use \cs{glsgetgrouptitle}} +%\end{macro} +% First letter upper case plural full form +%\begin{macro}{\Acfp} % \begin{macrocode} -\newglossarystyle{altlistgroup}{% + \let\Acfp\Acrfullpl % \end{macrocode} -% Base it on the \glostyle{altlist} style: +%\end{macro} +% Standard form +%\begin{macro}{\ac} % \begin{macrocode} - \glossarystyle{altlist}% + \let\ac\gls % \end{macrocode} -% Each group has a heading: +%\end{macro} +% First upper case standard form +%\begin{macro}{\Ac} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} + \let\Ac\Gls % \end{macrocode} -%\end{style} -% -%\begin{style}{altlisthypergroup} -% The \glostyle{altlisthypergroup} glossary style is like the -% \glostyle{altlistgroup} style, but has a -% set of links to the groups at the start of the glossary. +%\end{macro} +% Standard plural form +%\begin{macro}{\acp} % \begin{macrocode} -\newglossarystyle{altlisthypergroup}{% + \let\acp\glspl % \end{macrocode} -% Base it on the \glostyle{altlist} style: +%\end{macro} +% Standard first letter upper case plural form +%\begin{macro}{\Acp} % \begin{macrocode} - \glossarystyle{altlist}% + \let\Acp\Glspl % \end{macrocode} -% Add navigation links at the start of the environment: +%\end{macro} % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \item[\glsnavigation]}% +} % \end{macrocode} -% Each group has a heading with a hypertarget: +% Define synonyms if required % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{% - \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} +\ifglsacrshortcuts + \DefineAcronymSynonyms +\fi % \end{macrocode} -%\end{style} % -%\begin{style}{listdotted} -% The \glostyle{listdotted} glossary style was supplied by -% Axel~Menzel. I've modified it slightly so that the distance from -% the start of the name to the end of the dotted line is specified -% by \cs{glslistdottedwidth}. -% Note that this style ignores the page numbers as well as the -% symbol. Sub-entries are displayed in the same way as top-level -% entries. -% \begin{macrocode} -\newglossarystyle{listdotted}{% -% \end{macrocode} -% Base it on the \glostyle{list} style: +% \subsection{Predefined Glossary Styles}\label{sec:code:styles} +% The \sty{glossaries} bundle comes with some predefined glossary +% styles. These need to be loaded now for the \pkgopt{style} option +% to use them. +% +% First, the glossary hyper-navigation commands need to be loaded. % \begin{macrocode} - \glossarystyle{list}% +\RequirePackage{glossary-hypernav} % \end{macrocode} -% Each main (level 0) entry starts a new item: +% The styles that use list-like environments. These are not loaded +% if the \pkgopt{nolist} option is used: % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glsentryitem{##1}\glstarget{##1}{##2}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}% +\@gls@loadlist % \end{macrocode} -% Sub entries have the same format as main entries: +% The styles that use the \env{longtable} environment. These are +% not loaded if the \pkgopt{nolong} package option is used. % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - \item[]\makebox[\glslistdottedwidth][l]{% - \glssubentryitem{##2}% - \glstarget{##2}{##3}% - \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}% -} +\@gls@loadlong % \end{macrocode} -%\end{style} -%\begin{macro}{\glslistdottedwidth} -%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} +% The styles that use the \env{supertabular} environment. These are +% not loaded if the \pkgopt{nosuper} package option is used or if +% the \isty{supertabular} package isn't installed. % \begin{macrocode} -\newlength\glslistdottedwidth -\setlength{\glslistdottedwidth}{.5\hsize} +\@gls@loadsuper % \end{macrocode} -%\end{macro} -% -%\begin{style}{sublistdotted} -% This style is similar to the glostyle{listdotted} style, except -% that the main entries just have the name displayed. +% The tree-like styles. These are not loaded if the \pkgopt{notree} +% package option is used. % \begin{macrocode} -\newglossarystyle{sublistdotted}{% +\@gls@loadtree % \end{macrocode} -% Base it on the \glostyle{listdotted} style: +% The default glossary style is set according to the \pkgopt{style} package +% option, but can be overridden by \ics{glossarystyle}. The +% required style must be defined at this point. % \begin{macrocode} - \glossarystyle{listdotted}% +\ifx\@glossary@default@style\relax +\else + \setglossarystyle{\@glossary@default@style} +\fi % \end{macrocode} -% Main (level 0) entries just display the name: +% +%\subsection{Debugging Commands} +% +%\begin{macro}{\showgloparent} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showgloparent}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \item[\glsentryitem{##1}\glstarget{##1}{##2}]}% +\newcommand*{\showgloparent}[1]{% + \expandafter\show\csname glo@#1@parent\endcsname } % \end{macrocode} -%\end{style} -%\iffalse +%\end{macro} +% +%\begin{macro}{\showglolevel} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglolevel}\marg{label} +%\end{definition} % \begin{macrocode} -% +\newcommand*{\showglolevel}[1]{% + \expandafter\show\csname glo@#1@level\endcsname +} % \end{macrocode} -%\fi -%\iffalse +%\end{macro} +% +%\begin{macro}{\showglotext} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglotext}\marg{label} +%\end{definition} % \begin{macrocode} -%<*glossary-long.sty> +\newcommand*{\showglotext}[1]{% + \expandafter\show\csname glo@#1@text\endcsname +} % \end{macrocode} -%\fi -% \subsection{Glossary Styles using longtable (the glossary-long -% package)} -% The glossary styles defined in the \isty{glossary-long} package -% used the \env{longtable} environment in the glossary. +%\end{macro} +% +%\begin{macro}{\showgloplural} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showgloplural}\marg{label} +%\end{definition} % \begin{macrocode} -\ProvidesPackage{glossary-long}[2012/09/21 v3.03 (NLCT)] +\newcommand*{\showgloplural}[1]{% + \expandafter\show\csname glo@#1@plural\endcsname +} % \end{macrocode} -% Requires the \isty{longtable} package: +%\end{macro} +% +%\begin{macro}{\showglofirst} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglofirst}\marg{label} +%\end{definition} % \begin{macrocode} -\RequirePackage{longtable} +\newcommand*{\showglofirst}[1]{% + \expandafter\show\csname glo@#1@first\endcsname +} % \end{macrocode} -%\begin{macro}{\glsdescwidth} -% This is a length that governs the width of the description column. -% (There's a chance that the user may specify \pkgopt{nolong} -% and then load \isty{glossary-long} later, in which case -% \cs{glsdescwidth} may have already been defined by -% \isty{glossary-super}. The same goes for \cs{glspagelistwidth}.) -%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} +%\end{macro} +% +%\begin{macro}{\showglofirstpl} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglofirstpl}\marg{label} +%\end{definition} % \begin{macrocode} -\@ifundefined{glsdescwidth}{% - \newlength\glsdescwidth - \setlength{\glsdescwidth}{0.6\hsize} -}{} +\newcommand*{\showglofirstpl}[1]{% + \expandafter\show\csname glo@#1@firstpl\endcsname +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glspagelistwidth} -% This is a length that governs the width of the page list column. -%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} +%\begin{macro}{\showglotype} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglotype}\marg{label} +%\end{definition} % \begin{macrocode} -\@ifundefined{glspagelistwidth}{% - \newlength\glspagelistwidth - \setlength{\glspagelistwidth}{0.1\hsize} -}{} +\newcommand*{\showglotype}[1]{% + \expandafter\show\csname glo@#1@type\endcsname +} % \end{macrocode} %\end{macro} -% -%\begin{style}{long} -% The \glostyle{long} glossary style command which -% uses the \env{longtable} environment: +% +%\begin{macro}{\showglocounter} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglocounter}\marg{label} +%\end{definition} % \begin{macrocode} -\newglossarystyle{long}{% +\newcommand*{\showglocounter}[1]{% + \expandafter\show\csname glo@#1@counter\endcsname +} % \end{macrocode} -% Use \env{longtable} with two columns: +%\end{macro} +% +%\begin{macro}{\showglouseri} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglouseri}\marg{label} +%\end{definition} % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{lp{\glsdescwidth}}}% - {\end{longtable}}% +\newcommand*{\showglouseri}[1]{% + \expandafter\show\csname glo@#1@useri\endcsname +} % \end{macrocode} -% Do nothing at the start of the environment: +%\end{macro} +% +%\begin{macro}{\showglouserii} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglouserii}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\newcommand*{\showglouserii}[1]{% + \expandafter\show\csname glo@#1@userii\endcsname +} % \end{macrocode} -% No heading between groups: +%\end{macro} +% +%\begin{macro}{\showglouseriii} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglouseriii}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newcommand*{\showglouseriii}[1]{% + \expandafter\show\csname glo@#1@useriii\endcsname +} % \end{macrocode} -% Main (level 0) entries displayed in a row: +%\end{macro} +% +%\begin{macro}{\showglouseriv} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglouseriv}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% +\newcommand*{\showglouseriv}[1]{% + \expandafter\show\csname glo@#1@useriv\endcsname +} % \end{macrocode} -% Sub entries displayed on the following row without the name: +%\end{macro} +% +%\begin{macro}{\showglouserv} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglouserv}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +\newcommand*{\showglouserv}[1]{% + \expandafter\show\csname glo@#1@userv\endcsname +} % \end{macrocode} -% Blank row between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\end{macro} +% +%\begin{macro}{\showglouservi} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglouservi}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & \\\fi}% +\newcommand*{\showglouservi}[1]{% + \expandafter\show\csname glo@#1@uservi\endcsname } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{longborder} -% The \glostyle{longborder} style is like the above, but with horizontal and -% vertical lines: +%\begin{macro}{\showgloname} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showgloname}\marg{label} +%\end{definition} % \begin{macrocode} -\newglossarystyle{longborder}{% +\newcommand*{\showgloname}[1]{% + \expandafter\show\csname glo@#1@name\endcsname +} % \end{macrocode} -% Base it on the glostyle{long} style: +%\end{macro} +% +%\begin{macro}{\showglodesc} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglodesc}\marg{label} +%\end{definition} % \begin{macrocode} - \glossarystyle{long}% +\newcommand*{\showglodesc}[1]{% + \expandafter\show\csname glo@#1@desc\endcsname +} % \end{macrocode} -% Use \env{longtable} with two columns with vertical lines -% between each column: +%\end{macro} +% +%\begin{macro}{\showglodescplural} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglodescplural}\marg{label} +%\end{definition} % \begin{macrocode} - \renewenvironment{theglossary}{% - \begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% +\newcommand*{\showglodescplural}[1]{% + \expandafter\show\csname glo@#1@descplural\endcsname +} % \end{macrocode} -% Place horizontal lines at the head and foot of the table: +%\end{macro} +% +%\begin{macro}{\showglosort} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglosort}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +\newcommand*{\showglosort}[1]{% + \expandafter\show\csname glo@#1@sort\endcsname } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{longheader} -% The \glostyle{longheader} style is like the -% \glostyle{long} style but with a header: +%\begin{macro}{\showglosymbol} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglosymbol}\marg{label} +%\end{definition} % \begin{macrocode} -\newglossarystyle{longheader}{% +\newcommand*{\showglosymbol}[1]{% + \expandafter\show\csname glo@#1@symbol\endcsname +} % \end{macrocode} -% Base it on the glostyle{long} style: +%\end{macro} +% +%\begin{macro}{\showglosymbolplural} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglosymbolplural}\marg{label} +%\end{definition} % \begin{macrocode} - \glossarystyle{long}% +\newcommand*{\showglosymbolplural}[1]{% + \expandafter\show\csname glo@#1@symbolplural\endcsname +} % \end{macrocode} -% Set the table's header: +%\end{macro} +% +%\begin{macro}{\showgloshort} +%\changes{3.11a}{2013-10-15}{new} +%\begin{definition} +%\cs{showgloshort}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \bfseries \entryname & \bfseries \descriptionname\\\endhead}% +\newcommand*{\showgloshort}[1]{% + \expandafter\show\csname glo@#1@short\endcsname } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{longheaderborder} -% The \glostyle{longheaderborder} style is -% like the \glostyle{long} style but with a header and border: +%\begin{macro}{\showglolong} +%\changes{3.11a}{2013-10-15}{new} +%\begin{definition} +%\cs{showglolong}\marg{label} +%\end{definition} % \begin{macrocode} -\newglossarystyle{longheaderborder}{% +\newcommand*{\showglolong}[1]{% + \expandafter\show\csname glo@#1@long\endcsname +} % \end{macrocode} -% Base it on the glostyle{longborder} style: +%\end{macro} +% +%\begin{macro}{\showgloindex} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showgloindex}\marg{label} +%\end{definition} % \begin{macrocode} - \glossarystyle{longborder}% +\newcommand*{\showgloindex}[1]{% + \expandafter\show\csname glo@#1@index\endcsname +} % \end{macrocode} -% Set the table's header and add horizontal line to table's foot: +%\end{macro} +% +%\begin{macro}{\showgloflag} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showgloflag}\marg{label} +%\end{definition} % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \hline\bfseries \entryname & \bfseries \descriptionname\\\hline - \endhead - \hline\endfoot}% +\newcommand*{\showgloflag}[1]{% + \expandafter\show\csname ifglo@#1@flag\endcsname } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{long3col} -% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns +%\begin{macro}{\showacronymlists} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showacronymlists} +%\end{definition} +% Show list of glossaries that have been flagged as a list of +% acronyms. % \begin{macrocode} -\newglossarystyle{long3col}{% +\newcommand*{\showacronymlists}{% + \show\@glsacronymlists +} % \end{macrocode} -% Use a \env{longtable} with 3 columns: +%\end{macro} +%\begin{macro}{\showglossaries} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglossaries} +%\end{definition} +% Show list of defined glossaries. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}% - {\end{longtable}}% +\newcommand*{\showglossaries}{% + \show\@glo@types +} % \end{macrocode} -% No table header: +%\end{macro} +% +%\begin{macro}{\showglossaryin} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglossaryin}\marg{glossary-label} +%\end{definition} +% Show the `in' extension for the given glossary. % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\newcommand*{\showglossaryin}[1]{% + \expandafter\show\csname @glotype@#1@in\endcsname +} % \end{macrocode} -% No headings between groups: +%\end{macro} +% +%\begin{macro}{\showglossaryout} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglossaryout}\marg{glossary-label} +%\end{definition} +% Show the `out' extension for the given glossary. % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newcommand*{\showglossaryout}[1]{% + \expandafter\show\csname @glotype@#1@out\endcsname +} % \end{macrocode} -% Main (level 0) entries on a row (name in first column, -% description in second column, page list in last column): +%\end{macro} +% +%\begin{macro}{\showglossarytitle} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglossarytitle}\marg{glossary-label} +%\end{definition} +% Show the title for the given glossary. % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% +\newcommand*{\showglossarytitle}[1]{% + \expandafter\show\csname @glotype@#1@title\endcsname +} % \end{macrocode} -% Sub-entries on a separate row (no name, description in -% second column, page list in third column): +%\end{macro} +% +%\begin{macro}{\showglossarycounter} +%\changes{3.0}{2011/04/02}{new} +%\begin{definition} +%\cs{showglossarycounter}\marg{glossary-label} +%\end{definition} +% Show the counter for the given glossary. % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\\}% +\newcommand*{\showglossarycounter}[1]{% + \expandafter\show\csname @glotype@#1@counter\endcsname +} % \end{macrocode} -% Blank row between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\end{macro} +% +%\begin{macro}{\showglossaryentries} +%\changes{3.0}{2011/04/02}{new} +%\changes{3.02}{2012/05/21}{fixed misspelt command} +%\begin{definition} +%\cs{showglossaryentries}\marg{glossary-label} +%\end{definition} +% Show the list of entry labels for the given glossary. % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & &\\\fi}% +\newcommand*{\showglossaryentries}[1]{% + \expandafter\show\csname glolist@#1\endcsname } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{long3colborder} -% The \glostyle{long3colborder} style is like the -% \glostyle{long3col} style but with a border: +%\subsection{Compatibility with version 2.07 and below} +% +% In order to fix some bugs in v3.0, it was necessary to change the +% way information is written to the \filetype{glo} file, which also meant +% a change in the format of the Xindy style file. The compatibility +% option is meant for documents that use a customised Xindy style +% file with \ics{noist}. With the compatibility option, hopefully +% \app{xindy} will still be able to process the old document, but +% the bugs will remain. The issues in versions 2.07 and below: +%\begin{itemize} +% \item With \pkgopt{xindy}, the counter used by the entry was +% hard-coded into the Xindy style file. This meant that you couldn't +% use the \gloskey[glslink]{counter} to swap counters. +% \item With both \pkgopt{xindy} and \pkgopt{makeindex}, if used +% with \sty{hyperref} and \cs{theH}\meta{counter} was different to +% \cs{thecounter}, the link in the location number would be +% undefined. +%\end{itemize} % \begin{macrocode} -\newglossarystyle{long3colborder}{% +\csname ifglscompatible-2.07\endcsname + \RequirePackage{glossaries-compatible-207} +\fi % \end{macrocode} -% Base it on the glostyle{long3col} style: +%\iffalse % \begin{macrocode} - \glossarystyle{long3col}% +% % \end{macrocode} -% Use a \env{longtable} with 3 columns with vertical lines -% around them: +%\fi +%\iffalse % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% - {\end{longtable}}% +%<*glossaries-prefix.sty> % \end{macrocode} -% Place horizontal lines at the head and foot of the table: +%\fi +%\section{Prefix Support (glossaries-prefix Code)} +%\label{sec:code:accsupp} +%\changes{3.14a}{2013-11-12}{new} +% This package provides a means of adding prefixes to your glossary +% entries. For example, you may want to use ``a +% \cs{gls}\marg{label}'' on first use but use ``an +% \cs{gls}\marg{label}'' on subsequent use. % \begin{macrocode} - \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% -} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-prefix}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} -%\end{style} -% -%\begin{style}{long3colheader} -% The \glostyle{long3colheader} style is like \glostyle{long3col} but with a header row: +% Pass all options to \sty{glossaries}: % \begin{macrocode} -\newglossarystyle{long3colheader}{% +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}} % \end{macrocode} -% Base it on the glostyle{long3col} style: +% Process options: % \begin{macrocode} - \glossarystyle{long3col}% +\ProcessOptions % \end{macrocode} -% Set the table's header: +% Load \sty{glossaries}: % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\\\endhead}% -} +\RequirePackage{glossaries} % \end{macrocode} -%\end{style} -% -%\begin{style}{long3colheaderborder} -% The \glostyle{long3colheaderborder} style is like the above but with a border +% Add the new keys: % \begin{macrocode} -\newglossarystyle{long3colheaderborder}{% +\define@key{glossentry}{prefixfirst}{\def\@glo@entryprefixfirst{#1}}% +\define@key{glossentry}{prefixfirstplural}{\def\@glo@entryprefixfirstplural{#1}}% +\define@key{glossentry}{prefix}{\def\@glo@entryprefix{#1}}% +\define@key{glossentry}{prefixplural}{\def\@glo@entryprefixplural{#1}}% % \end{macrocode} -% Base it on the glostyle{long3colborder} style: +% Add them to \ics{@gls@keymap}: % \begin{macrocode} - \glossarystyle{long3colborder}% +\appto\@gls@keymap{,% + {prefixfirst}{prefixfirst},% + {prefixfirstplural}{prefixfirstplural},% + {prefix}{prefix},% + {prefixplural}{prefixplural}% + } % \end{macrocode} -% Set the table's header and add horizontal line at table's foot: +% Set the default values: % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \hline - \bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\\\hline\endhead - \hline\endfoot}% +\appto\@newglossaryentryprehook{% + \def\@glo@entryprefix{}% + \def\@glo@entryprefixplural{}% + \let\@glo@entryprefixfirst\@gls@default@value + \let\@glo@entryprefixfirstplural\@gls@default@value } % \end{macrocode} -%\end{style} -% -%\begin{style}{long4col} -% The \glostyle{long4col} style has four columns where the third -% column contains the value of the associated \gloskey{symbol} key. +% Set the assignment code: % \begin{macrocode} -\newglossarystyle{long4col}{% +\appto\@newglossaryentryposthook{% + \gls@assign@field{}{\@glo@label}{prefix}{\@glo@entryprefix}% + \gls@assign@field{}{\@glo@label}{prefixplural}{\@glo@entryprefixplural}% % \end{macrocode} -% Use a \env{longtable} with 4 columns: +% If \gloskey{prefixfirst} has not been supplied, make it the same +% as \gloskey{prefix}. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{llll}}% - {\end{longtable}}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefix\endcsname}{\@glo@label}{prefixfirst}% + {\@glo@entryprefixfirst}% % \end{macrocode} -% No table header: +% If \gloskey{prefixfirstplural} has not been supplied, make it the same +% as \gloskey{prefixplural}. % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% + \expandafter\gls@assign@field\expandafter + {\csname glo@\@glo@label @prefixplural\endcsname}{\@glo@label}% + {prefixfirstplural}{\@glo@entryprefixfirstplural}% +} % \end{macrocode} -% No group headings: +% +% Define commands to access these fields: +%\begin{macro}{\glsentryprefixfirst} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newcommand*{\glsentryprefixfirst}[1]{\csuse{glo@#1@prefixfirst}} % \end{macrocode} -% Main (level 0) entries on a single row (name in first column, -% description in second column, symbol in third column, page list -% in last column): +%\end{macro} +%\begin{macro}{\glsentryprefixfirstplural} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% +\newcommand*{\glsentryprefixfirstplural}[1]{\csuse{glo@#1@prefixfirstplural}} % \end{macrocode} -% Sub entries on a single row with no name (description in second -% column, symbol in third column, page list in last column): +%\end{macro} +%\begin{macro}{\glsentryprefix} % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +\newcommand*{\glsentryprefix}[1]{\csuse{glo@#1@prefix}} % \end{macrocode} -% Blank row between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\end{macro} +%\begin{macro}{\glsentryprefixplural} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & &\\\fi}% -} +\newcommand*{\glsentryprefixplural}[1]{\csuse{glo@#1@prefixplural}} % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{long4colheader} -% The \glostyle{long4colheader} style is like \glostyle{long4col} -% but with a header row. +% Now for the initial upper case variants: +%\begin{macro}{\Glsentryprefixfirst} % \begin{macrocode} -\newglossarystyle{long4colheader}{% +\newrobustcmd*{\Glsentryprefixfirst}[1]{% + \protected@edef\@glo@text{\csname glo@#1@prefixfirst\endcsname}% + \xmakefirstuc\@glo@text +} % \end{macrocode} -% Base it on the glostyle{long4col} style: +%\end{macro} +%\begin{macro}{\Glsentryprefixfirstplural} % \begin{macrocode} - \glossarystyle{long4col}% +\newrobustcmd*{\Glsentryprefixfirstplural}[1]{% + \protected@edef\@glo@text{\csname glo@#1@prefixfirstplural\endcsname}% + \xmakefirstuc\@glo@text +} % \end{macrocode} -% Table has a header: +%\end{macro} +%\begin{macro}{\Glsentryprefix} % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \bfseries\entryname&\bfseries\descriptionname& - \bfseries \symbolname& - \bfseries\pagelistname\\\endhead}% +\newrobustcmd*{\Glsentryprefix}[1]{% + \protected@edef\@glo@text{\csname glo@#1@prefix\endcsname}% + \xmakefirstuc\@glo@text } % \end{macrocode} -%\end{style} +%\end{macro} +%\begin{macro}{\Glsentryprefixplural} +% \begin{macrocode} +\newrobustcmd*{\Glsentryprefixplural}[1]{% + \protected@edef\@glo@text{\csname glo@#1@prefixplural\endcsname}% + \xmakefirstuc\@glo@text +} +% \end{macrocode} +%\end{macro} % -%\begin{style}{long4colborder} -% The \glostyle{long4colborder} style is like \glostyle{long4col} -% but with a border. +% Define commands to determine if the prefix keys have been set: +%\begin{macro}{\ifglshasprefix} % \begin{macrocode} -\newglossarystyle{long4colborder}{% +\newcommand*{\ifglshasprefix}[3]{% + \ifcsempty{glo@#1@prefix}% + {#3}% + {#2}% +} % \end{macrocode} -% Base it on the glostyle{long4col} style: +%\end{macro} +%\begin{macro}{\ifglshasprefixplural} % \begin{macrocode} - \glossarystyle{long4col}% +\newcommand*{\ifglshasprefixplural}[3]{% + \ifcsempty{glo@#1@prefixplural}% + {#3}% + {#2}% +} % \end{macrocode} -% Use a \env{longtable} with 4 columns surrounded by vertical -% lines: +%\end{macro} +%\begin{macro}{\ifglshasprefixfirst} % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|l|l|l|}}% - {\end{longtable}}% +\newcommand*{\ifglshasprefixfirst}[3]{% + \ifcsempty{glo@#1@prefixfirst}% + {#3}% + {#2}% +} % \end{macrocode} -% Add horizontal lines to the head and foot of the table: +%\end{macro} +%\begin{macro}{\ifglshasprefixfirstplural} % \begin{macrocode} - \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +\newcommand*{\ifglshasprefixfirstplural}[3]{% + \ifcsempty{glo@#1@prefixfirstplural}% + {#3}% + {#2}% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{long4colheaderborder} -% The \glostyle{long4colheaderborder} style is like the above but -% with a border. +% Define commands that insert the prefix before commands like \ics{gls}: +%\begin{macro}{\pgls} % \begin{macrocode} -\newglossarystyle{long4colheaderborder}{% +\newrobustcmd{\pgls}{\@ifstar\@spgls\@pgls} % \end{macrocode} -% Base it on the glostyle{long4col} style: +%\end{macro} +%\begin{macro}{\@spgls} +% Starred version. % \begin{macrocode} - \glossarystyle{long4col}% +\newcommand*{\@spgls}[2][]{\@pgls@{hyper=false,#1}{#2}} % \end{macrocode} -% Use a \env{longtable} with 4 columns surrounded by vertical -% lines: +%\end{macro} +%\begin{macro}{\@pgls} +% Unstarred version. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|l|l|l|}}% - {\end{longtable}}% +\newcommand*{\@pgls}[2][]{% + \new@ifnextchar[% + {\@pgls@{#1}{#2}}% + {\@pgls@{#1}{#2}[]}% +} % \end{macrocode} -% Add table header and horizontal line at the table's foot: +%\end{macro} +% +%\begin{macro}{\@pgls@} +% Read in the final optional argument: % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \hline\bfseries\entryname&\bfseries\descriptionname& - \bfseries \symbolname& - \bfseries\pagelistname\\\hline\endhead\hline\endfoot}% +\def\@pgls@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \glsentryprefix{#2}% + }% + {% + \glsentryprefixfirst{#2}% + }% + \@gls@{#1}{#2}[#3]% + }% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{altlong4col} -% The \glostyle{altlong4col} style is like the \glostyle{long4col} -% style but can have multiline descriptions and page lists. +% Similarly for the plural version: +%\begin{macro}{\pglspl} % \begin{macrocode} -\newglossarystyle{altlong4col}{% +\newrobustcmd{\pglspl}{\@ifstar\@spglspl\@pglspl} % \end{macrocode} -% Base it on the glostyle{long4col} style: +%\end{macro} +%\begin{macro}{\@spglspl} +% Starred version. % \begin{macrocode} - \glossarystyle{long4col}% +\newcommand*{\@spglspl}[2][]{\@pglspl@{hyper=false,#1}{#2}} % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +%\end{macro} +%\begin{macro}{\@pglspl} +% Unstarred version. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% - {\end{longtable}}% +\newcommand*{\@pglspl}[2][]{% + \new@ifnextchar[% + {\@pglspl@{#1}{#2}}% + {\@pglspl@{#1}{#2}[]}% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{altlong4colheader} -% The \glostyle{altlong4colheader} style is like -% \glostyle{altlong4col} but with a header row. -% \begin{macrocode} -\newglossarystyle{altlong4colheader}{% -% \end{macrocode} -% Base it on the glostyle{long4colheader} style: -% \begin{macrocode} - \glossarystyle{long4colheader}% -% \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +%\begin{macro}{\@pglspl@} +% Read in the final optional argument: % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% - {\end{longtable}}% +\def\@pglspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \glsentryprefixplural{#2}% + }% + {% + \glsentryprefixfirstplural{#2}% + }% + \@glspl@{#1}{#2}[#3]% + }% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{altlong4colborder} -% The \glostyle{altlong4colborder} style is like -% \glostyle{altlong4col} but with a border. +% Now for the first letter upper case versions: +%\begin{macro}{\Pgls} % \begin{macrocode} -\newglossarystyle{altlong4colborder}{% +\newrobustcmd{\Pgls}{\@ifstar\@sPgls\@Pgls} % \end{macrocode} -% Base it on the glostyle{long4colborder} style: +%\end{macro} +%\begin{macro}{\@sPgls} +% Starred version. % \begin{macrocode} - \glossarystyle{long4colborder}% +\newcommand*{\@sPgls}[2][]{\@Pgls@{hyper=false,#1}{#2}} % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +%\end{macro} +%\begin{macro}{\@Pgls} +% Unstarred version. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% - {\end{longtable}}% +\newcommand*{\@Pgls}[2][]{% + \new@ifnextchar[% + {\@Pgls@{#1}{#2}}% + {\@Pgls@{#1}{#2}[]}% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{altlong4colheaderborder} -% The \glostyle{altlong4colheaderborder} style is like the above but -% with a header as well as a border. +%\begin{macro}{\@Pgls@} +% Read in the final optional argument: % \begin{macrocode} -\newglossarystyle{altlong4colheaderborder}{% +\def\@Pgls@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefix{#2}% + {% + \Glsentryprefix{#2}% + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirst{#2}% + {% + \Glsentryprefixfirst{#2}% + \@gls@{#1}{#2}[#3]% + }% + {\@Gls@{#1}{#2}[#3]}% + }% + }% +} % \end{macrocode} -% Base it on the glostyle{long4colheaderborder} style: +%\end{macro} +% +% Similarly for the plural version: +%\begin{macro}{\Pglspl} % \begin{macrocode} - \glossarystyle{long4colheaderborder}% +\newrobustcmd{\Pglspl}{\@ifstar\@sPglspl\@Pglspl} % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +%\end{macro} +%\begin{macro}{\@sPglspl} +% Starred version. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% - {\end{longtable}}% -} +\newcommand*{\@sPglspl}[2][]{\@Pglspl@{hyper=false,#1}{#2}} % \end{macrocode} -%\end{style} -%\iffalse +%\end{macro} +%\begin{macro}{\@Pglspl} +% Unstarred version. % \begin{macrocode} -% +\newcommand*{\@Pglspl}[2][]{% + \new@ifnextchar[% + {\@Pglspl@{#1}{#2}}% + {\@Pglspl@{#1}{#2}[]}% +} % \end{macrocode} -%\fi -%\iffalse +%\end{macro} +% +%\begin{macro}{\@Pglspl@} +% Read in the final optional argument: % \begin{macrocode} -%<*glossary-longragged.sty> +\def\@Pglspl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \ifglshasprefixplural{#2}% + {% + \Glsentryprefixplural{#2}% + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + {% + \ifglshasprefixfirstplural{#2}% + {% + \Glsentryprefixfirstplural{#2}% + \@glspl@{#1}{#2}[#3]% + }% + {\@Glspl@{#1}{#2}[#3]}% + }% + }% +} % \end{macrocode} -%\fi -% \subsection{Glossary Styles using longtable (the glossary-longragged -% package)} -% The glossary styles defined in the \isty{glossary-longragged} package -% used the \env{longtable} environment in the glossary and use -% ragged right formatting for the multiline columns. +%\end{macro} +% +% Finally the all upper case versions: +%\begin{macro}{\PGLS} % \begin{macrocode} -\ProvidesPackage{glossary-longragged}[2012/09/21 v3.03 (NLCT)] +\newrobustcmd{\PGLS}{\@ifstar\@sPGLS\@PGLS} % \end{macrocode} -% Requires the \isty{array} package: +%\end{macro} +%\begin{macro}{\@sPGLS} +% Starred version. % \begin{macrocode} -\RequirePackage{array} +\newcommand*{\@sPGLS}[2][]{\@PGLS@{hyper=false,#1}{#2}} % \end{macrocode} -% Requires the \isty{longtable} package: +%\end{macro} +%\begin{macro}{\@PGLS} +% Unstarred version. % \begin{macrocode} -\RequirePackage{longtable} +\newcommand*{\@PGLS}[2][]{% + \new@ifnextchar[% + {\@PGLS@{#1}{#2}}% + {\@PGLS@{#1}{#2}[]}% +} % \end{macrocode} -%\begin{macro}{\glsdescwidth} -% This is a length that governs the width of the description column. -% This may have already been defined. +%\end{macro} +% +%\begin{macro}{\@PGLS@} +% Read in the final optional argument: % \begin{macrocode} -\@ifundefined{glsdescwidth}{% - \newlength\glsdescwidth - \setlength{\glsdescwidth}{0.6\hsize} -}{} +\def\@PGLS@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \mfirstucMakeUppercase{\glsentryprefix{#2}}% + }% + {% + \mfirstucMakeUppercase{\glsentryprefixfirst{#2}}% + }% + \@GLS@{#1}{#2}[#3]% + }% +} % \end{macrocode} %\end{macro} % -%\begin{macro}{\glspagelistwidth} -% This is a length that governs the width of the page list column. -% This may already have been defined. +% Plural version: +%\begin{macro}{\PGLSpl} % \begin{macrocode} -\@ifundefined{glspagelistwidth}{% - \newlength\glspagelistwidth - \setlength{\glspagelistwidth}{0.1\hsize} -}{} +\newrobustcmd{\PGLSpl}{\@ifstar\@sPGLSpl\@PGLSpl} % \end{macrocode} %\end{macro} -% -%\begin{style}{longragged} -% The \glostyle{longragged} glossary style is like the -% \glostyle{long} but uses ragged right formatting for the -% description column. +%\begin{macro}{\@sPGLSpl} +% Starred version. % \begin{macrocode} -\newglossarystyle{longragged}{% +\newcommand*{\@sPGLSpl}[2][]{\@PGLSpl@{hyper=false,#1}{#2}} % \end{macrocode} -% Use \env{longtable} with two columns: +%\end{macro} +%\begin{macro}{\@PGLSpl} +% Unstarred version. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}% - {\end{longtable}}% +\newcommand*{\@PGLSpl}[2][]{% + \new@ifnextchar[% + {\@PGLSpl@{#1}{#2}}% + {\@PGLSpl@{#1}{#2}[]}% +} % \end{macrocode} -% Do nothing at the start of the environment: +%\end{macro} +% +%\begin{macro}{\@PGLSpl@} +% Read in the final optional argument: % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\def\@PGLSpl@#1#2[#3]{% + \glsdoifexists{#2}% + {% + \ifglsused{#2}% + {% + \mfirstucMakeUppercase{\glsentryprefixplural{#2}}% + }% + {% + \mfirstucMakeUppercase{\glsentryprefixfirstplural{#2}}% + }% + \@GLSpl@{#1}{#2}[#3]% + }% +} % \end{macrocode} -% No heading between groups: +%\end{macro} +%\iffalse % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +% % \end{macrocode} -% Main (level 0) entries displayed in a row: +%\fi +%\iffalse % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% - \tabularnewline}% +%<*mfirstuc.sty> % \end{macrocode} -% Sub entries displayed on the following row without the name: +%\fi +%\section{Mfirstuc Documented Code} +%\label{sec:code:mfirstuc} % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6% - \tabularnewline}% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{mfirstuc}[2013/11/04 v1.08 (NLCT)] % \end{macrocode} -% Blank row between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% Requires \sty{etoolbox}:\changes{1.06}{2012/05/21}{now requires +% etoolbox} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & \tabularnewline\fi}% -} +\RequirePackage{etoolbox} % \end{macrocode} -%\end{style} -% -%\begin{style}{longraggedborder} -% The \glostyle{longraggedborder} style is like the above, but with horizontal and -% vertical lines: +%\begin{macro}{\makefirstuc} +% Syntax: +%\begin{definition} +% \cs{makefirstuc}\marg{text} +%\end{definition} +% 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, unless the group +% is empty. +% 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}. +%\changes{1.08}{2013-11-04}{made robust} % \begin{macrocode} -\newglossarystyle{longraggedborder}{% +\newif\if@glscs +\newtoks\@glsmfirst +\newtoks\@glsmrest +\newrobustcmd*{\makefirstuc}[1]{% + \def\gls@argi{#1}% + \ifx\gls@argi\@empty % \end{macrocode} -% Base it on the glostyle{longragged} style: +% If the argument is empty, do nothing. % \begin{macrocode} - \glossarystyle{longragged}% + \else % \end{macrocode} -% Use \env{longtable} with two columns with vertical lines -% between each column: +%\changes{1.03}{2008/12/22}{changed 'protected@edef to 'def} % \begin{macrocode} - \renewenvironment{theglossary}{% - \begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|}}% - {\end{longtable}}% + \def\@gls@tmp{\ #1}% + \@onelevel@sanitize\@gls@tmp + \expandafter\@gls@checkcs\@gls@tmp\relax\relax + \if@glscs + \@gls@getbody #1{}\@nil + \ifx\@gls@rest\@empty + \glsmakefirstuc{#1}% + \else + \expandafter\@gls@split\@gls@rest\@nil + \ifx\@gls@first\@empty + \glsmakefirstuc{#1}% + \else + \expandafter\@glsmfirst\expandafter{\@gls@first}% + \expandafter\@glsmrest\expandafter{\@gls@rest}% + \edef\@gls@domfirstuc{\noexpand\@gls@body + {\noexpand\glsmakefirstuc\the\@glsmfirst}% + \the\@glsmrest}% + \@gls@domfirstuc + \fi + \fi + \else + \glsmakefirstuc{#1}% + \fi + \fi +} % \end{macrocode} -% Place horizontal lines at the head and foot of the table: +%\end{macro} +% Put first argument in \cs{@gls@first} and second argument in +% \cs{@gls@rest}: % \begin{macrocode} - \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +\def\@gls@split#1#2\@nil{% + \def\@gls@first{#1}\def\@gls@rest{#2}% } % \end{macrocode} -%\end{style} -% -%\begin{style}{longraggedheader} -% The \glostyle{longraggedheader} style is like the -% \glostyle{longragged} style but with a header: % \begin{macrocode} -\newglossarystyle{longraggedheader}{% +\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} -% Base it on the glostyle{longragged} style: +%\begin{macro}{\@gls@makefirstuc} +% Make first thing upper case: % \begin{macrocode} - \glossarystyle{longragged}% +\def\@gls@makefirstuc#1{\mfirstucMakeUppercase #1} % \end{macrocode} -% Set the table's header: +%\end{macro} +% +%\begin{macro}{\mfirstucMakeUppercase} +% Allow user to replace \cs{MakeUppercase} with another case +% changing command. % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \bfseries \entryname & \bfseries \descriptionname - \tabularnewline\endhead}% -} +\newcommand*{\mfirstucMakeUppercase}{\MakeUppercase} % \end{macrocode} -%\end{style} +%\end{macro} +%\begin{macro}{\glsmakefirstuc} +%\changes{1.05}{2011/04/02}{new} +% Provide a user command to make it easier to customise. +% \begin{macrocode} +\newcommand*{\glsmakefirstuc}[1]{\@gls@makefirstuc{#1}} +% \end{macrocode} +%\end{macro} % -%\begin{style}{longraggedheaderborder} -% The \glostyle{longraggedheaderborder} style is -% like the \glostyle{longragged} style but with a header and border: +% Get the first grouped argument and stores in \cs{@gls@body}. % \begin{macrocode} -\newglossarystyle{longraggedheaderborder}{% +\def\@gls@getbody#1#{\def\@gls@body{#1}\@gls@gobbletonil} % \end{macrocode} -% Base it on the glostyle{longraggedborder} style: +% Scoup up everything to \cs{@nil} and store in \cs{@gls@rest}: % \begin{macrocode} - \glossarystyle{longraggedborder}% +\def\@gls@gobbletonil#1\@nil{\def\@gls@rest{#1}} % \end{macrocode} -% Set the table's header and add horizontal line to table's foot: +% +%\begin{macro}{\xmakefirstuc} +% Expand argument once before applying \cs{makefirstuc} +% (added v1.01). % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \hline\bfseries \entryname & \bfseries \descriptionname - \tabularnewline\hline - \endhead - \hline\endfoot}% -} +\newcommand*{\xmakefirstuc}[1]{% +\expandafter\makefirstuc\expandafter{#1}} % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{longragged3col} -% The \glostyle{longragged3col} style is like \glostyle{longragged} but with 3 columns +%\begin{macro}{\capitalisewords} +%\changes{1.06}{2012/05/21}{new} +% Capitalise each word in the argument. Words are considered to be +% separated by plain spaces (i.e.\ non-breakable spaces won't be +% considered a word break). +%\changes{1.08}{2013-11-04}{made robust} % \begin{macrocode} -\newglossarystyle{longragged3col}{% +\newrobustcmd*{\capitalisewords}[1]{% + \def\gls@add@space{}% + \mfu@capitalisewords#1 \@nil\mfu@endcap +} % \end{macrocode} -% Use a \env{longtable} with 3 columns: +%\end{macro} +% % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{longtable}}% +\def\mfu@capitalisewords#1 #2\mfu@endcap{% + \def\mfu@cap@first{#1}% + \def\mfu@cap@second{#2}% + \gls@add@space + \makefirstuc{#1}% + \def\gls@add@space{ }% + \ifx\mfu@cap@second\@nnil + \let\next@mfu@cap\mfu@noop + \else + \let\next@mfu@cap\mfu@capitalisewords + \fi + \next@mfu@cap#2\mfu@endcap +} +\def\mfu@noop#1\mfu@endcap{} % \end{macrocode} -% No table header: +% +%\begin{macro}{\xcapitalisewords} +%\changes{1.06}{2012/05/21}{new} +% Short-cut command: % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\newcommand*{\xcapitalisewords}[1]{% + \expandafter\capitalisewords\expandafter{#1}% +} % \end{macrocode} -% No headings between groups: +%\end{macro} +%\section{Glossary Styles} +%\iffalse % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +% % \end{macrocode} -% Main (level 0) entries on a row (name in first column, -% description in second column, page list in last column): +%\fi +%\iffalse % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% +%<*glossary-hypernav.sty> % \end{macrocode} -% Sub-entries on a separate row (no name, description in -% second column, page list in third column): +%\fi +% \subsection{Glossary hyper-navigation definitions (glossary-hypernav package)} +%\label{sec:code:hypernav} +% Package Definition: % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +\ProvidesPackage{glossary-hypernav}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} -% Blank row between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} -% \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & &\tabularnewline\fi}% -} -% \end{macrocode} -%\end{style} % -%\begin{style}{longragged3colborder} -% The \glostyle{longragged3colborder} style is like the -% \glostyle{longragged3col} style but with a border: +% The commands defined in this package are provided to +% help navigate around the groups within a glossary +% (see \autoref{sec:code:printglos}.) +% \ics{printglossary} (and \ics{printglossaries}) +% set \cs{@glo@type} to the label of the current +% glossary. This is used to create a unique hypertarget in +% the event of multiple glossaries. +%\\[10pt] +% \cs{glsnavhyperlink}\oarg{type}\marg{label}\marg{text}\\[10pt] +% This command makes \meta{text} a hyperlink to the glossary group +% whose label is given by \meta{label} for the glossary given +% by \meta{type}. +%\begin{macro}{\glsnavhyperlink} +%\changes{1.14}{2008 June 17}{changed 'edef to 'protected@edef} +%\changes{1.17}{2008 December 26}{replaced 'hyperlink to '@glslink} % \begin{macrocode} -\newglossarystyle{longragged3colborder}{% +\newcommand*{\glsnavhyperlink}[3][\@glo@type]{% + \edef\gls@grplabel{#2}\protected@edef\@gls@grptitle{#3}% + \@glslink{glsn:#1@#2}{#3}} % \end{macrocode} -% Base it on the glostyle{longragged3col} style: +%\end{macro} +%\vskip5pt +% \cs{glsnavhypertarget}\oarg{type}\marg{label}\marg{text}\\[10pt] +% This command makes \meta{text} a hypertarget for the glossary group +% whose label is given by \meta{label} in the glossary given +% by \meta{type}. If \meta{type} is omitted, \cs{@glo@type} is +% used which is set by \ics{printglossary} to the current +% glossary label. +%\begin{macro}{\glsnavhypertarget} +%\changes{1.14}{2008 June 17}{added write to aux file} +%\changes{1.15}{2008 August 15}{added check if rerun required} +%\changes{1.17}{2008 December 26}{replaced 'hypertarget to '@glstarget} % \begin{macrocode} - \glossarystyle{longragged3col}% +\newcommand*{\glsnavhypertarget}[3][\@glo@type]{% % \end{macrocode} -% Use a \env{longtable} with 3 columns with vertical lines -% around them: +% Add this group to the aux file for re-run check. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{longtable}}% + \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}% % \end{macrocode} -% Place horizontal lines at the head and foot of the table: +% Add the target. % \begin{macrocode} - \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% -} + \@glstarget{glsn:#1@#2}{#3}% % \end{macrocode} -%\end{style} -% -%\begin{style}{longragged3colheader} -% The \glostyle{longragged3colheader} style is like \glostyle{longragged3col} but with a header row: +% Check list of know groups to determine if a re-run is required. % \begin{macrocode} -\newglossarystyle{longragged3colheader}{% + \expandafter\let + \expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname % \end{macrocode} -% Base it on the glostyle{longragged3col} style: +% Iterate through list and terminate loop if this group is found. % \begin{macrocode} - \glossarystyle{longragged3col}% + \@for\@gls@elem:=\@gls@list\do{% + \ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}% % \end{macrocode} -% Set the table's header: +% Check if list terminated prematurely. % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\tabularnewline\endhead}% -} + \if@endfor + \else % \end{macrocode} -%\end{style} -% -%\begin{style}{longragged3colheaderborder} -% The \glostyle{longragged3colheaderborder} style is like the above but with a border +% This group was not included in the list, so issue a warning. % \begin{macrocode} -\newglossarystyle{longragged3colheaderborder}{% + \GlossariesWarningNoLine{Navigation panel + for glossary type `#1'^^Jmissing group `#2'}% + \gdef\gls@hypergrouprerun{% + \GlossariesWarningNoLine{Navigation panel + has changed. Rerun LaTeX}}% + \fi +} % \end{macrocode} -% Base it on the glostyle{longragged3colborder} style: +%\end{macro} +%\begin{macro}{\gls@hypergrouprerun} +% Give a warning at the end if re-run required +%\changes{1.15}{2008 August 15}{new} % \begin{macrocode} - \glossarystyle{longragged3colborder}% +\let\gls@hypergrouprerun\relax +\AtEndDocument{\gls@hypergrouprerun} % \end{macrocode} -% Set the table's header and add horizontal line at table's foot: +%\end{macro} +% +%\begin{macro}{\@gls@hypergroup} +% This adds to (or creates) the command \cs{@gls@hypergrouplist@}\meta{glossary type} +% which lists all groups for a given glossary, so that +% the navigation bar only contains those groups that are present. +% However it requires at least 2 runs to ensure the information is +% up-to-date. +%\changes{1.14}{2008 June 17}{new} % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \hline - \bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\tabularnewline\hline\endhead - \hline\endfoot}% +\newcommand*{\@gls@hypergroup}[2]{% +\@ifundefined{@gls@hypergrouplist@#1}{% + \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{#2}% +}{% + \expandafter\let\expandafter\@gls@tmp + \csname @gls@hypergrouplist@#1\endcsname + \expandafter\xdef\csname @gls@hypergrouplist@#1\endcsname{% + \@gls@tmp,#2}% +}% } % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{altlongragged4col} -% The \glostyle{altlongragged4col} style is like the \glostyle{altlong4col} -% style defined in the \isty{glossary-long} package, except that -% ragged right formatting is used for the description and page list -% columns. +% The \cs{glsnavigation} command displays a simple glossary +% group navigation. +% The symbol and number elements are defined separately, +% so that they can be suppressed if need be. Note that this +% command will produce a link to all 28 groups, but some groups +% may not be defined if there are groups that do not contain any +% terms, in which case you will get an undefined hyperlink warning. +% Now for the whole navigation bit: +%\begin{macro}{\glsnavigation} +% \changes{1.14}{2008 June 2008}{changed to only use labels for +% groups that are present} % \begin{macrocode} -\newglossarystyle{altlongragged4col}{% +\newcommand*{\glsnavigation}{% +\def\@gls@between{}% +\@ifundefined{@gls@hypergrouplist@\@glo@type}{% + \def\@gls@list{}% +}{% + \expandafter\let\expandafter\@gls@list + \csname @gls@hypergrouplist@\@glo@type\endcsname +}% +\@for\@gls@tmp:=\@gls@list\do{% + \@gls@between % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +%\changes{3.11a}{2013-10-15}{switched to using +%\cs{@gls@getgrouptitle}} % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{longtable}}% + \@gls@getgrouptitle{\@gls@tmp}{\@gls@grptitle}% + \glsnavhyperlink{\@gls@tmp}{\@gls@grptitle}% + \let\@gls@between\glshypernavsep% +}% +} % \end{macrocode} -% No table header: +%\end{macro} +%\begin{macro}{\glshypernavsep} +% Separator for the hyper navigation bar. % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\newcommand*{\glshypernavsep}{\space\textbar\space} % \end{macrocode} -% No group headings: +%\end{macro} +% The \cs{glssymbolnav} produces a simple navigation set of +% links for just the symbol and number groups. This used to be used at +% the start of \cs{glsnavigation}. This command is no longer needed. +%\begin{macro}{\glssymbolnav} % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newcommand*{\glssymbolnav}{% +\glsnavhyperlink{glssymbols}{\glsgetgrouptitle{glssymbols}}% +\glshypernavsep +\glsnavhyperlink{glsnumbers}{\glsgetgrouptitle{glsnumbers}}% +\glshypernavsep +} % \end{macrocode} -% Main (level 0) entries on a single row (name in first column, -% description in second column, symbol in third column, page list -% in last column): +%\end{macro} +%\iffalse % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% +% % \end{macrocode} -% Sub entries on a single row with no name (description in second -% column, symbol in third column, page list in last column): +%\fi +%\iffalse % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & - \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +%<*glossary-inline.sty> % \end{macrocode} -% Blank row between groups: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\fi +% \subsection{In-line Style (glossary-inline.sty)} +% This defines an in-line style where the entries are +% comma-separated with just the name and description displayed. % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & &\tabularnewline\fi}% -} +\ProvidesPackage{glossary-inline}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} -%\end{style} % -%\begin{style}{altlongragged4colheader} -% The \glostyle{altlongragged4colheader} style is like -% \glostyle{altlongragged4col} but with a header row. -% \begin{macrocode} -\newglossarystyle{altlongragged4colheader}{% -% \end{macrocode} -% Base it on the glostyle{altlongragged4col} style: +%\begin{style}{inline} +% Define the inline style. % \begin{macrocode} - \glossarystyle{altlongragged4col}% +\newglossarystyle{inline}{% % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +% Start of glossary sets up first empty separator between entries. +% (This is then changed by \cs{glossentry}) % \begin{macrocode} \renewenvironment{theglossary}% - {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{longtable}}% -% \end{macrocode} -% Table has a header: -% \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \bfseries\entryname&\bfseries\descriptionname& - \bfseries \symbolname& - \bfseries\pagelistname\tabularnewline\endhead}% -} -% \end{macrocode} -%\end{style} -% -%\begin{style}{altlongragged4colborder} -% The \glostyle{altlongragged4colborder} style is like -% \glostyle{altlongragged4col} but with a border. -% \begin{macrocode} -\newglossarystyle{altlongragged4colborder}{% + {% + \def\gls@inlinesep{}% + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{}% + }% + {\glspostinline}% % \end{macrocode} -% Base it on the glostyle{altlongragged4col} style: +% No header: % \begin{macrocode} - \glossarystyle{altlongragged4col}% + \renewcommand*{\glossaryheader}{}% % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +% No group headings (if heading is required, add +% \ics{glsinlinedopostchild} to start definition in case heading +% follows a child entry): % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{longtable}}% + \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} -% Add horizontal lines to the head and foot of the table: +% Just display separator followed by name and description: +%\changes{3.08a}{2013-08-30}{updated inline style to use +%\cs{glossentry} and \cs{subglossentry}} % \begin{macrocode} - \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% + \renewcommand{\glossentry}[2]{% + \glsinlinedopostchild + \gls@inlinesep + \glsentryitem{##1}% + \glsinlinenameformat{##1}{% + \glossentryname{##1}% + }% + \ifglsdescsuppressed{##1}% + {% + \glsinlineemptydescformat + {% + \glossentrysymbol{##1}% + }% + {% + ##2% + }% + }% + {% + \ifglshasdesc{##1}% + {\glsinlinedescformat{\glossentrydesc{##1}}{\glossentrysymbol{##1}}{##2}}% + {\glsinlineemptydescformat{\glossentrysymbol{##1}}{##2}}% + }% + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% +% \end{macrocode} +% Sub-entries display description: +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{% + \glossentryname{##2}}% + \glssubentryitem{##2}% + \glsinlinesubdescformat{\glossentrydesc{##2}}{\glossentrysymbol{##2}}{##3}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% +% \end{macrocode} +% Nothing special between groups: +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{}% } % \end{macrocode} %\end{style} % -%\begin{style}{altlongragged4colheaderborder} -% The \glostyle{altlongragged4colheaderborder} style is like the above but -% with a header as well as a border. -% \begin{macrocode} -\newglossarystyle{altlongragged4colheaderborder}{% -% \end{macrocode} -% Base it on the glostyle{altlongragged4col} style: +%\begin{macro}{\glsinlinedopostchild} % \begin{macrocode} - \glossarystyle{altlongragged4col}% +\newcommand*{\glsinlinedopostchild}{% + \gls@inlinepostchild + \def\gls@inlinepostchild{}% +} % \end{macrocode} -% Use a \env{longtable} with 4 columns where the second and -% last columns may have multiple lines in each row: +%\end{macro} +% +%\begin{macro}{\glsinlineseparator} +% Separator to use between entries. % \begin{macrocode} - \renewenvironment{theglossary}% - {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{longtable}}% +\newcommand*{\glsinlineseparator}{;\space} % \end{macrocode} -% Add table header and horizontal line at the table's foot: +%\end{macro} +% +%\begin{macro}{\glsinlinesubseparator} +% Separator to use between sub-entries. % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \hline\bfseries\entryname&\bfseries\descriptionname& - \bfseries \symbolname& - \bfseries\pagelistname\tabularnewline\hline\endhead - \hline\endfoot}% -} +\newcommand*{\glsinlinesubseparator}{,\space} % \end{macrocode} -%\end{style} -%\iffalse +%\end{macro} +% +%\begin{macro}{\glsinlineparentchildseparator} +% Separator to use between parent and children. % \begin{macrocode} -% +\newcommand*{\glsinlineparentchildseparator}{:\space} % \end{macrocode} -%\fi -%\iffalse +%\end{macro} +% +%\begin{macro}{\glsinlinepostchild} +%\changes{3.03}{2012/09/21}{new} +% Hook to use between child and next entry % \begin{macrocode} -%<*glossary-mcols.sty> +\newcommand*{\glsinlinepostchild}{} % \end{macrocode} -%\fi -%\subsection{Glossary Styles using \styfmt{multicol} -%(glossary-mcols.sty)} -%The \isty{glossary-mcols} style file defines glossary styles that -%use the \sty{multicol} package. These use the tree-like glossary -%styles in a multicol environment. +%\end{macro} +% +%\begin{macro}{\glspostinline} +% Terminator for inline glossary. +%\changes{3.03}{2012/09/21}{replaced ``.'' with \cs{glspostdescription}} % \begin{macrocode} -\ProvidesPackage{glossary-mcols}[2013/04/21 v3.05 (NLCT)] +\newcommand*{\glspostinline}{\glspostdescription\space} % \end{macrocode} -% Required packages: +%\end{macro} +% +%\begin{macro}{\glsinlinenameformat} +%\changes{3.03}{2012/09/21}{new} +% Formats the name of the entry (first argument label, second +% argument name): % \begin{macrocode} -\RequirePackage{multicol} -\RequirePackage{glossary-tree} +\newcommand*{\glsinlinenameformat}[2]{\glstarget{#1}{#2}} % \end{macrocode} +%\end{macro} % -%\begin{macro}{\glsmcols} -% Define macro in which to store the number of columns. (Defaults to -% 2.) +%\begin{macro}{\glsinlinedescformat} +%\changes{3.03}{2012/09/21}{new} +% Formats the entry's description, symbol and location list: % \begin{macrocode} -\newcommand*{\glsmcols}{2} +\newcommand*{\glsinlinedescformat}[3]{\space#1} % \end{macrocode} %\end{macro} % -%\begin{style}{mcolindex} -% Multi-column index style. Same as the \glostyle{index}, but puts the -% glossary in multiple columns. (Ideally the glossary title should go in the -% optional argument of \env{multicols}, but the title isn't part of -% the glossary style.) +%\begin{macro}{\glsinlineemptydescformat} +%\changes{3.03}{2012/09/21}{new} +% Formats the entry's symbol and location list when the description +% is empty: % \begin{macrocode} -\newglossarystyle{mcolindex}{% - \glossarystyle{index}% - \renewenvironment{theglossary}% - {% +\newcommand*{\glsinlineemptydescformat}[2]{} % \end{macrocode} -%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} +%\end{macro} +% +%\begin{macro}{\glsinlinesubnameformat} +%\changes{3.03}{2012/09/21}{new} +% Formats the name of the subentry (first argument label, second +% argument name): % \begin{macrocode} - \begin{multicols}{\glsmcols} - \setlength{\parindent}{0pt}% - \setlength{\parskip}{0pt plus 0.3pt}% - \let\item\@idxitem}% - {\end{multicols}}% -} +\newcommand*{\glsinlinesubnameformat}[2]{\glstarget{#1}{}} % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{mcolindexgroup} -% As \glostyle{mcolindex} but has headings: +%\begin{macro}{\glsinlinesubdescformat} +%\changes{3.03}{2012/09/21}{new} +% Formats the subentry's description, symbol and location list: % \begin{macrocode} -\newglossarystyle{mcolindexgroup}{% - \glossarystyle{mcolindex}% - \renewcommand*{\glsgroupheading}[1]{% - \item\textbf{\glsgetgrouptitle{##1}}\indexspace}% -} +\newcommand*{\glsinlinesubdescformat}[3]{#1} % \end{macrocode} -%\end{style} +%\end{macro} % -%\begin{style}{mcolindexhypergroup} -% The \glostyle{mcolindexhypergroup} style is like the -% \glostyle{mcolindexgroup} style but has hyper navigation. +% +%\iffalse % \begin{macrocode} -\newglossarystyle{mcolindexhypergroup}{% +% % \end{macrocode} -% Base it on the glostyle{mcolindex} style: +%\fi +%\iffalse % \begin{macrocode} - \glossarystyle{mcolindex}% +%<*glossary-list.sty> % \end{macrocode} -% Put navigation links to the groups at the start of the glossary: +%\fi +% \subsection{List Style (glossary-list.sty)} +% The \isty{glossary-list} style file defines glossary styles +% that use the \env{description} environment. Note that since +% the entry name is placed in the optional argument to the +% \ics{item} command, it will appear in a bold font by +% default. % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \item\textbf{\glsnavigation}\indexspace}% +\ProvidesPackage{glossary-list}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} -% Add a heading for each group (with a target). The group's title is -% in bold followed by a vertical gap. +%\begin{style}{list} +% The \glostyle{list} glossary style +% uses the \env{description} environment. The group separator +% \ics{glsgroupskip} is redefined as \cs{indexspace} +% which produces a gap between groups. The glossary heading +% and the group headings do nothing. Sub-entries immediately +% follow the main entry without the sub-entry name. This style +% does not use the entry's symbol. This is used as the default +% style for the \sty{glossaries} package. % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{% - \item\textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% - \indexspace}% -} +\newglossarystyle{list}{% % \end{macrocode} -%\end{style} -% -%\begin{style}{mcoltree} -% Multi-column index style. Same as the \glostyle{tree}, but puts the -% glossary in multiple columns. +% Use \env{description} environment: % \begin{macrocode} -\newglossarystyle{mcoltree}{% - \glossarystyle{tree}% \renewenvironment{theglossary}% - {% + {\begin{description}}{\end{description}}% % \end{macrocode} -%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} +% No header at the start of the environment: % \begin{macrocode} - \begin{multicols}{\glsmcols} - \setlength{\parindent}{0pt}% - \setlength{\parskip}{0pt plus 0.3pt}% - }% - {\end{multicols}}% + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries start a new item in the list: +%\changes{3.08a}{2013-08-30}{updated list style to use +%\cs{glossentry} and \cs{subglossentry}} +% \begin{macrocode} + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}] + \glossentrydesc{##1}\glspostdescription\space ##2}% +% \end{macrocode} +% Sub-entries continue on the same line: +% \begin{macrocode} + \renewcommand*{\subglossentry}[3]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}% + \glossentrydesc{##2}\glspostdescription\space ##3.}% +% \end{macrocode} +% Add vertical space between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% } % \end{macrocode} %\end{style} % -%\begin{style}{mcoltreegroup} -% Like the \glostyle{mcoltree} style but the glossary groups have -% headings. +%\begin{style}{listgroup} +% The \glostyle{listgroup} style is like the \glostyle{list} +% style, but the glossary groups have headings. +%\changes{1.08}{2007 Oct 13}{changed listgroup style to use \cs{glsgetgrouptitle}} % \begin{macrocode} -\newglossarystyle{mcoltreegroup}{% +\newglossarystyle{listgroup}{% % \end{macrocode} -% Base it on the glostyle{mcoltree} style: +% Base it on the \glostyle{list} style: % \begin{macrocode} - \glossarystyle{mcoltree}% + \setglossarystyle{list}% % \end{macrocode} -% Each group has a heading (in bold) followed by a vertical gap): +% Each group has a heading: % \begin{macrocode} - \renewcommand{\glsgroupheading}[1]{\par - \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}% -} + \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} % \end{macrocode} %\end{style} % -%\begin{style}{mcoltreehypergroup} -% The \glostyle{mcoltreehypergroup} style is like the -% \glostyle{treegroup} +%\begin{style}{listhypergroup} +% The \glostyle{listhypergroup} style is like the \glostyle{listgroup} % style, but has a set of links to the groups at the % start of the glossary. % \begin{macrocode} -\newglossarystyle{mcoltreehypergroup}{% +\newglossarystyle{listhypergroup}{% % \end{macrocode} -% Base it on the glostyle{mcoltree} style: +% Base it on the \glostyle{list} style: % \begin{macrocode} - \glossarystyle{mcoltree}% + \setglossarystyle{list}% % \end{macrocode} -% Put navigation links to the groups at the start of the -% \env{theglossary} environment: +% Add navigation links at the start of the environment: % \begin{macrocode} \renewcommand*{\glossaryheader}{% - \par\noindent\textbf{\glsnavigation}\par\indexspace}% + \item[\glsnavigation]}% % \end{macrocode} -% Each group has a heading (in bold with a target) followed by a -% vertical gap): +% Each group has a heading with a hypertarget: % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{% - \par\noindent - \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par - \indexspace}% -} + \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} % \end{macrocode} %\end{style} % -%\begin{style}{mcoltreenoname} -% Multi-column index style. Same as the \glostyle{treenoname}, but puts the -% glossary in multiple columns. +%\begin{style}{altlist} +% The \glostyle{altlist} glossary style is like the \glostyle{list} +% style, but places the description on a new line. Sub-entries +% follow in separate paragraphs without the sub-entry name. This +% style does not use the entry's symbol. % \begin{macrocode} -\newglossarystyle{mcoltreenoname}{% - \glossarystyle{treenoname}% - \renewenvironment{theglossary}% - {% +\newglossarystyle{altlist}{% % \end{macrocode} -%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} +% Base it on the \glostyle{list} style: % \begin{macrocode} - \begin{multicols}{\glsmcols} - \setlength{\parindent}{0pt}% - \setlength{\parskip}{0pt plus 0.3pt}% - }% - {\end{multicols}}% + \setglossarystyle{list}% +% \end{macrocode} +% Main (level 0) entries start a new item in the list with a +% line break after the entry name: +%\changes{3.08a}{2013-08-30}{updated altlist style to use +%\cs{glossentry} and \cs{subglossentry}} +% \begin{macrocode} + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}]% +% \end{macrocode} +%\changes{3.04}{2012-11-11}{replaced \cs{newline} with paragraph break} +% Version 3.04 changed \cs{newline} to the following paragraph break +% stuff (thanks to Daniel Gebhardt for supplying the fix) to prevent +% a page break occurring at this point. +% \begin{macrocode} + \mbox{}\par\nobreak\@afterheading + \glossentrydesc{##1}\glspostdescription\space ##2}% +% \end{macrocode} +% Sub-entries start a new paragraph: +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space ##3}% } % \end{macrocode} %\end{style} -% -%\begin{style}{mcoltreenonamegroup} -% Like the \glostyle{mcoltreenoname} style but the glossary groups have -% headings. +%\begin{style}{altlistgroup} +% The \glostyle{altlistgroup} glossary style is like the +% \glostyle{altlist} style, but the glossary groups have headings. +%\changes{1.08}{2007 Oct 13}{changed altlistgroup style to use \cs{glsgetgrouptitle}} % \begin{macrocode} -\newglossarystyle{mcoltreenonamegroup}{% +\newglossarystyle{altlistgroup}{% % \end{macrocode} -% Base it on the glostyle{mcoltreenoname} style: +% Base it on the \glostyle{altlist} style: % \begin{macrocode} - \glossarystyle{mcoltreenoname}% + \setglossarystyle{altlist}% % \end{macrocode} -% Give each group a heading: +% Each group has a heading: % \begin{macrocode} - \renewcommand{\glsgroupheading}[1]{\par - \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}% -} + \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} % \end{macrocode} %\end{style} % -%\begin{style}{mcoltreenonamehypergroup} -% The \glostyle{mcoltreenonamehypergroup} style is like the -% \glostyle{mcoltreenonamegroup} -% style, but has a set of links to the groups at the -% start of the glossary. +%\begin{style}{altlisthypergroup} +% The \glostyle{altlisthypergroup} glossary style is like the +% \glostyle{altlistgroup} style, but has a +% set of links to the groups at the start of the glossary. % \begin{macrocode} -\newglossarystyle{mcoltreenonamehypergroup}{% +\newglossarystyle{altlisthypergroup}{% % \end{macrocode} -% Base it on the glostyle{mcoltreenoname} style: +% Base it on the \glostyle{altlist} style: % \begin{macrocode} - \glossarystyle{mcoltreenoname}% + \setglossarystyle{altlist}% % \end{macrocode} -% Put navigation links to the groups at the start of the -% \env{theglossary} environment: +% Add navigation links at the start of the environment: % \begin{macrocode} \renewcommand*{\glossaryheader}{% - \par\noindent\textbf{\glsnavigation}\par\indexspace}% + \item[\glsnavigation]}% % \end{macrocode} -% Each group has a heading (in bold with a target) followed by a -% vertical gap): +% Each group has a heading with a hypertarget: % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{% - \par\noindent - \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par - \indexspace}% -} + \item[\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}]}} % \end{macrocode} %\end{style} % -%\begin{style}{mcolalttree} -% Multi-column index style. Same as the \glostyle{alttree}, but puts the -% glossary in multiple columns. -% \begin{macrocode} -\newglossarystyle{mcolalttree}{% - \glossarystyle{alttree}% - \renewenvironment{theglossary}% - {% -% \end{macrocode} -%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} +%\begin{style}{listdotted} +% The \glostyle{listdotted} glossary style was supplied by +% Axel~Menzel. I've modified it slightly so that the distance from +% the start of the name to the end of the dotted line is specified +% by \cs{glslistdottedwidth}. +% Note that this style ignores the page numbers as well as the +% symbol. Sub-entries are displayed in the same way as top-level +% entries. % \begin{macrocode} - \begin{multicols}{\glsmcols} - \def\@gls@prevlevel{-1}% - \mbox{}\par - }% - {\par\end{multicols}}% -} +\newglossarystyle{listdotted}{% % \end{macrocode} -%\end{style} -% -%\begin{style}{mcolalttreegroup} -% Like the \glostyle{mcolalttree} style but the glossary groups have -% headings. +% Base it on the \glostyle{list} style: % \begin{macrocode} -\newglossarystyle{mcolalttreegroup}{% + \setglossarystyle{list}% % \end{macrocode} -% Base it on the glostyle{mcolalttree} style: +% Each main (level 0) entry starts a new item: +%\changes{3.08a}{2013-08-30}{updated listdotted style to use +%\cs{glossentry} and \cs{subglossentry}} % \begin{macrocode} - \glossarystyle{mcolalttree}% + \renewcommand*{\glossentry}[2]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glsentryitem{##1}% + \glstarget{##1}{\glossentryname{##1}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##1}}% % \end{macrocode} -% Give each group a heading. +% Sub entries have the same format as main entries: % \begin{macrocode} - \renewcommand{\glsgroupheading}[1]{\par - \def\@gls@prevlevel{-1}% - \hangindent0pt\relax - \parindent0pt\relax - \textbf{\glsgetgrouptitle{##1}}\par\indexspace}% + \renewcommand*{\subglossentry}[3]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{\glossentryname{##2}}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}\glossentrydesc{##2}}% } % \end{macrocode} %\end{style} -% -%\begin{style}{mcolalttreehypergroup} -% The \glostyle{mcolalttreehypergroup} style is like the -% \glostyle{mcolalttreegroup} style, but has a set of links to the -% groups at the start of the glossary. +%\begin{macro}{\glslistdottedwidth} +%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} % \begin{macrocode} -\newglossarystyle{mcolalttreehypergroup}{% +\newlength\glslistdottedwidth +\setlength{\glslistdottedwidth}{.5\hsize} % \end{macrocode} -% Base it on the glostyle{mcolalttree} style: +%\end{macro} +% +%\begin{style}{sublistdotted} +% This style is similar to the glostyle{listdotted} style, except +% that the main entries just have the name displayed. % \begin{macrocode} - \glossarystyle{mcolalttree}% +\newglossarystyle{sublistdotted}{% % \end{macrocode} -% Put the navigation links in the header +% Base it on the \glostyle{listdotted} style: % \begin{macrocode} - \renewcommand*{\glossaryheader}{% - \par - \def\@gls@prevlevel{-1}% - \hangindent0pt\relax - \parindent0pt\relax - \textbf{\glsnavigation}\par\indexspace}% + \setglossarystyle{listdotted}% % \end{macrocode} -% Put a hypertarget at the start of each group +% Main (level 0) entries just display the name: % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{% - \par - \def\@gls@prevlevel{-1}% - \hangindent0pt\relax - \parindent0pt\relax - \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par - \indexspace}} + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}]}% +} % \end{macrocode} %\end{style} - - %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -%<*glossary-super.sty> +%<*glossary-long.sty> % \end{macrocode} %\fi -% \subsection{Glossary Styles using supertabular environment (glossary-super package)} -% The glossary styles defined in the \isty{glossary-super} package -% use the \env{supertabular} environment. +% \subsection{Glossary Styles using longtable (the glossary-long +% package)} +% The glossary styles defined in the \isty{glossary-long} package +% used the \env{longtable} environment in the glossary. % \begin{macrocode} -\ProvidesPackage{glossary-super}[2012/09/21 v3.03 (NLCT)] +\ProvidesPackage{glossary-long}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} -% Requires the \isty{supertabular} package: +% Requires the \isty{longtable} package: % \begin{macrocode} -\RequirePackage{supertabular} +\RequirePackage{longtable} % \end{macrocode} %\begin{macro}{\glsdescwidth} % This is a length that governs the width of the description column. -% This may already have been defined if \isty{glossary-long} -% has been loaded.\changes{2.01}{2009 May 30}{changed \cs{linewidth} -% to \cs{hsize}} +% (There's a chance that the user may specify \pkgopt{nolong} +% and then load \isty{glossary-long} later, in which case +% \cs{glsdescwidth} may have already been defined by +% \isty{glossary-super}. The same goes for \cs{glspagelistwidth}.) +%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} % \begin{macrocode} \@ifundefined{glsdescwidth}{% \newlength\glsdescwidth @@ -13790,9 +15085,7 @@ false,nolabel,autolabel}[nolabel]{% % %\begin{macro}{\glspagelistwidth} % This is a length that governs the width of the page list column. -% This may already have been defined if \isty{glossary-long} -% has been loaded.\changes{2.01}{2009 May 30}{changed \cs{linewidth} -% to \cs{hsize}} +%\changes{2.01}{2009 May 30}{changed \cs{linewidth} to \cs{hsize}} % \begin{macrocode} \@ifundefined{glspagelistwidth}{% \newlength\glspagelistwidth @@ -13800,248 +15093,244 @@ false,nolabel,autolabel}[nolabel]{% }{} % \end{macrocode} %\end{macro} -% -%\begin{style}{super} -% The \glostyle{super} glossary style uses the -% \env{supertabular} environment -% (it uses lengths defined in the \isty{glossary-long} package.) +% +%\begin{style}{long} +% The \glostyle{long} glossary style command which +% uses the \env{longtable} environment: % \begin{macrocode} -\newglossarystyle{super}{% +\newglossarystyle{long}{% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns and no head or tail: +% Use \env{longtable} with two columns: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{lp{\glsdescwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{lp{\glsdescwidth}}}% + {\end{longtable}}% % \end{macrocode} -% Do nothing at the start of the table: +% Do nothing at the start of the environment: % \begin{macrocode} \renewcommand*{\glossaryheader}{}% % \end{macrocode} -% No group headings: +% No heading between groups: % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} -% Main (level 0) entries put in a row (name in first column, -% description and page list in second column): +% Main (level 0) entries displayed in a row: +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline + }% % \end{macrocode} -% Sub entries put in a row (no name, description and page list -% in second column): +% Sub entries displayed on the following row without the name: % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & + \renewcommand{\subglossentry}[3]{% + & \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% + \glstarget{##2}{\strut}\glosentrydesc{##2}\glspostdescription\space + ##3\tabularnewline + }% % \end{macrocode} % Blank row between groups: %\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & \\\fi}% + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & +\tabularnewline\fi}% } % \end{macrocode} %\end{style} % -%\begin{style}{superborder} -% The \glostyle{superborder} style is like the above, but with -% horizontal and vertical lines: +%\begin{style}{longborder} +% The \glostyle{longborder} style is like the above, but with horizontal and +% vertical lines: % \begin{macrocode} -\newglossarystyle{superborder}{% +\newglossarystyle{longborder}{% % \end{macrocode} -% Base it on the glostyle{super} style: +% Base it on the glostyle{long} style: % \begin{macrocode} - \glossarystyle{super}% + \setglossarystyle{long}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns and a horizontal line in the head and tail: +% Use \env{longtable} with two columns with vertical lines +% between each column: % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}{|l|p{\glsdescwidth}|}}% - {\end{supertabular}}% + \renewenvironment{theglossary}{% + \begin{longtable}{|l|p{\glsdescwidth}|}}{\end{longtable}}% +% \end{macrocode} +% Place horizontal lines at the head and foot of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{superheader} -% The \glostyle{superheader} style is like the -% \glostyle{super} style, but with a header: +%\begin{style}{longheader} +% The \glostyle{longheader} style is like the +% \glostyle{long} style but with a header: % \begin{macrocode} -\newglossarystyle{superheader}{% +\newglossarystyle{longheader}{% % \end{macrocode} -% Base it on the glostyle{super} style: +% Base it on the glostyle{long} style: % \begin{macrocode} - \glossarystyle{super}% + \setglossarystyle{long}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns, a header and no tail: +% Set the table's header: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} -\renewenvironment{theglossary}% - {\tablehead{\bfseries \entryname & \bfseries \descriptionname\\}% - \tabletail{}% - \begin{supertabular}{lp{\glsdescwidth}}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \bfseries \entryname & \bfseries \descriptionname\tabularnewline\endhead}% } % \end{macrocode} %\end{style} % -%\begin{style}{superheaderborder} -% The \glostyle{superheaderborder} style is like -% the \glostyle{super} style but with a header and border: +%\begin{style}{longheaderborder} +% The \glostyle{longheaderborder} style is +% like the \glostyle{long} style but with a header and border: % \begin{macrocode} -\newglossarystyle{superheaderborder}{% +\newglossarystyle{longheaderborder}{% % \end{macrocode} -% Base it on the glostyle{super} style: +% Base it on the glostyle{longborder} style: % \begin{macrocode} - \glossarystyle{super}% + \setglossarystyle{longborder}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns, a header and horizontal lines above and below the -% table: +% Set the table's header and add horizontal line to table's foot: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\hline\bfseries \entryname & - \bfseries \descriptionname\\\hline}% - \tabletail{\hline} - \begin{supertabular}{|l|p{\glsdescwidth}|}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries \entryname & \bfseries + \descriptionname\tabularnewline\hline + \endhead + \hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{super3col} -% The \glostyle{super3col} style is like the \glostyle{super} -% style, but with 3 columns: +%\begin{style}{long3col} +% The \glostyle{long3col} style is like \glostyle{long} but with 3 columns % \begin{macrocode} -\newglossarystyle{super3col}{% +\newglossarystyle{long3col}{% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns and no head or tail: +% Use a \env{longtable} with 3 columns: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{longtable}}% % \end{macrocode} -% Do nothing at the start of the table: +% No table header: % \begin{macrocode} \renewcommand*{\glossaryheader}{}% % \end{macrocode} -% No group headings: +% No headings between groups: % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} % Main (level 0) entries on a row (name in first column, % description in second column, page list in last column): +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% % \end{macrocode} -% Sub entries on a row (no name, description in second column, -% page list in last column): +% Sub-entries on a separate row (no name, description in +% second column, page list in third column): % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% + \renewcommand{\subglossentry}[3]{% & \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\\}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% % \end{macrocode} % Blank row between groups: %\changes{3.03}{2012/09/21}{added check for glsnogroupskip} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & &\\\fi}% + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & &\tabularnewline\fi}% } % \end{macrocode} %\end{style} % -%\begin{style}{super3colborder} -% The \glostyle{super3colborder} style is like the -% \glostyle{super3col} style, but with a border: +%\begin{style}{long3colborder} +% The \glostyle{long3colborder} style is like the +% \glostyle{long3col} style but with a border: % \begin{macrocode} -\newglossarystyle{super3colborder}{% +\newglossarystyle{long3colborder}{% % \end{macrocode} -% Base it on the glostyle{super3col} style: +% Base it on the glostyle{long3col} style: % \begin{macrocode} - \glossarystyle{super3col}% + \setglossarystyle{long3col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns and a horizontal line in the head and tail: +% Use a \env{longtable} with 3 columns with vertical lines +% around them: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{longtable}}% +% \end{macrocode} +% Place horizontal lines at the head and foot of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{super3colheader} -% The \glostyle{super3colheader} style is like -% the \glostyle{super3col} style but with a header row: +%\begin{style}{long3colheader} +% The \glostyle{long3colheader} style is like \glostyle{long3col} but with a header row: % \begin{macrocode} -\newglossarystyle{super3colheader}{% +\newglossarystyle{long3colheader}{% % \end{macrocode} -% Base it on the glostyle{super3col} style: +% Base it on the glostyle{long3col} style: % \begin{macrocode} - \glossarystyle{super3col}% + \setglossarystyle{long3col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns, a header and no tail: +% Set the table's header: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\\}\tabletail{}% - \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\endhead}% } % \end{macrocode} %\end{style} % -%\begin{style}{super3colheaderborder} -% The \glostyle{super3colheaderborder} style is like -% the \glostyle{super3col} style but with a header and border: +%\begin{style}{long3colheaderborder} +% The \glostyle{long3colheaderborder} style is like the above but with a border % \begin{macrocode} -\newglossarystyle{super3colheaderborder}{% +\newglossarystyle{long3colheaderborder}{% % \end{macrocode} -% Base it on the glostyle{super3colborder} style: +% Base it on the glostyle{long3colborder} style: % \begin{macrocode} - \glossarystyle{super3colborder}% + \setglossarystyle{long3colborder}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns, a header with horizontal lines and a horizontal -% line in the tail: +% Set the table's header and add horizontal line at table's foot: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\hline - \bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\\\hline}% - \tabletail{\hline}% - \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{super4col} -% The \glostyle{super4col} glossary style has four columns, -% where the third column contains the value of the -% corresponding \gloskey{symbol} key used when that entry -% was defined. +%\begin{style}{long4col} +% The \glostyle{long4col} style has four columns where the third +% column contains the value of the associated \gloskey{symbol} key. % \begin{macrocode} -\newglossarystyle{super4col}{% +\newglossarystyle{long4col}{% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and no head or tail: +% Use a \env{longtable} with 4 columns: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{llll}}{% - \end{supertabular}}% + {\begin{longtable}{llll}}% + {\end{longtable}}% % \end{macrocode} -% Do nothing at the start of the table: +% No table header: % \begin{macrocode} \renewcommand*{\glossaryheader}{}% % \end{macrocode} @@ -14049,220 +15338,218 @@ false,nolabel,autolabel}[nolabel]{% % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} -% Main (level 0) entries on a row with the name in the first -% column, description in second column, symbol in third column -% and page list in last column: +% Main (level 0) entries on a single row (name in first column, +% description in second column, symbol in third column, page list +% in last column): +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & + ##2\tabularnewline + }% % \end{macrocode} -% Sub entries on a row with no name, the description in the second -% column, symbol in third column and page list in last column: +% Sub entries on a single row with no name (description in second +% column, symbol in third column, page list in last column): % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% + \renewcommand{\subglossentry}[3]{% & \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% % \end{macrocode} % Blank row between groups: %\changes{3.03}{2012/09/21}{added check for glsnogroupskip} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & &\\\fi}% + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & & &\tabularnewline\fi}% } % \end{macrocode} %\end{style} % -%\begin{style}{super4colheader} -% The \glostyle{super4colheader} style is like -% the \glostyle{super4col} but with a header row. +%\begin{style}{long4colheader} +% The \glostyle{long4colheader} style is like \glostyle{long4col} +% but with a header row. % \begin{macrocode} -\newglossarystyle{super4colheader}{% +\newglossarystyle{long4colheader}{% % \end{macrocode} -% Base it on the glostyle{super4col} style: +% Base it on the glostyle{long4col} style: % \begin{macrocode} - \glossarystyle{super4col}% + \setglossarystyle{long4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns, a header and no tail: +% Table has a header: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\bfseries\entryname&\bfseries\descriptionname& - \bfseries\symbolname & - \bfseries\pagelistname\\}% - \tabletail{}% - \begin{supertabular}{llll}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\endhead}% } % \end{macrocode} %\end{style} % -%\begin{style}{super4colborder} -% The \glostyle{super4colborder} style is like -% the \glostyle{super4col} but with a border. +%\begin{style}{long4colborder} +% The \glostyle{long4colborder} style is like \glostyle{long4col} +% but with a border. % \begin{macrocode} -\newglossarystyle{super4colborder}{% +\newglossarystyle{long4colborder}{% % \end{macrocode} -% Base it on the glostyle{super4col} style: +% Base it on the glostyle{long4col} style: % \begin{macrocode} - \glossarystyle{super4col}% + \setglossarystyle{long4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and a horizontal line in the head and tail: +% Use a \env{longtable} with 4 columns surrounded by vertical +% lines: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}{|l|l|l|l|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|l|l|l|}}% + {\end{longtable}}% +% \end{macrocode} +% Add horizontal lines to the head and foot of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{super4colheaderborder} -% The \glostyle{super4colheaderborder} style is like -% the \glostyle{super4col} but with a header and border. +%\begin{style}{long4colheaderborder} +% The \glostyle{long4colheaderborder} style is like the above but +% with a border. % \begin{macrocode} -\newglossarystyle{super4colheaderborder}{% +\newglossarystyle{long4colheaderborder}{% % \end{macrocode} -% Base it on the glostyle{super4col} style: +% Base it on the glostyle{long4col} style: % \begin{macrocode} - \glossarystyle{super4col}% + \setglossarystyle{long4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and a header bordered by horizontal lines and -% a horizontal line in the tail: +% Use a \env{longtable} with 4 columns surrounded by vertical +% lines: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname& - \bfseries\symbolname & - \bfseries\pagelistname\\\hline}\tabletail{\hline}% - \begin{supertabular}{|l|l|l|l|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|l|l|l|}}% + {\end{longtable}}% +% \end{macrocode} +% Add table header and horizontal line at the table's foot: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuper4col} -% The \glostyle{altsuper4col} glossary style is like -% \glostyle{super4col} but has provision for multiline descriptions. +%\begin{style}{altlong4col} +% The \glostyle{altlong4col} style is like the \glostyle{long4col} +% style but can have multiline descriptions and page lists. % \begin{macrocode} -\newglossarystyle{altsuper4col}{% +\newglossarystyle{altlong4col}{% % \end{macrocode} -% Base it on the glostyle{super4col} style: +% Base it on the glostyle{long4col} style: % \begin{macrocode} - \glossarystyle{super4col}% + \setglossarystyle{long4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and no head or tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuper4colheader} -% The \glostyle{altsuper4colheader} style is like -% the \glostyle{altsuper4col} but with a header row. +%\begin{style}{altlong4colheader} +% The \glostyle{altlong4colheader} style is like +% \glostyle{altlong4col} but with a header row. % \begin{macrocode} -\newglossarystyle{altsuper4colheader}{% +\newglossarystyle{altlong4colheader}{% % \end{macrocode} -% Base it on the glostyle{super4colheader} style: +% Base it on the glostyle{long4colheader} style: % \begin{macrocode} - \glossarystyle{super4colheader}% + \setglossarystyle{long4colheader}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns, a header and no tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\bfseries\entryname&\bfseries\descriptionname& - \bfseries\symbolname & - \bfseries\pagelistname\\}\tabletail{}% - \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{longtable}}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuper4colborder} -% The \glostyle{altsuper4colborder} style is like -% the \glostyle{altsuper4col} but with a border. +%\begin{style}{altlong4colborder} +% The \glostyle{altlong4colborder} style is like +% \glostyle{altlong4col} but with a border. % \begin{macrocode} -\newglossarystyle{altsuper4colborder}{% +\newglossarystyle{altlong4colborder}{% % \end{macrocode} -% Base it on the glostyle{super4colborder} style: +% Base it on the glostyle{long4colborder} style: % \begin{macrocode} - \glossarystyle{super4colborder}% + \setglossarystyle{long4colborder}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and a horizontal line in the head and tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}% - {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{longtable}}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuper4colheaderborder} -% The \glostyle{altsuper4colheaderborder} style is like -% the \glostyle{altsuper4col} but with a header and border. +%\begin{style}{altlong4colheaderborder} +% The \glostyle{altlong4colheaderborder} style is like the above but +% with a header as well as a border. % \begin{macrocode} -\newglossarystyle{altsuper4colheaderborder}{% +\newglossarystyle{altlong4colheaderborder}{% % \end{macrocode} -% Base it on the glostyle{super4colheaderborder} style: +% Base it on the glostyle{long4colheaderborder} style: % \begin{macrocode} - \glossarystyle{super4colheaderborder}% + \setglossarystyle{long4colheaderborder}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and a header bordered by horizontal lines and -% a horizontal line in the tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline - \bfseries\entryname & - \bfseries\descriptionname & - \bfseries\symbolname & - \bfseries\pagelistname\\\hline}% - \tabletail{\hline}% - \begin{supertabular}% - {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{longtable}}% } % \end{macrocode} %\end{style} %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -%<*glossary-superragged.sty> +%<*glossary-longragged.sty> % \end{macrocode} %\fi -% \subsection{Glossary Styles using supertabular environment (glossary-superragged package)} -% The glossary styles defined in the \isty{glossary-superragged} -% package use the \env{supertabular} environment. These styles -% are like those provided by the \isty{glossary-super} package, -% except that the multiline columns have ragged right justification. +% \subsection{Glossary Styles using longtable (the glossary-longragged +% package)} +% The glossary styles defined in the \isty{glossary-longragged} package +% used the \env{longtable} environment in the glossary and use +% ragged right formatting for the multiline columns. % \begin{macrocode} -\ProvidesPackage{glossary-superragged}[2012/09/21 v3.03 (NLCT)] +\ProvidesPackage{glossary-longragged}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} % Requires the \isty{array} package: % \begin{macrocode} \RequirePackage{array} % \end{macrocode} -% Requires the \isty{supertabular} package: +% Requires the \isty{longtable} package: % \begin{macrocode} -\RequirePackage{supertabular} +\RequirePackage{longtable} % \end{macrocode} %\begin{macro}{\glsdescwidth} % This is a length that governs the width of the description column. -% This may already have been defined. +% This may have already been defined. % \begin{macrocode} \@ifundefined{glsdescwidth}{% \newlength\glsdescwidth @@ -14281,44 +15568,47 @@ false,nolabel,autolabel}[nolabel]{% }{} % \end{macrocode} %\end{macro} -% -%\begin{style}{superragged} -% The \glostyle{superragged} glossary style uses the -% \env{supertabular} environment. +% +%\begin{style}{longragged} +% The \glostyle{longragged} glossary style is like the +% \glostyle{long} but uses ragged right formatting for the +% description column. % \begin{macrocode} -\newglossarystyle{superragged}{% +\newglossarystyle{longragged}{% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns and no head or tail: +% Use \env{longtable} with two columns: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{longtable}}% % \end{macrocode} -% Do nothing at the start of the table: +% Do nothing at the start of the environment: % \begin{macrocode} \renewcommand*{\glossaryheader}{}% % \end{macrocode} -% No group headings: +% No heading between groups: % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} -% Main (level 0) entries put in a row (name in first column, -% description and page list in second column): +% Main (level 0) entries displayed in a row: +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% - \tabularnewline}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2% + \tabularnewline + }% % \end{macrocode} -% Sub entries put in a row (no name, description and page list -% in second column): +% Sub entries displayed on the following row without the name: % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - & + \renewcommand{\subglossentry}[3]{% + & \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4\glspostdescription\space ##6% - \tabularnewline}% + \glstarget{##2}{\strut}\glossentrydesc{##2}% + \glspostdescription\space ##3% + \tabularnewline + }% % \end{macrocode} % Blank row between groups: %\changes{3.03}{2012/09/21}{added check for glsnogroupskip} @@ -14328,208 +15618,199 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{style}{superraggedborder} -% The \glostyle{superraggedborder} style is like the above, but with -% horizontal and vertical lines: +%\begin{style}{longraggedborder} +% The \glostyle{longraggedborder} style is like the above, but with horizontal and +% vertical lines: % \begin{macrocode} -\newglossarystyle{superraggedborder}{% +\newglossarystyle{longraggedborder}{% % \end{macrocode} -% Base it on the glostyle{superragged} style: +% Base it on the glostyle{longragged} style: % \begin{macrocode} - \glossarystyle{superragged}% + \setglossarystyle{longragged}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns and a horizontal line in the head and tail: +% Use \env{longtable} with two columns with vertical lines +% between each column: % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% - {\end{supertabular}}% + \renewenvironment{theglossary}{% + \begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{longtable}}% +% \end{macrocode} +% Place horizontal lines at the head and foot of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{superraggedheader} -% The \glostyle{superraggedheader} style is like the -% \glostyle{super} style, but with a header: +%\begin{style}{longraggedheader} +% The \glostyle{longraggedheader} style is like the +% \glostyle{longragged} style but with a header: % \begin{macrocode} -\newglossarystyle{superraggedheader}{% +\newglossarystyle{longraggedheader}{% % \end{macrocode} -% Base it on the glostyle{superragged} style: +% Base it on the glostyle{longragged} style: % \begin{macrocode} - \glossarystyle{superragged}% + \setglossarystyle{longragged}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns, a header and no tail: +% Set the table's header: % \begin{macrocode} -\renewenvironment{theglossary}% - {\tablehead{\bfseries \entryname & \bfseries \descriptionname - \tabularnewline}% - \tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \bfseries \entryname & \bfseries \descriptionname + \tabularnewline\endhead}% } % \end{macrocode} %\end{style} % -%\begin{style}{superraggedheaderborder} -% The \glostyle{superraggedheaderborder} style is like -% the \glostyle{superragged} style but with a header and border: +%\begin{style}{longraggedheaderborder} +% The \glostyle{longraggedheaderborder} style is +% like the \glostyle{longragged} style but with a header and border: % \begin{macrocode} -\newglossarystyle{superraggedheaderborder}{% +\newglossarystyle{longraggedheaderborder}{% % \end{macrocode} -% Base it on the glostyle{super} style: +% Base it on the glostyle{longraggedborder} style: % \begin{macrocode} - \glossarystyle{superragged}% + \setglossarystyle{longraggedborder}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% two columns, a header and horizontal lines above and below the -% table: +% Set the table's header and add horizontal line to table's foot: % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\hline\bfseries \entryname & - \bfseries \descriptionname\tabularnewline\hline}% - \tabletail{\hline} - \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \hline\bfseries \entryname & \bfseries \descriptionname + \tabularnewline\hline + \endhead + \hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{superragged3col} -% The \glostyle{superragged3col} style is like the \glostyle{superragged} -% style, but with 3 columns: +%\begin{style}{longragged3col} +% The \glostyle{longragged3col} style is like \glostyle{longragged} but with 3 columns % \begin{macrocode} -\newglossarystyle{superragged3col}{% +\newglossarystyle{longragged3col}{% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns and no head or tail: +% Use a \env{longtable} with 3 columns: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% % \end{macrocode} -% Do nothing at the start of the table: +% No table header: % \begin{macrocode} \renewcommand*{\glossaryheader}{}% % \end{macrocode} -% No group headings: +% No headings between groups: % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} % Main (level 0) entries on a row (name in first column, % description in second column, page list in last column): +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline + }% % \end{macrocode} -% Sub entries on a row (no name, description in second column, -% page list in last column): +% Sub-entries on a separate row (no name, description in +% second column, page list in third column): % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% + \renewcommand{\subglossentry}[3]{% & \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% % \end{macrocode} % Blank row between groups: %\changes{3.03}{2012/09/21}{added check for glsnogroupskip} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & &\tabularnewline\fi}% + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & &\tabularnewline\fi}% } % \end{macrocode} %\end{style} % -%\begin{style}{superragged3colborder} -% The \glostyle{superragged3colborder} style is like the -% \glostyle{superragged3col} style, but with a border: +%\begin{style}{longragged3colborder} +% The \glostyle{longragged3colborder} style is like the +% \glostyle{longragged3col} style but with a border: % \begin{macrocode} -\newglossarystyle{superragged3colborder}{% +\newglossarystyle{longragged3colborder}{% % \end{macrocode} -% Base it on the glostyle{superragged3col} style: +% Base it on the glostyle{longragged3col} style: % \begin{macrocode} - \glossarystyle{superragged3col}% + \setglossarystyle{longragged3col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns and a horizontal line in the head and tail: +% Use a \env{longtable} with 3 columns with vertical lines +% around them: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{supertabular}}% -} -% \end{macrocode} + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% +% \end{macrocode} +% Place horizontal lines at the head and foot of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% +} +% \end{macrocode} %\end{style} % -%\begin{style}{superragged3colheader} -% The \glostyle{superragged3colheader} style is like -% the \glostyle{superragged3col} style but with a header row: +%\begin{style}{longragged3colheader} +% The \glostyle{longragged3colheader} style is like \glostyle{longragged3col} but with a header row: % \begin{macrocode} -\newglossarystyle{superragged3colheader}{% +\newglossarystyle{longragged3colheader}{% % \end{macrocode} -% Base it on the glostyle{superragged3col} style: +% Base it on the glostyle{longragged3col} style: % \begin{macrocode} - \glossarystyle{superragged3col}% + \setglossarystyle{longragged3col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns, a header and no tail: +% Set the table's header: % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\tabularnewline}\tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\endhead}% } % \end{macrocode} %\end{style} % -%\begin{style}{superraggedright3colheaderborder} -% The \glostyle{superragged3colheaderborder} style is like -% the \glostyle{superragged3col} style but with a header and border: +%\begin{style}{longragged3colheaderborder} +% The \glostyle{longragged3colheaderborder} style is like the above but with a border % \begin{macrocode} -\newglossarystyle{superragged3colheaderborder}{% +\newglossarystyle{longragged3colheaderborder}{% % \end{macrocode} -% Base it on the glostyle{superragged3colborder} style: +% Base it on the glostyle{longragged3colborder} style: % \begin{macrocode} - \glossarystyle{superragged3colborder}% + \setglossarystyle{longragged3colborder}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% three columns, a header with horizontal lines and a horizontal -% line in the tail: +% Set the table's header and add horizontal line at table's foot: % \begin{macrocode} - \renewenvironment{theglossary}% - {\tablehead{\hline - \bfseries\entryname&\bfseries\descriptionname& - \bfseries\pagelistname\tabularnewline\hline}% - \tabletail{\hline}% - \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{supertabular}}% + \renewcommand*{\glossaryheader}{% + \hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuperragged4col} -% The \glostyle{altsuperragged4col} glossary style is like -% \glostyle{altsuper4col} style in the \isty{glossary-super} -% package but uses ragged right formatting in the description -% and page list columns. +%\begin{style}{altlongragged4col} +% The \glostyle{altlongragged4col} style is like the \glostyle{altlong4col} +% style defined in the \isty{glossary-long} package, except that +% ragged right formatting is used for the description and page list +% columns. % \begin{macrocode} -\newglossarystyle{altsuperragged4col}{% +\newglossarystyle{altlongragged4col}{% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and no head or tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{}\tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% >{\raggedright}p{\glspagelistwidth}}}% - {\end{supertabular}}% + {\end{longtable}}% % \end{macrocode} -% Do nothing at the start of the table: +% No table header: % \begin{macrocode} \renewcommand*{\glossaryheader}{}% % \end{macrocode} @@ -14537,223 +15818,192 @@ false,nolabel,autolabel}[nolabel]{% % \begin{macrocode} \renewcommand*{\glsgroupheading}[1]{}% % \end{macrocode} -% Main (level 0) entries on a row with the name in the first -% column, description in second column, symbol in third column -% and page list in last column: +% Main (level 0) entries on a single row (name in first column, +% description in second column, symbol in third column, page list +% in last column): +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} % \begin{macrocode} - \renewcommand*{\glossaryentryfield}[5]{% - \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & \glossentrydesc{##1} & + ##2\tabularnewline + }% % \end{macrocode} -% Sub entries on a row with no name, the description in the second% column, symbol in third column and page list in last column: +% Sub entries on a single row with no name (description in second +% column, symbol in third column, page list in last column): % \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% + \renewcommand{\subglossentry}[3]{% & \glssubentryitem{##2}% - \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% % \end{macrocode} % Blank row between groups: %\changes{3.03}{2012/09/21}{added check for glsnogroupskip} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & &\tabularnewline\fi}% + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & & &\tabularnewline\fi}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuperragged4colheader} -% The \glostyle{altsuperragged4colheader} style is like -% the \glostyle{altsuperragged4col} style but with a header row. +%\begin{style}{altlongragged4colheader} +% The \glostyle{altlongragged4colheader} style is like +% \glostyle{altlongragged4col} but with a header row. % \begin{macrocode} -\newglossarystyle{altsuperragged4colheader}{% +\newglossarystyle{altlongragged4colheader}{% % \end{macrocode} -% Base it on the glostyle{altsuperragged4col} style: +% Base it on the glostyle{altlongragged4col} style: % \begin{macrocode} - \glossarystyle{altsuperragged4col}% + \setglossarystyle{altlongragged4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns, a header and no tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\bfseries\entryname&\bfseries\descriptionname& - \bfseries\symbolname & - \bfseries\pagelistname\tabularnewline}\tabletail{}% - \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% - >{\raggedright}p{\glspagelistwidth}}}% - {\end{supertabular}}% + {\begin{longtable}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{longtable}}% +% \end{macrocode} +% Table has a header: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\endhead}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuperragged4colborder} -% The \glostyle{altsuperragged4colborder} style is like -% the \glostyle{altsuperragged4col} style but with a border. +%\begin{style}{altlongragged4colborder} +% The \glostyle{altlongragged4colborder} style is like +% \glostyle{altlongragged4col} but with a border. % \begin{macrocode} -\newglossarystyle{altsuperragged4colborder}{% +\newglossarystyle{altlongragged4colborder}{% % \end{macrocode} -% Base it on the glostyle{altsuperragged4col} style: +% Base it on the glostyle{altlongragged4col} style: % \begin{macrocode} - \glossarystyle{altsuper4col}% + \setglossarystyle{altlongragged4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and a horizontal line in the head and tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline}\tabletail{\hline}% - \begin{supertabular}% - {|l|>{\raggedright}p{\glsdescwidth}|l|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% +% \end{macrocode} +% Add horizontal lines to the head and foot of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{\hline\endhead\hline\endfoot}% } % \end{macrocode} %\end{style} % -%\begin{style}{altsuperragged4colheaderborder} -% The \glostyle{altsuperragged4colheaderborder} style is like -% the \glostyle{altsuperragged4col} style but with a header and border. +%\begin{style}{altlongragged4colheaderborder} +% The \glostyle{altlongragged4colheaderborder} style is like the above but +% with a header as well as a border. % \begin{macrocode} -\newglossarystyle{altsuperragged4colheaderborder}{% +\newglossarystyle{altlongragged4colheaderborder}{% % \end{macrocode} -% Base it on the glostyle{altsuperragged4col} style: +% Base it on the glostyle{altlongragged4col} style: % \begin{macrocode} - \glossarystyle{altsuperragged4col}% + \setglossarystyle{altlongragged4col}% % \end{macrocode} -% Put the glossary in a \env{supertabular} environment with -% four columns and a header bordered by horizontal lines and -% a horizontal line in the tail: +% Use a \env{longtable} with 4 columns where the second and +% last columns may have multiple lines in each row: % \begin{macrocode} \renewenvironment{theglossary}% - {\tablehead{\hline - \bfseries\entryname & - \bfseries\descriptionname & - \bfseries\symbolname & - \bfseries\pagelistname\tabularnewline\hline}% - \tabletail{\hline}% - \begin{supertabular}% - {|l|>{\raggedright}p{\glsdescwidth}|l|% - >{\raggedright}p{\glspagelistwidth}|}}% - {\end{supertabular}}% + {\begin{longtable}{|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{longtable}}% +% \end{macrocode} +% Add table header and horizontal line at the table's foot: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries \symbolname& + \bfseries\pagelistname\tabularnewline\hline\endhead + \hline\endfoot}% } % \end{macrocode} %\end{style} %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -%<*glossary-tree.sty> +%<*glossary-mcols.sty> % \end{macrocode} %\fi -%\subsection{Tree Styles (glossary-tree.sty)} -% The \isty{glossary-tree} style file defines glossary styles -% that have a tree-like structure. These are designed for -% hierarchical glossaries. +%\subsection{Glossary Styles using \styfmt{multicol} +%(glossary-mcols.sty)} +%The \isty{glossary-mcols} style file defines glossary styles that +%use the \sty{multicol} package. These use the tree-like glossary +%styles in a multicol environment. +% \begin{macrocode} +\ProvidesPackage{glossary-mcols}[2013/11/14 v4.0 (NLCT)] +% \end{macrocode} +% Required packages: % \begin{macrocode} -\ProvidesPackage{glossary-tree}[2012/09/21 v3.03 (NLCT)] +\RequirePackage{multicol} +\RequirePackage{glossary-tree} % \end{macrocode} % -%\begin{style}{index} -% The \glostyle{index} glossary style -% is similar in style to the way indices are usually typeset -% using \cs{item}, \cs{subitem} and \cs{subsubitem}. -% The entry name is -% set in bold. If an entry has a symbol, it is placed in -% brackets after the name. Then the description is displayed, -% followed by the number list. This style allows up to three -% levels. +%\begin{macro}{\glsmcols} +% Define macro in which to store the number of columns. (Defaults to +% 2.) % \begin{macrocode} -\newglossarystyle{index}{% +\newcommand*{\glsmcols}{2} % \end{macrocode} -% Set the paragraph indentation and skip and define \ics{item} -% to be the same as that used by \env{theindex}: +%\end{macro} +% +%\begin{style}{mcolindex} +% Multi-column index style. Same as the \glostyle{index}, but puts the +% glossary in multiple columns. (Ideally the glossary title should go in the +% optional argument of \env{multicols}, but the title isn't part of +% the glossary style.) % \begin{macrocode} +\newglossarystyle{mcolindex}{% + \setglossarystyle{index}% \renewenvironment{theglossary}% - {\setlength{\parindent}{0pt}% + {% +% \end{macrocode} +%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} +% \begin{macrocode} + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% \setlength{\parskip}{0pt plus 0.3pt}% \let\item\@idxitem}% - {}% + {\end{multicols}}% +} % \end{macrocode} -% Do nothing at the start of the environment: +%\end{style} +% +%\begin{style}{mcolindexgroup} +% As \glostyle{mcolindex} but has headings: % \begin{macrocode} - \renewcommand*{\glossaryheader}{}% +\newglossarystyle{mcolindexgroup}{% + \setglossarystyle{mcolindex}% + \renewcommand*{\glsgroupheading}[1]{% + \item\textbf{\glsgetgrouptitle{##1}}\indexspace}% +} % \end{macrocode} -% No group headers: +%\end{style} +% +%\begin{style}{mcolindexhypergroup} +% The \glostyle{mcolindexhypergroup} style is like the +% \glostyle{mcolindexgroup} style but has hyper navigation. % \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% +\newglossarystyle{mcolindexhypergroup}{% % \end{macrocode} -% Main (level 0) entry starts a new item with the name in bold -% followed by the symbol in brackets (if it exists), the description -% and the page list. -% \begin{macrocode} -\renewcommand*{\glossaryentryfield}[5]{% -\item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% - \ifx\relax##4\relax - \else - \space(##4)% - \fi - \space ##3\glspostdescription \space ##5}% -% \end{macrocode} -% Sub entries: level 1 entries use \ics{subitem}, levels greater -% than~1 use \ics{subsubitem}. The level ("##1") shouldn't be 0, -% as that's catered by \cs{glossaryentryfield}, but for completeness, -% if the level is 0, \ics{item} is used. The name is put in bold, -% followed by the symbol in brackets (if it exists), the description -% and the page list. -% \begin{macrocode} - \renewcommand*{\glossarysubentryfield}[6]{% - \ifcase##1\relax - % level 0 - \item - \or - % level 1 - \subitem - \glssubentryitem{##2}% - \else - % all other levels - \subsubitem - \fi - \textbf{\glstarget{##2}{##3}}% - \ifx\relax##5\relax - \else - \space(##5)% - \fi - \space##4\glspostdescription\space ##6}% -% \end{macrocode} -% Vertical gap between groups is the same as that used by indices: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} -% \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} -% \end{macrocode} -%\end{style} -% -%\begin{style}{indexgroup} -% The \glostyle{indexgroup} style is like the \glostyle{index} -% style but has headings. -% \begin{macrocode} -\newglossarystyle{indexgroup}{% -% \end{macrocode} -% Base it on the glostyle{index} style: -% \begin{macrocode} - \glossarystyle{index}% -% \end{macrocode} -% Add a heading for each group. This puts the group's title in -% bold followed by a vertical gap. -% \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{% - \item\textbf{\glsgetgrouptitle{##1}}\indexspace}% -} -% \end{macrocode} -%\end{style} -% -%\begin{style}{indexhypergroup} -% The \glostyle{indexhypergroup} style is like the -% \glostyle{indexgroup} style but has hyper navigation. -% \begin{macrocode} -\newglossarystyle{indexhypergroup}{% -% \end{macrocode} -% Base it on the glostyle{index} style: +% Base it on the glostyle{mcolindex} style: % \begin{macrocode} - \glossarystyle{index}% + \setglossarystyle{mcolindex}% % \end{macrocode} % Put navigation links to the groups at the start of the glossary: % \begin{macrocode} @@ -14770,76 +16020,35 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{style}{tree} -% The \glostyle{tree} glossary style -% is similar in style to the \glostyle{index} style, but -% can have arbitrary levels. -% \begin{macrocode} -\newglossarystyle{tree}{% -% \end{macrocode} -% Set the paragraph indentation and skip: +%\begin{style}{mcoltree} +% Multi-column index style. Same as the \glostyle{tree}, but puts the +% glossary in multiple columns. % \begin{macrocode} +\newglossarystyle{mcoltree}{% + \setglossarystyle{tree}% \renewenvironment{theglossary}% - {\setlength{\parindent}{0pt}% - \setlength{\parskip}{0pt plus 0.3pt}}% - {}% -% \end{macrocode} -% Do nothing at the start of the \env{theglossary} environment: -% \begin{macrocode} - \renewcommand*{\glossaryheader}{}% -% \end{macrocode} -% No group headings: -% \begin{macrocode} - \renewcommand*{\glsgroupheading}[1]{}% -% \end{macrocode} -% Main (level 0) entries: name in bold, followed by symbol in -% brackets (if it exists), the description and the page list: -% \begin{macrocode} - \renewcommand{\glossaryentryfield}[5]{% - \hangindent0pt\relax - \parindent0pt\relax - \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% - \ifx\relax##4\relax - \else - \space(##4)% - \fi - \space ##3\glspostdescription \space ##5\par}% -% \end{macrocode} -% Sub entries: level \meta{n} is indented by \meta{n} times -% \ics{glstreeindent}. The name is in bold, followed by the -% symbol in brackets (if it exists), the description and the -% page list. -% \begin{macrocode} - \renewcommand{\glossarysubentryfield}[6]{% - \hangindent##1\glstreeindent\relax - \parindent##1\glstreeindent\relax - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi - \textbf{\glstarget{##2}{##3}}% - \ifx\relax##5\relax - \else - \space(##5)% - \fi - \space##4\glspostdescription\space ##6\par}% + {% % \end{macrocode} -% Vertical gap between groups is the same as that used by -% indices: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% +} % \end{macrocode} %\end{style} % -%\begin{style}{treegroup} -% Like the \glostyle{tree} style but the glossary groups have +%\begin{style}{mcoltreegroup} +% Like the \glostyle{mcoltree} style but the glossary groups have % headings. % \begin{macrocode} -\newglossarystyle{treegroup}{% +\newglossarystyle{mcoltreegroup}{% % \end{macrocode} -% Base it on the glostyle{tree} style: +% Base it on the glostyle{mcoltree} style: % \begin{macrocode} - \glossarystyle{tree}% + \setglossarystyle{mcoltree}% % \end{macrocode} % Each group has a heading (in bold) followed by a vertical gap): % \begin{macrocode} @@ -14849,16 +16058,17 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{style}{treehypergroup} -% The \glostyle{treehypergroup} style is like the \glostyle{treegroup} +%\begin{style}{mcoltreehypergroup} +% The \glostyle{mcoltreehypergroup} style is like the +% \glostyle{treegroup} % style, but has a set of links to the groups at the % start of the glossary. % \begin{macrocode} -\newglossarystyle{treehypergroup}{% +\newglossarystyle{mcoltreehypergroup}{% % \end{macrocode} -% Base it on the glostyle{tree} style: +% Base it on the glostyle{mcoltree} style: % \begin{macrocode} - \glossarystyle{tree}% + \setglossarystyle{mcoltree}% % \end{macrocode} % Put navigation links to the groups at the start of the % \env{theglossary} environment: @@ -14877,81 +16087,35 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{macro}{\glstreeindent} -% Length governing left indent for each level of the \glostyle{tree} -% style. -% \begin{macrocode} -\newlength\glstreeindent -\setlength{\glstreeindent}{10pt} -% \end{macrocode} -%\end{macro} -% -%\begin{style}{treenoname} -% The \glostyle{treenoname} glossary style -% is like the \glostyle{tree} style, but -% doesn't print the name or symbol for sub-levels. -% \begin{macrocode} -\newglossarystyle{treenoname}{% -% \end{macrocode} -% Set the paragraph indentation and skip: +%\begin{style}{mcoltreenoname} +% Multi-column index style. Same as the \glostyle{treenoname}, but puts the +% glossary in multiple columns. % \begin{macrocode} +\newglossarystyle{mcoltreenoname}{% + \setglossarystyle{treenoname}% \renewenvironment{theglossary}% - {\setlength{\parindent}{0pt}% - \setlength{\parskip}{0pt plus 0.3pt}}% - {}% -% \end{macrocode} -% No header: -% \begin{macrocode} - \renewcommand*{\glossaryheader}{}% -% \end{macrocode} -% No group headings: -% \begin{macrocode} -\renewcommand*{\glsgroupheading}[1]{}% -% \end{macrocode} -% Main (level 0) entries: the name is in bold, followed by the -% symbol in brackets (if it exists), the description and the -% page list. -% \begin{macrocode} - \renewcommand{\glossaryentryfield}[5]{% - \hangindent0pt\relax - \parindent0pt\relax - \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% - \ifx\relax##4\relax - \else - \space(##4)% - \fi - \space ##3\glspostdescription \space ##5\par}% -% \end{macrocode} -% Sub entries: level \meta{n} is indented by \meta{n} times -% \ics{glstreeindent}. The name and symbol are omitted. The -% description followed by the page list are displayed. -% \begin{macrocode} - \renewcommand{\glossarysubentryfield}[6]{% - \hangindent##1\glstreeindent\relax - \parindent##1\glstreeindent\relax - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi - \glstarget{##2}{\strut}% - ##4\glspostdescription\space ##6\par}% + {% % \end{macrocode} -% Vertical gap between groups is the same as that used by indices: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} % \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + \begin{multicols}{\glsmcols} + \setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + }% + {\end{multicols}}% } % \end{macrocode} %\end{style} % -%\begin{style}{treenonamegroup} -% Like the \glostyle{treenoname} style but the glossary groups have +%\begin{style}{mcoltreenonamegroup} +% Like the \glostyle{mcoltreenoname} style but the glossary groups have % headings. % \begin{macrocode} -\newglossarystyle{treenonamegroup}{% +\newglossarystyle{mcoltreenonamegroup}{% % \end{macrocode} -% Base it on the glostyle{treenoname} style: +% Base it on the glostyle{mcoltreenoname} style: % \begin{macrocode} - \glossarystyle{treenoname}% + \setglossarystyle{mcoltreenoname}% % \end{macrocode} % Give each group a heading: % \begin{macrocode} @@ -14961,16 +16125,17 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{style}{treenonamehypergroup} -% The \glostyle{treenonamehypergroup} style is like the \glostyle{treenonamegroup} +%\begin{style}{mcoltreenonamehypergroup} +% The \glostyle{mcoltreenonamehypergroup} style is like the +% \glostyle{mcoltreenonamegroup} % style, but has a set of links to the groups at the % start of the glossary. % \begin{macrocode} -\newglossarystyle{treenonamehypergroup}{% +\newglossarystyle{mcoltreenonamehypergroup}{% % \end{macrocode} -% Base it on the glostyle{treenoname} style: +% Base it on the glostyle{mcoltreenoname} style: % \begin{macrocode} - \glossarystyle{treenoname}% + \setglossarystyle{mcoltreenoname}% % \end{macrocode} % Put navigation links to the groups at the start of the % \env{theglossary} environment: @@ -14989,190 +16154,35 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{macro}{\glssetwidest} -% \cs{glssetwidest}\oarg{level}\marg{text} sets the widest -% text for the given level. It is used by the -% \glostyle{alttree} glossary styles to determine the -% indentation of each level. +%\begin{style}{mcolalttree} +% Multi-column index style. Same as the \glostyle{alttree}, but puts the +% glossary in multiple columns. % \begin{macrocode} -\newcommand*{\glssetwidest}[2][0]{% - \expandafter\def\csname @glswidestname\romannumeral#1\endcsname{% - #2}% -} +\newglossarystyle{mcolalttree}{% + \setglossarystyle{alttree}% + \renewenvironment{theglossary}% + {% % \end{macrocode} -%\end{macro} -%\begin{macro}{\@glswidestname} -% Initialise \cs{@glswidestname}. +%\changes{3.05}{2013-04-21}{replaced `2' with \cs{glsmcols}} % \begin{macrocode} -\newcommand*{\@glswidestname}{} -% \end{macrocode} -%\end{macro} -% -%\begin{style}{alttree} -% The \glostyle{alttree} glossary style -% is similar in style to the \glostyle{tree} style, but -% the indentation is obtained from the width of -% \cs{@glswidestname} which is set using \cs{glssetwidest}. -% \begin{macrocode} -\newglossarystyle{alttree}{% -% \end{macrocode} -% Redefine \env{theglossary} environment. -% \begin{macrocode} - \renewenvironment{theglossary}% - {\def\@gls@prevlevel{-1}% - \mbox{}\par}% - {\par}% -% \end{macrocode} -% Set the header and group headers to nothing. -% \begin{macrocode} - \renewcommand*{\glossaryheader}{}% - \renewcommand*{\glsgroupheading}[1]{}% -% \end{macrocode} -% Redefine the way that the level~0 entries are displayed. -% \begin{macrocode} - \renewcommand{\glossaryentryfield}[5]{% -% \end{macrocode} -% If the level hasn't changed, keep the same settings, otherwise -% change \cs{glstreeindent} accordingly. -% \begin{macrocode} - \ifnum\@gls@prevlevel=0\relax - \else -% \end{macrocode} -% Find out how big the indentation should be by measuring the -% widest entry. -% \begin{macrocode} - \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}% -% \end{macrocode} -% Set the hangindent and paragraph indent. -% \begin{macrocode} - \hangindent\glstreeindent - \parindent\glstreeindent - \fi -% \end{macrocode} -% Put the name to the left of the paragraph block. -% \begin{macrocode} - \makebox[0pt][r]{\makebox[\glstreeindent][l]{% - \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}% -% \end{macrocode} -% If the symbol is missing, ignore it, otherwise put it in -% brackets. -% \begin{macrocode} - \ifx\relax##4\relax - \else - (##4)\space - \fi -% \end{macrocode} -% Do the description followed by the description terminator and -% location list. -% \begin{macrocode} - ##3\glspostdescription \space ##5\par -% \end{macrocode} -% Set the previous level to 0. -% \begin{macrocode} - \def\@gls@prevlevel{0}% - }% -% \end{macrocode} -% Redefine the way sub-entries are displayed. -% \begin{macrocode} - \renewcommand{\glossarysubentryfield}[6]{% -% \end{macrocode} -% Increment and display the sub-entry counter if this is a level~1 -% entry and the sub-entry counter is in use. -% \begin{macrocode} - \ifnum##1=1\relax - \glssubentryitem{##2}% - \fi -% \end{macrocode} -% If the level hasn't changed, keep the same settings, otherwise -% adjust \cs{glstreeindent} accordingly. -% \begin{macrocode} - \ifnum\@gls@prevlevel=##1\relax - \else -% \end{macrocode} -% Compute the widest entry for this level, or for level~0 if not -% defined for this level. Store in \cs{gls@tmplen} -% \begin{macrocode} - \@ifundefined{@glswidestname\romannumeral##1}{% - \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{% - \settowidth{\gls@tmplen}{\textbf{% - \csname @glswidestname\romannumeral##1\endcsname\space}}}% -% \end{macrocode} -% Determine if going up or down a level -% \begin{macrocode} - \ifnum\@gls@prevlevel<##1\relax -% \end{macrocode} -% Depth has increased, so add the width of the widest entry to -% \cs{glstreeindent}. -% \begin{macrocode} - \setlength\glstreeindent\gls@tmplen - \addtolength\glstreeindent\parindent - \parindent\glstreeindent - \else -% \end{macrocode} -% Depth has decreased, so subtract width of the widest entry -% from the previous level to \cs{glstreeindent}. First -% determine the width of the widest entry for the previous level -% and store in \cs{glstreeindent}. -% \begin{macrocode} - \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% - \settowidth{\glstreeindent}{\textbf{% - \@glswidestname\space}}}{% - \settowidth{\glstreeindent}{\textbf{% - \csname @glswidestname\romannumeral\@gls@prevlevel - \endcsname\space}}}% -% \end{macrocode} -% Subtract this length from the previous level's paragraph indent -% and set to \cs{glstreeindent}. -% \begin{macrocode} - \addtolength\parindent{-\glstreeindent}% - \setlength\glstreeindent\parindent - \fi - \fi -% \end{macrocode} -% Set the hanging indentation. -% \begin{macrocode} - \hangindent\glstreeindent -% \end{macrocode} -% Put the name to the left of the paragraph block -% \begin{macrocode} - \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% - \textbf{\glstarget{##2}{##3}}}}% -% \end{macrocode} -% If the symbol is missing, ignore it, otherwise put it in -% brackets. -% \begin{macrocode} - \ifx##5\relax\relax - \else - (##5)\space - \fi -% \end{macrocode} -% Do the description followed by the description terminator and -% location list. -% \begin{macrocode} - ##4\glspostdescription\space ##6\par -% \end{macrocode} -% Set the previous level macro to the current level. -% \begin{macrocode} - \def\@gls@prevlevel{##1}% + \begin{multicols}{\glsmcols} + \def\@gls@prevlevel{-1}% + \mbox{}\par }% -% \end{macrocode} -% Vertical gap between groups is the same as that used by indices: -%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} -% \begin{macrocode} - \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% + {\par\end{multicols}}% } % \end{macrocode} %\end{style} % -%\begin{style}{alttreegroup} -% Like the \glostyle{alttree} style but the glossary groups have +%\begin{style}{mcolalttreegroup} +% Like the \glostyle{mcolalttree} style but the glossary groups have % headings. % \begin{macrocode} -\newglossarystyle{alttreegroup}{% +\newglossarystyle{mcolalttreegroup}{% % \end{macrocode} -% Base it on the glostyle{alttree} style: +% Base it on the glostyle{mcolalttree} style: % \begin{macrocode} - \glossarystyle{alttree}% + \setglossarystyle{mcolalttree}% % \end{macrocode} % Give each group a heading. % \begin{macrocode} @@ -15185,16 +16195,16 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{style} % -%\begin{style}{alttreehypergroup} -% The \glostyle{alttreehypergroup} style is like the -% \glostyle{alttreegroup} style, but has a set of links to the +%\begin{style}{mcolalttreehypergroup} +% The \glostyle{mcolalttreehypergroup} style is like the +% \glostyle{mcolalttreegroup} style, but has a set of links to the % groups at the start of the glossary. % \begin{macrocode} -\newglossarystyle{alttreehypergroup}{% +\newglossarystyle{mcolalttreehypergroup}{% % \end{macrocode} -% Base it on the glostyle{alttree} style: +% Base it on the glostyle{mcolalttree} style: % \begin{macrocode} - \glossarystyle{alttree}% + \setglossarystyle{mcolalttree}% % \end{macrocode} % Put the navigation links in the header % \begin{macrocode} @@ -15216,218 +16226,1720 @@ false,nolabel,autolabel}[nolabel]{% \indexspace}} % \end{macrocode} %\end{style} -% + + %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -%<*glossaries-compatible-207.sty> +%<*glossary-super.sty> % \end{macrocode} %\fi -%\section{glossaries-compatible-207} -% Provides compatibility with version 2.07 and below. This uses -% original \sty{glossaries} xindy and makeindex formatting, so can -% be used with old documents that had customized style files, but -% hyperlinks may not work properly. +% \subsection{Glossary Styles using supertabular environment (glossary-super package)} +% The glossary styles defined in the \isty{glossary-super} package +% use the \env{supertabular} environment. % \begin{macrocode} -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-compatible-207}[2011/04/02 v1.0 (NLCT)] +\ProvidesPackage{glossary-super}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} -%\begin{macro}{\GlsAddXdyAttribute} -% Adds an attribute in old format. +% Requires the \isty{supertabular} package: % \begin{macrocode} -\ifglsxindy - \renewcommand*\GlsAddXdyAttribute[1]{% - \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}% - \expandafter\toks@\expandafter{\@xdylocref}% - \edef\@xdylocref{\the\toks@ ^^J% - (markup-locref - :open \string"\string~n\string\setentrycounter - {\noexpand\glscounter}% - \expandafter\string\csname#1\endcsname - \expandafter\@gobble\string\{\string" ^^J - :close \string"\expandafter\@gobble\string\}\string" ^^J - :attr \string"#1\string")}} +\RequirePackage{supertabular} % \end{macrocode} -% Only has an effect before \ics{writeist}: +%\begin{macro}{\glsdescwidth} +% This is a length that governs the width of the description column. +% This may already have been defined if \isty{glossary-long} +% has been loaded.\changes{2.01}{2009 May 30}{changed \cs{linewidth} +% to \cs{hsize}} % \begin{macrocode} -\fi +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} % \end{macrocode} %\end{macro} -%\begin{macro}{\GlsAddXdyCounters} +% +%\begin{macro}{\glspagelistwidth} +% This is a length that governs the width of the page list column. +% This may already have been defined if \isty{glossary-long} +% has been loaded.\changes{2.01}{2009 May 30}{changed \cs{linewidth} +% to \cs{hsize}} % \begin{macrocode} -\renewcommand*\GlsAddXdyCounters[1]{% - \GlossariesWarning{\string\GlsAddXdyCounters\space not available - in compatibility mode.}% -} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} % \end{macrocode} %\end{macro} -% Add predefined attributes +% +%\begin{style}{super} +% The \glostyle{super} glossary style uses the +% \env{supertabular} environment +% (it uses lengths defined in the \isty{glossary-long} package.) % \begin{macrocode} - \GlsAddXdyAttribute{glsnumberformat} - \GlsAddXdyAttribute{textrm} - \GlsAddXdyAttribute{textsf} - \GlsAddXdyAttribute{texttt} - \GlsAddXdyAttribute{textbf} - \GlsAddXdyAttribute{textmd} - \GlsAddXdyAttribute{textit} - \GlsAddXdyAttribute{textup} - \GlsAddXdyAttribute{textsl} - \GlsAddXdyAttribute{textsc} - \GlsAddXdyAttribute{emph} - \GlsAddXdyAttribute{glshypernumber} - \GlsAddXdyAttribute{hyperrm} - \GlsAddXdyAttribute{hypersf} - \GlsAddXdyAttribute{hypertt} - \GlsAddXdyAttribute{hyperbf} - \GlsAddXdyAttribute{hypermd} - \GlsAddXdyAttribute{hyperit} - \GlsAddXdyAttribute{hyperup} - \GlsAddXdyAttribute{hypersl} - \GlsAddXdyAttribute{hypersc} - \GlsAddXdyAttribute{hyperemph} +\newglossarystyle{super}{% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}}}% + {\end{supertabular}}% +% \end{macrocode} +% Do nothing at the start of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries put in a row (name in first column, +% description and page list in second column): +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline + }% +% \end{macrocode} +% Sub entries put in a row (no name, description and page list +% in second column): +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glosentrydesc{##2}\glspostdescription\space + ##3\tabularnewline + }% +% \end{macrocode} +% Blank row between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & \tabularnewline\fi}% +} % \end{macrocode} +%\end{style} % -%\begin{macro}{\GlsAddXdyLocation} -% Restore v2.07 definition: +%\begin{style}{superborder} +% The \glostyle{superborder} style is like the above, but with +% horizontal and vertical lines: % \begin{macrocode} -\ifglsxindy - \renewcommand*{\GlsAddXdyLocation}[2]{% - \edef\@xdyuserlocationdefs{% - \@xdyuserlocationdefs ^^J% - (define-location-class \string"#1\string"^^J\space\space - \space(#2)) - }% - \edef\@xdyuserlocationnames{% - \@xdyuserlocationnames^^J\space\space\space - \string"#1\string"}% - } -\fi +\newglossarystyle{superborder}{% % \end{macrocode} -%\end{macro} +% Base it on the glostyle{super} style: +% \begin{macrocode} + \setglossarystyle{super}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} % -%\begin{macro}{\@do@wrglossary} +%\begin{style}{superheader} +% The \glostyle{superheader} style is like the +% \glostyle{super} style, but with a header: % \begin{macrocode} -\renewcommand{\@do@wrglossary}[1]{% +\newglossarystyle{superheader}{% % \end{macrocode} -% Determine whether to use \app{xindy} or \app{makeindex} -% syntax +% Base it on the glostyle{super} style: % \begin{macrocode} -\ifglsxindy + \setglossarystyle{super}% % \end{macrocode} -% Need to determine if the formatting information starts with -% a ( or ) indicating a range. +% Put the glossary in a \env{supertabular} environment with +% two columns, a header and no tail: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} % \begin{macrocode} - \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil - \def\@glo@range{}% - \expandafter\if\@glo@prefix(\relax - \def\@glo@range{:open-range}% - \else - \expandafter\if\@glo@prefix)\relax - \def\@glo@range{:close-range}% - \fi - \fi +\renewenvironment{theglossary}% + {\tablehead{\bfseries \entryname & + \bfseries\descriptionname\tabularnewline}% + \tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}}}% + {\end{supertabular}}% +} % \end{macrocode} -% Get the location and escape any special characters +%\end{style} +% +%\begin{style}{superheaderborder} +% The \glostyle{superheaderborder} style is like +% the \glostyle{super} style but with a header and border: % \begin{macrocode} - \protected@edef\@glslocref{\theglsentrycounter}% - \@gls@checkmkidxchars\@glslocref +\newglossarystyle{superheaderborder}{% % \end{macrocode} -% Write to the glossary file using \app{xindy} syntax. +% Base it on the glostyle{super} style: % \begin{macrocode} - \glossary[\csname glo@#1@type\endcsname]{% - (indexentry :tkey (\csname glo@#1@index\endcsname) - :locref \string"\@glslocref\string" % - :attr \string"\@glo@suffix\string" \@glo@range - ) + \setglossarystyle{super}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns, a header and horizontal lines above and below the +% table: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries \entryname & + \bfseries \descriptionname\tabularnewline\hline}% + \tabletail{\hline} + \begin{supertabular}{|l|p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{super3col} +% The \glostyle{super3col} style is like the \glostyle{super} +% style, but with 3 columns: +% \begin{macrocode} +\newglossarystyle{super3col}{% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{supertabular}}% +% \end{macrocode} +% Do nothing at the start of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries on a row (name in first column, +% description in second column, page list in last column): +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & ##2\tabularnewline }% -\else % \end{macrocode} -% Convert the format information into the format required for -% \app{makeindex} +% Sub entries on a row (no name, description in second column, +% page list in last column): % \begin{macrocode} - \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% % \end{macrocode} -% Write to the glossary file using \app{makeindex} syntax. +% Blank row between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} % \begin{macrocode} - \glossary[\csname glo@#1@type\endcsname]{% - \string\glossaryentry{\csname glo@#1@index\endcsname - \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}% -\fi + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & &\tabularnewline\fi}% } % \end{macrocode} -%\end{macro} -%\begin{macro}{\@set@glo@numformat} -% Only had 3 arguments in v2.07 +%\end{style} +% +%\begin{style}{super3colborder} +% The \glostyle{super3colborder} style is like the +% \glostyle{super3col} style, but with a border: % \begin{macrocode} -\def\@set@glo@numformat#1#2#3{% - \expandafter\@glo@check@mkidxrangechar#3\@nil - \protected@edef#1{% - \@glo@prefix setentrycounter[]{#2}% - \expandafter\string\csname\@glo@suffix\endcsname - }% - \@gls@checkmkidxchars#1% +\newglossarystyle{super3colborder}{% +% \end{macrocode} +% Base it on the glostyle{super3col} style: +% \begin{macrocode} + \setglossarystyle{super3col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{supertabular}}% } % \end{macrocode} -%\end{macro} +%\end{style} % -%\begin{macro}{\writeist} -% Redefine \cs{writeist} back to the way it was in v2.07, but change -% \cs{istfile} to \cs{glswrite}. +%\begin{style}{super3colheader} +% The \glostyle{super3colheader} style is like +% the \glostyle{super3col} style but with a header row: % \begin{macrocode} -\ifglsxindy - \def\writeist{% - \openout\glswrite=\istfilename - \write\glswrite{;; xindy style file created by the glossaries - package in compatible-2.07 mode}% - \write\glswrite{;; for document '\jobname' on - \the\year-\the\month-\the\day}% - \write\glswrite{^^J; required styles^^J} - \@for\@xdystyle:=\@xdyrequiredstyles\do{% - \ifx\@xdystyle\@empty - \else - \protected@write\glswrite{}{(require - \string"\@xdystyle.xdy\string")}% - \fi - }% - \write\glswrite{^^J% - ; list of allowed attributes (number formats)^^J}% - \write\glswrite{(define-attributes ((\@xdyattributes)))}% - \write\glswrite{^^J; user defined alphabets^^J}% - \write\glswrite{\@xdyuseralphabets}% - \write\glswrite{^^J; location class definitions^^J}% - \protected@edef\@gls@roman{\@roman{0\string" - \string"roman-numbers-lowercase\string" :sep \string"}}% - \@onelevel@sanitize\@gls@roman - \edef\@tmp{\string" \string"roman-numbers-lowercase\string" - :sep \string"}% - \@onelevel@sanitize\@tmp - \ifx\@tmp\@gls@roman - \write\glswrite{(define-location-class - \string"roman-page-numbers\string"^^J\space\space\space - (\string"roman-numbers-lowercase\string") - :min-range-length \@glsminrange)}% - \else - \write\glswrite{(define-location-class - \string"roman-page-numbers\string"^^J\space\space\space - (:sep "\@gls@roman") - :min-range-length \@glsminrange)}% - \fi - \write\glswrite{(define-location-class - \string"Roman-page-numbers\string"^^J\space\space\space - (\string"roman-numbers-uppercase\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"arabic-page-numbers\string"^^J\space\space\space - (\string"arabic-numbers\string") - :min-range-length \@glsminrange)}% - \write\glswrite{(define-location-class - \string"alpha-page-numbers\string"^^J\space\space\space - (\string"alpha\string") - :min-range-length \@glsminrange)}% +\newglossarystyle{super3colheader}{% +% \end{macrocode} +% Base it on the glostyle{super3col} style: +% \begin{macrocode} + \setglossarystyle{super3col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns, a header and no tail: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{super3colheaderborder} +% The \glostyle{super3colheaderborder} style is like +% the \glostyle{super3col} style but with a header and border: +% \begin{macrocode} +\newglossarystyle{super3colheaderborder}{% +% \end{macrocode} +% Base it on the glostyle{super3colborder} style: +% \begin{macrocode} + \setglossarystyle{super3colborder}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns, a header with horizontal lines and a horizontal +% line in the tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|p{\glsdescwidth}|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{super4col} +% The \glostyle{super4col} glossary style has four columns, +% where the third column contains the value of the +% corresponding \gloskey{symbol} key used when that entry +% was defined. +% \begin{macrocode} +\newglossarystyle{super4col}{% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{llll}}{% + \end{supertabular}}% +% \end{macrocode} +% Do nothing at the start of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries on a row with the name in the first +% column, description in second column, symbol in third column +% and page list in last column: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & ##3\tabularnewline + }% +% \end{macrocode} +% Sub entries on a row with no name, the description in the second +% column, symbol in third column and page list in last column: +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% +% \end{macrocode} +% Blank row between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{% + \ifglsnogroupskip\else & & &\tabularnewline\fi}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{super4colheader} +% The \glostyle{super4colheader} style is like +% the \glostyle{super4col} but with a header row. +% \begin{macrocode} +\newglossarystyle{super4colheader}{% +% \end{macrocode} +% Base it on the glostyle{super4col} style: +% \begin{macrocode} + \setglossarystyle{super4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns, a header and no tail: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}% + \tabletail{}% + \begin{supertabular}{llll}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{super4colborder} +% The \glostyle{super4colborder} style is like +% the \glostyle{super4col} but with a border. +% \begin{macrocode} +\newglossarystyle{super4colborder}{% +% \end{macrocode} +% Base it on the glostyle{super4col} style: +% \begin{macrocode} + \setglossarystyle{super4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|l|l|l|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{super4colheaderborder} +% The \glostyle{super4colheaderborder} style is like +% the \glostyle{super4col} but with a header and border. +% \begin{macrocode} +\newglossarystyle{super4colheaderborder}{% +% \end{macrocode} +% Base it on the glostyle{super4col} style: +% \begin{macrocode} + \setglossarystyle{super4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and a header bordered by horizontal lines and +% a horizontal line in the tail: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|l|l|l|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuper4col} +% The \glostyle{altsuper4col} glossary style is like +% \glostyle{super4col} but has provision for multiline descriptions. +% \begin{macrocode} +\newglossarystyle{altsuper4col}{% +% \end{macrocode} +% Base it on the glostyle{super4col} style: +% \begin{macrocode} + \setglossarystyle{super4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuper4colheader} +% The \glostyle{altsuper4colheader} style is like +% the \glostyle{altsuper4col} but with a header row. +% \begin{macrocode} +\newglossarystyle{altsuper4colheader}{% +% \end{macrocode} +% Base it on the glostyle{super4colheader} style: +% \begin{macrocode} + \setglossarystyle{super4colheader}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns, a header and no tail: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuper4colborder} +% The \glostyle{altsuper4colborder} style is like +% the \glostyle{altsuper4col} but with a border. +% \begin{macrocode} +\newglossarystyle{altsuper4colborder}{% +% \end{macrocode} +% Base it on the glostyle{super4colborder} style: +% \begin{macrocode} + \setglossarystyle{super4colborder}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}% + {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuper4colheaderborder} +% The \glostyle{altsuper4colheaderborder} style is like +% the \glostyle{altsuper4col} but with a header and border. +% \begin{macrocode} +\newglossarystyle{altsuper4colheaderborder}{% +% \end{macrocode} +% Base it on the glostyle{super4colheaderborder} style: +% \begin{macrocode} + \setglossarystyle{super4colheaderborder}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and a header bordered by horizontal lines and +% a horizontal line in the tail: +%\changes{3.13a}{2013-11-05}{switched to \cs{tabularnewline}} +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname & + \bfseries\descriptionname & + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}% + {|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-superragged.sty> +% \end{macrocode} +%\fi +% \subsection{Glossary Styles using supertabular environment (glossary-superragged package)} +% The glossary styles defined in the \isty{glossary-superragged} +% package use the \env{supertabular} environment. These styles +% are like those provided by the \isty{glossary-super} package, +% except that the multiline columns have ragged right justification. +% \begin{macrocode} +\ProvidesPackage{glossary-superragged}[2013/11/14 v4.0 (NLCT)] +% \end{macrocode} +% Requires the \isty{array} package: +% \begin{macrocode} +\RequirePackage{array} +% \end{macrocode} +% Requires the \isty{supertabular} package: +% \begin{macrocode} +\RequirePackage{supertabular} +% \end{macrocode} +%\begin{macro}{\glsdescwidth} +% This is a length that governs the width of the description column. +% This may already have been defined. +% \begin{macrocode} +\@ifundefined{glsdescwidth}{% + \newlength\glsdescwidth + \setlength{\glsdescwidth}{0.6\hsize} +}{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glspagelistwidth} +% This is a length that governs the width of the page list column. +% This may already have been defined. +% \begin{macrocode} +\@ifundefined{glspagelistwidth}{% + \newlength\glspagelistwidth + \setlength{\glspagelistwidth}{0.1\hsize} +}{} +% \end{macrocode} +%\end{macro} +% +%\begin{style}{superragged} +% The \glostyle{superragged} glossary style uses the +% \env{supertabular} environment. +% \begin{macrocode} +\newglossarystyle{superragged}{% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{supertabular}}% +% \end{macrocode} +% Do nothing at the start of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries put in a row (name in first column, +% description and page list in second column): +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1}\glspostdescription\space ##2% + \tabularnewline + }% +% \end{macrocode} +% Sub entries put in a row (no name, description and page list +% in second column): +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space + ##3% + \tabularnewline + }% +% \end{macrocode} +% Blank row between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & \tabularnewline\fi}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superraggedborder} +% The \glostyle{superraggedborder} style is like the above, but with +% horizontal and vertical lines: +% \begin{macrocode} +\newglossarystyle{superraggedborder}{% +% \end{macrocode} +% Base it on the glostyle{superragged} style: +% \begin{macrocode} + \setglossarystyle{superragged}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superraggedheader} +% The \glostyle{superraggedheader} style is like the +% \glostyle{super} style, but with a header: +% \begin{macrocode} +\newglossarystyle{superraggedheader}{% +% \end{macrocode} +% Base it on the glostyle{superragged} style: +% \begin{macrocode} + \setglossarystyle{superragged}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns, a header and no tail: +% \begin{macrocode} +\renewenvironment{theglossary}% + {\tablehead{\bfseries \entryname & \bfseries \descriptionname + \tabularnewline}% + \tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superraggedheaderborder} +% The \glostyle{superraggedheaderborder} style is like +% the \glostyle{superragged} style but with a header and border: +% \begin{macrocode} +\newglossarystyle{superraggedheaderborder}{% +% \end{macrocode} +% Base it on the glostyle{super} style: +% \begin{macrocode} + \setglossarystyle{superragged}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% two columns, a header and horizontal lines above and below the +% table: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline\bfseries \entryname & + \bfseries \descriptionname\tabularnewline\hline}% + \tabletail{\hline} + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superragged3col} +% The \glostyle{superragged3col} style is like the \glostyle{superragged} +% style, but with 3 columns: +% \begin{macrocode} +\newglossarystyle{superragged3col}{% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +% \end{macrocode} +% Do nothing at the start of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries on a row (name in first column, +% description in second column, page list in last column): +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + ##2\tabularnewline + }% +% \end{macrocode} +% Sub entries on a row (no name, description in second column, +% page list in last column): +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + ##3\tabularnewline + }% +% \end{macrocode} +% Blank row between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & &\tabularnewline\fi}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superragged3colborder} +% The \glostyle{superragged3colborder} style is like the +% \glostyle{superragged3col} style, but with a border: +% \begin{macrocode} +\newglossarystyle{superragged3colborder}{% +% \end{macrocode} +% Base it on the glostyle{superragged3col} style: +% \begin{macrocode} + \setglossarystyle{superragged3col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superragged3colheader} +% The \glostyle{superragged3colheader} style is like +% the \glostyle{superragged3col} style but with a header row: +% \begin{macrocode} +\newglossarystyle{superragged3colheader}{% +% \end{macrocode} +% Base it on the glostyle{superragged3col} style: +% \begin{macrocode} + \setglossarystyle{superragged3col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns, a header and no tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{superraggedright3colheaderborder} +% The \glostyle{superragged3colheaderborder} style is like +% the \glostyle{superragged3col} style but with a header and border: +% \begin{macrocode} +\newglossarystyle{superragged3colheaderborder}{% +% \end{macrocode} +% Base it on the glostyle{superragged3colborder} style: +% \begin{macrocode} + \setglossarystyle{superragged3colborder}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% three columns, a header with horizontal lines and a horizontal +% line in the tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname&\bfseries\descriptionname& + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}{|l|>{\raggedright}p{\glsdescwidth}|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuperragged4col} +% The \glostyle{altsuperragged4col} glossary style is like +% \glostyle{altsuper4col} style in the \isty{glossary-super} +% package but uses ragged right formatting in the description +% and page list columns. +% \begin{macrocode} +\newglossarystyle{altsuperragged4col}{% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and no head or tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +% \end{macrocode} +% Do nothing at the start of the table: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries on a row with the name in the first +% column, description in second column, symbol in third column +% and page list in last column: +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & + \glossentrydesc{##1} & + \glossentrysymbol{##1} & ##2\tabularnewline + }% +% \end{macrocode} +% Sub entries on a row with no name, the description in the second +% column, symbol in third column and page list in last column: +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\glossentrydesc{##2} & + \glossentrysymbol{##2} & ##3\tabularnewline + }% +% \end{macrocode} +% Blank row between groups: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else & & &\tabularnewline\fi}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuperragged4colheader} +% The \glostyle{altsuperragged4colheader} style is like +% the \glostyle{altsuperragged4col} style but with a header row. +% \begin{macrocode} +\newglossarystyle{altsuperragged4colheader}{% +% \end{macrocode} +% Base it on the glostyle{altsuperragged4col} style: +% \begin{macrocode} + \setglossarystyle{altsuperragged4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns, a header and no tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\bfseries\entryname&\bfseries\descriptionname& + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline}\tabletail{}% + \begin{supertabular}{l>{\raggedright}p{\glsdescwidth}l% + >{\raggedright}p{\glspagelistwidth}}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuperragged4colborder} +% The \glostyle{altsuperragged4colborder} style is like +% the \glostyle{altsuperragged4col} style but with a border. +% \begin{macrocode} +\newglossarystyle{altsuperragged4colborder}{% +% \end{macrocode} +% Base it on the glostyle{altsuperragged4col} style: +% \begin{macrocode} + \setglossarystyle{altsuper4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and a horizontal line in the head and tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline}\tabletail{\hline}% + \begin{supertabular}% + {|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{altsuperragged4colheaderborder} +% The \glostyle{altsuperragged4colheaderborder} style is like +% the \glostyle{altsuperragged4col} style but with a header and border. +% \begin{macrocode} +\newglossarystyle{altsuperragged4colheaderborder}{% +% \end{macrocode} +% Base it on the glostyle{altsuperragged4col} style: +% \begin{macrocode} + \setglossarystyle{altsuperragged4col}% +% \end{macrocode} +% Put the glossary in a \env{supertabular} environment with +% four columns and a header bordered by horizontal lines and +% a horizontal line in the tail: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\tablehead{\hline + \bfseries\entryname & + \bfseries\descriptionname & + \bfseries\symbolname & + \bfseries\pagelistname\tabularnewline\hline}% + \tabletail{\hline}% + \begin{supertabular}% + {|l|>{\raggedright}p{\glsdescwidth}|l|% + >{\raggedright}p{\glspagelistwidth}|}}% + {\end{supertabular}}% +} +% \end{macrocode} +%\end{style} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossary-tree.sty> +% \end{macrocode} +%\fi +%\subsection{Tree Styles (glossary-tree.sty)} +% The \isty{glossary-tree} style file defines glossary styles +% that have a tree-like structure. These are designed for +% hierarchical glossaries. +% \begin{macrocode} +\ProvidesPackage{glossary-tree}[2013/11/14 v4.0 (NLCT)] +% \end{macrocode} +% +%\begin{style}{index} +% The \glostyle{index} glossary style +% is similar in style to the way indices are usually typeset +% using \cs{item}, \cs{subitem} and \cs{subsubitem}. +% The entry name is +% set in bold. If an entry has a symbol, it is placed in +% brackets after the name. Then the description is displayed, +% followed by the number list. This style allows up to three +% levels. +% \begin{macrocode} +\newglossarystyle{index}{% +% \end{macrocode} +% Set the paragraph indentation and skip and define \ics{item} +% to be the same as that used by \env{theindex}: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}% + \let\item\@idxitem}% +% \end{macrocode} +%\changes{3.08a}{2013-09-28}{added paragraph break at end of environment} +% \begin{macrocode} + {\par}% +% \end{macrocode} +% Do nothing at the start of the environment: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headers: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entry starts a new item with the name in bold +% followed by the symbol in brackets (if it exists), the description +% and the page list. +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} +% \begin{macrocode} + \renewcommand*{\glossentry}[2]{% + \item\glsentryitem{##1}\textbf{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \space \glossentrydesc{##1}\glspostdescription\space ##2% + }% +% \end{macrocode} +% Sub entries: level 1 entries use \ics{subitem}, levels greater +% than~1 use \ics{subsubitem}. The level ("##1") shouldn't be 0, +% as that's catered by \cs{glossentry}, but for completeness, +% if the level is 0, \ics{item} is used. The name is put in bold, +% followed by the symbol in brackets (if it exists), the description +% and the page list. +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + \ifcase##1\relax + % level 0 + \item + \or + % level 1 + \subitem + \glssubentryitem{##2}% + \else + % all other levels + \subsubitem + \fi + \textbf{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \space\glossentrydesc{##2}\glspostdescription\space ##3% + }% +% \end{macrocode} +% Vertical gap between groups is the same as that used by indices: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} +% \end{macrocode} +%\end{style} +% +%\begin{style}{indexgroup} +% The \glostyle{indexgroup} style is like the \glostyle{index} +% style but has headings. +% \begin{macrocode} +\newglossarystyle{indexgroup}{% +% \end{macrocode} +% Base it on the glostyle{index} style: +% \begin{macrocode} + \setglossarystyle{index}% +% \end{macrocode} +% Add a heading for each group. This puts the group's title in +% bold followed by a vertical gap. +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{% + \item\textbf{\glsgetgrouptitle{##1}}\indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{indexhypergroup} +% The \glostyle{indexhypergroup} style is like the +% \glostyle{indexgroup} style but has hyper navigation. +% \begin{macrocode} +\newglossarystyle{indexhypergroup}{% +% \end{macrocode} +% Base it on the glostyle{index} style: +% \begin{macrocode} + \setglossarystyle{index}% +% \end{macrocode} +% Put navigation links to the groups at the start of the glossary: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \item\textbf{\glsnavigation}\indexspace}% +% \end{macrocode} +% Add a heading for each group (with a target). The group's title is +% in bold followed by a vertical gap. +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{% + \item\textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}% + \indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{tree} +% The \glostyle{tree} glossary style +% is similar in style to the \glostyle{index} style, but +% can have arbitrary levels. +% \begin{macrocode} +\newglossarystyle{tree}{% +% \end{macrocode} +% Set the paragraph indentation and skip: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}}% + {}% +% \end{macrocode} +% Do nothing at the start of the \env{theglossary} environment: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries: name in bold, followed by symbol in +% brackets (if it exists), the description and the page list: +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \space\glossentrydesc{##1}\glspostdescription\space##2\par + }% +% \end{macrocode} +% Sub entries: level \meta{n} is indented by \meta{n} times +% \ics{glstreeindent}. The name is in bold, followed by the +% symbol in brackets (if it exists), the description and the +% page list. +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \textbf{\glstarget{##2}{\glossentryname{##2}}}% + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% + \space\glossentrydesc{##2}\glspostdescription\space ##3\par + }% +% \end{macrocode} +% Vertical gap between groups is the same as that used by +% indices: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}} +% \end{macrocode} +%\end{style} +% +%\begin{style}{treegroup} +% Like the \glostyle{tree} style but the glossary groups have +% headings. +% \begin{macrocode} +\newglossarystyle{treegroup}{% +% \end{macrocode} +% Base it on the glostyle{tree} style: +% \begin{macrocode} + \setglossarystyle{tree}% +% \end{macrocode} +% Each group has a heading (in bold) followed by a vertical gap): +% \begin{macrocode} + \renewcommand{\glsgroupheading}[1]{\par + \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{treehypergroup} +% The \glostyle{treehypergroup} style is like the \glostyle{treegroup} +% style, but has a set of links to the groups at the +% start of the glossary. +% \begin{macrocode} +\newglossarystyle{treehypergroup}{% +% \end{macrocode} +% Base it on the glostyle{tree} style: +% \begin{macrocode} + \setglossarystyle{tree}% +% \end{macrocode} +% Put navigation links to the groups at the start of the +% \env{theglossary} environment: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \par\noindent\textbf{\glsnavigation}\par\indexspace}% +% \end{macrocode} +% Each group has a heading (in bold with a target) followed by a +% vertical gap): +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{macro}{\glstreeindent} +% Length governing left indent for each level of the \glostyle{tree} +% style. +% \begin{macrocode} +\newlength\glstreeindent +\setlength{\glstreeindent}{10pt} +% \end{macrocode} +%\end{macro} +% +%\begin{style}{treenoname} +% The \glostyle{treenoname} glossary style +% is like the \glostyle{tree} style, but +% doesn't print the name or symbol for sub-levels. +% \begin{macrocode} +\newglossarystyle{treenoname}{% +% \end{macrocode} +% Set the paragraph indentation and skip: +% \begin{macrocode} + \renewenvironment{theglossary}% + {\setlength{\parindent}{0pt}% + \setlength{\parskip}{0pt plus 0.3pt}}% + {}% +% \end{macrocode} +% No header: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% +% \end{macrocode} +% No group headings: +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Main (level 0) entries: the name is in bold, followed by the +% symbol in brackets (if it exists), the description and the +% page list. +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{\glossentryname{##1}}}% + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% + \space\glossentrydesc{##1}\glspostdescription\space##2\par + }% +% \end{macrocode} +% Sub entries: level \meta{n} is indented by \meta{n} times +% \ics{glstreeindent}. The name and symbol are omitted. The +% description followed by the page list are displayed. +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstarget{##2}{\strut}% + \glossentrydesc{##2}\glspostdescription\space##3\par + }% +% \end{macrocode} +% Vertical gap between groups is the same as that used by indices: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{treenonamegroup} +% Like the \glostyle{treenoname} style but the glossary groups have +% headings. +% \begin{macrocode} +\newglossarystyle{treenonamegroup}{% +% \end{macrocode} +% Base it on the glostyle{treenoname} style: +% \begin{macrocode} + \setglossarystyle{treenoname}% +% \end{macrocode} +% Give each group a heading: +% \begin{macrocode} + \renewcommand{\glsgroupheading}[1]{\par + \noindent\textbf{\glsgetgrouptitle{##1}}\par\indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{treenonamehypergroup} +% The \glostyle{treenonamehypergroup} style is like the \glostyle{treenonamegroup} +% style, but has a set of links to the groups at the +% start of the glossary. +% \begin{macrocode} +\newglossarystyle{treenonamehypergroup}{% +% \end{macrocode} +% Base it on the glostyle{treenoname} style: +% \begin{macrocode} + \setglossarystyle{treenoname}% +% \end{macrocode} +% Put navigation links to the groups at the start of the +% \env{theglossary} environment: +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \par\noindent\textbf{\glsnavigation}\par\indexspace}% +% \end{macrocode} +% Each group has a heading (in bold with a target) followed by a +% vertical gap): +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{% + \par\noindent + \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{macro}{\glssetwidest} +% \cs{glssetwidest}\oarg{level}\marg{text} sets the widest +% text for the given level. It is used by the +% \glostyle{alttree} glossary styles to determine the +% indentation of each level. +% \begin{macrocode} +\newcommand*{\glssetwidest}[2][0]{% + \expandafter\def\csname @glswidestname\romannumeral#1\endcsname{% + #2}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@glswidestname} +% Initialise \cs{@glswidestname}. +% \begin{macrocode} +\newcommand*{\@glswidestname}{} +% \end{macrocode} +%\end{macro} +% +%\begin{style}{alttree} +% The \glostyle{alttree} glossary style +% is similar in style to the \glostyle{tree} style, but +% the indentation is obtained from the width of +% \cs{@glswidestname} which is set using \cs{glssetwidest}. +% \begin{macrocode} +\newglossarystyle{alttree}{% +% \end{macrocode} +% Redefine \env{theglossary} environment. +% \begin{macrocode} + \renewenvironment{theglossary}% + {\def\@gls@prevlevel{-1}% + \mbox{}\par}% + {\par}% +% \end{macrocode} +% Set the header and group headers to nothing. +% \begin{macrocode} + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% +% \end{macrocode} +% Redefine the way that the level~0 entries are displayed. +%\changes{3.08a}{2013-09-28}{updated to use \cs{glossentry} and +%\cs{subglossentry}} +% \begin{macrocode} + \renewcommand{\glossentry}[2]{% +% \end{macrocode} +% If the level hasn't changed, keep the same settings, otherwise +% change \cs{glstreeindent} accordingly. +% \begin{macrocode} + \ifnum\@gls@prevlevel=0\relax + \else +% \end{macrocode} +% Find out how big the indentation should be by measuring the +% widest entry. +% \begin{macrocode} + \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}% +% \end{macrocode} +% Set the hangindent and paragraph indent. +% \begin{macrocode} + \hangindent\glstreeindent + \parindent\glstreeindent + \fi +% \end{macrocode} +% Put the name to the left of the paragraph block. +% \begin{macrocode} + \makebox[0pt][r]{\makebox[\glstreeindent][l]{% + \glsentryitem{##1}\textbf{\glstarget{##1}{\glossentryname{##1}}}}}% +% \end{macrocode} +% If the symbol is missing, ignore it, otherwise put it in +% brackets. +% \begin{macrocode} + \ifglshassymbol{##1}{\space(\glossentrysymbol{##1})}{}% +% \end{macrocode} +% Do the description followed by the description terminator and +% location list. +% \begin{macrocode} + \glossentrydesc{##1}\glspostdescription \space ##2\par +% \end{macrocode} +% Set the previous level to 0. +% \begin{macrocode} + \def\@gls@prevlevel{0}% + }% +% \end{macrocode} +% Redefine the way sub-entries are displayed. +% \begin{macrocode} + \renewcommand{\subglossentry}[3]{% +% \end{macrocode} +% Increment and display the sub-entry counter if this is a level~1 +% entry and the sub-entry counter is in use. +% \begin{macrocode} + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi +% \end{macrocode} +% If the level hasn't changed, keep the same settings, otherwise +% adjust \cs{glstreeindent} accordingly. +% \begin{macrocode} + \ifnum\@gls@prevlevel=##1\relax + \else +% \end{macrocode} +% Compute the widest entry for this level, or for level~0 if not +% defined for this level. Store in \cs{gls@tmplen} +% \begin{macrocode} + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{% + \settowidth{\gls@tmplen}{\textbf{% + \csname @glswidestname\romannumeral##1\endcsname\space}}}% +% \end{macrocode} +% Determine if going up or down a level +% \begin{macrocode} + \ifnum\@gls@prevlevel<##1\relax +% \end{macrocode} +% Depth has increased, so add the width of the widest entry to +% \cs{glstreeindent}. +% \begin{macrocode} + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else +% \end{macrocode} +% Depth has decreased, so subtract width of the widest entry +% from the previous level to \cs{glstreeindent}. First +% determine the width of the widest entry for the previous level +% and store in \cs{glstreeindent}. +% \begin{macrocode} + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\textbf{% + \@glswidestname\space}}}{% + \settowidth{\glstreeindent}{\textbf{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\space}}}% +% \end{macrocode} +% Subtract this length from the previous level's paragraph indent +% and set to \cs{glstreeindent}. +% \begin{macrocode} + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi + \fi +% \end{macrocode} +% Set the hanging indentation. +% \begin{macrocode} + \hangindent\glstreeindent +% \end{macrocode} +% Put the name to the left of the paragraph block +% \begin{macrocode} + \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% + \textbf{\glstarget{##2}{\glossentryname{##2}}}}}% +% \end{macrocode} +% If the symbol is missing, ignore it, otherwise put it in +% brackets. +% \begin{macrocode} + \ifglshassymbol{##2}{\space(\glossentrysymbol{##2})}{}% +% \end{macrocode} +% Do the description followed by the description terminator and +% location list. +% \begin{macrocode} + \glossentrydesc{##2}\glspostdescription\space ##3\par +% \end{macrocode} +% Set the previous level macro to the current level. +% \begin{macrocode} + \def\@gls@prevlevel{##1}% + }% +% \end{macrocode} +% Vertical gap between groups is the same as that used by indices: +%\changes{3.03}{2012/09/21}{added check for glsnogroupskip} +% \begin{macrocode} + \renewcommand*{\glsgroupskip}{\ifglsnogroupskip\else\indexspace\fi}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{alttreegroup} +% Like the \glostyle{alttree} style but the glossary groups have +% headings. +% \begin{macrocode} +\newglossarystyle{alttreegroup}{% +% \end{macrocode} +% Base it on the glostyle{alttree} style: +% \begin{macrocode} + \setglossarystyle{alttree}% +% \end{macrocode} +% Give each group a heading. +% \begin{macrocode} + \renewcommand{\glsgroupheading}[1]{\par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \textbf{\glsgetgrouptitle{##1}}\par\indexspace}% +} +% \end{macrocode} +%\end{style} +% +%\begin{style}{alttreehypergroup} +% The \glostyle{alttreehypergroup} style is like the +% \glostyle{alttreegroup} style, but has a set of links to the +% groups at the start of the glossary. +% \begin{macrocode} +\newglossarystyle{alttreehypergroup}{% +% \end{macrocode} +% Base it on the glostyle{alttree} style: +% \begin{macrocode} + \setglossarystyle{alttree}% +% \end{macrocode} +% Put the navigation links in the header +% \begin{macrocode} + \renewcommand*{\glossaryheader}{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \textbf{\glsnavigation}\par\indexspace}% +% \end{macrocode} +% Put a hypertarget at the start of each group +% \begin{macrocode} + \renewcommand*{\glsgroupheading}[1]{% + \par + \def\@gls@prevlevel{-1}% + \hangindent0pt\relax + \parindent0pt\relax + \textbf{\glsnavhypertarget{##1}{\glsgetgrouptitle{##1}}}\par + \indexspace}} +% \end{macrocode} +%\end{style} +% +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-compatible-207.sty> +% \end{macrocode} +%\fi +%\section{glossaries-compatible-207} +% Provides compatibility with version 2.07 and below. This uses +% original \sty{glossaries} xindy and makeindex formatting, so can +% be used with old documents that had customized style files, but +% hyperlinks may not work properly. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-compatible-207}[2011/04/02 v1.0 (NLCT)] +% \end{macrocode} +%\begin{macro}{\GlsAddXdyAttribute} +% Adds an attribute in old format. +% \begin{macrocode} +\ifglsxindy + \renewcommand*\GlsAddXdyAttribute[1]{% + \edef\@xdyattributes{\@xdyattributes ^^J \string"#1\string"}% + \expandafter\toks@\expandafter{\@xdylocref}% + \edef\@xdylocref{\the\toks@ ^^J% + (markup-locref + :open \string"\string~n\string\setentrycounter + {\noexpand\glscounter}% + \expandafter\string\csname#1\endcsname + \expandafter\@gobble\string\{\string" ^^J + :close \string"\expandafter\@gobble\string\}\string" ^^J + :attr \string"#1\string")}} +% \end{macrocode} +% Only has an effect before \ics{writeist}: +% \begin{macrocode} +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\GlsAddXdyCounters} +% \begin{macrocode} +\renewcommand*\GlsAddXdyCounters[1]{% + \GlossariesWarning{\string\GlsAddXdyCounters\space not available + in compatibility mode.}% +} +% \end{macrocode} +%\end{macro} +% Add predefined attributes +% \begin{macrocode} + \GlsAddXdyAttribute{glsnumberformat} + \GlsAddXdyAttribute{textrm} + \GlsAddXdyAttribute{textsf} + \GlsAddXdyAttribute{texttt} + \GlsAddXdyAttribute{textbf} + \GlsAddXdyAttribute{textmd} + \GlsAddXdyAttribute{textit} + \GlsAddXdyAttribute{textup} + \GlsAddXdyAttribute{textsl} + \GlsAddXdyAttribute{textsc} + \GlsAddXdyAttribute{emph} + \GlsAddXdyAttribute{glshypernumber} + \GlsAddXdyAttribute{hyperrm} + \GlsAddXdyAttribute{hypersf} + \GlsAddXdyAttribute{hypertt} + \GlsAddXdyAttribute{hyperbf} + \GlsAddXdyAttribute{hypermd} + \GlsAddXdyAttribute{hyperit} + \GlsAddXdyAttribute{hyperup} + \GlsAddXdyAttribute{hypersl} + \GlsAddXdyAttribute{hypersc} + \GlsAddXdyAttribute{hyperemph} +% \end{macrocode} +% +%\begin{macro}{\GlsAddXdyLocation} +% Restore v2.07 definition: +% \begin{macrocode} +\ifglsxindy + \renewcommand*{\GlsAddXdyLocation}[2]{% + \edef\@xdyuserlocationdefs{% + \@xdyuserlocationdefs ^^J% + (define-location-class \string"#1\string"^^J\space\space + \space(#2)) + }% + \edef\@xdyuserlocationnames{% + \@xdyuserlocationnames^^J\space\space\space + \string"#1\string"}% + } +\fi +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@do@wrglossary} +% \begin{macrocode} +\renewcommand{\@do@wrglossary}[1]{% +% \end{macrocode} +% Determine whether to use \app{xindy} or \app{makeindex} +% syntax +% \begin{macrocode} +\ifglsxindy +% \end{macrocode} +% Need to determine if the formatting information starts with +% a ( or ) indicating a range. +% \begin{macrocode} + \expandafter\@glo@check@mkidxrangechar\@glsnumberformat\@nil + \def\@glo@range{}% + \expandafter\if\@glo@prefix(\relax + \def\@glo@range{:open-range}% + \else + \expandafter\if\@glo@prefix)\relax + \def\@glo@range{:close-range}% + \fi + \fi +% \end{macrocode} +% Get the location and escape any special characters +% \begin{macrocode} + \protected@edef\@glslocref{\theglsentrycounter}% + \@gls@checkmkidxchars\@glslocref +% \end{macrocode} +% Write to the glossary file using \app{xindy} syntax. +% \begin{macrocode} + \glossary[\csname glo@#1@type\endcsname]{% + (indexentry :tkey (\csname glo@#1@index\endcsname) + :locref \string"\@glslocref\string" % + :attr \string"\@glo@suffix\string" \@glo@range + ) + }% +\else +% \end{macrocode} +% Convert the format information into the format required for +% \app{makeindex} +% \begin{macrocode} + \@set@glo@numformat\@glo@numfmt\@gls@counter\@glsnumberformat +% \end{macrocode} +% Write to the glossary file using \app{makeindex} syntax. +% \begin{macrocode} + \glossary[\csname glo@#1@type\endcsname]{% + \string\glossaryentry{\csname glo@#1@index\endcsname + \@gls@encapchar\@glo@numfmt}{\theglsentrycounter}}% +\fi +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@set@glo@numformat} +% Only had 3 arguments in v2.07 +% \begin{macrocode} +\def\@set@glo@numformat#1#2#3{% + \expandafter\@glo@check@mkidxrangechar#3\@nil + \protected@edef#1{% + \@glo@prefix setentrycounter[]{#2}% + \expandafter\string\csname\@glo@suffix\endcsname + }% + \@gls@checkmkidxchars#1% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\writeist} +% Redefine \cs{writeist} back to the way it was in v2.07, but change +% \cs{istfile} to \cs{glswrite}. +% \begin{macrocode} +\ifglsxindy + \def\writeist{% + \openout\glswrite=\istfilename + \write\glswrite{;; xindy style file created by the glossaries + package in compatible-2.07 mode}% + \write\glswrite{;; for document '\jobname' on + \the\year-\the\month-\the\day}% + \write\glswrite{^^J; required styles^^J} + \@for\@xdystyle:=\@xdyrequiredstyles\do{% + \ifx\@xdystyle\@empty + \else + \protected@write\glswrite{}{(require + \string"\@xdystyle.xdy\string")}% + \fi + }% + \write\glswrite{^^J% + ; list of allowed attributes (number formats)^^J}% + \write\glswrite{(define-attributes ((\@xdyattributes)))}% + \write\glswrite{^^J; user defined alphabets^^J}% + \write\glswrite{\@xdyuseralphabets}% + \write\glswrite{^^J; location class definitions^^J}% + \protected@edef\@gls@roman{\@roman{0\string" + \string"roman-numbers-lowercase\string" :sep \string"}}% + \@onelevel@sanitize\@gls@roman + \edef\@tmp{\string" \string"roman-numbers-lowercase\string" + :sep \string"}% + \@onelevel@sanitize\@tmp + \ifx\@tmp\@gls@roman + \write\glswrite{(define-location-class + \string"roman-page-numbers\string"^^J\space\space\space + (\string"roman-numbers-lowercase\string") + :min-range-length \@glsminrange)}% + \else + \write\glswrite{(define-location-class + \string"roman-page-numbers\string"^^J\space\space\space + (:sep "\@gls@roman") + :min-range-length \@glsminrange)}% + \fi + \write\glswrite{(define-location-class + \string"Roman-page-numbers\string"^^J\space\space\space + (\string"roman-numbers-uppercase\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"arabic-page-numbers\string"^^J\space\space\space + (\string"arabic-numbers\string") + :min-range-length \@glsminrange)}% + \write\glswrite{(define-location-class + \string"alpha-page-numbers\string"^^J\space\space\space + (\string"alpha\string") + :min-range-length \@glsminrange)}% \write\glswrite{(define-location-class \string"Alpha-page-numbers\string"^^J\space\space\space (\string"ALPHA\string") @@ -15485,106 +17997,906 @@ false,nolabel,autolabel}[nolabel]{% \@onelevel@sanitize\gls@suffixFF \ifx\gls@suffixF\@empty \else - \write\glswrite{(markup-range - :close "\gls@suffixF" :length 1 :ignore-end)}% + \write\glswrite{(markup-range + :close "\gls@suffixF" :length 1 :ignore-end)}% + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{(markup-range + :close "\gls@suffixFF" :length 2 :ignore-end)}% + \fi + \write\glswrite{^^J; define format to use for locations^^J}% + \write\glswrite{\@xdylocref}% + \write\glswrite{^^J; define letter group list format^^J}% + \write\glswrite{(markup-letter-group-list + :sep \string"\string\glsgroupskip\string~n\string")}% + \write\glswrite{^^J; letter group headings^^J}% + \write\glswrite{(markup-letter-group + :open-head \string"\string\glsgroupheading + \glsopenbrace\string"^^J\space\space\space + :close-head \string"\glsclosebrace\string")}% + \write\glswrite{^^J; additional letter groups^^J}% + \write\glswrite{\@xdylettergroups}% + \write\glswrite{^^J; additional sort rules^^J} + \write\glswrite{\@xdysortrules}% + \noist} +\else + \edef\@gls@actualchar{\string?} + \edef\@gls@encapchar{\string|} + \edef\@gls@levelchar{\string!} + \edef\@gls@quotechar{\string"} + \def\writeist{\relax + \openout\glswrite=\istfilename + \write\glswrite{\expandafter\@gobble\string\% makeindex style file + created by the glossaries package} + \write\glswrite{\expandafter\@gobble\string\% for document + '\jobname' on \the\year-\the\month-\the\day} + \write\glswrite{actual '\@gls@actualchar'} + \write\glswrite{encap '\@gls@encapchar'} + \write\glswrite{level '\@gls@levelchar'} + \write\glswrite{quote '\@gls@quotechar'} + \write\glswrite{keyword \string"\string\\glossaryentry\string"} + \write\glswrite{preamble \string"\string\\glossarysection[\string + \\glossarytoctitle]{\string\\glossarytitle}\string + \\glossarypreamble\string\n\string\\begin{theglossary}\string + \\glossaryheader\string\n\string"} + \write\glswrite{postamble \string"\string\%\string\n\string + \\end{theglossary}\string\\glossarypostamble\string\n + \string"} + \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n + \string"} + \write\glswrite{item_0 \string"\string\%\string\n\string"} + \write\glswrite{item_1 \string"\string\%\string\n\string"} + \write\glswrite{item_2 \string"\string\%\string\n\string"} + \write\glswrite{item_01 \string"\string\%\string\n\string"} + \write\glswrite{item_x1 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{item_12 \string"\string\%\string\n\string"} + \write\glswrite{item_x2 + \string"\string\\relax \string\\glsresetentrylist\string\n + \string"} + \write\glswrite{delim_0 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_1 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_2 \string"\string\{\string + \\glossaryentrynumbers\string\{\string\\relax \string"} + \write\glswrite{delim_t \string"\string\}\string\}\string"} + \write\glswrite{delim_n \string"\string\\delimN \string"} + \write\glswrite{delim_r \string"\string\\delimR \string"} + \write\glswrite{headings_flag 1} + \write\glswrite{heading_prefix + \string"\string\\glsgroupheading\string\{\string"} + \write\glswrite{heading_suffix + \string"\string\}\string\\relax + \string\\glsresetentrylist \string"} + \write\glswrite{symhead_positive \string"glssymbols\string"} + \write\glswrite{numhead_positive \string"glsnumbers\string"} + \write\glswrite{page_compositor \string"\glscompositor\string"} + \@gls@escbsdq\gls@suffixF + \@gls@escbsdq\gls@suffixFF + \ifx\gls@suffixF\@empty + \else + \write\glswrite{suffix_2p \string"\gls@suffixF\string"} + \fi + \ifx\gls@suffixFF\@empty + \else + \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} + \fi + \noist + } +\fi +% \end{macrocode} +%\end{macro} +%\begin{macro}{\noist} +% \begin{macrocode} +\renewcommand*{\noist}{\let\writeist\relax} +% \end{macrocode} +%\end{macro} +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*glossaries-compatible-307.sty> +% \end{macrocode} +%\fi +% Compatibility macros. +% \begin{macrocode} +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{glossaries-compatible-307}[2013/11/14 v4.0 (NLCT)] +% \end{macrocode} +% +% Compatibility macros for predefined glossary styles: +%\begin{macro}{\compatglossarystyle} +% Defines a compatibility glossary style. +% \begin{macrocode} +\newcommand{\compatglossarystyle}[2]{% + \ifcsundef{@glscompstyle@#1}% + {% + \csdef{@glscompstyle@#1}{#2}% + }% + {% + \PackageError{glossaries}{Glossary compatibility style `#1' is already defined}{}% + }% +} +% \end{macrocode} +%\end{macro} +% Backward compatible \glostyle{inline} style. +% \begin{macrocode} +\compatglossarystyle{inline}{% + \renewcommand{\glossaryentryfield}[5]{% + \glsinlinedopostchild + \gls@inlinesep + \def\glo@desc{##3}% + \def\@no@post@desc{\nopostdesc}% + \glsentryitem{##1}\glsinlinenameformat{##1}{##2}% + \ifx\glo@desc\@no@post@desc + \glsinlineemptydescformat{##4}{##5}% + \else + \ifstrempty{##3}% + {\glsinlineemptydescformat{##4}{##5}}% + {\glsinlinedescformat{##3}{##4}{##5}}% + \fi + \ifglshaschildren{##1}% + {% + \glsresetsubentrycounter + \glsinlineparentchildseparator + \def\gls@inlinesubsep{}% + \def\gls@inlinepostchild{\glsinlinepostchild}% + }% + {}% + \def\gls@inlinesep{\glsinlineseparator}% + }% +% \end{macrocode} +% Sub-entries display description: +% \begin{macrocode} + \renewcommand{\glossarysubentryfield}[6]{% + \gls@inlinesubsep% + \glsinlinesubnameformat{##2}{##3}% + \glssubentryitem{##2}\glsinlinesubdescformat{##4}{##5}{##6}% + \def\gls@inlinesubsep{\glsinlinesubseparator}% + }% +} +% \end{macrocode} +% Backward compatible \glostyle{list} style. +% \begin{macrocode} +\compatglossarystyle{list}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}] + ##3\glspostdescription\space ##5}% +% \end{macrocode} +% Sub-entries continue on the same line: +% \begin{macrocode} + \renewcommand*{\glossarysubentryfield}[6]{% + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6.}% +} +% \end{macrocode} +% Backward compatible \glostyle{listgroup} style. +% \begin{macrocode} +\compatglossarystyle{listgroup}{% + \csuse{@glscompstyle@list}% +}% +% \end{macrocode} +% Backward compatible \glostyle{listhypergroup} style. +% \begin{macrocode} +\compatglossarystyle{listhypergroup}{% + \csuse{@glscompstyle@list}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlist} style. +% \begin{macrocode} +\compatglossarystyle{altlist}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}]% + \mbox{}\par\nobreak\@afterheading + ##3\glspostdescription\space ##5}% + \renewcommand{\glossarysubentryfield}[6]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlistgroup} style. +% \begin{macrocode} +\compatglossarystyle{altlistgroup}{% + \csuse{@glscompstyle@altlist}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlisthypergroup} style. +% \begin{macrocode} +\compatglossarystyle{altlisthypergroup}{% + \csuse{@glscompstyle@altlist}% +}% +% \end{macrocode} +% Backward compatible \glostyle{listdotted} style. +% \begin{macrocode} +\compatglossarystyle{listdotted}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glsentryitem{##1}\glstarget{##1}{##2}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##3}% + \renewcommand*{\glossarysubentryfield}[6]{% + \item[]\makebox[\glslistdottedwidth][l]{% + \glssubentryitem{##2}% + \glstarget{##2}{##3}% + \unskip\leaders\hbox to 2.9mm{\hss.}\hfill\strut}##4}% +}% +% \end{macrocode} +% Backward compatible \glostyle{sublistdotted} style. +% \begin{macrocode} +\compatglossarystyle{sublistdotted}{% + \csuse{@glscompstyle@listdotted}% + \renewcommand*{\glossaryentryfield}[5]{% + \item[\glsentryitem{##1}\glstarget{##1}{##2}]}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long} style. +% \begin{macrocode} +\compatglossarystyle{long}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longborder} style. +% \begin{macrocode} +\compatglossarystyle{longborder}{% + \csuse{@glscompstyle@long}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longheader} style. +% \begin{macrocode} +\compatglossarystyle{longheader}{% + \csuse{@glscompstyle@long}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{longheaderborder}{% + \csuse{@glscompstyle@long}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long3col} style. +% \begin{macrocode} +\compatglossarystyle{long3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\\}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long3colborder} style. +% \begin{macrocode} +\compatglossarystyle{long3colborder}{% + \csuse{@glscompstyle@long3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long3colheader} style. +% \begin{macrocode} +\compatglossarystyle{long3colheader}{% + \csuse{@glscompstyle@long3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long3colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{long3colheaderborder}{% + \csuse{@glscompstyle@long3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long4col} style. +% \begin{macrocode} +\compatglossarystyle{long4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long4colheader} style. +% \begin{macrocode} +\compatglossarystyle{long4colheader}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long4colborder} style. +% \begin{macrocode} +\compatglossarystyle{long4colborder}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{long4colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{long4colheaderborder}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlong4col} style. +% \begin{macrocode} +\compatglossarystyle{altlong4col}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlong4colheader} style. +% \begin{macrocode} +\compatglossarystyle{altlong4colheader}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlong4colborder} style. +% \begin{macrocode} +\compatglossarystyle{altlong4colborder}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlong4colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{altlong4colheaderborder}{% + \csuse{@glscompstyle@long4col}% +}% +% \end{macrocode} +% +% Backward compatible \glostyle{long} style. +% \begin{macrocode} +\compatglossarystyle{longragged}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% + \tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6% + \tabularnewline}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longraggedborder} style. +% \begin{macrocode} +\compatglossarystyle{longraggedborder}{% + \csuse{@glscompstyle@longragged}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longraggedheader} style. +% \begin{macrocode} +\compatglossarystyle{longraggedheader}{% + \csuse{@glscompstyle@longragged}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longraggedheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{longraggedheaderborder}{% + \csuse{@glscompstyle@longragged}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longragged3col} style. +% \begin{macrocode} +\compatglossarystyle{longragged3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longragged3colborder} style. +% \begin{macrocode} +\compatglossarystyle{longragged3colborder}{% + \csuse{@glscompstyle@longragged3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longragged3colheader} style. +% \begin{macrocode} +\compatglossarystyle{longragged3colheader}{% + \csuse{@glscompstyle@longragged3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{longragged3colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{longragged3colheaderborder}{% + \csuse{@glscompstyle@longragged3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlongragged4col} style. +% \begin{macrocode} +\compatglossarystyle{altlongragged4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlongragged4colheader} style. +% \begin{macrocode} +\compatglossarystyle{altlongragged4colheader}{% + \csuse{@glscompstyle@altlong4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlongragged4colborder} style. +% \begin{macrocode} +\compatglossarystyle{altlongragged4colborder}{% + \csuse{@glscompstyle@altlong4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altlongragged4colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{altlongragged4colheaderborder}{% + \csuse{@glscompstyle@altlong4col}% +}% +% \end{macrocode} +% +% Backward compatible \glostyle{index} style. +% \begin{macrocode} +\compatglossarystyle{index}{% + \renewcommand*{\glossaryentryfield}[5]{% + \item\glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5}% + \renewcommand*{\glossarysubentryfield}[6]{% + \ifcase##1\relax + % level 0 + \item + \or + % level 1 + \subitem + \glssubentryitem{##2}% + \else + % all other levels + \subsubitem \fi - \ifx\gls@suffixFF\@empty + \textbf{\glstarget{##2}{##3}}% + \ifx\relax##5\relax \else - \write\glswrite{(markup-range - :close "\gls@suffixFF" :length 2 :ignore-end)}% + \space(##5)% + \fi + \space##4\glspostdescription\space ##6}% +}% +% \end{macrocode} +% Backward compatible \glostyle{indexgroup} style. +% \begin{macrocode} +\compatglossarystyle{indexgroup}{% + \csuse{@glscompstyle@index}% +}% +% \end{macrocode} +% Backward compatible \glostyle{indexhypergroup} style. +% \begin{macrocode} +\compatglossarystyle{indexhypergroup}{% + \csuse{@glscompstyle@index}% +}% +% \end{macrocode} +% Backward compatible \glostyle{tree} style. +% \begin{macrocode} +\compatglossarystyle{tree}{% + \renewcommand{\glossaryentryfield}[5]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5\par}% + \renewcommand{\glossarysubentryfield}[6]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \textbf{\glstarget{##2}{##3}}% + \ifx\relax##5\relax + \else + \space(##5)% + \fi + \space##4\glspostdescription\space ##6\par}% +}% +% \end{macrocode} +% Backward compatible \glostyle{treegroup} style. +% \begin{macrocode} +\compatglossarystyle{treegroup}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{treehypergroup} style. +% \begin{macrocode} +\compatglossarystyle{treehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{treenoname} style. +% \begin{macrocode} +\compatglossarystyle{treenoname}{% + \renewcommand{\glossaryentryfield}[5]{% + \hangindent0pt\relax + \parindent0pt\relax + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}% + \ifx\relax##4\relax + \else + \space(##4)% + \fi + \space ##3\glspostdescription \space ##5\par}% + \renewcommand{\glossarysubentryfield}[6]{% + \hangindent##1\glstreeindent\relax + \parindent##1\glstreeindent\relax + \ifnum##1=1\relax + \glssubentryitem{##2}% + \fi + \glstarget{##2}{\strut}% + ##4\glspostdescription\space ##6\par}% +}% +% \end{macrocode} +% Backward compatible \glostyle{treenonamegroup} style. +% \begin{macrocode} +\compatglossarystyle{treenonamegroup}{% + \csuse{@glscompstyle@treenoname}% +}% +% \end{macrocode} +% Backward compatible \glostyle{treenonamehypergroup} style. +% \begin{macrocode} +\compatglossarystyle{treenonamehypergroup}{% + \csuse{@glscompstyle@treenoname}% +}% +% \end{macrocode} +% Backward compatible \glostyle{alttree} style. +% \begin{macrocode} +\compatglossarystyle{alttree}{% + \renewcommand{\glossaryentryfield}[5]{% + \ifnum\@gls@prevlevel=0\relax + \else + \settowidth{\glstreeindent}{\textbf{\@glswidestname\space}}% + \hangindent\glstreeindent + \parindent\glstreeindent + \fi + \makebox[0pt][r]{\makebox[\glstreeindent][l]{% + \glsentryitem{##1}\textbf{\glstarget{##1}{##2}}}}% + \ifx\relax##4\relax + \else + (##4)\space + \fi + ##3\glspostdescription \space ##5\par + \def\@gls@prevlevel{0}% + }% + \renewcommand{\glossarysubentryfield}[6]{% + \ifnum##1=1\relax + \glssubentryitem{##2}% \fi - \write\glswrite{^^J; define format to use for locations^^J}% - \write\glswrite{\@xdylocref}% - \write\glswrite{^^J; define letter group list format^^J}% - \write\glswrite{(markup-letter-group-list - :sep \string"\string\glsgroupskip\string~n\string")}% - \write\glswrite{^^J; letter group headings^^J}% - \write\glswrite{(markup-letter-group - :open-head \string"\string\glsgroupheading - \glsopenbrace\string"^^J\space\space\space - :close-head \string"\glsclosebrace\string")}% - \write\glswrite{^^J; additional letter groups^^J}% - \write\glswrite{\@xdylettergroups}% - \write\glswrite{^^J; additional sort rules^^J} - \write\glswrite{\@xdysortrules}% - \noist} -\else - \edef\@gls@actualchar{\string?} - \edef\@gls@encapchar{\string|} - \edef\@gls@levelchar{\string!} - \edef\@gls@quotechar{\string"} - \def\writeist{\relax - \openout\glswrite=\istfilename - \write\glswrite{\expandafter\@gobble\string\% makeindex style file - created by the glossaries package} - \write\glswrite{\expandafter\@gobble\string\% for document - '\jobname' on \the\year-\the\month-\the\day} - \write\glswrite{actual '\@gls@actualchar'} - \write\glswrite{encap '\@gls@encapchar'} - \write\glswrite{level '\@gls@levelchar'} - \write\glswrite{quote '\@gls@quotechar'} - \write\glswrite{keyword \string"\string\\glossaryentry\string"} - \write\glswrite{preamble \string"\string\\glossarysection[\string - \\glossarytoctitle]{\string\\glossarytitle}\string - \\glossarypreamble\string\n\string\\begin{theglossary}\string - \\glossaryheader\string\n\string"} - \write\glswrite{postamble \string"\string\%\string\n\string - \\end{theglossary}\string\\glossarypostamble\string\n - \string"} - \write\glswrite{group_skip \string"\string\\glsgroupskip\string\n - \string"} - \write\glswrite{item_0 \string"\string\%\string\n\string"} - \write\glswrite{item_1 \string"\string\%\string\n\string"} - \write\glswrite{item_2 \string"\string\%\string\n\string"} - \write\glswrite{item_01 \string"\string\%\string\n\string"} - \write\glswrite{item_x1 - \string"\string\\relax \string\\glsresetentrylist\string\n - \string"} - \write\glswrite{item_12 \string"\string\%\string\n\string"} - \write\glswrite{item_x2 - \string"\string\\relax \string\\glsresetentrylist\string\n - \string"} - \write\glswrite{delim_0 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_1 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_2 \string"\string\{\string - \\glossaryentrynumbers\string\{\string\\relax \string"} - \write\glswrite{delim_t \string"\string\}\string\}\string"} - \write\glswrite{delim_n \string"\string\\delimN \string"} - \write\glswrite{delim_r \string"\string\\delimR \string"} - \write\glswrite{headings_flag 1} - \write\glswrite{heading_prefix - \string"\string\\glsgroupheading\string\{\string"} - \write\glswrite{heading_suffix - \string"\string\}\string\\relax - \string\\glsresetentrylist \string"} - \write\glswrite{symhead_positive \string"glssymbols\string"} - \write\glswrite{numhead_positive \string"glsnumbers\string"} - \write\glswrite{page_compositor \string"\glscompositor\string"} - \@gls@escbsdq\gls@suffixF - \@gls@escbsdq\gls@suffixFF - \ifx\gls@suffixF\@empty + \ifnum\@gls@prevlevel=##1\relax \else - \write\glswrite{suffix_2p \string"\gls@suffixF\string"} + \@ifundefined{@glswidestname\romannumeral##1}{% + \settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{% + \settowidth{\gls@tmplen}{\textbf{% + \csname @glswidestname\romannumeral##1\endcsname\space}}}% + \ifnum\@gls@prevlevel<##1\relax + \setlength\glstreeindent\gls@tmplen + \addtolength\glstreeindent\parindent + \parindent\glstreeindent + \else + \@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{% + \settowidth{\glstreeindent}{\textbf{% + \@glswidestname\space}}}{% + \settowidth{\glstreeindent}{\textbf{% + \csname @glswidestname\romannumeral\@gls@prevlevel + \endcsname\space}}}% + \addtolength\parindent{-\glstreeindent}% + \setlength\glstreeindent\parindent + \fi \fi - \ifx\gls@suffixFF\@empty + \hangindent\glstreeindent + \makebox[0pt][r]{\makebox[\gls@tmplen][l]{% + \textbf{\glstarget{##2}{##3}}}}% + \ifx##5\relax\relax \else - \write\glswrite{suffix_3p \string"\gls@suffixFF\string"} + (##5)\space \fi - \noist - } -\fi + ##4\glspostdescription\space ##6\par + \def\@gls@prevlevel{##1}% + }% +}% +% \end{macrocode} +% Backward compatible \glostyle{alttreegroup} style. +% \begin{macrocode} +\compatglossarystyle{alttreegroup}{% + \csuse{@glscompstyle@alttree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{alttreehypergroup} style. +% \begin{macrocode} +\compatglossarystyle{alttreehypergroup}{% + \csuse{@glscompstyle@alttree}% +}% +% \end{macrocode} +% +% Backward compatible \glostyle{mcolindex} style. +% \begin{macrocode} +\compatglossarystyle{mcolindex}{% + \csuse{@glscompstyle@index}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcolindexgroup} style. +% \begin{macrocode} +\compatglossarystyle{mcolindexgroup}{% + \csuse{@glscompstyle@index}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcolindexhypergroup} style. +% \begin{macrocode} +\compatglossarystyle{mcolindexhypergroup}{% + \csuse{@glscompstyle@index}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcoltree} style. +% \begin{macrocode} +\compatglossarystyle{mcoltree}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcoltreegroup} style. +% \begin{macrocode} +\compatglossarystyle{mcolindextreegroup}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcoltreehypergroup} style. +% \begin{macrocode} +\compatglossarystyle{mcolindextreehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcoltreenoname} style. +% \begin{macrocode} +\compatglossarystyle{mcoltreenoname}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcoltreenonamegroup} style. +% \begin{macrocode} +\compatglossarystyle{mcoltreenonamegroup}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcoltreenonamehypergroup} style. +% \begin{macrocode} +\compatglossarystyle{mcoltreenonamehypergroup}{% + \csuse{@glscompstyle@tree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcolalttree} style. +% \begin{macrocode} +\compatglossarystyle{mcolalttree}{% + \csuse{@glscompstyle@alttree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcolalttreegroup} style. +% \begin{macrocode} +\compatglossarystyle{mcolalttreegroup}{% + \csuse{@glscompstyle@alttree}% +}% +% \end{macrocode} +% Backward compatible \glostyle{mcolalttreehypergroup} style. +% \begin{macrocode} +\compatglossarystyle{mcolalttreehypergroup}{% + \csuse{@glscompstyle@alttree}% +}% +% \end{macrocode} + +% Backward compatible \glostyle{superragged} style. +% \begin{macrocode} +\compatglossarystyle{superragged}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5% + \tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6% + \tabularnewline}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superraggedborder} style. +% \begin{macrocode} +\compatglossarystyle{superraggedborder}{% + \csuse{@glscompstyle@superragged}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superraggedheader} style. +% \begin{macrocode} +\compatglossarystyle{superraggedheader}{% + \csuse{@glscompstyle@superragged}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superraggedheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{superraggedheaderborder}{% + \csuse{@glscompstyle@superragged}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superragged3col} style. +% \begin{macrocode} +\compatglossarystyle{superragged3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\tabularnewline}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superragged3colborder} style. +% \begin{macrocode} +\compatglossarystyle{superragged3colborder}{% + \csuse{@glscompstyle@superragged3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superragged3colheader} style. +% \begin{macrocode} +\compatglossarystyle{superragged3colheader}{% + \csuse{@glscompstyle@superragged3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superragged3colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{superragged3colheaderborder}{% + \csuse{@glscompstyle@superragged3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuperragged4col} style. +% \begin{macrocode} +\compatglossarystyle{altsuperragged4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\tabularnewline}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\tabularnewline}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuperragged4colheader} style. +% \begin{macrocode} +\compatglossarystyle{altsuperragged4colheader}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuperragged4colborder} style. +% \begin{macrocode} +\compatglossarystyle{altsuperragged4colborder}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuperragged4colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{altsuperragged4colheaderborder}{% + \csuse{@glscompstyle@altsuperragged4col}% +}% +% \end{macrocode} +% +% Backward compatible \glostyle{super} style. +% \begin{macrocode} +\compatglossarystyle{super}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4\glspostdescription\space ##6\\}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superborder} style. +% \begin{macrocode} +\compatglossarystyle{superborder}{% + \csuse{@glscompstyle@super}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superheader} style. +% \begin{macrocode} +\compatglossarystyle{superheader}{% + \csuse{@glscompstyle@super}% +}% +% \end{macrocode} +% Backward compatible \glostyle{superheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{superheaderborder}{% + \csuse{@glscompstyle@super}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super3col} style. +% \begin{macrocode} +\compatglossarystyle{super3col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##6\\}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super3colborder} style. +% \begin{macrocode} +\compatglossarystyle{super3colborder}{% + \csuse{@glscompstyle@super3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super3colheader} style. +% \begin{macrocode} +\compatglossarystyle{super3colheader}{% + \csuse{@glscompstyle@super3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super3colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{super3colheaderborder}{% + \csuse{@glscompstyle@super3col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super4col} style. +% \begin{macrocode} +\compatglossarystyle{super4col}{% + \renewcommand*{\glossaryentryfield}[5]{% + \glsentryitem{##1}\glstarget{##1}{##2} & ##3 & ##4 & ##5\\}% + \renewcommand*{\glossarysubentryfield}[6]{% + & + \glssubentryitem{##2}% + \glstarget{##2}{\strut}##4 & ##5 & ##6\\}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super4colheader} style. +% \begin{macrocode} +\compatglossarystyle{super4colheader}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super4colborder} style. +% \begin{macrocode} +\compatglossarystyle{super4colborder}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{super4colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{super4colheaderborder}{% + \csuse{@glscompstyle@super4col}% +}% % \end{macrocode} -%\end{macro} -%\begin{macro}{\noist} +% Backward compatible \glostyle{altsuper4col} style. % \begin{macrocode} -\renewcommand*{\noist}{\let\writeist\relax} +\compatglossarystyle{altsuper4col}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuper4colheader} style. +% \begin{macrocode} +\compatglossarystyle{altsuper4colheader}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuper4colborder} style. +% \begin{macrocode} +\compatglossarystyle{altsuper4colborder}{% + \csuse{@glscompstyle@super4col}% +}% +% \end{macrocode} +% Backward compatible \glostyle{altsuper4colheaderborder} style. +% \begin{macrocode} +\compatglossarystyle{altsuper4colheaderborder}{% + \csuse{@glscompstyle@super4col}% +}% % \end{macrocode} -%\end{macro} %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse @@ -15605,7 +18917,7 @@ false,nolabel,autolabel}[nolabel]{% % but will only be updated when \texttt{glossaries-accsupp.sty} is % modified. % \begin{macrocode} -\ProvidesPackage{glossaries-accsupp}[2011/04/02 v3.0 (NLCT) +\ProvidesPackage{glossaries-accsupp}[2013/11/14 v4.0 (NLCT) Experimental glossaries accessibility] % \end{macrocode} % Pass all options to \sty{glossaries}: @@ -15616,6 +18928,37 @@ false,nolabel,autolabel}[nolabel]{% % \begin{macrocode} \ProcessOptions % \end{macrocode} +% Override style compatibility macros: +% \begin{macrocode} +\newcommand*{\compatibleglossentry}[2]{% + \toks@{#2}% + \protected@edef\@do@glossentry{% + \noexpand\accsuppglossaryentryfield{#1}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@#1@name\endcsname}}% + {\expandafter\expandonce\csname glo@#1@desc\endcsname}% + {\expandafter\expandonce\csname glo@#1@symbol\endcsname}% + {\the\toks@}% + }% + \@do@glossentry +} +% \end{macrocode} +% +% \begin{macrocode} +\newcommand*{\compatiblesubglossentry}[3]{% + \toks@{#3}% + \protected@edef\@do@subglossentry{% + \noexpand\accsuppglossarysubentryfield{\number#1}% + {#2}% + {\noexpand\glsnamefont + {\expandafter\expandonce\csname glo@#2@name\endcsname}}% + {\expandafter\expandonce\csname glo@#2@desc\endcsname}% + {\expandafter\expandonce\csname glo@#2@symbol\endcsname}% + {\the\toks@}% + }% + \@do@subglossentry +} +% \end{macrocode} % Required packages: % \begin{macrocode} \RequirePackage{glossaries} @@ -15738,6 +19081,25 @@ false,nolabel,autolabel}[nolabel]{% % explicitly put in the value, e.g., % "user1={\glsaccsupp{inches}{in}}". % +% Append these new keys to \cs{@gls@keymap}: +% \begin{macrocode} +\appto\@gls@keymap{,% + {access}{access},% + {textaccess}{textaccess},% + {firstaccess}{firstaccess},% + {pluralaccess}{pluralaccess},% + {firstpluralaccess}{firstpluralaccess},% + {symbolaccess}{symbolaccess},% + {symbolpluralaccess}{symbolpluralaccess},% + {descaccess}{descaccess},% + {descpluralaccess}{descpluralaccess},% + {shortaccess}{shortaccess},% + {shortpluralaccess}{shortpluralaccess},% + {longaccess}{longaccess},% + {longpluralaccess}{longpluralaccess}% +} +% \end{macrocode} +% %\begin{macro}{\@gls@noaccess} % Indicates that no replacement text has been provided. % \begin{macrocode} @@ -16152,360 +19514,237 @@ false,nolabel,autolabel}[nolabel]{% % \end{macrocode} %\end{macro} % -%\begin{macro}{\@gls@} -% Redefine \cs{@gls@} to change the way the link text is defined +%\begin{macro}{\@@gls@default@entryfmt} +% Redefine the default entry format to use accessibility information % \begin{macrocode} -\def\@gls@#1#2[#3]{% - \glsdoifexists{#2}% +\renewcommand*{\@@gls@default@entryfmt}[2]{% + \ifdefempty\glscustomtext {% - \edef\@glo@type{\glsentrytype{#2}}% -% \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} -% \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% -% \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}). This is no longer expanded. -% \begin{macrocode} - \ifglsused{#2}% + \glsifplural {% - \def\@glo@text{\csname gls@\@glo@type @display\endcsname - {\glstextaccessdisplay{\glsentrytext{#2}}{#2}}% - {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}% - {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}% - {#3}}% - }% - {% - \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname - {\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}}% - {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}% - {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}% - {#3}}% - }% % \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used, suppress -% hyperlink for first use. +% Plural form % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse{\(\boolean{@glsisacronymlist}\AND - \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}% - {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% - }% + \glscapscase {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - }% % \end{macrocode} -% Indicate that this entry has now been used +% Don't adjust case % \begin{macrocode} - \glsunset{#2}% - }% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Gls@} +% Subsequent use % \begin{macrocode} -\def\@Gls@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% + #2{\glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}} + {\glsinsert}% + }% + {% % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% First use % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + #1{\glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}). The first character of the entry text is -% converted to uppercase before passing to -% \cs{gls@}\meta{type}"@display" or -% \cs{gls@}\meta{type}"@displayfirst" +% Make first letter upper case % \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{\csname gls@\@glo@type @display\endcsname - {\glstextaccessdisplay{\Glsentrytext{#2}}{#2}}% - {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}% - {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}% - {#3}}% - }% - {% - \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname - {\glsfirstaccessdisplay{\Glsentryfirst{#2}}{#2}}% - {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}% - {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}% - {#3}}% - }% + \ifglsused\glslabel + {% % \end{macrocode} -% Call \cs{@gls@link}. -% If \pkgopt{footnote} package option has been used, suppress -% hyperlink for first use. +% Subsequent use. % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse{\(\boolean{@glsisacronymlist}\AND - \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}% - {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% - }% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - }% + #2{\glspluralaccessdisplay + {\Glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% % \end{macrocode} -% Indicate that this entry has now been used +% First use % \begin{macrocode} - \glsunset{#2}% - }% -} + #1{\glsfirstpluralaccessdisplay + {\Glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + }% + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLS@} +% Make all upper case % \begin{macrocode} -\def\@GLS@#1#2[#3]{% - \glsdoifexists{#2}{% - \edef\@glo@type{\glsentrytype{#2}}% + \ifglsused\glslabel + {% % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% Subsequent use % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + \MakeUppercase{% + #2{\glspluralaccessdisplay + {\glsentryplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + {% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}). +% First use % \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{\csname gls@\@glo@type @display\endcsname - {\glstextaccessdisplay{\glsentrytext{#2}}{#2}}% - {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}% - {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}% - {#3}}% + \MakeUppercase{% + #1{\glsfirstpluralaccessdisplay + {\glsentryfirstplural{\glslabel}}{\glslabel}}% + {\glsdescriptionpluralaccessdisplay + {\glsentrydescplural{\glslabel}}{\glslabel}}% + {\glssymbolpluralaccessdisplay + {\glsentrysymbolplural{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + }% }% {% - \edef\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname - {\glsfirstaccessdisplay{\glsentryfirst{#2}}{#2}}% - {\glsdescriptionaccessdisplay{\glsentrydesc{#2}}{#2}}% - {\glssymbolaccessdisplay{\glsentrysymbol{#2}}{#2}}% - {#3}}% - }% % \end{macrocode} -% Call \cs{@gls@link} -% If \pkgopt{footnote} package option has been used, suppress -% hyperlink for first use. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} +% Singular form % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse{\(\boolean{@glsisacronymlist}\AND - \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}{% - \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% - }% + \glscapscase {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - }% -% \end{macrocode} -% Indicate that this entry has now been used -% \begin{macrocode} - \glsunset{#2}% - }% -} -% \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@gls@pl@} -% \begin{macrocode} -\def\@glspl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% Don't adjust case % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + \ifglsused\glslabel + {% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +% Subsequent use % \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{\csname gls@\@glo@type @display\endcsname - {\glspluralaccessdisplay{\glsentryplural{#2}}{#2}}% - {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}% - {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}% - {#3}}% - }% - {% - \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname - {\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}}% - {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}% - {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}% - {#3}}% - }% + #2{\glstextaccessdisplay + {\glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% % \end{macrocode} -% Call \cs{@gls@link} -% If \pkgopt{footnote} package option has been used, suppress -% hyperlink for first use. -%\changes{1.16}{2008 August 27}{Test glossary type is 'acronymtype in addition to -%checking if footnote option has been used} +% First use % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - {% - \gls@checkisacronymlist\@glo@type - \ifthenelse{\(\boolean{@glsisacronymlist}\AND - \boolean{glsacrfootnote}\) \OR\NOT\boolean{glshyperfirst}}% - {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + #1{\glsfirstaccessdisplay + {\glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% }% {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - }% -% \end{macrocode} -% Indicate that this entry has now been used -% \begin{macrocode} - \glsunset{#2}% - }% -} % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@Glspl@} -% \begin{macrocode} -\def\@Glspl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% -% \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% Make first letter upper case % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + \ifglsused\glslabel + {% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}). +% Subsequent use % \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{\csname gls@\@glo@type @display\endcsname - {\glspluralaccessdisplay{\Glsentryplural{#2}}{#2}}% - {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}% - {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}% - {#3}}% - }% - {% - \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname - {\glsfirstpluralaccessdisplay{\Glsentryfirstplural{#2}}{#2}}% - {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}% - {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}% - {#3}}% - }% + #2{\glstextaccessdisplay + {\Glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% + {% % \end{macrocode} -% Call \cs{@gls@link} -% If \pkgopt{footnote} package option has been used, suppress -% hyperlink for first use. +% First use % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - {% - \ifthenelse{\equal{\@glo@type}{\acronymtype}\and - \boolean{glsacrfootnote}}% - {% - \@gls@link[#1,hyper=false]{#2}{\@glo@text}% + #1{\glsfirstaccessdisplay + {\Glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% }% {% - \@gls@link[#1]{#2}{\@glo@text}% - }% - }% % \end{macrocode} -% Indicate that this entry has now been used +% Make all upper case % \begin{macrocode} - \glsunset{#2}% - }% -} + \ifglsused\glslabel + {% % \end{macrocode} -%\end{macro} -% -%\begin{macro}{\@GLSpl@} +% Subsequent use % \begin{macrocode} -\def\@GLSpl@#1#2[#3]{% - \glsdoifexists{#2}% - {% - \edef\@glo@type{\glsentrytype{#2}}% + \MakeUppercase{% + #2{\glstextaccessdisplay + {\glsentrytext{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + {% % \end{macrocode} -% Save options in \cs{@gls@link@opts} and label in \cs{@gls@link@label} +% First use % \begin{macrocode} - \def\@gls@link@opts{#1}% - \def\@gls@link@label{#2}% + \MakeUppercase{% + #1{\glsfirstaccessdisplay + {\glsentryfirst{\glslabel}}{\glslabel}}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}}% + }% + }% + }% + }% + {% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +% Custom text provided in \cs{glsdisp} % \begin{macrocode} - \ifglsused{#2}% - {% - \def\@glo@text{\csname gls@\@glo@type @display\endcsname - {\glspluralaccessdisplay{\glsentryplural{#2}}{#2}}% - {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}% - {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}% - {#3}}% - }% + \ifglsused{\glslabel}% {% - \def\@glo@text{\csname gls@\@glo@type @displayfirst\endcsname - {\glsfirstpluralaccessdisplay{\glsentryfirstplural{#2}}{#2}}% - {\glsdescriptionpluralaccessdisplay{\glsentrydescplural{#2}}{#2}}% - {\glssymbolpluralaccessdisplay{\glsentrysymbolplural{#2}}{#2}}% - {#3}}% - }% % \end{macrocode} -% Call \cs{@gls@link} -% If \pkgopt{footnote} package option has been used, suppress -% hyperlink for first use. +% Subsequent use % \begin{macrocode} - \ifglsused{#2}% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% + #2{\glscustomtext}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% }% {% - \gls@checkisacronymlist\@glo@type - \ifthenelse{\(\boolean{@glsisacronymlist}\AND - \boolean{glsacrfootnote}\)\OR\NOT\boolean{glshyperfirst}}% - {% - \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% - }% - {% - \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - }% - }% % \end{macrocode} -% Indicate that this entry has now been used +% First use % \begin{macrocode} - \glsunset{#2}% + #1{\glscustomtext}% + {\glsdescriptionaccessdisplay + {\glsentrydesc{\glslabel}}{\glslabel}}% + {\glssymbolaccessdisplay + {\glsentrysymbol{\glslabel}}{\glslabel}}% + {\glsinsert}% + }% }% } % \end{macrocode} @@ -16518,16 +19757,20 @@ false,nolabel,autolabel}[nolabel]{% {% \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - \def\@glo@text{% - \glsshortaccessdisplay{\glsentryshort{#2}}{#2}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\glsentryshort{#2}}{#2}}#3% }% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% } % \end{macrocode} @@ -16540,16 +19783,20 @@ false,nolabel,autolabel}[nolabel]{% {% \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - \def\@glo@text{% - \glsshortaccessdisplay{\Glsentryshort{#2}}{#2}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@secondofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay{\Glsentryshort{#2}}{#2}}#3% }% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\@glo@text}#3}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% } % \end{macrocode} @@ -16562,16 +19809,21 @@ false,nolabel,autolabel}[nolabel]{% {% \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - \def\@glo@text{% - \glsshortaccessdisplay{\MakeUppercase{\glsentryshort{#2}}}{#2}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@thirdofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glsshortaccessdisplay + {\MakeUppercase{\glsentryshort{#2}}}{#2}}#3% }% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}{\acronymfont{\@glo@text#3}}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% } % \end{macrocode} @@ -16584,16 +19836,20 @@ false,nolabel,autolabel}[nolabel]{% {% \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - \def\@glo@text{% - \glslongaccessdisplay{\glsentrylong{#2}}{#2}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\glsentrylong{#2}}{#2}}#3% }% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}{\@glo@text#3}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% } % \end{macrocode} @@ -16606,16 +19862,20 @@ false,nolabel,autolabel}[nolabel]{% {% \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - \def\@glo@text{% - \glslongaccessdisplay{\Glsentrylong{#2}}{#2}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{\Glsentrylong{#2}}{#2}}#3% }% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}{\@glo@text#3}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% } % \end{macrocode} @@ -16628,47 +19888,94 @@ false,nolabel,autolabel}[nolabel]{% {% \edef\@glo@type{\glsentrytype{#2}}% % \end{macrocode} -% Determine what the link text should be (this is stored in -% \cs{@glo@text}) +%\changes{3.11a}{2013-10-15}{added \cs{glslabel}, \cs{glsifplural}, +% \cs{glscapscase}, \cs{glsinsert} and \cs{glscustomtext}} % \begin{macrocode} - \def\@glo@text{% - \glslongaccessdisplay{\MakeUppercase{\glsentrylong{#2}}}{#2}% + \def\glslabel{#2}% + \let\glsifplural\@secondoftwo + \let\glscapscase\@firstofthree + \let\glsinsert\@empty + \def\glscustomtext{% + \acronymfont{\glslongaccessdisplay{% + \MakeUppercase{\glsentrylong{#2}}}{#2}#3}% }% % \end{macrocode} % Call \cs{@gls@link} % \begin{macrocode} - \@gls@link[#1]{#2}{\@glo@text#3}% + \@gls@link[#1]{#2}{\csname gls@\@glo@type @entryfmt\endcsname}% }% } % \end{macrocode} %\end{macro} % %\subsection{Displaying the Glossary} -% Entries within the glossary or list of acronyms are now formatted -% via \cs{accsuppglossaryentryfield} and +%\changes{3.08a}{2013-09-28}{removed definition of \cs{@glossaryentryfield}} +%\changes{3.08a}{2013-09-28}{removed definition of \cs{@glossarysubentryfield}} +% +% We need to redefine the way the glossary entries are formatted to +% include the accessibility support. The predefined glossary styles +% use \ics{glossentryname}, \ics{glossentrydesc} and +% \ics{glossentrysymbol}, but we need to provide compatibility with +% earlier versions in case users have defined their own styles using +% \cs{accsuppglossaryentryfield} and % \cs{accsuppglossarysubentryfield}. -%\begin{macro}{\@glossaryentryfield} +% +% Now redefine \cs{glossentryname}, \cs{glossentrydesc} and +% \cs{glossentrysymbol} etc so they use the accessibility stuff. % \begin{macrocode} -\ifglsxindy - \renewcommand*{\@glossaryentryfield}{% - \string\\accsuppglossaryentryfield} -\else - \renewcommand*{\@glossaryentryfield}{% - \string\accsuppglossaryentryfield} -\fi +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\glsentryname{#1}}{#1}}% + }% +} % \end{macrocode} -%\end{macro} -%\begin{macro}{\@glossarysubentryfield} +% % \begin{macrocode} -\ifglsxindy - \renewcommand*{\@glossarysubentryfield}{% - \string\\accsuppglossarysubentryfield} -\else - \renewcommand*{\@glossarysubentryfield}{% - \string\accsuppglossarysubentryfield} -\fi +\renewcommand*{\glossentryname}[1]{% + \glsdoifexists{#1}% + {% + \glsnamefont{\glsnameaccessdisplay{\Glsentryname{#1}}{#1}}% + }% +} % \end{macrocode} -%\end{macro} +% +% \begin{macrocode} +\renewcommand*{\glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\glsentrydesc{#1}}{#1}% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\renewcommand*{\Glossentrydesc}[1]{% + \glsdoifexists{#1}% + {% + \glsdescriptionaccessdisplay{\Glsentrydesc{#1}}{#1}% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\renewcommand*{\glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\glsentrysymbol{#1}}{#1}% + }% +} +% \end{macrocode} +% +% \begin{macrocode} +\renewcommand*{\Glossentrysymbol}[1]{% + \glsdoifexists{#1}% + {% + \glssymbolaccessdisplay{\Glsentrysymbol{#1}}{#1}% + }% +} +% \end{macrocode} +% %\begin{macro}{\accsuppglossaryentryfield} % \begin{macrocode} \newcommand*{\accsuppglossaryentryfield}[5]{% @@ -16682,7 +19989,7 @@ false,nolabel,autolabel}[nolabel]{% %\begin{macro}{\accsuppglossarysubentryfield} % \begin{macrocode} \newcommand*{\accsuppglossarysubentryfield}[6]{% - \glossaryentryfield{#1}{#2}% + \glossarysubentryfield{#1}{#2}% {\glsnameaccessdisplay{#3}{#2}}% {\glsdescriptionaccessdisplay{#4}{#2}}% {\glssymbolaccessdisplay{#5}{#2}}{#6}% @@ -16993,7 +20300,7 @@ false,nolabel,autolabel}[nolabel]{% % support is required, but the \isty{translator} package is not loaded. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-babel}[2009/04/16 v1.2 (NLCT)] +\ProvidesPackage{glossaries-babel}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} % English: % \begin{macrocode} @@ -17308,7 +20615,7 @@ false,nolabel,autolabel}[nolabel]{% %\subsection{Polyglossia Captions} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries-polyglossia}[2009/11/09 v1.0 (NLCT)] +\ProvidesPackage{glossaries-polyglossia}[2013/11/14 v4.0 (NLCT)] % \end{macrocode} % English: % \begin{macrocode} @@ -17846,15 +21153,29 @@ false,nolabel,autolabel}[nolabel]{% % A further run through LaTeX will be required to ensure that % the table of contents is up to date if the toc option % is used. + % Alternatively, if you use arara, you can add the following + % directives in your document: + % + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + \documentclass{article} \listfiles \usepackage[colorlinks]{hyperref} - \usepackage{glossaries} % acronym will go in main glossary - %\usepackage[acronym]{glossaries} % make a separate list of acronyms + %\usepackage{glossaries} % acronym will go in main glossary + \usepackage[acronym]{glossaries} % make a separate list of acronyms \makeglossaries +\longnewglossaryentry{par}{name={par}}% +{% + A long description with a paragraph break. + + This is the next paragraph. +} + \newglossaryentry{sample}{name={sample}, description={a sample entry}} @@ -17869,6 +21190,9 @@ A \gls{sample} entry and \gls{aca}. Second use: \gls{aca}. Plurals: \glspl{sample}. Reset acronym\glsreset{aca}. First use: \glspl{aca}. Second use: \glspl{aca}. +If you want paragraph breaks in the description use +\verb|\longnewglossaryentry|, as with entry \gls{par}. + \printglossaries \end{document} % \end{macrocode} @@ -17885,6 +21209,11 @@ First use: \glspl{aca}. Second use: \glspl{aca}. %\fi %\iffalse % \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{article} \usepackage[colorlinks]{hyperref} @@ -17908,10 +21237,10 @@ a \gls{pear}}} \newglossaryentry{fruit}{name=fruit, description={sweet, fleshy product of plant containing seed}} -% \glssee{fruit}{pear,apple,banana} +\glssee{fruit}{pear,apple,banana} \begin{document} -%\gls{pear}, \gls{apple} and \gls{banana}. +\gls{pear}, \gls{apple} and \gls{banana}. \printglossaries @@ -17931,15 +21260,17 @@ description={sweet, fleshy product of plant containing seed}} %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{report} \usepackage[colorlinks]{hyperref} \usepackage[acronym, % create list of acronyms nomain, % don't need main glossary for this example style=tree, % need a style that displays the symbol - hyperfirst=false,% don't hyperlink first use - sanitize=none % switch off sanitization as description - % will be used in the main text + hyperfirst=false% don't hyperlink first use ]{glossaries} \makeglossaries @@ -17951,7 +21282,7 @@ description={sweet, fleshy product of plant containing seed}} % document the short form will be displayed in small caps, but in % the list of acronyms the short form is displayed in normal % capitals. To ensure this, the short form should be written in - % lower case when the acronym is defined, and \MakeUppercase is + % lower case when the acronym is defined, and \MakeTextUppercase is % used when it's displayed in the list of acronyms. % In the list of acronyms, the long form is used as the name, the @@ -17960,28 +21291,14 @@ description={sweet, fleshy product of plant containing seed}} \renewcommand*{\CustomAcronymFields}{% name={\the\glslongtok},% - symbol={\MakeUppercase{\the\glsshorttok}},% + symbol={\MakeTextUppercase{\the\glsshorttok}},% text={\textsc{\the\glsshorttok}},% plural={\textsc{\the\glsshorttok}\noexpand\acrpluralsuffix}% } \renewcommand*{\SetCustomDisplayStyle}[1]{% - % ##1 corresponds to the 'first' key - % ##2 corresponds to the 'description' key - % ##3 corresponds to the 'symbol' key - % ##4 is the inserted text given by the final optional argument to - % commands like \gls - % The short form can be obtained via \glsentryshort{\glslabel} - % The plural short form can be obtained via - % \glsentryshortplural{\glslabel} - % The long form can be obtained via \glsentrylong{\glslabel} - % The plural long form can be obtained via - % \glsentrylongplural{\glslabel} - \defglsdisplayfirst[#1]{##1##4\protect\footnote{% - \glsentrylong{\glslabel}: ##2}}% - % ##1 corresponds to the 'text' key - % the rest as above - \defglsdisplay[#1]{##1##4}% + \defglsentryfmt[#1]{\glsgenentryfmt + \ifglsused{\glslabel}{}{\footnote{\glsentrylong{\glslabel}}}}% } % Now set the custom acronym style (to override the default style) @@ -18020,6 +21337,10 @@ Sheet} %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{article} \usepackage[acronym]{glossaries} @@ -18028,11 +21349,11 @@ Sheet} \newcommand*{\newdualentry}[5][]{% \newglossaryentry{main-#2}{name={#4},% - text={#3\protect\glsadd{#2}},% + text={#3\glsadd{#2}},% description={#5},% #1 }% - \newacronym{#2}{#3\protect\glsadd{main-#2}}{#4} + \newacronym{#2}{#3\glsadd{main-#2}}{#4} } \newdualentry{svm}% label @@ -18057,12 +21378,178 @@ Sheet} %\fi %\iffalse % \begin{macrocode} +%<*sample-entryfmt.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{article} + +\usepackage[colorlinks]{hyperref} +\usepackage[style=tree]{glossaries} + +\makeglossaries + +\renewcommand*{\glsentryfmt}{% + \glsgenentryfmt + \ifglsused{\glslabel}{}{\space (\glsentrysymbol{\glslabel})}% +} + +\newglossaryentry{distance}{name=distance, +description={The length between two points}, +symbol={km}} + +\begin{document} + +First use: \gls{distance}. Next use: \gls{distance}. + +\printglossaries + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample-FnDesc.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you are using arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{report} + +\usepackage[colorlinks]{hyperref} +\usepackage[hyperfirst=false]{glossaries} + +\makeglossaries + +\renewcommand*{\glsentryfmt}{% + \glsgenentryfmt + \ifglsused{\glslabel}{}{\footnote{\glsentrydesc{\glslabel}}}% +} + +\newglossaryentry{sample}{name={sample},description={an example +description}} + +\begin{document} +\chapter{Sample Chapter} + +First use: \gls{sample}. + +Next use: \gls{sample}. + +\printglossaries +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample-index.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{report} + +\usepackage[colorlinks]{hyperref} +\usepackage[toc]{glossaries} +\usepackage{glossary-mcols} + +\newglossary[ilg]{index}{ind}{idx}{\indexname} + +\makeglossaries + +\newcommand*{\newterm}[2][]{% + \newglossaryentry{#2}{type={index},name={#2},description={\nopostdesc},#1}% +} + +% define terms for the index + +\newterm[plural={stegosauruses}]{stegosaurus} +\newterm[plural={triceratopses}]{triceratops} +\newterm[plural={apatosauruses}]{apatosaurus} + +\newterm[name={dinosaur}]{ind-dinosaur} +\newterm[name={Triassic}]{ind-triassic} + +% define terms for the main glossary + +\newglossaryentry{dinosaur}% +{% + name={dinosaur\glsadd{ind-dinosaur}},% + description={One of a group of dinosauria}% +} + +\newglossaryentry{Triassic}% +{% + name={Triassic\glsadd{ind-triassic}},% + description={The first period of the Mesozoic Era} +} + +\begin{document} +\tableofcontents + +\chapter{Dinosaurs} + +\Glspl{dinosaur} are now extinct. They first appeared during the +\gls{Triassic} period. Examples of \glspl{dinosaur} include the +\gls{triceratops}, the \gls{apatosaurus} and the \gls{stegosaurus}. + +\renewcommand*{\glsnamefont}[1]{\textbf{\makefirstuc{#1}}} + +\printglossary[style=long,nogroupskip] + +\renewcommand*{\glsnamefont}[1]{\textmd{#1}} + +\printglossary[type=index,style=mcolindexgroup] + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*sample-inline.tex> % \end{macrocode} %\fi %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass[a4paper]{report} \usepackage[plainpages=false,colorlinks]{hyperref} @@ -18072,7 +21559,7 @@ Sheet} \renewcommand*{\glossarysection}[2][]{\textbf{#1}: } \renewcommand{\glsnamefont}[1]{\textsc{#1}} -\glossarystyle{inline} +\setglossarystyle{inline} \makeglossaries @@ -18219,6 +21706,11 @@ There are two types of ordering: word ordering (which places %\fi %\iffalse % \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass[english,french]{article} \usepackage[utf8]{inputenc} @@ -18231,77 +21723,212 @@ There are two types of ordering: word ordering (which places \makeglossaries - % \newword{label}{english}{determiner}{french} -\newcommand*{\newword}[4]{% - \newglossaryentry{en-#1}{type=english,name={#2},description={#3 #4}}% - \newglossaryentry{fr-#1}{type=french,name={#3 #4},text={#4},sort={#4},description={#2}}% -} + % \newword{label}{english}{determiner}{french} +\newcommand*{\newword}[4]{% + \newglossaryentry{en-#1}{type=english,name={#2},description={#3 #4}}% + \newglossaryentry{fr-#1}{type=french,name={#3 #4},text={#4},sort={#4},description={#2}}% +} + +\newword{cat}{cat}{le}{chat} +\newword{mat}{mat}{la}{natte} + +\begin{document} +\selectlanguage{english} +The \gls{en-cat} sat on the \gls{en-mat}. + +\selectlanguage{french} +Le \gls{fr-cat} s'est repos\'e sur la \gls{fr-mat}. + +\selectlanguage{english} +\printglossary[type=english] + +\selectlanguage{french} +\printglossary[type=french] +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample-mfirstuc.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directive: + % arara: pdflatex: { synctex: on } +\documentclass{article} + +\usepackage{mfirstuc} + +\begin{document} + +\makefirstuc{abc}. + +\makefirstuc{{\em abc}}. + +\makefirstuc{\emph{abc}}. + +\makefirstuc{\ae bc}. + +\makefirstuc{{\ae}bc}. + +\newcommand{\abc}{abc}% +\xmakefirstuc{\abc}. + +\capitalisewords{a book of rhyme.} + +\capitalisewords{a book\space of rhyme.} + +\newcommand{\mytitle}{a book\space of rhyme.} +\capitalisewords{\mytitle} + +\xcapitalisewords{\mytitle} + + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample-newkeys.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you are using arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{article} + +\usepackage[colorlinks]{hyperref} +\usepackage[nopostdot,nogroupskip]{glossaries} + +\glsaddkey*% star version needed as default value needs expanding + {ed}% key + {\glsentrytext{\glslabel}ed}% default value + {\glsentryed}% command analogous to \glsentrytext + {\Glsentryed}% command analogous to \Glsentrytext + {\glsed}% command analogous to \glstext + {\Glsed}% command analogous to \Glstext + {\GLSed}% command analogous to \GLStext + +\glsaddkey* + {ing}% key + {\glsentrytext{\glslabel}ing}% default value + {\glsentrying}% command analogous to \glsentrytext + {\Glsentrying}% command analogous to \Glsentrytext + {\glsing}% command analogous to \glstext + {\Glsing}% command analogous to \Glstext + {\GLSing}% command analogous to \GLStext + + +\makeglossaries + +\newglossaryentry{jump}{name={jump},description={}} -\newword{cat}{cat}{le}{chat} -\newword{mat}{mat}{la}{natte} +\newglossaryentry{run}{name={run},% + ed={ran},% + ing={running}, + description={}} + +\newglossaryentry{waddle}{name={waddle},% + ed={waddled},% + ing={waddling},% + description={}} \begin{document} -\selectlanguage{english} -The \gls{en-cat} sat on the \gls{en-mat}. -\selectlanguage{french} -Le \gls{fr-cat} s'est repos\'e sur la \gls{fr-mat}. +This is a sample document illustrating how to add new glossary entry +keys. -\selectlanguage{english} -\printglossary[type=english] +The dog \glsed{jump} over the duck. + +The duck was \glsing{waddle} round the dog. + +The dog \glsed{run} away from the duck. + +\printglossaries -\selectlanguage{french} -\printglossary[type=french] \end{document} % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -%<*sample-mfirstuc.tex> +%<*sample-nomathhyper.tex> % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -\documentclass{article} - -\usepackage{mfirstuc} - -\begin{document} - -\makefirstuc{abc}. - -\makefirstuc{{\em abc}}. - -\makefirstuc{\emph{abc}}. + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{report} -\makefirstuc{\ae bc}. +\usepackage[colorlinks]{hyperref} +\usepackage{glossaries} -\makefirstuc{{\ae}bc}. +\makeglossaries -\newcommand{\abc}{abc}% -\xmakefirstuc{\abc}. + % switch off hyperlinks: +\glsdisablehyper -\capitalisewords{a book of rhyme.} + % redefine \glsentryfmt so that it adds a hyperlink + % if not in math mode +\renewcommand*{\glsentryfmt}{% + \ifmmode + \glsgenentryfmt + \else + % Temporarily enable hyperlinks: + \glsenablehyper + \glshyperlink[\glsgenentryfmt]{\glslabel}% + % Disable hyperlinks again + \glsdisablehyper + \fi +} -\capitalisewords{a book\space of rhyme.} +\renewcommand{\glossarypreamble}{\glsenablehyper} +\renewcommand{\glossarypostamble}{\glsdisablehyper} -\newcommand{\mytitle}{a book\space of rhyme.} -\capitalisewords{\mytitle} + % define a sample entry: +\newglossaryentry{x}{name={x},description={sample entry}} -\xcapitalisewords{\mytitle} +\begin{document} +\chapter{Sample} +In text mode: \gls{x}. Inline maths: $\gls{x}$. Displayed +maths: +\[ + \gls{x} +\] +Back to text mode again: \gls{x}. +\printglossaries \end{document} % \end{macrocode} %\fi %\iffalse % \begin{macrocode} -% +% % \end{macrocode} %\fi %\iffalse @@ -18311,6 +21938,12 @@ Le \gls{fr-cat} s'est repos\'e sur la \gls{fr-mat}. %\fi %\iffalse % \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass{report} \usepackage[colorlinks]{hyperref} @@ -18354,12 +21987,139 @@ Here's some more information about \glspl{sample}. %\fi %\iffalse % \begin{macrocode} +%<*sample-prefix.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } + +\documentclass{article} + +\usepackage[colorlinks]{hyperref} +\usepackage[toc,acronym]{glossaries-prefix} + +\makeglossaries + +\newglossaryentry{sample}{name={sample}, + description={an example}, + prefix={a~}, + prefixplural={the\space}% +} + +\newglossaryentry{oeil}{name={oeil}, + plural={yeux}, + description={eye}, + prefix={l'}, + prefixplural={les\space}} + +\newacronym + [% + prefix={an\space},prefixfirst={a~}% + ]{svm}{SVM}{support vector machine} + +\newglossarystyle{plist}{% + \setglossarystyle{list}% + \renewcommand*{\glossentry}[2]{% + \item[\glsentryitem{##1}% + \Glsentryprefix{##1}% + \glstarget{##1}{\glossentryname{##1}}] + \glossentrydesc{##1}\glspostdescription\space ##2}% +} + +\begin{document} + +\tableofcontents + +\section{Sample} + +First use: \pgls{sample}, \pgls{svm}, \pgls{oeil}. Next use: \pgls{sample}, \pgls{svm}, \pgls{oeil}. + +Reset. \glsresetall + +First use: \pglspl{sample}, \pglspl{svm}, \pglspl{oeil}. Next use: +\pglspl{sample}, \pglspl{svm}, \pglspl{oeil}. + +Reset. \glsresetall + +First use: \Pgls{sample}, \Pgls{svm}. Next use: \Pgls{sample}, \Pgls{svm}. + +Reset. \glsresetall + +First use: \Pglspl{sample}, \Pglspl{svm}. Next use: \Pglspl{sample}, \Pglspl{svm}. + +Reset. \glsresetall + +First use: \PGLS{sample}, \PGLS{svm}. Next use: \PGLS{sample}, \PGLS{svm}. + +Reset. \glsresetall + +First use: \PGLSpl{sample}, \PGLSpl{svm}. Next use: \PGLSpl{sample}, \PGLSpl{svm}. + +\printglossary[style=plist] + +\printacronyms +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%<*sample-si.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{article} +\usepackage{siunitx} +\usepackage[style=long4col]{glossaries} +% +\makeglossaries +% +\newglossaryentry{ohm}{% + name=ohm, + symbol={\si{\ohm}}, + description=unit of electrical resistance% +} +% +\begin{document} +\glsaddallunused +% +\printglossaries +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*sample.tex> % \end{macrocode} %\fi %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass[a4paper]{report} \usepackage[plainpages=false,colorlinks]{hyperref} @@ -18509,6 +22269,10 @@ There are two types of ordering: word ordering (which places %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass[a4paper]{article} \usepackage[style=long4colheaderborder]{glossaries} @@ -18548,9 +22312,15 @@ measured in kilograms. %\iffalse % \begin{macrocode} % This file is public domain -\documentclass{article} + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass[a4paper]{article} -\usepackage[acronym,smallcaps]{glossaries-accsupp} +\usepackage[margin=0.5in]{geometry} +\usepackage{booktabs} +\usepackage[acronym]{glossaries-accsupp} \makeglossaries @@ -18560,16 +22330,28 @@ measured in kilograms. \newacronym{eg}{e.g.}{for example} -\begin{document} -\gls{dr}~Jones. -\gls{dr}~Jones. +\newcommand*{\samplerow}[1]{% + \gls{#1} & \gls{#1} & \acrshort{#1} & \acrlong{#1}\\ + \glsreset{#1}\Gls{#1} & \Gls{#1} & \Acrshort{#1} & \Acrlong{#1}\\ + \glsreset{#1}\GLS{#1} & \GLS{#1} & \ACRshort{#1} & \ACRlong{#1}\\ +} -\Gls{eg}, \gls{eg}, \acrshort{eg}, \acrlong{eg}, \acrfull{eg}. +\begin{document} -\Acrshort{eg}, \ACRshort{eg}. \Acrlong{eg}, \ACRlong{eg}. -\Acrfull{eg}, \ACRfull{eg}. +\begin{center} +\begin{tabular}{lllll} +\toprule +\bfseries First & \bfseries Next & \bfseries Short & \bfseries Long +\\\midrule +\samplerow{dr} +\midrule +\samplerow{eg} +\midrule +\samplerow{svm} +\bottomrule +\end{tabular} +\end{center} -\gls{svm}. \gls{svm}, \acrshort{svm}, \acrlong{svm}, \acrfull{svm}. \printglossaries \end{document} @@ -18588,6 +22370,11 @@ measured in kilograms. %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass[a4paper]{report} \usepackage[colorlinks,plainpages=false]{hyperref} @@ -18683,6 +22470,11 @@ You don't need to worry about makeindex's special characters: %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass[a4paper]{report} \usepackage[colorlinks,plainpages=false]{hyperref} @@ -18766,6 +22558,10 @@ one \gls[format=hyperbf]{svm}. %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{article} \usepackage[acronym,footnote,acronymlists={main,acronym2}]{glossaries} @@ -18815,6 +22611,10 @@ one \gls[format=hyperbf]{svm}. %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{article} \usepackage[colorlinks,plainpages=false]{hyperref} @@ -18851,13 +22651,18 @@ one \gls[format=hyperbf]{svm}. % This file is public domain % % See also sampleAcrDesc.tex + % + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass[a4paper]{report} \usepackage[colorlinks,plainpages=false]{hyperref} \usepackage[style=altlist, % use altlist style - toc, % add the glossary to the table of contents - sanitize={description=false}% don't sanitize description + toc % add the glossary to the table of contents ]{glossaries} \makeglossaries @@ -18866,10 +22671,8 @@ one \gls[format=hyperbf]{svm}. % how the entry name should appear in the glossary name={Support vector machine (SVM)}, % how the description should appear in the glossary - % since I have used sanitize={description=false} - % I have to protect fragile commands description={Statistical pattern recognition -technique~\protect\cite{svm}}, +technique~\cite{svm}}, % how the entry should appear in the document text text={svm}, % how the entry should appear the first time it is @@ -18935,7 +22738,7 @@ one \gls[format=hyperbf]{svm}. \usepackage{amsmath} \usepackage[colorlinks]{hyperref} -\usepackage[toc,ucmark,style=long3colheader,counter=equation]{glossaries} +\usepackage[xindy,toc,ucmark,style=long3colheader,counter=equation]{glossaries} \makeglossaries @@ -19199,6 +23002,13 @@ Bessel functions $Z_\nu$ are solutions of % (Note that this problem is avoided if the page numbering is % reset after the glossary. For example, if the glossary has % roman numbering and the subsequent pages have arabic numbering) + % + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass[a4paper,12pt]{report} \usepackage{amsmath} @@ -19486,11 +23296,16 @@ Bessel functions $Z_\nu(z)$ are solutions of %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass{report} \usepackage[plainpages=false,colorlinks]{hyperref} \usepackage{html} -\usepackage[toc,savewrites,xindy]{glossaries} +\usepackage[toc,xindy]{glossaries} % Define a new glossary type called notation \newglossary[nlg]{notation}{not}{ntn}{Notation} @@ -19577,12 +23392,88 @@ The factorial symbol: \gls{not:fact}. %\fi %\iffalse % \begin{macrocode} +%<*samplePeople.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you are using arara, you need the following directives: + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } +\documentclass{report} + +\usepackage[colorlinks]{hyperref} +\usepackage[toc]{glossaries} + +\makeglossaries + +\newcommand{\sortname}[2]{#2, #1} +\newcommand{\textname}[2]{#1 #2} + + % Syntax: \name{first name}{surname} + \let\name\textname + +\renewcommand{\glsprestandardsort}[3]{% + \let\name\sortname + \edef#1{\expandafter\expandonce\expandafter{#1}}% + \let\name\textname + \glsdosanitizesort +} + +\newglossaryentry{joebloggs}{name={\name{Joe}{Bloggs}},description={\nopostdesc}} + +\newglossaryentry{johnsmith}{name={\name{John}{Smith}},description={\nopostdesc}} + +\newglossaryentry{zoeadams}{name={\name{Zo\'e}{Adams}},description={\nopostdesc}} + +\newglossaryentry{maryadams}{name={\name{Mary}{Adams}},description={\nopostdesc}} + +\begin{document} +\tableofcontents + +\chapter{\glsentrytext{joebloggs}} + +\gls{joebloggs} was a fairly ordinary person. + +\chapter{\glsentrytext{johnsmith}} + +\gls{johnsmith} was great friends with \gls{joebloggs}. + +\chapter{\glsentrytext{maryadams}} + +\gls{maryadams} worked with \gls{johnsmith} but never met +\gls{joebloggs}. + +\chapter{\glsentrytext{zoeadams}} + +\gls{zoeadams} was \gls{maryadams}['s] sister. +\printglossaries + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*sampleSec.tex> % \end{macrocode} %\fi %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } \documentclass{report} \usepackage[plainpages=false,colorlinks]{hyperref} @@ -19650,12 +23541,132 @@ Another \gls{ident} entry. %\fi %\iffalse % \begin{macrocode} +%<*sampleSort.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} + % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } + % arara: pdflatex: { synctex: on } +\documentclass{report} + +\usepackage[plainpages=false,colorlinks]{hyperref} +\usepackage[toc,acronym]{glossaries} + + % Define a new glossary type called notation +\newglossary[nlg]{notation}{not}{ntn}{Notation} + +\makeglossaries + +\newcounter{sortcount} + +\renewcommand{\glsprestandardsort}[3]{% + \ifdefstring{#2}{notation}% + {% + \stepcounter{sortcount}% + \edef#1{\glssortnumberfmt{\arabic{sortcount}}}% + }% + {% + \glsdosanitizesort + }% +} + + % Notation definitions + +\newglossaryentry{not:set}{type=notation, % glossary type +name={$\mathcal{S}$}, +text={\mathcal{S}}, +description={A set}} + +\newglossaryentry{not:emptyset}{type=notation, +name={$\emptyset$}, +text={\emptyset}, +description={The empty set}} + +\newglossaryentry{not:card}{type=notation, +name={$|\mathcal{S}|$}, +text={|\mathcal{S}|}, +description={cardinality of $\mathcal{S}$}} + + % Main glossary definitions + +\newglossaryentry{gls:set}{name=set, +description={A collection of distinct objects}} + +\newglossaryentry{gls:card}{name=cardinality, +description={The number of elements in the specified set}} + + % Acronym definitions + +\newacronym{zfc}{ZFC}{Zermelo-Fraenkel set theory} + +\newacronym{ad}{AD}{axiom of determinacy} + +\newacronym{nf}{NF}{new foundations} + +\begin{document} +\title{Sample Document using the glossaries Package} +\author{Nicola Talbot} +\pagenumbering{alph} +\maketitle + +\begin{abstract} + %stop hyperref complaining about duplicate page identifiers: +\pagenumbering{Alph} +This is a sample document illustrating the use of the +\textsf{glossaries} package. In this example, a new glossary type +called \texttt{notation} is defined, so that the document can have a +separate glossary of terms, list of acronyms and index of notation. +\end{abstract} + + +\pagenumbering{roman} +\tableofcontents + +\printglossaries + +\chapter{Introduction} +\pagenumbering{arabic} + +\Glspl{gls:set} are denoted by a calligraphic font +e.g.\ $\gls{not:set}$. + +The \gls{gls:card} of a set $\mathcal{S}$ is denoted +$\gls{not:card}$. The empty set is denoted +$\gls{not:emptyset}$. + +Here are some acronyms: \gls{nf}, \gls{zfc} and \gls{ad}. + +\chapter{Another Chapter} + +Another mention of the empty set $\gls{not:emptyset}$. + +Here are the acronyms again: \gls{nf}, \gls{zfc} and \gls{ad}. + +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +% +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*sampletree.tex> % \end{macrocode} %\fi %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{report} \usepackage[colorlinks]{hyperref} @@ -19735,6 +23746,10 @@ The letter \gls{C} represents Euler's constant. %\iffalse % \begin{macrocode} % This file is public domain + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{article} \usepackage[utf8]{inputenc} @@ -19743,9 +23758,9 @@ The letter \gls{C} represents Euler's constant. \makeglossaries -% Note that because the é is the first letter of the -% name, it needs to be grouped or it will cause a -% problem for \makefirstuc due to expansion issues. + % Note that because the é is the first letter of the + % name, it needs to be grouped or it will cause a + % problem for \makefirstuc due to expansion issues. \newglossaryentry{elite}{name={{é}lite}, description={select group or class}} @@ -19758,8 +23773,8 @@ description=large deer} \newglossaryentry{mannerly}{name=mannerly, description=polite} -% The œ is not the first letter, so it doesn't need to -% be grouped. + % The œ is not the first letter, so it doesn't need to + % be grouped. \newglossaryentry{manoeuvre}{name={manœuvre}, description=planned and controlled movement} @@ -19777,7 +23792,6 @@ description={canal from mouth to stomach}} description=man-eating giant} \begin{document} -\null % ensure that the first run produces some output \glsaddall \printglossaries @@ -20070,6 +24084,10 @@ This page discusses \gls{mcnemar} who introduced % % xindy -L english -C utf8 -I xindy -M samplexdy -t samplexdy.glg -o samplexdy.gls samplexdy.glo % + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{article} \usepackage[utf8]{inputenc} @@ -20332,6 +24350,10 @@ This page discusses \gls{mcnemar} who introduced % % This sample file won't work with makeindex % + % If you want to use arara, you need the following directives: + % arara: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } \documentclass{report} \usepackage[utf8]{inputenc} @@ -20372,6 +24394,7 @@ the glossaries package. \part{First Part} \chapter{Sample Chapter} +This example document has an eccentric section numbering system. \section{First Section} diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins index d374e0f50cd..c337a6f6a95 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 2013/7/5 21:47 +% glossaries.ins generated using makedtx version 1.1 2013/11/14 14:05 \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, mfirstuc.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, 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-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample-inline.tex, sample-langdict.tex, sample-mfirstuc.tex, sample-numberlist.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, sampleSec.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl, mfirstuc.perl. + This work consists of the files glossaries.dtx and glossaries.ins and the derived files glossaries.sty, glossaries-prefix.sty, mfirstuc.sty, glossary-hypernav.sty, glossary-inline.sty, glossary-list.sty, glossary-long.sty, glossary-longragged.sty, glossary-mcols.sty, glossary-super.sty, glossary-superragged.sty, glossary-tree.sty, glossaries-compatible-207.sty, glossaries-compatible-307.sty, glossaries-accsupp.sty, glossaries-babel.sty, glossaries-polyglossia.sty, glossaries-dictionary-Brazilian.dict, 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-Polish.dict, glossaries-dictionary-Serbian.dict, glossaries-dictionary-Spanish.dict, minimalgls.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample-entryfmt.tex, sample-FnDesc.tex, sample-index.tex, sample-inline.tex, sample-langdict.tex, sample-mfirstuc.tex, sample-newkeys.tex, sample-nomathhyper.tex, sample-numberlist.tex, sample-prefix.tex, sample-si.tex, sample.tex, sample4col.tex, sampleaccsupp.tex, sampleAcr.tex, sampleAcrDesc.tex, sampleacronyms.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleNtn.tex, samplePeople.tex, sampleSec.tex, sampleSort.tex, sampletree.tex, sampleutf8.tex, samplexdy-compatible207.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl, mfirstuc.perl. \endpreamble @@ -26,6 +26,8 @@ \generate{\file{glossaries.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries.sty,package}} +\file{glossaries-prefix.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-prefix.sty,package}} \file{mfirstuc.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{mfirstuc.sty,package}} \file{glossary-hypernav.sty}{\usepreamble\defaultpreamble @@ -48,6 +50,8 @@ \usepostamble\defaultpostamble\from{glossaries.dtx}{glossary-tree.sty,package}} \file{glossaries-compatible-207.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-207.sty,package}} +\file{glossaries-compatible-307.sty}{\usepreamble\defaultpreamble +\usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-compatible-307.sty,package}} \file{glossaries-accsupp.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{glossaries.dtx}{glossaries-accsupp.sty,package}} \file{glossaries-babel.sty}{\usepreamble\defaultpreamble @@ -82,10 +86,17 @@ \file{sample-crossref.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-crossref.tex}} \file{sample-custom-acronym.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-custom-acronym.tex}} \file{sample-dual.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-dual.tex}} +\file{sample-entryfmt.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-entryfmt.tex}} +\file{sample-FnDesc.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-FnDesc.tex}} +\file{sample-index.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-index.tex}} \file{sample-inline.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-inline.tex}} \file{sample-langdict.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-langdict.tex}} \file{sample-mfirstuc.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-mfirstuc.tex}} +\file{sample-newkeys.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-newkeys.tex}} +\file{sample-nomathhyper.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-nomathhyper.tex}} \file{sample-numberlist.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-numberlist.tex}} +\file{sample-prefix.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-prefix.tex}} +\file{sample-si.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-si.tex}} \file{sample.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample.tex}} \file{sample4col.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample4col.tex}} \file{sampleaccsupp.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleaccsupp.tex}} @@ -97,7 +108,9 @@ \file{sampleEq.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleEq.tex}} \file{sampleEqPg.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleEqPg.tex}} \file{sampleNtn.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleNtn.tex}} +\file{samplePeople.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{samplePeople.tex}} \file{sampleSec.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleSec.tex}} +\file{sampleSort.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleSort.tex}} \file{sampletree.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampletree.tex}} \file{sampleutf8.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sampleutf8.tex}} \file{samplexdy-compatible207.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{samplexdy-compatible207.tex}} -- cgit v1.2.3