summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx')
-rw-r--r--Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx124
1 files changed, 96 insertions, 28 deletions
diff --git a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx
index 4470df440b2..0f4115aaa35 100644
--- a/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx
+++ b/Master/texmf-dist/source/latex/glossaries-extra/glossaries-extra.dtx
@@ -1,23 +1,23 @@
%\iffalse
% glossaries-extra.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
+% -section "chapter"
% -doc "glossaries-extra-codedoc.tex"
% -macrocode ".*\.tex"
% -macrocode ".*\.bib"
+% -comment ".*\.tex"
+% -comment ".*\.bib"
+% -author "Nicola Talbot"
% -codetitle "Main Package Code (\\styfmt{glossaries-extra.sty})"
-% -section "chapter"
-% -setambles ".*\.bib=>\nopreamble\nopostamble"
% -src "glossaries-extra.sty\Z=>glossaries-extra.sty"
% -src "glossaries-extra-bib2gls.sty\Z=>glossaries-extra-bib2gls.sty"
% -src "glossaries-extra-stylemods.sty\Z=>glossaries-extra-stylemods.sty"
% -src "glossary-bookindex.sty\Z=>glossary-bookindex.sty"
% -src "(example-glossaries-.+\.tex)\Z=>\1"
% -src "(example-glossaries-.+\.bib)\Z=>\1"
-% -comment ".*\.tex"
-% -comment ".*\.bib"
-% -author "Nicola Talbot"
+% -setambles ".*\.bib=>\nopreamble\nopostamble"
% glossaries-extra
-% Created on 2018/7/26 10:14
+% Created on 2018/7/29 19:02
%\fi
%\iffalse
%<*package>
@@ -127,7 +127,7 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of
\setcounter{IndexColumns}{2}
-\CheckSum{23197}
+\CheckSum{23240}
\newcommand*{\ifirstuse}{\iterm{first use}}
\newcommand*{\firstuse}{\gls{firstuse}}
@@ -167,13 +167,13 @@ governed by the \gloskey{first} and \gloskey{firstplural} keys of
\raggedright
}
-\title{glossaries-extra.sty v1.33:
+\title{glossaries-extra.sty v1.34:
documented code}
\author{Nicola L.C. Talbot\\[10pt]
Dickimaw Books\\
\url{http://www.dickimaw-books.com/}}
-\date{2018-07-26}
+\date{2018-07-29}
\begin{document}
\DocInput{glossaries-extra.dtx}
@@ -218,7 +218,7 @@ Dickimaw Books\\
%\section{Package Initialisation and Options}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{glossaries-extra}[2018/07/26 v1.33 (NLCT)]
+\ProvidesPackage{glossaries-extra}[2018/07/29 v1.34 (NLCT)]
% \end{macrocode}
% Requires \sty{xkeyval} to define package options.
% \begin{macrocode}
@@ -359,6 +359,7 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%\begin{option}{undefaction}
% \begin{macrocode}
\define@choicekey{glossaries-extra.sty}{undefaction}%
[\glsxtr@undefaction@val\glsxtr@undefaction@nr]%
@@ -375,6 +376,7 @@ Dickimaw Books\\
\fi
}
% \end{macrocode}
+%\end{option}
%
%To assist bib2gls, v1.08 introduces the \pkgopt{record} option, which will write
%information to the aux file whenever an entry needs to be indexed.
@@ -837,6 +839,7 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%\begin{option}{record}
%Now define the \pkgopt{record} package option.
%\changes{1.08}{2016-12-13}{added \pkgopt{record} package option}
% \begin{macrocode}
@@ -919,6 +922,7 @@ Dickimaw Books\\
\fi
}
% \end{macrocode}
+%\end{option}
%
%\changes{1.06}{2016-06-18}{docdef option changed to choice}
%Version 1.06 changes the \pkgopt{docdef} option to a choice rather
@@ -953,25 +957,30 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
-%
+%\begin{option}{docdef}
% By default don't allow entries to be defined in the document to
% encourage the user to define them in the preamble, but if the user
% is really determined to define them in the document allow them to
% request this.
+%\changes{1.34}{2018-07-29}{added package option docdef=atom}
% \begin{macrocode}
\define@choicekey{glossaries-extra.sty}{docdef}
[\@glsxtr@docdefsetting\@glsxtr@docdefval]%
- {false,true,restricted}[true]%
+ {false,true,restricted,atom}[true]%
{%
- \ifnum\@glsxtr@docdefval=2\relax
+ \ifnum\@glsxtr@docdefval>1\relax
\renewcommand*{\@glsdoifexistsorwarn}{\glsdoifexists}%
+ \else
+ \renewcommand*{\@glsdoifexistsorwarn}{\glsdoifexistsorwarn}%
\fi
}
% \end{macrocode}
+%\end{option}
%\begin{macro}{\if@glsxtrdocdefrestricted}
%\changes{1.06}{2016-06-18}{new}
+%\changes{1.34}{2018-07-29}{changed to allow for atom as well}
% \begin{macrocode}
-\newcommand*{\if@glsxtrdocdefrestricted}{\ifnum\@glsxtr@docdefval=2 }
+\newcommand*{\if@glsxtrdocdefrestricted}{\ifnum\@glsxtr@docdefval>1 }
% \end{macrocode}
%\end{macro}
%
@@ -1294,6 +1303,7 @@ Dickimaw Books\\
% \end{macrocode}
%\end{macro}
%
+%\begin{option}{shortcuts}
%Provide \pkgopt{shortcuts} option. Unlike the \styfmt{glossaries}
%version, this is a choice rather than a boolean key but it also provides
%\pkgopt[true]{shortcuts} and \pkgopt[false]{shortcuts}, which are
@@ -1367,6 +1377,7 @@ Dickimaw Books\\
\fi
}
% \end{macrocode}
+%\end{option}
%
%\begin{macro}{\@glsxtr@doaccsupp}
%\changes{0.5.1}{2015-12-07}{new}
@@ -1385,17 +1396,19 @@ Dickimaw Books\\
%
%\begin{macro}{\glsxtrNoGlossaryWarning}
%\changes{0.3}{2015-12-02}{new}
+%\changes{1.34}{2018-07-29}{added package warning}
% Warning text displayed in document if the external glossary file
% given by the argument is missing.
% \begin{macrocode}
\newcommand{\glsxtrNoGlossaryWarning}[1]{%
+ \GlossariesExtraWarning{Glossary `#1' is missing}%
\@glsxtr@defaultnoglossarywarning{#1}%
}
% \end{macrocode}
%\end{macro}
%
%\begin{option}{nomissingglstext}
-% If true, suppress the text produced if the external glossary file
+% If true, suppress the text and warning produced if the external glossary file
% is missing.
% \begin{macrocode}
\define@choicekey{glossaries-extra.sty}{nomissingglstext}
@@ -1852,19 +1865,24 @@ Dickimaw Books\\
}
% \end{macrocode}
%
-%\begin{macro}{\ifglsused}
-%\changes{1.33}{2018-07-26}{added redefinition}
-%In the event that undefined entries should trigger a warning rather
-%than an error, \cs{ifglsused} needs to be modified to check for
-%existence.
+%\section{Extra Utilities}
+%
+%\begin{macro}{\GlsXtrIfUnusedOrUndefined}
+%\changes{1.34}{2018-07-29}{new}
+%\begin{definition}
+%\cs{GlsXtrIfUnusedOrUndefined}\marg{label}\marg{true}\marg{false}
+%\end{definition}
+% Does \meta{true} if the entry given by \meta{label} is either
+% undefined or hasn't been used (or has had the first use flag reset).
% \begin{macrocode}
-\renewcommand*{\ifglsused}[3]{%
- \glsdoifexists{#1}{\ifbool{glo@\glsdetoklabel{#1}@flag}{#2}{#3}}%
+\newcommand*{\GlsXtrIfUnusedOrUndefined}[3]{%
+ \ifglsentryexists{#1}%
+ {\ifbool{glo@\glsdetoklabel{#1}@flag}{#3}{#2}}%
+ {#2}%
}
% \end{macrocode}
%\end{macro}
%
-%\section{Extra Utilities}
%\begin{macro}{\glsxtrifemptyglossary}
%\begin{definition}
%\cs{glsxtrifemptyglossary}\marg{type}\marg{true}\marg{false}
@@ -2686,6 +2704,24 @@ Dickimaw Books\\
% Some of the commands provided by \styfmt{glossaries} are modified
% to take into account new options or to change default behaviour.
%
+%\begin{macro}{\ifglsused}
+%\begin{definition}
+%\cs{ifglsused}\marg{label}\marg{true part}\marg{false part}
+%\end{definition}
+%\changes{1.33}{2018-07-26}{added redefinition}
+%In the event that undefined entries should trigger a warning rather
+%than an error, \cs{ifglsused} needs to be modified to check for
+%existence. If the boolean variable is undefined, then its state is
+%indeterminate and is neither true nor false, so neither \meta{true
+%part} nor \meta{false} part will be performed if \meta{label} is
+%undefined.
+% \begin{macrocode}
+\renewcommand*{\ifglsused}[3]{%
+ \glsdoifexists{#1}{\ifbool{glo@\glsdetoklabel{#1}@flag}{#2}{#3}}%
+}
+% \end{macrocode}
+%\end{macro}
+%
%Provide a starred version of \cs{longnewglossaryentry} that doesn't
%automatically insert \verb|\leavevmode\unskip\nopostdesc| at the
%end of the description. The unstarred version is modified to use
@@ -3497,10 +3533,42 @@ Dickimaw Books\\
\@gls@restoreat
\undef\@gls@restoreat
\gls@defdocnewglossaryentry
+ \else
+ \ifnum\@glsxtr@docdefval=3\relax
+% \end{macrocode}
+%\changes{1.34}{2018-07-29}{added support for docdef=atom}
+%The \pkgopt[atom]{docdef} package option has been set. Create the
+%.glsdefs file for the autocomplete support but don't read it.
+% \begin{macrocode}
+ \@gls@enablesavenonumberlist
+ \let\gls@checkseeallowed\relax
+ \let\newglossaryentry\new@atom@glossaryentry
+ \global\newwrite\@gls@deffile
+ \immediate\openout\@gls@deffile=\jobname.glsdefs
+% \end{macrocode}
+%Write all currently defined entries.
+% \begin{macrocode}
+ \forallglsentries{\@glsentry}{\@gls@writedef{\@glsentry}}%
+ \fi
\fi
}
}
-{}
+{%
+ \ifnum\@glsxtr@docdefval=3\relax
+ \PackageError{glossaries-extra}{Package option
+ `docdef=\@glsxtr@docdefsetting' requires at least version 4.37
+ of the base glossaries.sty package}{}
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\new@atom@glossaryentry}
+% \begin{macrocode}
+\newrobustcmd{\new@atom@glossaryentry}[2]{%
+ \gls@defglossaryentry{#1}{#2}%
+ \@gls@writedef{#1}%
+}
% \end{macrocode}
%\end{macro}
%
@@ -3593,7 +3661,7 @@ Dickimaw Books\\
% \begin{macrocode}
\let\gls@checkseeallowed\relax
\let\newglossaryentry\new@glossaryentry
- \or
+ \else
% \end{macrocode}
%Restricted mode just needs to allow the \gloskey{see} value.
% \begin{macrocode}
@@ -22319,7 +22387,7 @@ defined}{}%
%automatically loaded by the record option.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{glossaries-extra-bib2gls}[2018/07/26 v1.33 (NLCT)]
+\ProvidesPackage{glossaries-extra-bib2gls}[2018/07/29 v1.34 (NLCT)]
% \end{macrocode}
%
%These are some convenient macros for use with custom rules.
@@ -24696,7 +24764,7 @@ defined}{}%
% First identify package:
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{glossaries-extra-stylemods}[2018/07/26 v1.33 (NLCT)]
+\ProvidesPackage{glossaries-extra-stylemods}[2018/07/29 v1.34 (NLCT)]
% \end{macrocode}
% Provide package options to automatically load required predefined
% styles. The simplest method is to just test for the existence of
@@ -26871,7 +26939,7 @@ defined}{}%
%\section{Package Initialisation and Options}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{glossary-bookindex}[2018/07/26 v1.33 (NLCT)]
+\ProvidesPackage{glossary-bookindex}[2018/07/29 v1.34 (NLCT)]
% \end{macrocode}
%Load required packages.
% \begin{macrocode}