diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries')
3 files changed, 1284 insertions, 112 deletions
diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx index 4422a782e6f..2f8ddb199a9 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -21,7 +21,7 @@ % -doc "glossaries-manual.tex" % -codetitle "Documented Code" % glossaries -% Created on 2008/6/18 16:44 +% Created on 2008/8/27 12:55 %\fi %\iffalse %<*package> @@ -72,7 +72,7 @@ \makeatother \RecordChanges \PageIndex -\CheckSum{5121} +\CheckSum{5329} \CodelineNumbered \newcommand*{\termdef}[1]{\emph{#1}\iterm{#1}} \newcommand*{\term}[1]{#1\iterm{#1}} @@ -124,7 +124,7 @@ %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{glossaries.sty v 1.14: \LaTeXe\ Package to Assist Generating Glossaries} +% \title{glossaries.sty v 1.16: \LaTeXe\ Package to Assist Generating Glossaries} % \author{Nicola L.C. Talbot\\[10pt] %School of Computing Sciences\\ %University of East Anglia\\ @@ -132,7 +132,7 @@ %NR4 7TJ. United Kingdom.\\ %\url{http://theoval.cmp.uea.ac.uk/~nlct/}} % -% \date{18th June 2008} +% \date{27th August 2008} % \maketitle %\tableofcontents % @@ -252,7 +252,7 @@ %\deftranslation[to=Irish]{Symbol (glossaries)}{Siombail} %\end{verbatim} % -%\subsection{Generating the associated glossary files} +%\subsection{Generating the Associated Glossary Files} %\label{sec:makeglossaries} % %The \sty{glossaries} package comes with the Perl script @@ -662,14 +662,14 @@ %\end{verbatim} %In this example the relevant glossary entry will have the %page number in bold (since it uses \cs{textbf}) but -%it will no longer have a hyperlink (if hyperlinks are enabled.) +%it will no longer have a hyperlink (if hyperlinks are enabled). % %\item The \sty{glossaries} package provides commands to %change the font whilst ensuring that the number remains a %hyperlink. These are of the form \cs{hyper}\meta{xx} and %are equivalent to the standard font changing commands of the %form \cs{text}\meta{xx}, as well as \ics{hyperemph} -%(which uses \ics{emph}.) For example: +%(which uses \ics{emph}). For example: %\begin{verbatim} %The primary definition of \glspl[format=hyperbf]{singmtx}. %\end{verbatim} @@ -720,11 +720,21 @@ %a term that doesn't appear in the document, then it means %you haven't used it in the text (either via \ics{glslink} %or \ics{gls} and related commands, or via \ics{glsadd} -%or \ics{glsaddall}.) +%or \ics{glsaddall}). % %\item To change the sorting order, use the \gloskey{sort} key. %For example: %\begin{verbatim} +%\newglossaryentry{tex}{name={\TeX}, +%description={A typesetting language}, +%sort=tex} +%\end{verbatim} +%This will put the entry in the \dq{T} group (entries starting with +%the letter \dq{t} or \dq{T}) rather than the +%\dq{symbols} group (entries starting with a symbol). +%Similarly, the following example puts the entry in the \dq{U} +%group instead of the \dq{symbol} group. +%\begin{verbatim} %\newglossaryentry{universal}{name={\ensuremath{\mathcal{U}}}, %description=The universal set, %sort=U} @@ -752,8 +762,12 @@ %The predefined glossary styles that display the entry symbol %are: \glostyle{long4col}, \glostyle{long4colheader}, %\glostyle{long4colborder}, \glostyle{long4colheaderborder}, +% \glostyle{altlong4col}, \glostyle{altlong4colheader}, +%\glostyle{altlong4colborder}, \glostyle{altlong4colheaderborder}, %\glostyle{super4col}, \glostyle{super4colheader}, -%\glostyle{super4colborder} and \glostyle{super4colheaderborder}. +%\glostyle{super4colborder}, \glostyle{super4colheaderborder}. +%\glostyle{altsuper4col}, \glostyle{altsuper4colheader}, +%\glostyle{altsuper4colborder} and \glostyle{altsuper4colheaderborder}. %All the other styles supplied by this package ignore the associated %symbol. % @@ -886,7 +900,7 @@ %glossary styles are listed in \autoref{sec:styles}. %\item[\pkgopt{nonumberlist}] This option will suppress the %associated number lists\iterm{number list} in the glossaries (see also -%\autoref{sec:numberlists}.) +%\autoref{sec:numberlists}). %\item[\pkgopt{counter}] This is a \meta{key}=\meta{value} option. The %value should be the name of the default counter to use in the number %lists\iterm{number list}. @@ -1114,7 +1128,7 @@ %description={A scripting language}} % %\newglossaryentry{tex}{name={\TeX}, -%description={A typesetting language}} +%description={A typesetting language},sort={TeX}} % %\newglossaryentry{html}{type=\glsdefaulttype, %name={html}, @@ -1177,7 +1191,21 @@ %document using one of the commands listed in this section. The %text which appears at that point in the document when using %one of these commands is referred to as the -%\termdef{link text} (even if there are no hyperlinks). +%\termdef{link text} (even if there are no hyperlinks). The commands +%in this section also add a line to an external file that is used +%by \appname{makeindex} to generate the relevant entry in the +%glossary. It is strongly recommended that you don't use the commands +%defined in this section in the arguments of sectioning or caption +%commands. This is particularly important if you are using the +%\sty{glossaries} package in conjunction with the \isty{hyperref} package. +%Instead, use one of the commands listed in +%\autoref{sec:glsnolink} (such as \cs{glsentrytext}) or provide an alternative via +%the optional argument to the sectioning/caption command. +%Examples: +%\begin{verbatim} +%\section{An overview of \glsentrytext{perl}} +%\section[An overview of Perl]{An overview of \gls{perl}} +%\end{verbatim} % %The way the \term{link text} is displayed %depends on \DescribeMacro{\glstextformat}\cs{glstextformat}\marg{text}. @@ -1447,7 +1475,14 @@ %\cs{glspl} (or their uppercase variants). The default definitions %of \cs{glsdisplay} and \cs{glsdisplayfirst} simply %print the first argument immediately followed by the fourth argument. -%The remaining arguments are ignored. +%The remaining arguments are ignored. Note that \ics{glslink} (which +%is used by commands like \cs{gls} and \cs{glspl}) sets +%\DescribeMacro{\glslabel}\ics{glslabel} to the label for the given +%entry (i.e.\ the label supplied to the mandatory argument to +%\cs{gls}), so it is possible to use this label in the definition of +%\cs{glsdisplay} or \cs{glsdisplayfirst} to supply additional +%information using any of the commands described in +%\autoref{sec:glsnolink}, if required. % %For example, suppose you want a glossary of measurements and %units, you can use the \gloskey{symbol} key to store the unit: @@ -1532,8 +1567,7 @@ %within a group. Note that you should only use \cs{glsenablehyper} %if the commands \ics{hyperlink} and \ics{hypertarget} have been %defined (for example, by the \isty{hyperref} package). -% -%\subsection{Adding an entry to the glossary without generating text} +%\subsection{Adding an Entry to the Glossary Without Generating Text} %\label{sec:glsadd} % %\DescribeMacro{\glsadd} @@ -1567,6 +1601,69 @@ %\glsaddall[types={\acronymtype,notation}] %\end{verbatim} % +%\subsection{Using Glossary Terms Without Links} +%\label{sec:glsnolink} +% +%The commands described in this section display entry details without +%adding any information to the glossary. They don't use +%\cs{glstextformat}, they don't have any optional arguments, +%they don't affect the flag that determines if the term has been +%used and they don't produce hyperlinks. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentryname}\cs{glsentryname}\marg{label}\\ +%\DescribeMacro{\Glsentryname}\cs{Glsentryname}\marg{label}\par\vskip10pt\noindent +%These commands display the name of the glossary entry given by +%\meta{label}, as specified by the \gloskey{name} key. +%\cs{Glsentryname} makes the first letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentrytext}\cs{glsentrytext}\marg{label}\\ +%\DescribeMacro{\Glsentrytext}\cs{Glsentrytext}\marg{label}\par\vskip10pt\noindent +%These commands display the subsequent use text for the glossary entry +%given by \meta{label}, as specified by the \gloskey{text} key. +%\cs{Glsentrytext} makes the first letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentryplural}\cs{glsentryplural}\marg{label}\\ +%\DescribeMacro{\Glsentryplural}\cs{Glsentryplural}\marg{label}\par\vskip10pt\noindent +%These commands display the subsequent use plural text for the glossary +%entry given by \meta{label}, as specified by the \gloskey{plural} key. +%\cs{Glsentryplural} makes the first letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentryfirst}\cs{glsentryfirst}\marg{label}\\ +%\DescribeMacro{\Glsentryfirst}\cs{Glsentryfirst}\marg{label}\par\vskip10pt\noindent +%These commands display the first use text for the glossary entry +%given by \meta{label}, as specified by the \gloskey{first} key. +%\cs{Glsentryfirst} makes the first letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentryfirstplural}\cs{glsentryfirstplural}\marg{label}\\ +%\DescribeMacro{\Glsentryfirstplural}\cs{Glsentryfirstplural}\marg{label}\par\vskip10pt\noindent +%These commands display the plural form of the first use text for the +%glossary entry given by \meta{label}, as specified by the +%\gloskey{firstplural} key. \cs{Glsentryfirstplural} makes the first +%letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentrydesc}\cs{glsentrydesc}\marg{label}\\ +%\DescribeMacro{\Glsentrydesc}\cs{Glsentrydesc}\marg{label}\par\vskip10pt\noindent +%These commands display the description for the glossary entry given by +%\meta{label}. \cs{Glsentrydesc} makes the first letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentrydescplural}\cs{glsentrydescplural}\marg{label}\\ +%\DescribeMacro{\Glsentrydescplural}\cs{Glsentrydescplural}\marg{label}\par\vskip10pt\noindent +%These commands display the plural description for the glossary entry +%given by \meta{label}. \cs{Glsentrydescplural} makes the first letter +%uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentrysymbol}\cs{glsentrysymbol}\marg{label}\\ +%\DescribeMacro{\Glsentrysymbol}\cs{Glsentrysymbol}\marg{label}\par\vskip10pt\noindent +%These commands display the symbol for the glossary entry given by +%\meta{label}. \cs{Glsentrysymbol} makes the first letter uppercase. +%\par\vskip10pt\noindent +%\DescribeMacro{\glsentrysymbolplural}\cs{glsentrysymbolplural}\marg{label}\\ +%\DescribeMacro{\Glsentrysymbolplural}\cs{Glsentrysymbolplural}\marg{label}\par\vskip10pt\noindent +%These commands display the plural symbol for the glossary entry given by +%\meta{label}. \cs{Glsentrysymbolplural} makes the first letter uppercase. +% +%For further information see \autoref{sec:code:glsnolink}. +% %\subsection{Displaying a glossary} % %\DescribeMacro{\printglossaries} @@ -1700,6 +1797,7 @@ %\DescribeMacro{\acronymtype}\cs{acronymtype} which is set to %\texttt{acronym}, if the \pkgopt{acronym} option has been used, %otherwise it is set to \texttt{main}. +% %\subsection{Acronyms} %\label{sec:acronyms} % @@ -1874,7 +1972,11 @@ %\pkgopt{footnote}, \pkgopt{dua} %and \pkgopt{description} use \ics{defglsdisplay} and %\ics{defglsdisplayfirst} (described in \autoref{sec:glsdisplay}) -%to change the way the link text is displayed. +%to change the way the link text is displayed. This means that these +%package options only work for the glossary type given by +%\cs{acronymtype}. If you have multiple lists of acronyms, you +%will need to make the appropriate changes for each additional +%glossary type. % %\begin{description} %\item[\pkgopt{description},\pkgopt{footnote}]\mbox{}\par When these two package options are used together, the first use displays @@ -2038,7 +2140,7 @@ %\end{table} % % -%\subsection{Unsetting and resetting entry flags} +%\subsection{Unsetting and Resetting Entry Flags} % %When using \ics{gls}, \ics{glspl} and their uppercase variants it is %possible that you may want to use the value given by the @@ -2115,7 +2217,10 @@ %environment (defined by the \isty{longtable} package). It has two %columns: the first column contains the entry's name and the second %column contains the description followed by the \term{number list}. -%Sub groups are separated with a blank row. +%Sub groups are separated with a blank row. The width of the +%first column is governed by the widest entry in that column. The +%width of the second column is governed by the length +%\ics{glsdescwidth}. % %\item[longborder] The \glostyle{longborder} style is like %\glostyle{long} but has horizontal and vertical lines around it. @@ -2130,7 +2235,11 @@ %\item[long3col] The \glostyle{long3col} style is like %\glostyle{long} but has three columns. The first column contains %the entry's name, the second column contains the description -%and the third column contains the \term{number list}. +%and the third column contains the \term{number list}. The width of the +%first column is governed by the widest entry in that column. The +%width of the second column is governed by the length +%\ics{glsdescwidth}. The width of the third column is governed by the +%length \ics{glspagelistwidth}. % %\item[long3colborder] The \glostyle{long3colborder} style is like %the \glostyle{long3col} style but has horizontal and vertical @@ -2145,7 +2254,10 @@ % %\item[long4col] The \glostyle{long4col} style is like %\glostyle{long3col} but has an additional column in which the -%entry's associated symbol appears. +%entry's associated symbol appears. This style is used for brief +%single line descriptions. The column widths are governed by the +%widest entry in the given column. Use \glostyle{altlong4col} for long +%descriptions. % %\item[long4colborder] The \glostyle{long4colborder} style is like %the \glostyle{long4col} style but has horizontal and vertical @@ -2158,11 +2270,34 @@ %like \glostyle{long4colheader} but has horizontal and vertical lines %around it. % +%\item[altlong4col] The \glostyle{altlong4col} style is like +%\glostyle{long4col} but allows multi-line descriptions and page lists. +%The width of the description column is governed by the length +%\ics{glsdescwidth} and the width of the page list column is +%governed by the length \ics{glspagelistwidth}. The width of the name +%and symbol columns is governed by the widest entry in the +%given column. +% +%\item[altlong4colborder] The \glostyle{altlong4colborder} style is like +%the \glostyle{long4colborder} but allows multi-line descriptions and +%page lists. +% +%\item[altlong4colheader] The \glostyle{altlong4colheader} style is like +%\glostyle{long4colheader} but allows multi-line descriptions and +%page lists. +% +%\item[altlong4colheaderborder] The \glostyle{altlong4colheaderborder} +%style is like \glostyle{long4colheaderborder} but allows multi-line +%descriptions and page lists. +% %\item[super] The \glostyle{super} style uses the \envname{supertabular} %environment (defined by the \isty{supertabular} package). It has two %columns: the first column contains the entry's name and the second %column contains the description followed by the \term{number list}. -%Sub groups are separated with a blank row. +%Sub groups are separated with a blank row. The width of the +%first column is governed by the widest entry in that column. The +%width of the second column is governed by the length +%\ics{glsdescwidth}. % %\item[superborder] The \glostyle{superborder} style is like %\glostyle{super} but has horizontal and vertical lines around it. @@ -2177,7 +2312,11 @@ %\item[super3col] The \glostyle{super3col} style is like %\glostyle{super} but has three columns. The first column contains %the entry's name, the second column contains the description -%and the third column contains the \iterm{number list}. +%and the third column contains the \iterm{number list}. The width of the +%first column is governed by the widest entry in that column. The +%width of the second column is governed by the length +%\ics{glsdescwidth}. The width of the third column is governed by the +%length \ics{glspagelistwidth}. % %\item[super3colborder] The \glostyle{super3colborder} style is like %the \glostyle{super3col} style but has horizontal and vertical @@ -2192,7 +2331,10 @@ % %\item[super4col] The \glostyle{super4col} style is like %\glostyle{super3col} but has an additional column in which the -%entry's associated symbol appears. +%entry's associated symbol appears. This style is designed for +%entries with brief single line descriptions. The column widths are governed by the +%widest entry in the given column. Use \glostyle{altsuper4col} +%for longer descriptions. % %\item[super4colborder] The \glostyle{super4colborder} style is like %the \glostyle{super4col} style but has horizontal and vertical @@ -2205,12 +2347,43 @@ %is like \glostyle{super4colheader} but has horizontal and vertical %lines around it. % +%\item[altsuper4col] The \glostyle{altsuper4col} style is like +%\glostyle{super4col} but allows multi-line descriptions and page +%lists. +%The width of the description column is governed by the length +%\ics{glsdescwidth} and the width of the page list column is +%governed by the length \ics{glspagelistwidth}. The width of the name +%and symbol columns is governed by the widest entry in the +%given column. +% +%\item[altsuper4colborder] The \glostyle{altsuper4colborder} style is like +%the \glostyle{super4colborder} style but allows multi-line descriptions +%and page lists. +% +%\item[altsuper4colheader] The \glostyle{altsuper4colheader} style is like +%\glostyle{super4colheader} but allows multi-line descriptions and +%page lists. +% +%\item[altsuper4colheaderborder] The \glostyle{altsuper4colheaderborder} +%style is like \glostyle{super4colheaderborder} but allows multi-line +%descriptions and page lists. +% %\end{description} % %The glossary style can be set using the \pkgopt{style} package option %or using the \gloskey[printglossary]{style} key in the optional %argument to \ics{printglossary} or using the command:\\[10pt] %\DescribeMacro{\glossarystyle}\cs{glossarystyle}\marg{style-name}\\[10pt] +%The tabular-like styles that allow multi-line descriptions and page +%lists use the length \DescribeMacro{\glsdescwidth}\cs{glsdescwidth} to +%set the width of the description column and the length +%\DescribeMacro{\glspagelistwidth}\cs{glspagelistwidth} to set the +%width of the page list column. These will need to be changed using +%\cs{setlength} if the glossary is too wide. Note that the +%\glostyle{long4col} and \glostyle{super4col} styles (and their header and border +%variations) don't use these lengths as they are designed for single +%line entries. Instead you should use the analogous +%\glostyle{altlong4col} and \glostyle{altsuper4col} styles. % %Note that if you use the \gloskey[printglossary]{style} key in the %optional argument to \ics{printglossary}, it will override any @@ -2229,7 +2402,7 @@ %\glossarystyle{long} %\end{verbatim} %will reset \cs{glsgroupskip} back to its default definition for the -%named glossary style (\dq{long} in this case). If you want to +%named glossary style (\glostyle{long} in this case). If you want to %modify the styles, either use \ics{newglossarystyle} (described %in the next section) or make the modifications after %\ics{glossarystyle}. @@ -2258,7 +2431,7 @@ %This environment defines how the main body of the glossary should %be typeset. Note that this does not include the section heading, %the glossary preamble (defined by \cs{glossarypreamble}) or the -%glossary postamble (defined by \cs{glossarypostamble}.) For example, +%glossary postamble (defined by \cs{glossarypostamble}). For example, %the \glostyle{list} style uses the \envname{description} environment, %so the \envname{theglossary} environment is simply redefined to begin %and end the \envname{description} environment. @@ -2491,13 +2664,14 @@ % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2008/06/17 v1.14 (NLCT)] +\ProvidesPackage{glossaries}[2008/08/27 v1.16 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} \RequirePackage{ifthen} \RequirePackage{xkeyval}[2006/11/18] \RequirePackage{mfirstuc} +\RequirePackage{xfor} % \end{macrocode} % If \isty{babel} package is loaded, check to see if \isty{translator} is installed. % \begin{macrocode} @@ -2621,7 +2795,7 @@ false,nolabel,autolabel}[nolabel]{% % will also be applied to the delimiters. % The \pkgopt{nonumberlist} package option suppresses the % number lists (this simply redefines -% \cs{glossaryentrynumbers} to ignores its argument.) +% \cs{glossaryentrynumbers} to ignores its argument). % \begin{macrocode} \DeclareOptionX{nonumberlist}{% \renewcommand*{\glossaryentrynumbers}[1]{}} @@ -2633,7 +2807,7 @@ false,nolabel,autolabel}[nolabel]{% % affects any commands that can optionally take a glossary name % as an argument (or as the value of the % \gloskey{type}\igloskey[printglossary]{type} key in -%a key-value list.) This was mainly done so that +%a key-value list). This was mainly done so that % \ics{loadglsentries} can temporarily change % \cs{glsdefaulttype} while it loads a file containing % new glossary entries (see \autoref{sec:load}). @@ -2871,6 +3045,14 @@ name=true]{% \providecommand*{\acronymname}{Acronyms} % \end{macrocode} %\end{macro} +%\begin{macro}{\glssettoctitle} +% Sets the TOC title for the given glossary. +%\changes{1.15}{2008 August 15}{new} +% \begin{macrocode} +\newcommand*{\glssettoctitle}[1]{% +\def\glossarytoctitle{\csname @glotype@#1@title\endcsname}} +% \end{macrocode} +%\end{macro} % % The following commands provide text for the headers used by % some of the tabular-like glossary @@ -2924,8 +3106,15 @@ 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} % \begin{macrocode} \@ifpackageloaded{translator}{\usedictionary{glossaries-dictionary}% + \renewcommand*{\glssettoctitle}[1]{% + \ifthenelse{\equal{#1}{main}}{% + \translatelet{\glossarytoctitle}{Glossary}}{% + \ifthenelse{\equal{#1}{acronym}}{% + \translatelet{\glossarytoctitle}{Acronyms}}{% + \def\glossarytoctitle{\csname @glotype@#1@title\endcsname}}}}% \renewcommand*{\glossaryname}{\translate{Glossary}}% \renewcommand*{\acronymname}{\translate{Acronyms}}% \renewcommand*{\entryname}{\translate{Notation (glossaries)}}% @@ -3002,7 +3191,7 @@ name=true]{% %\end{macro} % Individual numbers in an entry's associated number list are % delimited using \cs{delimN} (which corresponds to the -% \istkey{delim\_n} \appname{makeindex} keyword.) The default value +% \istkey{delim\_n} \appname{makeindex} keyword). The default value % is a comma followed by a space. %\begin{macro}{\delimN} % \begin{macrocode} @@ -3011,7 +3200,7 @@ name=true]{% %\end{macro} % A range of numbers within an entry's associated number list is % delimited using \cs{delimR} (which corresponds to the -% \istkey{delim\_r} \appname{makeindex} keyword.) The default is +% \istkey{delim\_r} \appname{makeindex} keyword). The default is % an en-dash. %\begin{macro}{\delimR} % \begin{macrocode} @@ -3042,7 +3231,7 @@ name=true]{% % This is provided to allow the user to % add something after the end of the \envname{theglossary} % environment (again, this shouldn't be affected by the -% glossary style.) It is, of course, possible to simply add the +% glossary style). It is, of course, possible to simply add the % text after \ics{printglossary}, but if you only want the % postamble to appear after the first glossary, but not after % subsequent glossaries, you can do something like: @@ -3260,7 +3449,7 @@ been defined.}{}}{#2}} % in \cs{@glo@types}. When a new glossary type % is created, its identifying name is added to this list. % This is used by commands that iterate through all glossaries -% (such as \ics{makeglossaries} and \ics{printglossaries}.) +% (such as \ics{makeglossaries} and \ics{printglossaries}). %\begin{macro}{\@glo@types} % \begin{macrocode} \newcommand*{\@glo@types}{,} @@ -3282,7 +3471,7 @@ been defined.}{}}{#2}} % belonging to this glossary. The \appname{makeglossaries} Perl % script reads in the relevant extensions from the auxiliary file, % and passes the appropriate file names and switches to -% \appname{makeindex}.) +% \appname{makeindex}. %\begin{macro}{\newglossary} % \begin{macrocode} \newcommand*{\newglossary}[5][glg]{% @@ -3395,7 +3584,7 @@ exists}% % 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 +% commands). The \gloskey{description} key is required when % defining a new glossary entry. (Be careful not to make the % description too long, because \appname{makeindex} has a limited % buffer. \cs{@glo@desc} is defined to be a short command @@ -3418,7 +3607,7 @@ exists}% % % The \gloskey{sort} key needs to be sanitized here % (the sort key is provided for \appname{makeindex}'s benefit, -% not for use in the document.) The \gloskey{sort} key is optional +% 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}. % \begin{macrocode} @@ -3475,7 +3664,7 @@ exists}% % 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.) +% and \ics{defglsdisplayfirst} for individual glossaries). % \begin{macrocode} \define@key{glossentry}{symbol}{% \def\@glo@symbol{#1}% @@ -3547,14 +3736,18 @@ counter as its value}}{% \def\@glo@plural{\@glo@text\glspluralsuffix}% % \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} % \begin{macrocode} -\def\@glo@first{\relax}% +\let\@glo@first\relax % \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} -\def\@glo@firstplural{\relax}% +\let\@glo@firstplural\relax % \end{macrocode} % \begin{macrocode} \def\@glo@sort{\@glo@name}% @@ -3580,16 +3773,19 @@ in it}}{% % 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} -\if\relax\@glo@firstplural\relax% - \if\relax\@glo@first\relax% +\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 \else - \if\relax\@glo@first\relax% + \ifx\relax\@glo@first \def\@glo@first{\@glo@text}% \fi \fi @@ -3604,10 +3800,27 @@ in it}}{% \expandafter\protected@xdef\csname glo@#1@counter\endcsname{\@glo@counter}% \@gls@sanitizename \expandafter\protected@xdef\csname glo@#1@name\endcsname{\@glo@name}% +% \end{macrocode} +% 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}% +% \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}% \expandafter\protected@xdef\csname glo@#1@sort\endcsname{\@glo@sort}% +% \end{macrocode} +%\changes{1.15}{2008 August 15}{check for '@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}% @@ -3632,7 +3845,7 @@ in it}}{% % Each glossary entry is assigned a conditional of the form %\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 +% \ics{ifglsused} defined below). These flags can % be set and unset using the following macros: % % The command \cs{glsreset}\marg{label} can be used @@ -3722,8 +3935,8 @@ in it}}{% % glossary is used. Only those entries used in the document (via % \ics{glslink}, \ics{gls}, \ics{glspl} and uppercase % variants or \ics{glsadd} and \ics{glsaddall} -% will appear in the glossary.) The mandatory argument is -% the filename (with or without .tex extension.) +% will appear in the glossary). The mandatory argument is +% the filename (with or without .tex extension). %\begin{macro}{\loadglsentries} % \begin{macrocode} \newcommand*{\loadglsentries}[2][\@gls@default]{% @@ -3747,7 +3960,7 @@ in it}}{% % \ics{glslink}, the way the term appears in the text is % determined by \ics{glsdisplayfirst} (if it is the first % time the term has been used) or \ics{glsdisplay} (for -% subsequent use.) Any formatting commands (such as \cs{textbf} +% 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}% @@ -3893,9 +4106,11 @@ counter as its value}}{% % Define the un-starred version: %\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} % \begin{macrocode} \newcommand*{\@gls@link}[3][]{% \glsdoifexists{#2}{% +\def\glslabel{#2}% \def\@glsnumberformat{glsnumberformat}% \edef\@gls@counter{\csname glo@#2@counter\endcsname}% \KV@glslink@hypertrue @@ -4245,11 +4460,17 @@ counter as its value}}{% % 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} +\newlength\gls@tmplen \@ifundefined{hypertarget}{% \gdef\@glstarget#1#2{#2}% }{% - \gdef\@glstarget#1#2{\hypertarget{#1}{#2}}} + \gdef\@glstarget#1#2{% + \settoheight{\gls@tmplen}{#2}% + \raisebox{\gls@tmplen}{\hypertarget{#1}{}}#2}% +} % \end{macrocode} %\end{macro} % @@ -4268,7 +4489,9 @@ counter as its value}}{% % \begin{macrocode} \newcommand{\glsenablehyper}{% \renewcommand*\@glslink[2]{\hyperlink{##1}{##2}}% -\renewcommand*\@glstarget[2]{\hypertarget{##1}{##2}}} +\renewcommand*\@glstarget[2]{% + \settoheight{\gls@tmplen}{##2}% + \raisebox{\gls@tmplen}{\hypertarget{##1}{}}##2}} % \end{macrocode} %\end{macro} % @@ -4333,15 +4556,18 @@ counter as its value}}{% % 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} % \begin{macrocode} \ifglsused{#2}{% \@gls@link[#1]{#2}{\@glo@text}% }{% - \ifglsacrfootnote + \ifthenelse{\equal{\@glo@type}{\acronymtype}\and + \boolean{glsacrfootnote}}{% \@gls@link[#1,hyper=false]{#2}{\@glo@text}% - \else + }{% \@gls@link[#1]{#2}{\@glo@text}% - \fi + }% }% % \end{macrocode} % Indicate that this entry has now been used @@ -4353,7 +4579,7 @@ counter as its value}}{% % \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 +% be grouped when you define the entry). It is mainly intended % for terms that start a sentence: %\begin{macro}{\Gls} % \begin{macrocode} @@ -4393,18 +4619,21 @@ counter as its value}}{% % 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} % \begin{macrocode} \ifglsused{#2}{% \@gls@link[#1]{#2}{% \expandafter\makefirstuc\expandafter{\@glo@text}}% }{% - \ifglsacrfootnote + \ifthenelse{\equal{\@glo@type}{\acronymtype}\and + \boolean{glsacrfootnote}}{% \@gls@link[#1,hyper=false]{#2}{% \expandafter\makefirstuc\expandafter{\@glo@text}}% - \else + }{% \@gls@link[#1]{#2}{% \expandafter\makefirstuc\expandafter{\@glo@text}}% - \fi + }% }% % \end{macrocode} % Indicate that this entry has now been used @@ -4453,15 +4682,18 @@ counter as its value}}{% % 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} % \begin{macrocode} \ifglsused{#2}{% \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% }{% - \ifglsacrfootnote + \ifthenelse{\equal{\@glo@type}{\acronymtype}\and + \boolean{glsacrfootnote}}{% \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% - \else + }{% \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - \fi + }% }% % \end{macrocode} % Indicate that this entry has now been used @@ -4514,15 +4746,18 @@ counter as its value}}{% % 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} % \begin{macrocode} \ifglsused{#2}{% \@gls@link[#1]{#2}{\@glo@text}% }{% - \ifglsacrfootnote + \ifthenelse{\equal{\@glo@type}{\acronymtype}\and + \boolean{glsacrfootnote}}{% \@gls@link[#1,hyper=false]{#2}{\@glo@text}% - \else + }{% \@gls@link[#1]{#2}{\@glo@text}% - \fi + }% }% % \end{macrocode} % Indicate that this entry has now been used @@ -4534,7 +4769,7 @@ counter as its value}}{% % \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.) +% will need to be grouped). %\begin{macro}{\Glspl} % \begin{macrocode} \newcommand*{\Glspl}{\@ifstar\@sGlspl\@Glspl} @@ -4577,18 +4812,21 @@ counter as its value}}{% % 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} % \begin{macrocode} \ifglsused{#2}{% \@gls@link[#1]{#2}{% \expandafter\makefirstuc\expandafter{\@glo@text}}% }{% - \ifglsacrfootnote + \ifthenelse{\equal{\@glo@type}{\acronymtype}\and + \boolean{glsacrfootnote}}{% \@gls@link[#1,hyper=false]{#2}{% \expandafter\makefirstuc\expandafter{\@glo@text}}% - \else + }{% \@gls@link[#1]{#2}{% \expandafter\makefirstuc\expandafter{\@glo@text}}% - \fi + }% }% % \end{macrocode} % Indicate that this entry has now been used @@ -4641,15 +4879,18 @@ counter as its value}}{% % 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} % \begin{macrocode} \ifglsused{#2}{% \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% }{% - \ifglsacrfootnote + \ifthenelse{\equal{\@glo@type}{\acronymtype}\and + \boolean{glsacrfootnote}}{% \@gls@link[#1,hyper=false]{#2}{\MakeUppercase{\@glo@text}}% - \else + }{% \@gls@link[#1]{#2}{\MakeUppercase{\@glo@text}}% - \fi + }% }% % \end{macrocode} % Indicate that this entry has now been used @@ -5667,12 +5908,13 @@ counter as its value}}{% % % \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 +% 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 @@ -5691,7 +5933,7 @@ counter as its value}}{% %\end{macro} % % Get the entry description (as specified by the -% \gloskey{description} when the entry was defined.) The argument +% \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} @@ -5791,7 +6033,7 @@ counter as its value}}{% % % 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.) +% the entry was defined). %\begin{macro}{\glsentryfirst} % \begin{macrocode} \newcommand*{\glsentryfirst}[1]{\csname glo@#1@first\endcsname} @@ -5806,7 +6048,7 @@ counter as its value}}{% %\end{macro} % % Get the plural form (as specified by the \gloskey{firstplural} -% key when the entry was defined.) +% key when the entry was defined). %\begin{macro}{\glsentryfirstplural} % \begin{macrocode} \newcommand*{\glsentryfirstplural}[1]{% @@ -5887,7 +6129,7 @@ counter as its value}}{% %\vskip5pt %\cs{glsaddall}\oarg{glossary list}\\[10pt] % Add all terms defined for the listed glossaries (without displaying -% any text.) If \gloskey[glsaddall]{types} key is omitted, apply to all +% any text). If \gloskey[glsaddall]{types} key is omitted, apply to all % glossary types. %\begin{macro}{\glsaddall} % \begin{macrocode} @@ -5915,7 +6157,7 @@ counter as its value}}{% % 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 \appname{makeindex} special characters.) +% needs to worry about \appname{makeindex} special characters). % % The symbols and numbers label for group headings are hardwired into % the \filetype{.ist} file as \texttt{glssymbols} and @@ -5976,7 +6218,7 @@ counter as its value}}{% % %The command \cs{noist} will suppress the creation of % the \filetype{.ist} file (it simply redefines -% \cs{writeist} to do nothing.) Obviously you need to use this +% \cs{writeist} to do nothing). Obviously you need to use this % command before \cs{writeist} to have any effect. Since % the \filetype{.ist} file should only be created once, \cs{noist} % is called at the end of \cs{writeist}. @@ -5993,13 +6235,13 @@ counter as its value}}{% % \meta{out-ext} parameter used in \ics{newglossary} % (and it will also activate the \ics{glossary} command, % and create the customized \filetype{.ist} \appname{makeindex} -% style file.) +% 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 +% file). The relevant glossary must be % defined prior to using \cs{@makeglossary}. %\begin{macro}{\@makeglossary} % \begin{macrocode} @@ -6086,7 +6328,7 @@ to move \string\makeglossaries\space after all your % 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}.) +% (the format of which is set in \cs{glslink}). %\begin{macro}{\@wrglossary} % \begin{macrocode} \renewcommand*{\@wrglossary}[2]{% @@ -6102,15 +6344,21 @@ to move \string\makeglossaries\space after all your % 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}{\printglossary} +%\changes{1.15}{2008 August 15}{changed the way the TOC title is set} +% 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. % \begin{macrocode} \newcommand*{\printglossary}[1][type=\glsdefaulttype]{% \def\@glo@type{\glsdefaulttype}% \def\glossarytitle{\csname @glotype@\@glo@type @title\endcsname}% -\def\glossarytoctitle{\glossarytitle}% \def\@glossarystyle{}% +\def\gls@dotoctitle{\glssettoctitle{\@glo@type}}% \bgroup \setkeys{printgloss}{#1}% +\gls@dotoctitle \@glossarystyle \makeatletter \@input@{\jobname.\csname @glotype@\@glo@type @in\endcsname}% @@ -6150,10 +6398,12 @@ to move \string\makeglossaries\space after all your % The \gloskey[printglossary]{toctitle} sets the text used for the relevant entry % in the table of contents. % \begin{macrocode} -\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}} +\define@key{printgloss}{toctitle}{\def\glossarytoctitle{#1}% +\let\gls@dotoctitle\relax +} % \end{macrocode} % The \gloskey[printglossary]{style} key sets the glossary style (but only for -% the given glossary.) +% the given glossary). % \begin{macrocode} \define@key{printgloss}{style}{% \@ifundefined{@glsstyle@#1}{\PackageError{glossaries}{Glossary @@ -6263,7 +6513,7 @@ false,nolabel,autolabel}[nolabel]{% % 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.) +% into the required title (and vice-versa). %\\[10pt] %\cs{glsgetgrouptitle}\marg{label}\\[10pt] % This command produces the title for the glossary group @@ -6324,7 +6574,7 @@ style `#1' undefined}{}}{% % \envname{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 +% 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 @@ -6382,7 +6632,7 @@ style `#1' undefined}{}}{% % \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}.) +% \cs{glshypernumber}). %\begin{macro}{\@delimR} % \begin{macrocode} \def\@delimR#1\delimR #2\delimR #3\\{% @@ -7555,14 +7805,47 @@ firstplural={\@glo@descplural\space (\@glo@plural)},% % by \meta{type}. %\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} % \begin{macrocode} \@ifundefined{hypertarget}{% \newcommand*{\glsnavhypertarget}[3][\@glo@type]{% \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}% -#3}}{% +#3% +\expandafter +\let\expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname +\@for\@gls@elem:=\@gls@list\do{% +\ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}% +\if@endfor +\else + \PackageWarningNoLine{glossaries}{Navigation panel + for glossary type `#1'^^Jmissing group `#2'}% + \gdef\gls@hypergrouprerun{% + \PackageWarningNoLine{glossaries}{Navigation panel + has changed. Rerun LaTeX}}% +\fi}}{% \newcommand*{\glsnavhypertarget}[3][\@glo@type]{% \protected@write\@auxout{}{\string\@gls@hypergroup{#1}{#2}}% -\hypertarget{glsn:#1@#2}{#3}}} +\hypertarget{glsn:#1@#2}{#3}% +\expandafter +\let\expandafter\@gls@list\csname @gls@hypergrouplist@#1\endcsname +\@for\@gls@elem:=\@gls@list\do{% +\ifthenelse{\equal{\@gls@elem}{#2}}{\@endfortrue}{}}% +\if@endfor +\else + \PackageWarningNoLine{glossaries}{Navigation panel + for glossary type `#1'^^Jmissing group `#2'}% + \gdef\gls@hypergrouprerun{% + \PackageWarningNoLine{glossaries}{Navigation panel + has changed. Rerun LaTeX}}% +\fi}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\gls@hypergrouprerun} +% Give a warning at the end if rerun required +%\changes{1.15}{2008 August 15}{new} +% \begin{macrocode} +\let\gls@hypergrouprerun\relax +\AtEndDocument{\gls@hypergrouprerun} % \end{macrocode} %\end{macro} % @@ -7703,7 +7986,7 @@ firstplural={\@glo@descplural\space (\@glo@plural)},% \renewcommand*{\glsgroupheading}[1]{\item[\glsgetgrouptitle{##1}]}} % \end{macrocode} % The \glostyle{altlisthypergroup} glossary style is like the -% \glostyle{altlisthypergroup} style, but has a +% \glostyle{altlistgroup} style, but has a % set of links to the groups at the start of the glossary. % \begin{macrocode} \newglossarystyle{altlisthypergroup}{% @@ -7899,6 +8182,46 @@ firstplural={\@glo@descplural\space (\@glo@plural)},% \bfseries\pagelistname\\\hline\endhead\hline\endfoot}% } % \end{macrocode} +% The \glostyle{altlong4col} style is like the \glostyle{long4col} +% style but can have multiline descriptions and page lists. +% \begin{macrocode} +\newglossarystyle{altlong4col}{% +\glossarystyle{long4col}% +\renewenvironment{theglossary}{% +\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}{% +\end{longtable}}% +} +% \end{macrocode} +% The \glostyle{altlong4colheader} style is like \glostyle{altlong4col} +% but with a header row. +% \begin{macrocode} +\newglossarystyle{altlong4colheader}{% +\glossarystyle{long4colheader}% +\renewenvironment{theglossary}{% +\begin{longtable}{lp{\glsdescwidth}lp{\glspagelistwidth}}}{% +\end{longtable}}% +} +% \end{macrocode} +% The \glostyle{altlong4colborder} style is like +% \glostyle{altlong4col} but with a border. +% \begin{macrocode} +\newglossarystyle{altlong4colborder}{% +\glossarystyle{long4colborder}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagewidthlist}|}}{% +\end{longtable}}% +} +% \end{macrocode} +% The \glostyle{altlong4colheaderborder} style is like the above but +% with a header as well as a border. +% \begin{macrocode} +\newglossarystyle{altlong4colheaderborder}{% +\glossarystyle{long4colheaderborder}% +\renewenvironment{theglossary}{% +\begin{longtable}{|l|p{\glsdescwidth}|l|p{\glspagewidthlist}|}}{% +\end{longtable}}% +} +% \end{macrocode} %\iffalse % \begin{macrocode} %</glossary-long.sty> @@ -8069,6 +8392,54 @@ firstplural={\@glo@descplural\space (\@glo@plural)},% \end{supertabular}}% } % \end{macrocode} +% The \glostyle{altsuper4col} glossary style is like \glostyle{super4col} +% but has provision for multiline descriptions. +% \begin{macrocode} +\newglossarystyle{altsuper4col}{% +\glossarystyle{super4col}% +\renewenvironment{theglossary}{% +\tablehead{}\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{altsuper4colheader} style is like +% the \glostyle{altsuper4col} but with a header row. +% \begin{macrocode} +\newglossarystyle{altsuper4colheader}{% +\glossarystyle{super4colheader}% +\renewenvironment{theglossary}{% +\tablehead{\bfseries\entryname&\bfseries\descriptionname& +\bfseries\symbolname & +\bfseries\pagelistname\\}\tabletail{}% +\begin{supertabular}{lp{\glsdescwidth}lp{\glspagelistwidth}}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{altsuper4colborder} style is like +% the \glostyle{altsuper4col} but with a border. +% \begin{macrocode} +\newglossarystyle{altsuper4colborder}{% +\glossarystyle{super4colborder}% +\renewenvironment{theglossary}{% +\tablehead{\hline}\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}{% +\end{supertabular}}% +} +% \end{macrocode} +% The \glostyle{altsuper4colheaderborder} style is like +% the \glostyle{altsuper4col} but with a header and border. +% \begin{macrocode} +\newglossarystyle{altsuper4colheaderborder}{% +\glossarystyle{super4colheaderborder}% +\renewenvironment{theglossary}{% +\tablehead{\hline\bfseries\entryname&\bfseries\descriptionname& +\bfseries\symbolname & +\bfseries\pagelistname\\}\tabletail{\hline}% +\begin{supertabular}{|l|p{\glsdescwidth}|l|p{\glspagelistwidth}|}}{% +\end{supertabular}}% +} +% \end{macrocode} %\iffalse % \begin{macrocode} %</glossary-super.sty> @@ -8541,8 +8912,9 @@ firstplural={\@glo@descplural\space (\@glo@plural)},% \documentclass{article} \listfiles +\usepackage{hyperref} %\usepackage{glossaries} % acronym will go in main glossary - \usepackage[acronym]{glossaries} % make a separate list of acronyms + \usepackage[acronym,footnote]{glossaries} % make a separate list of acronyms \makeglossaries @@ -9721,8 +10093,8 @@ description={the hash symbol}} # File : glossaries.perl # Author : Nicola L.C. Talbot # Date : 14th June 2007 -# Last Modified : 22 February 2008 -# Version : 1.03 +# Last Modified : 25th July 2008 +# Version : 1.04 # Description : LaTeX2HTML (limited!) implementation of glossaries # package. Note that not all the glossaries.sty # macros have been implemented. @@ -9761,7 +10133,8 @@ sub do_glossaries_toc{ sub do_glossaries_toc_true{ } -$GLSCURRENTFORMAT="textrm"; +$GLSCURRENTFORMAT="textrm" if (!defined($GLSCURRENTFORMAT)); +$GLOSSARY_END_DESCRIPTION = '. ' if (!defined($GLOSSARY_END_DESCRIPTION)); sub do_cmd_glossaryname{ "Glossary$_[0]" @@ -9921,14 +10294,14 @@ sub add_real_gls{ $delimN . $glossary{$type}{$key} . $linktext - . "</A>\n" + . "</A>" : "<DT>" - . $name + . "<A NAME=\"gls:$entry\">$name</A>" . "<DD>" . $glsentry{$entry}{'description'} - . $symbol . '. ' + . $symbol . $GLOSSARY_END_DESCRIPTION . $glossary{$type}{$key} - . $linktext. "</A>\n"); + . $linktext. "</A>"); $previous = $current; } $glossary = '<DD>'.$glossary unless ($glossary =~ /^\s*<D(T|D)>/); @@ -10061,6 +10434,11 @@ sub make_textohtmlglossary{ $toc_sec_title = $toctitle; $glsfile{$type} = $CURRENT_FILE; + if (defined($frame_main_suffix)) + { + $glsfile{$type}=~s/$frame_main_suffix/$frame_body_suffix/; + } + $TITLE=&translate_commands($toctitle); if (%glossary_labels) { &make_glossary_labels(); } @@ -10139,7 +10517,9 @@ sub make_glossary_entry { &make_real_glossary_entry(@_) } sub make_real_glossary_entry { local($entry,$text,$type) = @_; local($this_file) = $CURRENT_FILE; - $TITLE = $saved_title if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title))); + + $TITLE = $saved_title + if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title))); local($sort) = $glsentry{$entry}{'sort'}; @@ -10148,12 +10528,30 @@ sub make_real_glossary_entry { # concatenate multiple spaces into a single space # otherwise keys won't sort properly $str=~s/\s+/ /gs; - local($br_id) = ++$global{'max_id'}; - $glossary{$type}{$str} .= &make_half_href($this_file."#$br_id"); + + local($id) = ++$glsentry{$entry}{'maxid'}; + local($glsanchor)="gls:$entry$id"; + + local($target) = $frame_body_name; + + if (defined($frame_main_suffix)) + { + $this_file=~s/$frame_main_suffix/$frame_body_suffix/; + } + + $glossary{$type}{$str} .= &make_half_href($this_file."#$glsanchor"); $glossary_format{$type}{$str} = $GLSCURRENTFORMAT; $glossary_entry{$type}{$str} = $entry; $glossary_linktext{$type}{$str} = $TITLE; - "<A HREF=$gls_file_mark{$type}#tex2html$href_name NAME=\"$br_id\">$text<\/A>"; + + if (defined($frame_foot_name)) + { + "<A HREF=$gls_file_mark{$type}#gls:$entry NAME=\"$glsanchor\" TARGET=\"$frame_foot_name\">$text<\/A>"; + } + else + { + "<A HREF=$gls_file_mark{$type}#gls:$entry NAME=\"$glsanchor\">$text<\/A>"; + } } sub do_cmd_newglossary{ @@ -10332,7 +10730,8 @@ sub gls_entry_init{ plural => "${name}s", firstplural => "${name}s", symbol => '', - flag => 0 + flag => 0, + maxid=>0 ); } @@ -10877,10 +11276,16 @@ sub do_cmd_glsunsetall{ $_; } +$glslabel = ''; + +sub do_cmd_glslabel{ $glslabel.$_[0] } + sub make_glslink{ local($type,$label,$format,$text) = @_; local($str) = ''; + $glslabel = $label; + if (defined $type) { $str = &gls_add_entry($type,$label,$format,$text); @@ -10919,6 +11324,25 @@ sub do_cmd_glslink{ &make_glslink($type, $label, $format, $text) . $_; } +sub do_cmd_glslinkstar{ + local($_) = @_; + local($optarg,$pat,$label,$text,$type,$format,$str); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + $text = &missing_braces unless + (s/$next_pair_pr_rx/$text=$2;''/eo); + + $type = &gls_get_type($label); + + $text . $_; +} + sub do_cmd_glsentrydesc{ local($_) = @_; @@ -11111,6 +11535,64 @@ sub do_cmd_gls{ &make_glslink($type, $label, $format, $link_text) .$space . $_; } +# added v1.04 +sub do_cmd_glsstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type); + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + $link_text . $space . $_; +} + sub do_cmd_glspl{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -11168,6 +11650,64 @@ sub do_cmd_glspl{ &make_glslink($type, $label, $format, $link_text) . $space . $_; } +# added v1.04 +sub do_cmd_glsplstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + $link_text . $space . $_; +} + sub do_cmd_Gls{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -11225,6 +11765,64 @@ sub do_cmd_Gls{ &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; } +# added v1.04 +sub do_cmd_Glsstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + ucfirst($link_text). $space . $_; +} + sub do_cmd_Glspl{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -11282,6 +11880,64 @@ sub do_cmd_Glspl{ &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_; } +# added v1.04 +sub do_cmd_Glsplstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + ucfirst($link_text).$space . $_; +} + sub do_cmd_GLS{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -11339,6 +11995,64 @@ sub do_cmd_GLS{ &make_glslink($type, $label, $format, uc($link_text)).$space . $_; } +# added v1.04 +sub do_cmd_GLSstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + uc($link_text).$space . $_; +} + sub do_cmd_GLSpl{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -11396,6 +12110,64 @@ sub do_cmd_GLSpl{ &make_glslink($type, $label, $format, uc($link_text)).$space . $_; } +# added v1.04 +sub do_cmd_GLSplstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + uc($link_text).$space . $_; +} + # added 22 Feb 2008 sub do_cmd_glstext{ local($_) = @_; diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins index 7996164767c..1fad698c1d4 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.ins +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.ins @@ -1,4 +1,4 @@ -% glossaries.ins generated using makedtx version 0.94b 2008/6/18 16:44 +% glossaries.ins generated using makedtx version 0.94b 2008/8/27 12:55 \input docstrip \preamble diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.perl b/Master/texmf-dist/source/latex/glossaries/glossaries.perl index d666df02b57..9aa8f17e5bb 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.perl +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.perl @@ -1,8 +1,8 @@ # File : glossaries.perl # Author : Nicola L.C. Talbot # Date : 14th June 2007 -# Last Modified : 22 February 2008 -# Version : 1.03 +# Last Modified : 25th July 2008 +# Version : 1.04 # Description : LaTeX2HTML (limited!) implementation of glossaries # package. Note that not all the glossaries.sty # macros have been implemented. @@ -40,7 +40,8 @@ sub do_glossaries_toc{ sub do_glossaries_toc_true{ } -$GLSCURRENTFORMAT="textrm"; +$GLSCURRENTFORMAT="textrm" if (!defined($GLSCURRENTFORMAT)); +$GLOSSARY_END_DESCRIPTION = '. ' if (!defined($GLOSSARY_END_DESCRIPTION)); sub do_cmd_glossaryname{ "Glossary$_[0]" @@ -200,14 +201,14 @@ sub add_real_gls{ $delimN . $glossary{$type}{$key} . $linktext - . "</A>\n" + . "</A>" : "<DT>" - . $name + . "<A NAME=\"gls:$entry\">$name</A>" . "<DD>" . $glsentry{$entry}{'description'} - . $symbol . '. ' + . $symbol . $GLOSSARY_END_DESCRIPTION . $glossary{$type}{$key} - . $linktext. "</A>\n"); + . $linktext. "</A>"); $previous = $current; } $glossary = '<DD>'.$glossary unless ($glossary =~ /^\s*<D(T|D)>/); @@ -340,6 +341,11 @@ sub make_textohtmlglossary{ $toc_sec_title = $toctitle; $glsfile{$type} = $CURRENT_FILE; + if (defined($frame_main_suffix)) + { + $glsfile{$type}=~s/$frame_main_suffix/$frame_body_suffix/; + } + $TITLE=&translate_commands($toctitle); if (%glossary_labels) { &make_glossary_labels(); } @@ -418,7 +424,9 @@ sub make_glossary_entry { &make_real_glossary_entry(@_) } sub make_real_glossary_entry { local($entry,$text,$type) = @_; local($this_file) = $CURRENT_FILE; - $TITLE = $saved_title if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title))); + + $TITLE = $saved_title + if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title))); local($sort) = $glsentry{$entry}{'sort'}; @@ -427,12 +435,30 @@ sub make_real_glossary_entry { # concatenate multiple spaces into a single space # otherwise keys won't sort properly $str=~s/\s+/ /gs; - local($br_id) = ++$global{'max_id'}; - $glossary{$type}{$str} .= &make_half_href($this_file."#$br_id"); + + local($id) = ++$glsentry{$entry}{'maxid'}; + local($glsanchor)="gls:$entry$id"; + + local($target) = $frame_body_name; + + if (defined($frame_main_suffix)) + { + $this_file=~s/$frame_main_suffix/$frame_body_suffix/; + } + + $glossary{$type}{$str} .= &make_half_href($this_file."#$glsanchor"); $glossary_format{$type}{$str} = $GLSCURRENTFORMAT; $glossary_entry{$type}{$str} = $entry; $glossary_linktext{$type}{$str} = $TITLE; - "<A HREF=$gls_file_mark{$type}#tex2html$href_name NAME=\"$br_id\">$text<\/A>"; + + if (defined($frame_foot_name)) + { + "<A HREF=$gls_file_mark{$type}#gls:$entry NAME=\"$glsanchor\" TARGET=\"$frame_foot_name\">$text<\/A>"; + } + else + { + "<A HREF=$gls_file_mark{$type}#gls:$entry NAME=\"$glsanchor\">$text<\/A>"; + } } sub do_cmd_newglossary{ @@ -611,7 +637,8 @@ sub gls_entry_init{ plural => "${name}s", firstplural => "${name}s", symbol => '', - flag => 0 + flag => 0, + maxid=>0 ); } @@ -1156,10 +1183,16 @@ sub do_cmd_glsunsetall{ $_; } +$glslabel = ''; + +sub do_cmd_glslabel{ $glslabel.$_[0] } + sub make_glslink{ local($type,$label,$format,$text) = @_; local($str) = ''; + $glslabel = $label; + if (defined $type) { $str = &gls_add_entry($type,$label,$format,$text); @@ -1198,6 +1231,25 @@ sub do_cmd_glslink{ &make_glslink($type, $label, $format, $text) . $_; } +sub do_cmd_glslinkstar{ + local($_) = @_; + local($optarg,$pat,$label,$text,$type,$format,$str); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + $text = &missing_braces unless + (s/$next_pair_pr_rx/$text=$2;''/eo); + + $type = &gls_get_type($label); + + $text . $_; +} + sub do_cmd_glsentrydesc{ local($_) = @_; @@ -1390,6 +1442,64 @@ sub do_cmd_gls{ &make_glslink($type, $label, $format, $link_text) .$space . $_; } +# added v1.04 +sub do_cmd_glsstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = &gls_get_type($label); + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type); + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + $link_text . $space . $_; +} + sub do_cmd_glspl{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -1447,6 +1557,64 @@ sub do_cmd_glspl{ &make_glslink($type, $label, $format, $link_text) . $space . $_; } +# added v1.04 +sub do_cmd_glsplstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + $link_text . $space . $_; +} + sub do_cmd_Gls{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -1504,6 +1672,64 @@ sub do_cmd_Gls{ &make_glslink($type, $label, $format, ucfirst($link_text)). $space . $_; } +# added v1.04 +sub do_cmd_Glsstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + ucfirst($link_text). $space . $_; +} + sub do_cmd_Glspl{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -1561,6 +1787,64 @@ sub do_cmd_Glspl{ &make_glslink($type, $label, $format, ucfirst($link_text)).$space . $_; } +# added v1.04 +sub do_cmd_Glsplstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + ucfirst($link_text).$space . $_; +} + sub do_cmd_GLS{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -1618,6 +1902,64 @@ sub do_cmd_GLS{ &make_glslink($type, $label, $format, uc($link_text)).$space . $_; } +# added v1.04 +sub do_cmd_GLSstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_text($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_first($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + uc($link_text).$space . $_; +} + sub do_cmd_GLSpl{ local($_) = @_; local($optarg,$pat,$label,$text, $format, $insert); @@ -1675,6 +2017,64 @@ sub do_cmd_GLSpl{ &make_glslink($type, $label, $format, uc($link_text)).$space . $_; } +# added v1.04 +sub do_cmd_GLSplstar{ + local($_) = @_; + local($optarg,$pat,$label,$text, $format, $insert); + + ($optarg,$pat) = &get_next_optional_argument; + + ($format,$optarg) = &get_keyval('format', $optarg); + + $label = &missing_braces unless + (s/$next_pair_pr_rx/$label=$2;''/eo); + + local ($space) = ''; + if (/^\s+[^\[]/ or /^\s*\[.*\]\s/) {$space = ' ';} + + $insert = ''; + ($insert,$pat) = &get_next_optional_argument; + + local($display) = ''; + + local($type) = $glsentry{$label}{'type'}; + + if (&gls_used($label)) + { + # entry has already been used + + $text = &gls_get_plural($label); + $display = &gls_get_display($type);; + } + else + { + # entry hasn't been used + + $text = &gls_get_firstplural($label); + $display = &gls_get_displayfirst($type); + + &unset_entry($label); + } + + local($args) = ''; + + local($id) = ++$global{'max_id'}; + $args .= "$OP$id$CP$text$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{description}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$glsentry{$label}{symbol}$OP$id$CP"; + + $id = ++$global{'max_id'}; + $args .= "$OP$id$CP$insert$OP$id$CP"; + + local($link_text) = &translate_commands("$display$args"); + + uc($link_text).$space . $_; +} + # added 22 Feb 2008 sub do_cmd_glstext{ local($_) = @_; |