diff options
author | Karl Berry <karl@freefriends.org> | 2015-02-28 22:54:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-02-28 22:54:06 +0000 |
commit | d4db9d840415a1868b4310efe460401d68cae791 (patch) | |
tree | 31f80d21b92628da33c2bed6968be3e033d65e36 /Master/texmf-dist/source/latex/glossaries | |
parent | aba7aabf318f484a2247d9778fb54ce454f4525f (diff) |
glossaries (28feb15)
git-svn-id: svn://tug.org/texlive/trunk@36407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries')
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries/glossaries.dtx | 568 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/glossaries/glossaries.ins | 5 |
2 files changed, 549 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx index 01dd7d08e4a..0d4368c4efe 100644 --- a/Master/texmf-dist/source/latex/glossaries/glossaries.dtx +++ b/Master/texmf-dist/source/latex/glossaries/glossaries.dtx @@ -1,15 +1,8 @@ %\iffalse % glossaries.dtx generated using makedtx version 1.1 (c) Nicola Talbot % Command line args: -% -macrocode ".*\.perl" -% -macrocode ".*\.tex" -% -macrocode ".*\.xdy" -% -setambles ".*\.perl=>\nopreamble\nopostamble" -% -setambles ".*\.tex=>\nopreamble\nopostamble" -% -setambles ".*\.xdy=>\nopreamble\nopostamble" -% -comment ".*\.perl" -% -comment ".*\.tex" -% -comment ".*\.xdy" +% -author "Nicola Talbot" +% -doc "glossaries-manual.tex" % -src "glossaries.sty\Z=>glossaries.sty" % -src "glossaries-prefix.sty\Z=>glossaries-prefix.sty" % -src "mfirstuc.sty\Z=>mfirstuc.sty" @@ -26,11 +19,18 @@ % -src "(samplexdy-mc.*\.xdy)\Z=>\1" % -src "(database.*\.tex)\Z=>\1" % -src "(.*\.perl)\Z=>\1" -% -doc "glossaries-manual.tex" -% -author "Nicola Talbot" +% -comment ".*\.perl" +% -comment ".*\.tex" +% -comment ".*\.xdy" +% -macrocode ".*\.perl" +% -macrocode ".*\.tex" +% -macrocode ".*\.xdy" % -codetitle "Main Package Code" +% -setambles ".*\.perl=>\nopreamble\nopostamble" +% -setambles ".*\.tex=>\nopreamble\nopostamble" +% -setambles ".*\.xdy=>\nopreamble\nopostamble" % glossaries -% Created on 2015/2/3 15:15 +% Created on 2015/2/28 17:35 %\fi %\iffalse %<*package> @@ -140,7 +140,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of \setcounter{IndexColumns}{2} -\CheckSum{17781} +\CheckSum{18045} \newcommand*{\ifirstuse}{\iterm{first use}} \newcommand*{\firstuse}{\gls{firstuse}} @@ -168,12 +168,12 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of %\MakeShortVerb{"} %\DeleteShortVerb{\|} % -% \title{Documented Code For glossaries v4.13} +% \title{Documented Code For glossaries v4.14} % \author{Nicola L.C. Talbot\\[10pt] %Dickimaw Books\\ %\url{http://www.dickimaw-books.com/}} % -% \date{2015-02-03} +% \date{2015-02-28} % \maketitle % %This is the documented code for the \styfmt{glossaries} package. @@ -189,7 +189,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 v4.13: +%For the main user guide, read \qt{glossaries.sty v4.14: %\LaTeX2e\ Package to Assist Generating Glossaries}. % %\item[\url{mfirstuc-manual.pdf}] @@ -248,7 +248,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of % This package requires \LaTeXe. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{glossaries}[2015/02/03 v4.13 (NLCT)] +\ProvidesPackage{glossaries}[2015/02/28 v4.14 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -4760,6 +4760,17 @@ false,nolabel,autolabel,nameref}[nolabel]{% } % \end{macrocode} %\end{macro} + +%\begin{macro}{\gls@defdocnewglossaryentry} +%\changes{4.14}{2015-02-28}{new} +% The definition of \cs{newglossaryentry} is changed at the start of +% the \env{document} environment. +% \begin{macrocode} +\newcommand*{\gls@defdocnewglossaryentry}{% + \let\newglossaryentry\new@glossaryentry +} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\provideglossaryentry} % Like \cs{newglossaryentry} but does nothing if the entry has @@ -4799,7 +4810,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% \makeatletter \InputIfFileExists{\jobname.glsdefs}{}{}% \makeatother - \let\newglossaryentry\new@glossaryentry + \gls@defdocnewglossaryentry } \AtEndDocument{\ifdef\@gls@deffile{\closeout\@gls@deffile}{}} % \end{macrocode} @@ -5493,6 +5504,10 @@ false,nolabel,autolabel,nameref}[nolabel]{% \do@glo@storeentry{\@glo@label}% }% % \end{macrocode} +% Define entry counters if enabled: +% \begin{macrocode} + \@newglossaryentry@defcounters +% \end{macrocode} % Add end hook in case another package wants to add extra keys. % \begin{macrocode} \@newglossaryentryposthook @@ -5501,6 +5516,7 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\changes{1.13}{2008 May 10}{Removed restriction on only using % \cs{newglossaryentry} in the preamble} %\end{macro} +% %\begin{macro}{\@newglossaryentryprehook} % Allow extra information to be added to glossary entries: %\changes{2.04}{2009 November 10}{new} @@ -5516,6 +5532,13 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\begin{macro}{\@newglossaryentry@defcounters} +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@newglossaryentry@defcounters}{} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\glsmoveentry} %\changes{3.02}{2012/05/21}{new} % Moves entry whose label is given by first argument to the glossary @@ -5699,13 +5722,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % to set the entry flag to indicate that it hasn't been used yet. The % required argument is the entry label. %\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.14}{2015-02-28}{switched to \cs{@glsreset}} % \begin{macrocode} \newcommand*{\glsreset}[1]{% \gls@ifnotmeasuring {% \glsdoifexists{#1}% {% - \expandafter\global\csname glo@\glsdetoklabel{#1}@flagfalse\endcsname + \@glsreset{#1}% }% }% } @@ -5715,13 +5739,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\glslocalreset} % As above, but with only a local effect: %\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.14}{2015-02-28}{switched to \cs{@glslocalreset}} % \begin{macrocode} \newcommand*{\glslocalreset}[1]{% \gls@ifnotmeasuring {% \glsdoifexists{#1}% {% - \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iffalse + \@glslocalreset{#1}% }% }% } @@ -5732,13 +5757,14 @@ false,nolabel,autolabel,nameref}[nolabel]{% % set the entry flag to indicate that it has been used. The required % argument is the entry label. %\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.14}{2015-02-28}{switched to \cs{@glsunset}} % \begin{macrocode} \newcommand*{\glsunset}[1]{% \gls@ifnotmeasuring {% \glsdoifexists{#1}% {% - \expandafter\global\csname glo@\glsdetoklabel{#1}@flagtrue\endcsname + \@glsunset{#1}% }% }% } @@ -5748,18 +5774,96 @@ false,nolabel,autolabel,nameref}[nolabel]{% %\begin{macro}{\glslocalunset} % As above, but with only a local effect: %\changes{4.03}{2014-01-20}{added \cs{glsdetoklabel}} +%\changes{4.14}{2015-02-28}{switched to \cs{@glslocalunset}} % \begin{macrocode} \newcommand*{\glslocalunset}[1]{% \gls@ifnotmeasuring {% \glsdoifexists{#1}% {% - \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iftrue + \@glslocalunset{#1}% }% }% } % \end{macrocode} %\end{macro} +% +%\begin{macro}{\@glslocalunset} +% Local unset. This defaults to just \cs{@@glslocalunset} but is changed +% by \cs{glsenableentrycount}. +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@glslocalunset}{\@@glslocalunset} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@@glslocalunset} +%\changes{4.14}{2015-02-28}{new} +% Local unset without checks. +% \begin{macrocode} +\newcommand*{\@@glslocalunset}[1]{% + \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iftrue +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsunset} +% Global unset. This defaults to just \cs{@@glsunset} but is changed +% by \cs{glsenableentrycount}. +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@glsunset}{\@@glsunset} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@@glsunset} +%\changes{4.14}{2015-02-28}{new} +% Global unset without checks. +% \begin{macrocode} +\newcommand*{\@@glsunset}[1]{% + \expandafter\global\csname glo@\glsdetoklabel{#1}@flagtrue\endcsname +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glslocalreset} +% Local reset. This defaults to just \cs{@@glslocalreset} but is changed +% by \cs{glsenableentrycount}. +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@glslocalreset}{\@@glslocalreset} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@@glslocalreset} +%\changes{4.14}{2015-02-28}{new} +% Local reset without checks. +% \begin{macrocode} +\newcommand*{\@@glslocalreset}[1]{% + \expandafter\let\csname ifglo@\glsdetoklabel{#1}@flag\endcsname\iffalse +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@glsreset} +% Global reset. This defaults to just \cs{@@glsreset} but is changed +% by \cs{glsenableentrycount}. +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@glsreset}{\@@glsreset} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@@glsreset} +%\changes{4.14}{2015-02-28}{new} +% Global reset without checks. +% \begin{macrocode} +\newcommand*{\@@glsreset}[1]{% + \expandafter\global\csname glo@\glsdetoklabel{#1}@flagfalse\endcsname +} +% \end{macrocode} +%\end{macro} +% % Reset all entries for the named glossaries (supplied in a % comma-separated list). % Syntax: \cs{glsresetall}\oarg{glossary-list} @@ -5809,6 +5913,377 @@ false,nolabel,autolabel,nameref}[nolabel]{% % \end{macrocode} %\end{macro} % +%\subsection{Keeping Track of How Many Times an Entry Has Been Unset} +%Version 4.14 introduced \cs{glsenableentrycount} that keeps track +%of how many times an entry is marked as used. The counter is reset +%back to zero when the first use flag is reset. Note that although +%the word ``counter'' is used here, it's not an actual \LaTeX\ +%counter or even an explicit \TeX\ count register but is just a +%macro. Any of the commands that use \cs{glsunset} or +%\cs{glslocalunset}, such as \cs{gls}, will automatically increment this value. +%Commands that don't modify the first use flag (such as \cs{glstext} +%or \cs{glsentrytext}) don't modify this value. +% +%\begin{macro}{\@@newglossaryentry@defcounters} +%\changes{4.14}{2015-02-28}{new} +% Define entry fields to keep track of how many times that entry has +% been marked as used. +% \begin{macrocode} +\newcommand*{\@@newglossaryentry@defcounters}{% + \csdef{glo@\@glo@label @currcount}{0}% + \csdef{glo@\@glo@label @prevcount}{0}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\glsenableentrycount} +%\changes{4.14}{2015-02-28}{new} +% Enables tracking of how many times an entry has been marked as +% used. +% \begin{macrocode} +\newcommand*{\glsenableentrycount}{% +% \end{macrocode} +% Enable new entry fields. +% \begin{macrocode} + \let\@newglossaryentry@defcounters\@@newglossaryentry@defcounters +% \end{macrocode} +% Disable \cs{newglossaryentry} in the \env{document} environment. +% \begin{macrocode} + \renewcommand*{\gls@defdocnewglossaryentry}{% + \renewcommand*\newglossaryentry[2]{% + \PackageError{glossaries}{\string\newglossaryentry\space + may only be used in the preamble when entry counting has + been activated}{If you use \string\glsenableentrycount\space + you must place all entry definitions in the preamble not in + the document environment}% + }% + }% +% \end{macrocode} +% Define commands \ics{glsentrycurrcount} and \ics{glsentryprevcount} to +% access these new fields. Default to zero if undefined. +% \begin{macrocode} + \newcommand*{\glsentrycurrcount}[1]{% + \ifcsundef{glo@\glsdetoklabel{##1}@currcount}% + {0}{\@gls@entry@field{##1}{currcount}}% + }% + \newcommand*{\glsentryprevcount}[1]{% + \ifcsundef{glo@\glsdetoklabel{##1}@prevcount}% + {0}{\@gls@entry@field{##1}{prevcount}}% + }% +% \end{macrocode} +% Make the unset and reset functions also increment or reset the +% entry counter. +% \begin{macrocode} + \renewcommand*{\@glsunset}[1]{% + \@@glsunset{##1}% + \@gls@increment@currcount{##1}% + }% + \renewcommand*{\@glslocalunset}[1]{% + \@@glslocalunset{##1}% + \@gls@local@increment@currcount{##1}% + }% + \renewcommand*{\@glsreset}[1]{% + \@@glsreset{##1}% + \csgdef{glo@\glsdetoklabel{##1}@currcount}{0}% + }% + \renewcommand*{\@glslocalreset}[1]{% + \@@glslocalreset{##1}% + \csdef{glo@\glsdetoklabel{##1}@currcount}{0}% + }% +% \end{macrocode} +% Alter behaviour of \cs{cgls}. (Only global unset is used if +% previous count was one as it doesn't make sense to have a~local +% unset here given that the previous count was global.) +% \begin{macrocode} + \def\@cgls@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cglsformat{##2}{##3}% + \glsunset{##2}% + \else + \@gls@{##1}{##2}[##3]% + \fi + }% +% \end{macrocode} +% Similarly for the analogous commands. No case change plural: +% \begin{macrocode} + \def\@cglspl@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cglsplformat{##2}{##3}% + \glsunset{##2}% + \else + \@glspl@{##1}{##2}[##3]% + \fi + }% +% \end{macrocode} +% First letter uppercase singular: +% \begin{macrocode} + \def\@cGls@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cGlsformat{##2}{##3}% + \glsunset{##2}% + \else + \@Gls@{##1}{##2}[##3]% + \fi + }% +% \end{macrocode} +% First letter uppercase plural: +% \begin{macrocode} + \def\@cGlspl@##1##2[##3]{% + \ifnum\glsentryprevcount{##2}=1\relax + \cGlsplformat{##2}{##3}% + \glsunset{##2}% + \else + \@Glspl@{##1}{##2}[##3]% + \fi + }% +% \end{macrocode} +% Write information to aux file at the end of the document +% \begin{macrocode} + \AtEndDocument{\@gls@write@entrycounts}% +% \end{macrocode} +% Fetch previous count information from aux file. (No check here to +% determine if the entry is still defined.) +% \begin{macrocode} + \renewcommand*{\@gls@entry@count}[2]{% + \csgdef{glo@\glsdetoklabel{##1}@prevcount}{##2}% + }% +% \end{macrocode} +% \cs{glsenableentrycount} may only be used once and only in the +% preamble. +% \begin{macrocode} + \let\glsenableentrycount\relax +} +\@onlypreamble\glsenableentrycount +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@increment@currcount} +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@gls@increment@currcount}[1]{% + \csxdef{glo@\glsdetoklabel{#1}@currcount}{% + \number\numexpr\glsentrycurrcount{#1}+1}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@local@increment@currcount} +%\changes{4.14}{2015-02-28}{new} +% \begin{macrocode} +\newcommand*{\@gls@local@increment@currcount}[1]{% + \csedef{glo@\glsdetoklabel{#1}@currcount}{% + \number\numexpr\glsentrycurrcount{#1}+1}% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@write@entrycounts} +%\changes{4.14}{2015-02-28}{new} +% Write the entry counts to the aux file. Use \cs{immediate} since +% this occurs right at the end of the document. Only write +% information for entries that have been used. (Some users have a +% file containing vast numbers of entries, many of which may not be +% used. There's no point writing information about the entries that +% haven't been used and it will only slow things down.) +% \begin{macrocode} +\newcommand*{\@gls@write@entrycounts}{% + \immediate\write\@auxout + {\string\providecommand*{\string\@gls@entry@count}[2]{}}% + \forallglsentries{\@glsentry}{% + \ifglsused{\@glsentry}% + {\immediate\write\@auxout + {\string\@gls@entry@count{\@glsentry}{\glsentrycurrcount{\@glsentry}}}}% + {}% + }% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@gls@entry@count} +%\changes{4.14}{2015-02-28}{new} +% Default behaviour is to ignore arguments. Activated by +% \cs{glsenableentrycount}. +% \begin{macrocode} +\newcommand*{\@gls@entry@count}[2]{} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cgls} +%\changes{4.14}{2015-02-28}{new} +% Define command that works like \cs{gls} but behaves differently if +% the entry count function is enabled. (If not enabled, it behaves +% the same as \cs{gls} but issues a warning.) +% \begin{macrocode} +\newrobustcmd*{\cgls}{\@gls@hyp@opt\@cgls} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cgls} +%\changes{4.14}{2015-02-28}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@cgls}[2][]{% + \new@ifnextchar[{\@cgls@{#1}{#2}}{\@cgls@{#1}{#2}[]}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cgls@} +%\changes{4.14}{2015-02-28}{new} +% Read in the final optional argument. This defaults to same behaviour +% as \cs{gls} but issues a warning. +% \begin{macrocode} +\def\@cgls@#1#2[#3]{% + \GlossariesWarning{\string\cgls\space is defaulting to + \string\gls\space since you haven't enabled entry counting}% + \@gls@{#1}{#2}[#3]% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cglsformat} +%\changes{4.14}{2015-02-28}{new} +% Format used by \cs{cgls} if entry only used once on previous run. +% The first argument is the label, the second argument is the insert +% text. +% \begin{macrocode} +\newcommand*{\cglsformat}[2]{% + \ifglshaslong{#1}{\glsentrylong{#1}}{\glsentryfirst{#1}}#2% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cGls} +%\changes{4.14}{2015-02-28}{new} +% Define command that works like \cs{Gls} but behaves differently if +% the entry count function is enabled. (If not enabled, it behaves +% the same as \cs{Gls} but issues a warning.) +% \begin{macrocode} +\newrobustcmd*{\cGls}{\@gls@hyp@opt\@cGls} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cGls} +%\changes{4.14}{2015-02-28}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@cGls}[2][]{% + \new@ifnextchar[{\@cGls@{#1}{#2}}{\@cGls@{#1}{#2}[]}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cGls@} +%\changes{4.14}{2015-02-28}{new} +% Read in the final optional argument. This defaults to same behaviour +% as \cs{Gls} but issues a warning. +% \begin{macrocode} +\def\@cGls@#1#2[#3]{% + \GlossariesWarning{\string\cGls\space is defaulting to + \string\Gls\space since you haven't enabled entry counting}% + \@Gls@{#1}{#2}[#3]% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cGlsformat} +%\changes{4.14}{2015-02-28}{new} +% Format used by \cs{cGls} if entry only used once on previous run. +% The first argument is the label, the second argument is the insert +% text. +% \begin{macrocode} +\newcommand*{\cGlsformat}[2]{% + \ifglshaslong{#1}{\Glsentrylong{#1}}{\Glsentryfirst{#1}}#2% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cglspl} +%\changes{4.14}{2015-02-28}{new} +% Define command that works like \cs{glspl} but behaves differently if +% the entry count function is enabled. (If not enabled, it behaves +% the same as \cs{glspl} but issues a warning.) +% \begin{macrocode} +\newrobustcmd*{\cglspl}{\@gls@hyp@opt\@cglspl} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cglspl} +%\changes{4.14}{2015-02-28}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@cglspl}[2][]{% + \new@ifnextchar[{\@cglspl@{#1}{#2}}{\@cglspl@{#1}{#2}[]}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cglspl@} +%\changes{4.14}{2015-02-28}{new} +% Read in the final optional argument. This defaults to same behaviour +% as \cs{glspl} but issues a warning. +% \begin{macrocode} +\def\@cglspl@#1#2[#3]{% + \GlossariesWarning{\string\cglspl\space is defaulting to + \string\glspl\space since you haven't enabled entry counting}% + \@glspl@{#1}{#2}[#3]% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cglsplformat} +%\changes{4.14}{2015-02-28}{new} +% Format used by \cs{cglspl} if entry only used once on previous run. +% The first argument is the label, the second argument is the insert +% text. +% \begin{macrocode} +\newcommand*{\cglsplformat}[2]{% + \ifglshaslong{#1}{\glsentrylongpl{#1}}{\glsentryfirstplural{#1}}#2% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cGlspl} +%\changes{4.14}{2015-02-28}{new} +% Define command that works like \cs{Glspl} but behaves differently if +% the entry count function is enabled. (If not enabled, it behaves +% the same as \cs{Glspl} but issues a warning.) +% \begin{macrocode} +\newrobustcmd*{\cGlspl}{\@gls@hyp@opt\@cGlspl} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cglspl} +%\changes{4.14}{2015-02-28}{new} +% Defined the un-starred form. Need to determine if there is +% a final optional argument +% \begin{macrocode} +\newcommand*{\@cGlspl}[2][]{% + \new@ifnextchar[{\@cGlspl@{#1}{#2}}{\@cGlspl@{#1}{#2}[]}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\@cGlspl@} +%\changes{4.14}{2015-02-28}{new} +% Read in the final optional argument. This defaults to same behaviour +% as \cs{Glspl} but issues a warning. +% \begin{macrocode} +\def\@cGlspl@#1#2[#3]{% + \GlossariesWarning{\string\cGlspl\space is defaulting to + \string\Glspl\space since you haven't enabled entry counting}% + \@Glspl@{#1}{#2}[#3]% +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cGlsplformat} +%\changes{4.14}{2015-02-28}{new} +% Format used by \cs{cGlspl} if entry only used once on previous run. +% The first argument is the label, the second argument is the insert +% text. +% \begin{macrocode} +\newcommand*{\cGlsplformat}[2]{% + \ifglshaslong{#1}{\Glsentrylongpl{#1}}{\Glsentryfirstplural{#1}}#2% +} +% \end{macrocode} +%\end{macro} +% % \subsection{Loading files containing glossary entries} %\label{sec:load} % Glossary entries can be defined in an external file. @@ -26349,6 +26824,55 @@ Linking with insert: \acrfullpl{html}['s], \Acrfullpl{html}['s], %\fi %\iffalse % \begin{macrocode} +%<*sample-entrycount.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: pdflatex: { synctex: on } + % arara: makeglossaries + % arara: pdflatex: { synctex: on } +\documentclass{article} + +\usepackage[colorlinks]{hyperref} +\usepackage + [nomain,% 'nomain' is used to suppress the main glossary + acronym% 'acronym' is used to create the 'acronym' glossary + ] + {glossaries} +\makeglossaries + +\glsenableentrycount + +\setacronymstyle{long-short} + +\newacronym{html}{HTML}{hypertext markup language} +\newacronym{css}{CSS}{cascading style sheets} +\newacronym{xml}{XML}{extensible markup language} +\newacronym{sql}{SQL}{structured query language} +\newacronym{rdbms}{RDBMS}{relational database management system} +\newacronym{rdsms}{RDSMS}{relational data stream management system} + +\begin{document} +These entries are only used once: \cgls{sql}, \cgls{rdbms}, +\cgls{xml}. These entries are used multiple times: +\cgls{html}, \cgls{html}, \cgls{css}, \cgls{css}, \cgls{css}, +\cgls{rdsms}, \cgls{rdsms}. + +\printglossaries +\end{document} +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} +%</sample-entrycount.tex> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*sample-entryfmt.tex> % \end{macrocode} %\fi diff --git a/Master/texmf-dist/source/latex/glossaries/glossaries.ins b/Master/texmf-dist/source/latex/glossaries/glossaries.ins index aecd29d6570..77801a5852a 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 1.1 2015/2/3 15:15 +% glossaries.ins generated using makedtx version 1.1 2015/2/28 17:35 \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, glossaries-prefix.sty, mfirstuc.sty, mfirstuc-english.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, minimalgls.tex, glossary-lipsum-examples.tex, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample-entryfmt.tex, sample-FnDesc.tex, sample-ignored.tex, sample-index.tex, sample-inline.tex, sample-langdict.tex, sample-mfirstuc.tex, sample-newkeys.tex, sample-noidxapp-utf8.tex, sample-noidxapp.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, sampleCustomAcr.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleFnAcrDesc.tex, sampleNtn.tex, samplePeople.tex, sampleSec.tex, sampleSort.tex, sampletree.tex, sampleutf8.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, mfirstuc-english.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, minimalgls.tex, glossary-lipsum-examples.tex, example-glossaries-acronym-desc.tex, example-glossaries-acronym.tex, example-glossaries-acronyms-lang.tex, example-glossaries-brief.tex, example-glossaries-childnoname.tex, example-glossaries-cite.tex, example-glossaries-images.tex, example-glossaries-long.tex, example-glossaries-multipar.tex, example-glossaries-parent.tex, example-glossaries-symbols.tex, example-glossaries-url.tex, sample-crossref.tex, sample-custom-acronym.tex, sample-dual.tex, sample-entrycount.tex, sample-entryfmt.tex, sample-FnDesc.tex, sample-ignored.tex, sample-index.tex, sample-inline.tex, sample-langdict.tex, sample-mfirstuc.tex, sample-newkeys.tex, sample-noidxapp-utf8.tex, sample-noidxapp.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, sampleCustomAcr.tex, sampleDB.tex, sampleDesc.tex, sampleEq.tex, sampleEqPg.tex, sampleFnAcrDesc.tex, sampleNtn.tex, samplePeople.tex, sampleSec.tex, sampleSort.tex, sampletree.tex, sampleutf8.tex, samplexdy.tex, samplexdy2.tex, samplexdy-mc.xdy, samplexdy-mc207.xdy, database1.tex, database2.tex, glossaries.perl, mfirstuc.perl. \endpreamble @@ -77,6 +77,7 @@ \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-entrycount.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-entrycount.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-ignored.tex}{\nopreamble\nopostamble\from{glossaries.dtx}{sample-ignored.tex}} |