summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-10-15 03:01:23 +0000
committerNorbert Preining <norbert@preining.info>2022-10-15 03:01:23 +0000
commit716f66d13d38e113c2d0491804fae5879de67bb3 (patch)
tree98e4752aa89041db35c60e5b893897e714561340 /macros
parent1c0d5e0721918b8ee790c9f1c11f1543e0403322 (diff)
CTAN sync 202210150301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/apxproof/README.md29
-rw-r--r--macros/latex/contrib/apxproof/apxproof.dtx363
-rw-r--r--macros/latex/contrib/apxproof/apxproof.pdfbin569226 -> 595825 bytes
-rw-r--r--macros/latex/contrib/docshots/DEPENDS.txt5
-rw-r--r--macros/latex/contrib/docshots/LICENSE.txt21
-rw-r--r--macros/latex/contrib/docshots/README.md25
-rw-r--r--macros/latex/contrib/docshots/docshots.dtx203
-rw-r--r--macros/latex/contrib/docshots/docshots.ins55
-rw-r--r--macros/latex/contrib/docshots/docshots.pdfbin0 -> 279951 bytes
-rw-r--r--macros/latex/contrib/huawei/huawei.dtx60
-rw-r--r--macros/latex/contrib/huawei/huawei.pdfbin413691 -> 412294 bytes
-rw-r--r--macros/latex/contrib/nlctdoc/README4
-rw-r--r--macros/latex/contrib/nlctdoc/nlctdoc.cls26
-rw-r--r--macros/latex/contrib/nlctdoc/nlctuserguide.sty3118
14 files changed, 3693 insertions, 216 deletions
diff --git a/macros/latex/contrib/apxproof/README.md b/macros/latex/contrib/apxproof/README.md
index c36cb1411a..8b385398fa 100644
--- a/macros/latex/contrib/apxproof/README.md
+++ b/macros/latex/contrib/apxproof/README.md
@@ -19,32 +19,37 @@ The documentation of this package is provided in the
In addition to a working installation of LaTeX2e, `apxproof` relies on a
few other packages, which should be provided by all reasonable LaTeX
distributions:
- - `amsthm`
- - `environ`
- - `etoolbox`
- - `fancyvrb`
- - `ifthen`
- - `kvoptions`
- - `bibunits` (optional, only if the `bibliography` option is set to `separate`)
+
+- `amsthm`
+- `environ`
+- `etoolbox`
+- `fancyvrb`
+- `ifthen`
+- `kvoptions`
+- `bibunits` (optional, only if the `bibliography` option is set to `separate`)
## Manual installation
-Simply copy the file [apxproof.sty](apxproof.sty) in your LaTeX working directory, or
-in any other directory where LaTeX searches for packages.
+Simply copy the file [apxproof.sty](apxproof.sty) in your LaTeX working
+directory, or in any other directory where LaTeX searches for packages.
## License
-Copyright © 2016-2021 by Pierre Senellart.
+Copyright © 2016-2022 by Pierre Senellart.
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License, either version 1.3 of this license or (at
your option) any later version. The latest version of this license is in
-http://www.latex-project.org/lppl.txt and version 1.3 or later is part of
+<http://www.latex-project.org/lppl.txt> and version 1.3 or later is part of
all distributions of LaTeX version 2005/12/01 or later.
+The [diffpdf.py](examples/diffpdf.py) script used for regression testing
+but not part of the `apxproof` LaTeX package itself is under the
+[Affero GPL 3.0](https://www.gnu.org/licenses/agpl-3.0.html) license.
+
## Contact
-https://github.com/PierreSenellart/apxproof
+<https://github.com/PierreSenellart/apxproof>
Pierre Senellart <pierre@senellart.com>
diff --git a/macros/latex/contrib/apxproof/apxproof.dtx b/macros/latex/contrib/apxproof/apxproof.dtx
index 0225d20e77..35a8b6f95a 100644
--- a/macros/latex/contrib/apxproof/apxproof.dtx
+++ b/macros/latex/contrib/apxproof/apxproof.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2016-2021 by Pierre Senellart
+% Copyright (C) 2016-2022 by Pierre Senellart
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -11,7 +11,7 @@
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
-%
+%
% The Current Maintainer of this work is Pierre Senellart
% <pierre@senellart.com> and a version control system for this work
% is available at http://github.com/PierreSenellart/apxproof
@@ -20,11 +20,11 @@
% and the derived file apxproof.sty.
%
% \fi
-%
+%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{apxproof}
-%<package> [2021/09/03 v1.2.3 Automatic proofs in appendix]
+%<package> [2022/10/14 v1.2.4 Automatic proofs in appendix]
%
%<*driver>
\documentclass{ltxdoc}
@@ -45,7 +45,7 @@
%</driver>
% \fi
%
-% \CheckSum{864}
+% \CheckSum{974}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -87,7 +87,7 @@
% \changes{v1.0.0}{2016/10/31}{Initial released version}
% \changes{v1.0.1}{2016/11/07}{Prevent empty bibliography environment;
% fix typos}
-%
+%
% \GetFileInfo{apxproof.sty}
%
% \makeatletter\c@IndexColumns=2\makeatother
@@ -102,13 +102,13 @@
% }
%
% \title{The \textsf{apxproof} package}
-%
+%
% \author{Pierre Senellart \\ \texttt{pierre@senellart.com} \\
% \url{http://github.com/PierreSenellart/apxproof}}
% \date{\filedate \quad \fileversion}
%
% \maketitle
-%
+%
% \begin{abstract}
% This package makes it easier to write articles where proofs and other material
% are deferred to the appendix. The appendix material is written in the \LaTeX{}
@@ -149,9 +149,7 @@
% \end{toappendix}
% \end{verbatim}
% \begin{toappendix}
-%<*driver>
-This content is in the appendix.
-%</driver>
+% This content is in the appendix.
% \end{toappendix}
% \end{example}
% \changes{v1.0.3}{2017/01/10}{Note on entire sections in appendix}
@@ -168,7 +166,7 @@ This content is in the appendix.
% \hspace*{1em}\dots\\
% |\end{appendixproof}|
% \end{quote}
-% This behaves like the |toappendix| environment, except that
+% This behaves like the |toappendix| environment, except that
% a proof environment is generated.
% \begin{example}We now send a proof to the appendix:
% \begin{verbatim}
@@ -177,9 +175,7 @@ This content is in the appendix.
% \end{appendixproof}
% \end{verbatim}
% \begin{appendixproof}
-%<*driver>
-This proof is in the appendix.
-%</driver>
+% This proof is in the appendix.
% \end{appendixproof}
% \end{example}
%
@@ -195,7 +191,7 @@ This proof is in the appendix.
% |\newtheoremrep|\marg{name}\oarg{counter}\marg{title}\oarg{countersec}\DescribeMacro{\newtheoremrep}
% \end{quote}
% Usage is exactly the same as that of AMS \LaTeX{}'s |\newtheorem|
-% macro:
+% macro:
% \begin{itemize}
% \item \meta{name} (e.g., |theorem|) is the name of an environment that is created for this kind of
% theorem;
@@ -266,9 +262,7 @@ This proof is in the appendix.
% This foobar is repeated in the appendix.
% \end{foobarrep}
% \begin{proof}
-%<*driver>
-This is the proof of the repeated foobar.
-%</driver>
+% This is the proof of the repeated foobar.
% \end{proof}
% Note that, since |hyperref| is loaded, there are hyperlinks
% created between the statements of the theorems in the main text and in
@@ -309,7 +303,7 @@ This is the proof of the repeated foobar.
% This is an inline proof.
% \end{inlineproof}
% \end{example}
-%
+%
% \subsection{Bibliography}
% By default, \textsf{apxproof} automatically adds a bibliography in the appendix
% with only the references cited in the appendix material. This allows for a
@@ -325,9 +319,7 @@ This is the proof of the repeated foobar.
% \end{verbatim}
% This is a citation in the main text~\cite{lamport86}.
% \begin{toappendix}
-%<*driver>
-This is a citation in the appendix~\cite{proofsAreHard}.
-%</driver>
+% This is a citation in the appendix~\cite{proofsAreHard}.
% \end{toappendix}
% \end{example}
% The bibliography in the appendix can use
@@ -477,18 +469,18 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% Issues not listed here should be reported to the author.
%
% \section{License}
-% Copyright \textcopyright{} 2016--2021 by Pierre Senellart.
-%
+% Copyright \textcopyright{} 2016--2022 by Pierre Senellart.
+%
% This work may be distributed and/or modified under the conditions of the
% \LaTeX{} Project Public License, either version 1.3 of this license or (at
% your option) any later version. The latest version of this license is in
% \url{http://www.latex-project.org/lppl.txt} and version 1.3 or later is part of
% all distributions of \LaTeX{} version 2005/12/01 or later.
-%
+%
% \section{Contact}
% \begin{itemize}
% \item \url{https://github.com/PierreSenellart/apxproof}
-% \item
+% \item
% Pierre Senellart
% \href{mailto:pierre@senellart.com}{<pierre@senellart.com>}
% \end{itemize}
@@ -505,7 +497,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \PrintChanges
% \PrintIndex
% }
-%
+%
% \section{Implementation}
% We now describe the entire code of the package, in a literate programming
% fashion. Throughout the package, we use the |axp@| prefix to identify
@@ -630,7 +622,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}}}
\ifthenelse{\equal{\axp@bibliography}{separate}}{
% \end{macrocode}
-% The external \textsf{bibunits} package
+% The external \textsf{bibunits} package
% is used to add a second bibliography for the appendix material.
% \changes{v1.2.0}{2019/04/17}{Do not load \textsf{bibunits} if
% \texttt{bibliography} is set to \texttt{common}}
@@ -726,7 +718,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% We define the high-level |\newtheoremrep| to have the same syntax as
% \textsf{amsthm}'s |\newtheorem|. For this purpose, we need a little
% trick to deal with the second and fourth optional arguments, which is what
-% |\@oparg| and |\axp@newtheoremreptmp| are
+% |\@oparg| and |\axp@newtheoremreptmp| are
% used for. |\axp@newtheoremrep| is defined differently
% depending on the compilation mode.
% \begin{macrocode}
@@ -745,7 +737,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \begin{macrocode}
\newenvironment{proofsketch}{\begin{axp@oldproof}[Proof sketch]}{\end{axp@oldproof}}
% \end{macrocode}
-% \end{environment}
+% \end{environment}
% \begin{macro}{\mainbodyrepeatedtheorem}
% \changes{v1.2.0}{2019/09/21}{Configurable repeated theorem command}
% \begin{macro}{\appendixrefname}
@@ -776,11 +768,15 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \end{macro}
% \end{macro}
% \begin{environment}{axp@oldproof}
-% We save the definition of the existing |proof| environment.
-% \begin{macrocode}
+% We save the definition of the existing |proof| environment (and of
+% the |claimproof| environment that the \textsf{lipics} document class
+% defines).
+% \begin{macrocode}
\let\axp@oldproof\proof
\let\endaxp@oldproof\endproof
-% \end{macrocode}
+ \let\axp@oldclaimproof\claimproof
+ \let\endaxp@oldclaimproof\endclaimproof
+% \end{macrocode}
% \end{environment}
% We define a utility macro that will be used to properly set the
% |\label| command (and its \textsf{amsmath} counterpart,
@@ -793,7 +789,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \changes{v1.2.0}{2019/02/15}{Fix extra spacing erroneously
% introduced within the \texttt{\textbackslash axp@redefinelabels}
% macro}
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\axp@redefinelabels}{%
\providecommand\label@in@display{}%
\ifthenelse{\equal{\axp@appendix}{inline}}{%
@@ -814,9 +810,9 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\renewcommand\label@in@display[1]{\axp@oldlabel@in@display{##1-apx}}%
}%
}
-% \end{macrocode}
-% \end{macro}
-% \subsubsection{Class-Specific Behavior}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{Class-Specific Behavior}
% Finally, some class-specific behavior common to all compilation modes.
% \paragraph{\textsf{llncs} and other Springer document classes}
% \changes{v1.0.6}{2018/05/10}{Better support of Springer document
@@ -844,13 +840,13 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\spnewtheorem*{#1}{#2}{\upshape\bfseries}{\itshape}%
}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{proofsketch}
% \changes{v1.2.0}{2019/02/15}{Fix proof sketches in inline
% compilation mode for Springer document classes}
% We redefine the |proofsketch| environment, which is used
-% differently in the base class.
+% differently in the base class.
% \begin{macrocode}
\renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@oldproof}}
% \end{macrocode}
@@ -886,7 +882,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}
}
% \end{macrocode}
-% \end{macro}
+% \end{macro}
% \begin{environment}{inlineproof}
% \begin{environment}{nestedproof}
% \begin{environment}{appendixproof}
@@ -900,23 +896,23 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\let\appendixproof\proof
\let\endappendixproof\endproof
% \end{macrocode}
-% \end{environment}
-% \end{environment}
-% \end{environment}
+% \end{environment}
+% \end{environment}
+% \end{environment}
% \begin{environment}{toappendix}
% \begin{macro}{\noproofinappendix}
% \begin{macro}{\nosectionappendix}
-% In inline mode, this environment and these macros are no-ops.
+% In inline mode, this environment and these macros are no-ops.
% \begin{macrocode}
\newenvironment{toappendix}{}{}
\let\noproofinappendix\relax
\let\nosectionappendix\relax
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{environment}
+% \end{macro}
+% \end{environment}
% \begin{macrocode}
-}
+}
% \end{macrocode}
% \subsection{Append or Strip Compilation Modes}
% \begin{macrocode}
@@ -926,37 +922,39 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% useful: either append the appendix material to the document, or strip
% it entirely.
% \bigskip
-% \subsubsection{Auxiliary File for the Appendix}
-% \begin{macro}{\axp@proofsfile}
+% \subsubsection{Auxiliary File for the Appendix}
+% \begin{macro}{\axp@proofsfile}
% We open a new auxiliary file, with extension |.axp|, where the appendix
-% material will be dumped.
+% material will be dumped.
% \changes{v1.1.0}{2018/07/11}{Initialization deferred to \cs{AtBeginDocument}
% for compatibility with \cs{dump}ed precompiled preambles (K. D.
% Bauer)}
-% \begin{macrocode}
+% \begin{macrocode}
\AtBeginDocument{
\newwrite\axp@proofsfile
\immediate\openout\axp@proofsfile=\jobname.axp
}
-% \end{macrocode}
-% \end{macro}
+% \end{macrocode}
+% \end{macro}
% \begin{environment}{proof}
% \begin{macro}{\section}
% At the beginning of this file, we make |@| a regular character (since
% it will be used in several places for internal names) and reestablish the original definition of
% the |proof| environment and the |\section| macro.
-% \begin{macrocode}
+% \begin{macrocode}
\AtBeginDocument{
\immediate\write\axp@proofsfile{%
\noexpand\makeatletter
\noexpand\let\noexpand\proof\noexpand\axp@oldproof
\noexpand\let\noexpand\endproof\noexpand\endaxp@oldproof
+ \noexpand\let\noexpand\claimproof\noexpand\axp@oldclaimproof
+ \noexpand\let\noexpand\endclaimproof\noexpand\endaxp@oldclaimproof
\noexpand\let\noexpand\section\noexpand\axp@oldsection
}
}
-% \end{macrocode}
-% \end{macro}
-% \end{environment}
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
% \begin{macro}{\axp@unactivateeightbit}
% \changes{v1.1.0}{2019/01/28}{Fix compilation of non-ASCII
% characters with \texttt{\textbackslash usepackage[utf8]\{inputenc\}}}
@@ -976,7 +974,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \begin{environment}{axp@VerbatimOut}
% \begin{macro}{\FVB@axp@VerbatimOut}
% \begin{macro}{\FVE@axp@VerbatimOut}
-% \changes{v1.1.0}{2018/10/02}{Make \textsf{apxproof} compatible with
+% \changes{v1.1.0}{2018/10/02}{Make \textsf{apxproof} compatible with
% independent use of \textsf{fancyvrb}}
% Using the functionalities of the \textsf{fancyvrb} package, we define a
% custom verbatim environment |axp@VerbatimOut| that writes every line
@@ -1009,39 +1007,39 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\endgroup\@esphack}
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{environment}
+% \end{macro}
+% \end{environment}
% \begin{environment}{toappendix}
% The entire content of this environment is put in appendix,
% starting a new appendix section beforehand if needed.
-% \begin{macrocode}
+% \begin{macrocode}
\newenvironment{toappendix}
{\axp@writesection\axp@VerbatimOut}
{\endaxp@VerbatimOut}
-% \end{macrocode}
+% \end{macrocode}
% \end{environment}
-% \subsubsection{Definition of New Theorems}
+% \subsubsection{Definition of New Theorems}
% \begin{macro}{axp@seenreptheorem}
% Used to indicate whether a repeated theorem was just typeset, without
% its proof.
-% \begin{macrocode}
+% \begin{macrocode}
\newtoggle{axp@seenreptheorem}
-% \end{macrocode}
-% \end{macro}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{axp@rpcounter}
% Sequentially incremented for every repeated theorem, used to create labels.
-% \begin{macrocode}
+% \begin{macrocode}
\newcounter{axp@rpcounter}
-% \end{macrocode}
-% \end{macro}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{axp@equation}
% \begin{macro}{axp@equationx}
% Used to save the value of the |equation| counter, when |repeqn| is set
% to |same|.
-% \begin{macrocode}
+% \begin{macrocode}
\newcounter{axp@equation}
\newcounter{axp@equationx}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{axp@newtheoremrep}
@@ -1050,13 +1048,13 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% theorem |foobar|. We then patch |\begin{foobar}| so as not to
% expect a proof in the appendix and define an internal theorem |axp@foobarrp| that
% will be used in the appendix to restate the existing theorem.
-% \begin{macrocode}
+% \begin{macrocode}
\def\axp@newtheoremrep#1[#2]#3[#4]{%
\axp@newtheoremrep@definetheorem{#1}{#2}{#3}{#4}%
\expandafter\pretocmd\csname #1\endcsname{\noproofinappendix}{}{}%
\axp@newtheorem*{axp@#1rp}{#3}%
\axp@forward@setup{#1}{#2}{#3}{#4}%
-% \end{macrocode}
+% \end{macrocode}
% We then define a |foobarrep| environment that increments the
% |axp@rpcounter| and typeset the regular |foobar| theorem with a label
% derived from the counter, along with a possible custom command to
@@ -1083,16 +1081,16 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\fi
\mainbodyrepeatedtheorem
\BODY\end{#1}%
-% \end{macrocode}
+% \end{macrocode}
% We set the |axp@seenreptheorem| toggle to indicate that we are looking
% for the proof of the theorem, then store in a macro the content of the
% theorem's body.
-% \begin{macrocode}
+% \begin{macrocode}
\global\toggletrue{axp@seenreptheorem}%
\global\expandafter\let\csname rplet\roman{axp@rpcounter}%
\endcsname
\BODY
-% \end{macrocode}
+% \end{macrocode}
% Possibly after starting a new appendix section if needed, we typeset a
% repeated version of the theorem using the |axp@foobarrp| environment
% and a reference to the previously defined label.
@@ -1102,7 +1100,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% theorem, but theorem notes are usually typeset in a much
% different way (different font, parentheses) than theorem
% headings. In the case of the Springer document
-% classes, we use the |\theopargself| macro to disable parentheses. For
+% classes, we use the |\theopargself| macro to disable parentheses. For
% other document classes, we need to manually patch the |\thmhead|
% command at the right time. We also specially cover the case of
% the ACM document class where |\@acmplainnotefont| is used instead
@@ -1114,7 +1112,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \changes{v1.0.6}{2018/05/10}{Fix incorrect use of \texttt{\textbackslash noexpand}
% in optional argument of macro environment}
% \changes{v1.2.0}{2019/10/07}{Fix display of theorem notes}
-% \begin{macrocode}
+% \begin{macrocode}
\axp@writesection%
\immediate\write\axp@proofsfile{\noexpand\makeatletter}%
\ifthenelse{\equal{\axp@repeqn}{same}}{%
@@ -1152,7 +1150,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\noexpand\the\noexpand\thm@notefont
\noexpand\fi
\fi
- \fi
+ \fi
{} (\unexpanded{{##1}})%
}%
]%
@@ -1170,18 +1168,18 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}%
}
% \end{macrocode}
-% \end{macro}
-%
+% \end{macro}
+%
% \subsubsection{Forward-Linking Mechanism}
% \changes{v1.1.0}{2018/07/02}{Added forward-link mechanism (K. D. Bauer)}
-%
+%
% When hyperref is loaded, |foobarrep| environments
% in the main text have their number link to their
% repetition in the appendix.
-%
-%
+%
+%
-%
+%
% \begin{macro}{\axp@with@forward}
% In order to make the number of the |foobarrep| theorem a link
% to its repeated version, we temporarily redefine the
@@ -1191,7 +1189,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% a |\hyperlink|, without adding extensive dependence
% on internals of |amsthm|, the builtin |\newtheorem|
% and possibly document-class specific definitions.
-%
+%
% In order to allow users to redefine |\thefoobar| without
% breaking this feature, we redefine |\thefoobar| only
% for the duration of the |\begin{foobar}| form,
@@ -1204,7 +1202,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% We also redefine |\theHfoobar| which is used by |hyperref| but not
% defined if |hyperref| was loaded after |\newtheoremrep| was used.
% and |\protect| it to output it verbatim into the |.aux| file.
-%
+%
% These hyperlinks are of course disabled in the |strip| compilation
% mode.
% \begin{macrocode}
@@ -1233,7 +1231,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% Dummy macro, for handling the unwanted change of
% the |\newlabel| entry in the |.aux| file caused by
% changing the definition of |\thefoobar|.
-%
+%
% \begin{macrocode}
\newbool{axp@forward}
\newcommand{\axp@forward@link}[2]{%
@@ -1250,7 +1248,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \end{macrocode}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macro}{\axp@forward@target}
% Provides the needed |\hypertarget|.
% Intended to be written to the |.axp| file.
@@ -1264,7 +1262,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\axp@forward@setup}
% In order to support counter inheritance with the first
% optional argument of |\newtheoremrep|,
@@ -1278,22 +1276,28 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}
% \end{macrocode}
% \end{macro}
-%
-%
-% \subsubsection{Proof Environments}
+%
+%
+% \subsubsection{Proof Environments}
% \begin{macro}{\noproofinappendix}
% Utility macro that toggles |axp@seenreptheorem| to false.
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand\noproofinappendix{%
\global\togglefalse{axp@seenreptheorem}%
}
% \end{macrocode}
% \end{macro}
% \begin{environment}{appendixproof}
+% \changes{v1.2.4}{2021/11/03}{Support optional arguments in proofs}
% We dump the content of this in appendix, within an original |proof|
% environment, possibly after creating a new appendix section.
-% \begin{macrocode}
- \newenvironment{appendixproof}
+% We support
+% optional arguments in proofs, but we need to be careful not to gobble
+% any newline character, that would make it impossible to process the
+% first line with \textsf{fancyvrb}.
+% \begin{macrocode}
+ \def\appendixproof{\catcode`\^^M=\active\@ifnextchar[{\catcode`\^^M=5\@@appendixproof}{\catcode`\^^M=5\@appendixproof}}
+ \def\@appendixproof
{%
\axp@writesection
\immediate\write\axp@proofsfile{%
@@ -1301,6 +1305,15 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}%
\axp@VerbatimOut
}
+ \def\@@appendixproof[#1]%
+ {%
+ \axp@writesection
+ \immediate\write\axp@proofsfile{%
+ \noexpand\makeatletter\noexpand\begin{axp@oldproof}[\unexpanded{#1}]\noexpand\makeatother%
+ }%
+ \axp@VerbatimOut
+ }
+ \def\endappendixproof
{%
\endaxp@VerbatimOut
\immediate\write\axp@proofsfile{%
@@ -1308,13 +1321,17 @@ This is a citation in the appendix~\cite{proofsAreHard}.
}%
\noproofinappendix
}
-% \end{macrocode}
+% \end{macrocode}
% \end{environment}
% \begin{environment}{proof}
% This environment either puts the proof in appendix, if we are after a repeated
-% theorem without its proof, or inlines it otherwise.
-% \begin{macrocode}
- \renewenvironment{proof}
+% theorem without its proof, or inlines it otherwise. We support
+% optional arguments in proofs, but we need to be careful not to gobble
+% any newline character, that would make it impossible to process the
+% first line with \textsf{fancyvrb}.
+% \begin{macrocode}
+ \def\proof{\catcode`\^^M=\active\ltx@ifnextchar@nospace[{\catcode`\^^M=5\axp@@proof}{\catcode`\^^M=5\axp@proof}}
+ \def\axp@proof
{%
\iftoggle{axp@seenreptheorem}{%
\appendixproof
@@ -1322,6 +1339,15 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\axp@oldproof
}%
}
+ \def\axp@@proof[#1]%
+ {%
+ \iftoggle{axp@seenreptheorem}{%
+ \appendixproof[#1]
+ }{%
+ \axp@oldproof[#1]
+ }%
+ }
+ \def\endproof
{%
\iftoggle{axp@seenreptheorem}{%
\endappendixproof
@@ -1329,34 +1355,75 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\endaxp@oldproof
}%
}
-% \end{macrocode}
+% \end{macrocode}
+% \end{environment}
+% \begin{environment}{claimproof}
+% \changes{v1.2.4}{2021/11/03}{Support for \texttt{claimproof} environment
+% from \textsf{lipics}}
+% If the |claimproof| environment exists (\textsf{lipics} document
+% class), we also redefine it, in the same way.
+% \begin{macrocode}
+ \ifdefined\claimproof
+ \def\claimproof{\catcode`\^^M=\active\ltx@ifnextchar@nospace[{\catcode`\^^M=5\axp@@claimproof}{\catcode`\^^M=5\axp@claimproof}}
+ \def\axp@claimproof
+ {%
+ \iftoggle{axp@seenreptheorem}{%
+ \appendixproof
+ }{%
+ \axp@oldclaimproof
+ }%
+ }
+ \def\axp@@claimproof[#1]%
+ {%
+ \iftoggle{axp@seenreptheorem}{%
+ \appendixproof[#1]
+ }{%
+ \axp@oldclaimproof[#1]
+ }%
+ }
+ \def\endclaimproof
+ {%
+ \iftoggle{axp@seenreptheorem}{%
+ \immediate\write\axp@proofsfile{%
+ \noexpand\makeatletter
+ \noexpand\let\noexpand\endaxp@oldproof\noexpand\endaxp@oldclaimproof
+ \noexpand\makeatother
+ }%
+ \endappendixproof
+ }{%
+ \endaxp@oldclaimproof
+ }%
+ }
+ \fi
+% \end{macrocode}
% \end{environment}
+
% \begin{environment}{inlineproof}
% \begin{environment}{nestedproof}
% These two environments are synonyms for the original |proof|
-% environment.
-% \begin{macrocode}
+% environment.
+% \begin{macrocode}
\let\inlineproof\axp@oldproof
\let\endinlineproof\endaxp@oldproof
\let\nestedproof\axp@oldproof
\let\endnestedproof\endaxp@oldproof
-% \end{macrocode}
+% \end{macrocode}
% \end{environment}
% \end{environment}
-% \subsubsection{Section Management}
+% \subsubsection{Section Management}
% \begin{macro}{axp@seccounter}
% Sequentially incremented for every section, used to create labels.
-% \begin{macrocode}
+% \begin{macrocode}
\newcounter{axp@seccounter}
-% \end{macrocode}
-% \end{macro}
+% \end{macrocode}
+% \end{macro}
% \begin{macro}{\axp@sectitle}
% Saves the title of the last encountered section.
-% \begin{macrocode}
+% \begin{macrocode}
\def\axp@sectitle{}
-% \end{macrocode}
-% \end{macro}
-% \begin{macro}{\axp@section}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\axp@section}
% \changes{v1.2.2}{2021/06/23}{Detect a section within an included
% file to avoid produced useless sections}
% \begin{macro}{\axp@@sectiontestinput}
@@ -1366,8 +1433,8 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% does not produce anything. This is useful to avoid producing empty
% sections in the appendix. Using the \textsf{catchfile} package, we
% also check whether a |\section| is within an |\input| that immediately
-% follows.
-% \begin{macrocode}
+% follows.
+% \begin{macrocode}
\def\axp@section#1{%
\@ifnextchar\input
{\axp@@sectiontestinput{#1}}%
@@ -1379,10 +1446,10 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\expandafter\axp@tmptmp\axp@tmp%
}
\def\axp@@sectiontestsection#1{\@ifnextchar\section{\makeatother}{\axp@oldsection{#1}\makeatother}}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \begin{macro}{\axp@oldsection}
% \begin{macro}{\section}
% \changes{v1.1.0}{2018/07/25}{Rewrote definition of \cs{section}
@@ -1411,7 +1478,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\addtocounter{axp@seccounter}{1}%
\label{axp@s\roman{axp@seccounter}}%
}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -1419,30 +1486,30 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \begin{macro}{\nosectionappendix}
% We remove the current section title, to indicate no section should be
% created in the appendix.
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand{\nosectionappendix}{
\global\def\axp@sectitle{}%
}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \begin{macro}{\axp@writesection}
% If |\axp@sectitle| is not empty, we create
% a new section in the appendix, referring to the main text section.
-%
+%
% Here, we wrap |\ref{axp@si}| into |\axp@protectref@i|, in order
% to protect the label name from wrongly being converted to uppercase,
% e.g., in \textsf{fancyhdr} with |\pagestyle{fancy}|.
-%
+%
% This macro is defined both in the |.aux| file (in order to ensure availability
% when typesetting the |\tableofcontents|), and immediately before typesetting
% the appendix section (to ensure availability in the |\section| command).
-%
+%
% \changes{v1.0.6}{2018/05/10}{Fix extraneous space after section number
% in appendix titles}
% \changes{v1.1.0}{2018/07/09}{Make \cs{axp@tmp} wrapper more robust.
-% Resolves issues from use of section title in \textsf{fancyhdr},
+% Resolves issues from use of section title in \textsf{fancyhdr},
% and in \cs{tableofcontents} (K. D. Bauer).}
-% \begin{macrocode}
+% \begin{macrocode}
\newcommand\axp@writesection{%
\ifx\axp@sectitle\@empty
\else
@@ -1465,28 +1532,28 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\nosectionappendix
\fi
}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% Finally, in a somewhat ad hoc manner, we disable the whole section management
% for \cs{tableofcontents}, which may be typeset using a section heading,
% but for which automatic section management does not make sense.
-%
+%
% \begin{macro}{\axp@oldtableofcontents}
% \begin{macro}{\tableofcontents}
% \changes{v1.1.0}{2018/07/09}{Disable section management for table
% of contents}
-% \begin{macrocode}
+% \begin{macrocode}
\let\axp@oldtableofcontents\tableofcontents
\def\tableofcontents{{\let\section\axp@oldsection\axp@oldtableofcontents}}
-% \end{macrocode}
+% \end{macrocode}
% \end{macro}
% \end{macro}
-% \subsubsection{Append Compilation Mode}
-% \begin{macrocode}
+% \subsubsection{Append Compilation Mode}
+% \begin{macrocode}
\ifthenelse{\equal{\axp@appendix}{append}}{
-% \end{macrocode}
-% \begin{macro}{\axp@oldbibliography}
-% \begin{macro}{\bibliography}
+% \end{macrocode}
+% \begin{macro}{\axp@oldbibliography}
+% \begin{macro}{\bibliography}
% Unless the |bibliography| option is set to |common|, we need to set the
% appendix bibliography source to be the same as that of the main
% text, thanks to \textsf{bibunits}'s |\defaultbibliography| macro.
@@ -1501,7 +1568,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \end{macrocode}
% \end{macro}
% \end{macro}
-% After the end of the main text, we add the appendix (after the command
+% After the end of the main text, we add the appendix (after the command
% |\appendixprelim| is issued)
% within a |bibunit| environment so as to typeset
% a separate bibliography for the appendix (unless the |bibliography|
@@ -1566,11 +1633,11 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\fi
}{}
}{}{}
-% \end{macrocode}
-% \begin{macrocode}
+% \end{macrocode}
+% \begin{macrocode}
}{}
% \end{macrocode}
-% \subsubsection{Class-Specific Behavior}
+% \subsubsection{Class-Specific Behavior}
% We conclude with some class-specific behavior.
% \paragraph{ACM Document Classes (old versions, till 2017)}
% \changes{v1.0.4}{2017/03/08}{More faithful theorem style for ACM templates}
@@ -1579,12 +1646,12 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\ifdefined\@acmtitlebox
% \end{macrocode}
% We first redefine the |proofsketch| environment, which is used
-% differently in the base class.
+% differently in the base class.
% \begin{macrocode}
\renewenvironment{proofsketch}{\begin{axp@oldproof}[sketch]}{\end{axp@oldproof}}
% \end{macrocode}
% We adjust the styling of theorems for the needs of \textsf{apxproof}.
-% \begin{macrocode}
+% \begin{macrocode}
\newtheoremstyle{mystyle}
{6pt}
{6pt}
@@ -1602,7 +1669,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% The section title of the bibliography is in uppercase in these document
% classes. In addition, the |\thebibliography| macro hard-codes twice
% the section title, so we un-hardcode it so that it can be modified
-% in the appendix.
+% in the appendix.
% \begin{macrocode}
\patchcmd{\thebibliography}{References}{\protect\refname}{}{}
\patchcmd{\thebibliography}{References}{\protect\refname}{}{}
@@ -1612,7 +1679,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \end{macro}
% \end{macro}
% \end{macro}
-%
+%
% \begin{macrocode}
\fi
% \end{macrocode}
@@ -1622,7 +1689,7 @@ This is a citation in the appendix~\cite{proofsAreHard}.
% \begin{macrocode}
\ifdefined\lipics@opterrshort
% \end{macrocode}
-% \begin{macro}{\appendixbibliographyprelim}
+% \begin{macro}{\appendixbibliographyprelim}
% \changes{v1.0.3}{2017/02/06}{Support for lipics-v2016}
% The default bibliography in the \textsf{lipics} document class
% formatting is not compatible with the
@@ -1631,9 +1698,9 @@ This is a citation in the appendix~\cite{proofsAreHard}.
\renewcommand{\appendixbibliographyprelim}{%
\global\let\@oldbiblabel\@biblabel
\def\@biblabel{\hspace*{-2em}\small\@oldbiblabel}%
- }
+ }
% \end{macrocode}
-% \end{macro}
+% \end{macro}
% \begin{macrocode}
\fi
}
diff --git a/macros/latex/contrib/apxproof/apxproof.pdf b/macros/latex/contrib/apxproof/apxproof.pdf
index 223f7ebad7..8f2f4e9bc5 100644
--- a/macros/latex/contrib/apxproof/apxproof.pdf
+++ b/macros/latex/contrib/apxproof/apxproof.pdf
Binary files differ
diff --git a/macros/latex/contrib/docshots/DEPENDS.txt b/macros/latex/contrib/docshots/DEPENDS.txt
new file mode 100644
index 0000000000..d8361a6695
--- /dev/null
+++ b/macros/latex/contrib/docshots/DEPENDS.txt
@@ -0,0 +1,5 @@
+hard iexec
+hard fancyvrb
+hard pdfcrop
+hard pgf
+hard pgf-blur
diff --git a/macros/latex/contrib/docshots/LICENSE.txt b/macros/latex/contrib/docshots/LICENSE.txt
new file mode 100644
index 0000000000..bd949ffdab
--- /dev/null
+++ b/macros/latex/contrib/docshots/LICENSE.txt
@@ -0,0 +1,21 @@
+(The MIT License)
+
+Copyright (c) 2021-2022 Yegor Bugayenko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the 'Software'), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/macros/latex/contrib/docshots/README.md b/macros/latex/contrib/docshots/README.md
new file mode 100644
index 0000000000..6201451a88
--- /dev/null
+++ b/macros/latex/contrib/docshots/README.md
@@ -0,0 +1,25 @@
+[![l3build](https://github.com/yegor256/docshots/actions/workflows/l3build.yml/badge.svg)](https://github.com/yegor256/docshots/actions/workflows/l3build.yml)
+[![CTAN](https://img.shields.io/ctan/v/docshots)](https://ctan.org/pkg/docshots)
+[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/docshots/blob/master/LICENSE.txt)
+
+This LaTeX package helps you add PDF snapshots to DTX documentation.
+
+First, [install it](https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages)
+from [CTAN](https://ctan.org/pkg/docshots)
+and then use in DTX:
+
+```tex
+% \begin{docshot}
+% \documentclass{article}
+% \pagestyle{empty}
+% \begin{document}
+% Hello, \LaTeX!
+% \end{document}
+% \end{docshot}
+```
+
+If you want to contribute yourself, make a fork, then create a branch,
+then run `l3build ctan` in the root directory.
+It should compile everything without errors. If not, submit an issue and wait.
+Otherwise, make your changes and then run `l3build ctan` again. If the build is
+still clean, submit a pull request.
diff --git a/macros/latex/contrib/docshots/docshots.dtx b/macros/latex/contrib/docshots/docshots.dtx
new file mode 100644
index 0000000000..3fa5c9ac13
--- /dev/null
+++ b/macros/latex/contrib/docshots/docshots.dtx
@@ -0,0 +1,203 @@
+% \iffalse meta-comment
+% (The MIT License)
+%
+% Copyright (c) 2021-2022 Yegor Bugayenko
+%
+% Permission is hereby granted, free of charge, to any person obtaining a copy
+% of this software and associated documentation files (the 'Software'), to deal
+% in the Software without restriction, including without limitation the rights
+% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+% copies of the Software, and to permit persons to whom the Software is
+% furnished to do so, subject to the following conditions:
+%
+% The above copyright notice and this permission notice shall be included in all
+% copies or substantial portions of the Software.
+%
+% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+% SOFTWARE.
+% \fi
+
+% \CheckSum{0}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+
+% \GetFileInfo{docshots.dtx}
+% \DoNotIndex{\endgroup,\begingroup,\let,\else,\s,\n,\r,\\,\1,\fi}
+
+% \iffalse
+%<*driver>
+\ProvidesFile{docshots.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{docshots}
+%<*package>
+[2022-10-14 0.0.1 TeX Samples Next to Their PDF Snapshots in DTX]
+%</package>
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[tt=false, type1=true]{libertine}
+\usepackage{microtype}
+\usepackage{docshots}
+\usepackage{href-ul}
+\PageIndex
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{docshots.dtx}
+ \PrintChanges
+ \PrintIndex
+\end{document}
+%</driver>
+% \fi
+
+% \title{|docshots|: \TeX{} Samples Next to Their \\ PDF Snapshots in DTX\thanks{The sources are in GitHub at \href{https://github.com/yegor256/docshots}{yegor256/docshots}}}
+% \author{Yegor Bugayenko \\ \texttt{yegor256@gmail.com}}
+% \date{\filedate, \fileversion}
+%
+% \maketitle
+%
+% \textbf{NB!}
+% You must run \TeX{} processor with |--shell-escape| option
+% and you must have \href{https://www.perl.org}{Perl} installed.
+
+% \section{Introduction}
+%
+% You put this into your |.dtx| file:
+%
+% \vspace{0pt}\begingroup\ttfamily\noindent
+% \% \char`\\begin\char`\{docshot\char`\} \\
+% \% \char`\\documentclass\char`\{article\char`\} \\
+% \% \char`\\begin\char`\{document\char`\} \\
+% \% \char`\\pagestyle\char`\{empty\char`\} \\
+% \% ~~Hello, \char`\\LaTeX! \\
+% \% \char`\\end\char`\{document\char`\} \\
+% \% \char`\\end\char`\{docshot\char`\}
+% \endgroup\vspace{0pt}
+%
+% It will be rendered as such:
+%
+% \begin{docshot}
+% \documentclass{article}
+% \begin{document}
+% \pagestyle{empty}
+% Hello, \LaTeX!
+% \end{document}
+% \end{docshot}
+
+% Here is a more complex example:
+%
+% \begin{docshot}
+% \documentclass{article}
+% \usepackage{tikz}
+% \begin{document}\pagestyle{empty}
+% \begin{tikzpicture}
+% \node [circle,draw] (v0) {$v_0$};
+% \node [circle,draw,
+% below right of=v0] (v1) {$v_1$};
+% \draw [->] (v0) -- (v1);
+% \end{tikzpicture}
+% \end{document}
+% \end{docshot}
+
+% The pictures you see on the left sides are rendered by a subprocess
+% executing |pdflatex| with the |.tex| content taken from |dtx| file.
+% After a successful processing of \TeX{} sources, we use
+% \href{https://ctan.org/pkg/pdfcrop}{pdfcrop} to trim the document. Then,
+% the trimmed PDF is embedded into the final document.
+
+% \StopEventually{}
+
+% \section{Implementation}
+
+% \changes{v0.0.1}{2022/10/09}{Initial version}
+
+% First, we include a few packages:
+% \begin{macrocode}
+\RequirePackage{iexec}
+\RequirePackage{fancyvrb}
+\RequirePackage{xcolor}
+\RequirePackage{graphicx}
+\RequirePackage{tikz}
+\usetikzlibrary{shadows.blur}
+% \end{macrocode}
+
+% Then, we show the version of |pdflatex|:
+% \begin{macrocode}
+\iexec[log,quiet]{pdflatex --version}%
+% \end{macrocode}
+
+% Then, we show the version of |pdfcrop|:
+% \begin{macrocode}
+\iexec[log,quiet]{pdfcrop --version}%
+% \end{macrocode}
+
+% Then, we show the version of |ghostscript|:
+% \begin{macrocode}
+\iexec[log,quiet]{gs --version}%
+% \end{macrocode}
+
+% Then, we make a directory where all temporary files will be kept:
+% \begin{macrocode}
+\iexec[null]{mkdir -p _docshots/\jobname}%
+% \end{macrocode}
+
+% \begin{macro}{docshot}
+% Then, we define |docshot| environment:
+% \begin{macrocode}
+\newenvironment{docshot}
+{\VerbatimEnvironment\begin{VerbatimOut}{_docshots/\jobname/verbatim.tex}}
+{\end{VerbatimOut}%
+ \iexec[null]{perl -i -0777pe "s/(\\n|^)\\x{25} /\\1/g"
+ _docshots/\jobname/verbatim.tex}%
+ \def\hash{\pdfmdfivesum file {_docshots/\jobname/verbatim.tex}}%
+ \message{^^Jdocshots: name set to "\hash"^^J}%
+ \iexec[log,quiet]{cp _docshots/\jobname/verbatim.tex
+ _docshots/\jobname/\hash.tex}%
+ \iexec[log,quiet]{(cd _docshots/\jobname;
+ pdflatex -interaction=batchmode -shell-escape \hash.tex)}%
+ \iexec[log,quiet]{pdfcrop --margins 5 _docshots/\jobname/\hash.pdf
+ _docshots/\jobname/\hash.crop.pdf}%
+ \fvset{frame=leftline,numbers=left,numbersep=3pt,
+ framerule=.4pt,rulecolor=\color{gray},
+ samepage=true}%
+ \par%
+ \tikz[baseline=(a.north)] \node[draw=gray] (a)
+ {\includegraphics[width=.3\linewidth]{_docshots/\jobname/\hash.crop.pdf}};%
+ \hspace{1.8em}%
+ \begin{minipage}[t]{.65\linewidth}%
+ \vspace{0pt}%
+ \VerbatimInput{_docshots/\jobname/\hash.tex}%
+ \vspace{0pt}%
+ \end{minipage}%
+ \par%
+}
+% \end{macrocode}
+% \end{macro}
+
+% \Finale
+
+%\clearpage
+
+%\PrintChanges
+%\clearpage
+%\PrintIndex
diff --git a/macros/latex/contrib/docshots/docshots.ins b/macros/latex/contrib/docshots/docshots.ins
new file mode 100644
index 0000000000..d7ba42bfee
--- /dev/null
+++ b/macros/latex/contrib/docshots/docshots.ins
@@ -0,0 +1,55 @@
+%% (The MIT License)
+%%
+%% Copyright (c) 2021-2022 Yegor Bugayenko
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a copy
+%% of this software and associated documentation files (the 'Software'), to deal
+%% in the Software without restriction, including without limitation the rights
+%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+%% copies of the Software, and to permit persons to whom the Software is
+%% furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in all
+%% copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+%% SOFTWARE.
+
+\input docstrip.tex
+\keepsilent
+\usedir{macros/latex/contrib/docshots}
+\preamble
+(The MIT License)
+
+Copyright (c) 2021-2022 Yegor Bugayenko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the 'Software'), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+\endpreamble
+\generate{\file{docshots.sty}{\from{docshots.dtx}{package}}}
+\obeyspaces
+\Msg{To finish the installation you have to move the ".sty"}
+\Msg{file into a directory searched by TeX. To produce the}
+\Msg{documentation run the file ".dtx" through LaTeX. If any}
+\Msg{questions, submit a new GitHub issue.}
+\endbatchfile
diff --git a/macros/latex/contrib/docshots/docshots.pdf b/macros/latex/contrib/docshots/docshots.pdf
new file mode 100644
index 0000000000..402009aed3
--- /dev/null
+++ b/macros/latex/contrib/docshots/docshots.pdf
Binary files differ
diff --git a/macros/latex/contrib/huawei/huawei.dtx b/macros/latex/contrib/huawei/huawei.dtx
index 68db55e298..fdb272a996 100644
--- a/macros/latex/contrib/huawei/huawei.dtx
+++ b/macros/latex/contrib/huawei/huawei.dtx
@@ -50,7 +50,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{huawei}
%<*class>
-[05.10.2022 0.14.1 Template for Huawei Documents]
+[2022-10-14 0.14.2 Template for Huawei Documents]
%</class>
%<*driver>
\documentclass{ltxdoc}
@@ -141,57 +141,47 @@ $pdflatex = 'pdflatex %O --shell-escape %S';
% |\documentclass|, which can help you fine-tune
% the layout of your document:
-% \begin{macro}{landscape}
+% \DescribeMacro{landscape}
% makes the document in landscape format, also changing the size
% of the paper to 16x9 inches (the default page size is
% \href{https://en.wikipedia.org/wiki/Paper_size}{A4}),
% making it perfect for presentations.
-% \end{macro}
-% \begin{macro}{dark}
+% \DescribeMacro{dark}
% Turns on a dark layout, where the page color is black and the text
% is white.
-% \end{macro}
-% \begin{macro}{slides}
+% \DescribeMacro{slides}
% makes all headers a bit larger, assuming that the document
% is in the landscape mode and being presented as a slide deck.
-% \end{macro}
-% \begin{macro}{nocover}
+% \DescribeMacro{nocover}
% avoid printing the cover images on the first page by the
% |\PrintTitlePage| command.
-% \end{macro}
-% \begin{macro}{anonymous}
+% \DescribeMacro{anonymous}
% removes the name of the author everywhere, including the bottom
% of the page, where the author's name stays next to the name of the
% company.
-% \end{macro}
-% \begin{macro}{nobrand}
+% \DescribeMacro{nobrand}
% avoid mentioning the brand of Huawei anywhere
% in the document and removes the logo too.
-% \end{macro}
-% \begin{macro}{nosecurity}
+% \DescribeMacro{nosecurity}
% avoids mentioning the level of security at the right top
% corner of the document and also avoids showing the ID of the author
% where it usually is visible.
-% \end{macro}
-% \begin{macro}{nodate}
+% \DescribeMacro{nodate}
% don't show the date and time at the bottom of each page,
% where they usually are rendered in ISO~8601 format.
-% \end{macro}
-% \begin{macro}{nopaging}
+% \DescribeMacro{nopaging}
% avoids page numbers at the bottom of each page.
-% \end{macro}
-% \begin{macro}{authordraft}
+% \DescribeMacro{authordraft}
% prints a big ``It's a draft'' message across each page.
-% \end{macro}
% \section{Preamble}
@@ -221,32 +211,27 @@ Hello, world!
% The following meta commands are defined:
-% \begin{macro}{\thetitle}
+% \DescribeMacro{\thetitle}
% |\thetitle| is the main title of the document
% to be used in the text and in the properties of the PDF document.
-% \end{macro}
-% \begin{macro}{\thesubtitle}
+% \DescribeMacro{\thesubtitle}
% |\thesubtitle| is the subtitle to be
% printed under the title.
-% \end{macro}
-% \begin{macro}{\theauthor}
+% \DescribeMacro{\theauthor}
% |\theauthor| is the author of the document
% in ``first-name last-name'' format.
-% \end{macro}
-% \begin{macro}{\theid}
+% \DescribeMacro{\theid}
% |\theid| is the internal ID of the author, if
% it's applicable.
-% \end{macro}
-% \begin{macro}{\thesecurity}
+% \DescribeMacro{\thesecurity}
% It is the level of security of
% the document, which is usually printed at the top right
% corner of it; usual values are ``Internal,''
% ''Confidential,'' or ``Secret.''
-% \end{macro}
% Default values of all these commands are empty. If you don't
% renew them in your document, nothing will be printed.
@@ -255,28 +240,24 @@ Hello, world!
% Inside the document body you can use these commands:
-% \begin{macro}{\PrintFirstPage}
+% \DescribeMacro{\PrintFirstPage}
% |\PrintFirstPage|
% prints the first page of a project charter or a similar landscape documents,
% placing the image |front-image.pdf| on the front (the file should be present
% in the current dir. If you don't have the front image file, just leave
% the first argument empty.
-% \end{macro}
-% \begin{macro}{\PrintLastPage}
+% \DescribeMacro{\PrintLastPage}
% |\PrintLastPage|
% prints the last page of a project charter or a similar landscape document.
-% \end{macro}
-% \begin{macro}{\PrintThankYouPage}
+% \DescribeMacro{\PrintThankYouPage}
% |\PrintThankYouPage|
% prints the last page with a "Thank You" message in the center.
-% \end{macro}
-% \begin{macro}{\PrintDisclaimer}
+% \DescribeMacro{\PrintDisclaimer}
% |\PrintDisclaimer|
% prints a paragraph at the bottom of the page with a standard disclaimer.
-% \end{macro}
% \section{Best Practices}
@@ -410,7 +391,6 @@ Here goes the second column content.
\newtimeformat{daytime}{\twodigit{\THEHOUR}:\twodigit{\THEMINUTE}}
\RequirePackage[tt=false,type1=true]{libertine}
\RequirePackage{paralist}
- \setdefaultenum{a)}{a)}{a)}{a)}
\RequirePackage{makecell}
\RequirePackage[para]{footmisc}
\setlength{\footnotemargin}{2pt}
diff --git a/macros/latex/contrib/huawei/huawei.pdf b/macros/latex/contrib/huawei/huawei.pdf
index 0bf288e449..404d6a0722 100644
--- a/macros/latex/contrib/huawei/huawei.pdf
+++ b/macros/latex/contrib/huawei/huawei.pdf
Binary files differ
diff --git a/macros/latex/contrib/nlctdoc/README b/macros/latex/contrib/nlctdoc/README
index 07673ae539..b807bfed6b 100644
--- a/macros/latex/contrib/nlctdoc/README
+++ b/macros/latex/contrib/nlctdoc/README
@@ -1,6 +1,6 @@
-nlctdoc.cls:
+nlctdoc.cls and nlctuserguide.sty v1.08 (2022-10-14):
-This class is provided "as is" solely for the benefit
+This class and package is provided "as is" solely for the benefit
of anyone who wants to compile the documentation for
my packages. (To comply with TeX Live requirements
that all package documentation must be distributed with
diff --git a/macros/latex/contrib/nlctdoc/nlctdoc.cls b/macros/latex/contrib/nlctdoc/nlctdoc.cls
index 1067813691..daead092d8 100644
--- a/macros/latex/contrib/nlctdoc/nlctdoc.cls
+++ b/macros/latex/contrib/nlctdoc/nlctdoc.cls
@@ -4,7 +4,7 @@
% copy the code here to another file and modify it for your own purposes.
% There's no guarantee that it will work with other packages.
%
-% Copyright 2013-2020 Nicola Talbot
+% Copyright 2013-2022 Nicola Talbot
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -13,23 +13,22 @@
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
+%
+% This class is being phased out, but it will continue to be provided
+% for existing documents that use it.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{nlctdoc}[2020/02/12 v1.07 (NLCT)]
+\ProvidesClass{nlctdoc}[2022/10/14 v1.08 (NLCT)]
\RequirePackage{ifpdf}
\RequirePackage{ifxetex}
% tex4ht stopped working with koma during TL2013.
% Use pdflatex with koma for the pdf version
% and latex with one of the base classes for the html
% version to circumvent this.
-\ifpdf
+\ifx\HCode\UNDEFINED
\newcommand{\@nlctdoc@if@usingtexht}[2]{#2}
\else
- \ifxetex
- \newcommand{\@nlctdoc@if@usingtexht}[2]{#2}
- \else
- \newcommand{\@nlctdoc@if@usingtexht}[2]{#1}
- \fi
+ \newcommand{\@nlctdoc@if@usingtexht}[2]{#1}
\fi
\@nlctdoc@if@usingtexht
@@ -120,7 +119,8 @@
\RequirePackage{fourier}
}%
\RequirePackage{etoolbox}
-\RequirePackage{doc,dox}
+\RequirePackage{doc}[=v2]
+\RequirePackage{dox}
\RequirePackage{upquote}
% doc.sty interferes with upquote.sty so patch it
@@ -180,7 +180,7 @@ headings_flag 1
\marginpar{\parbox[b][2\baselineskip]{\marginparwidth}{\nlctdocmarginfmt#1\vfill\par}}%
}
-\newrobustcmd\cs[1]{\texttt{\char`\\#1}}
+\providerobustcmd\cs[1]{\texttt{\char`\\#1}}
\newrobustcmd*{\mgroup}[1]{\texttt{\char`\{#1\char`\}}}
@@ -506,8 +506,6 @@ bold; padding-bottom: 2ex; padding-left: 1em; padding-right: 1em;}
\newcommand*{\tableref}[1]{\hyperref[#1]{table~\ref*{#1}}}
\newcommand*{\Tableref}[1]{\hyperref[#1]{Table~\ref*{#1}}}
-\renewcommand{\SpecialMainIndex}[1]{\@bsphack \SpecialIndex@ {#1}{\nlctdocmainencap}\@esphack}
-
\newcommand{\idxmarker@SpecialMainIndex}[1]{%
\@bsphack \idxmarker@SpecialIndex@ {#1}{\nlctdocmainencap}\@esphack
}
@@ -559,7 +557,7 @@ bold; padding-bottom: 2ex; padding-left: 1em; padding-right: 1em;}
\newrobustcmd{\ics}{\@ifstar\s@ics\@ics}
\newcommand*{\s@ics}[1]{\idxmarkedfont{\cs{#1}}\idxmarker@SpecialMainIndex{#1}}
-\newcommand*{\@ics}[1]{\cs{#1}\SpecialMainIndex{#1}}
+\newcommand*{\@ics}[1]{\cs{#1}\SpecialIndex@{#1}}
\newrobustcmd{\csmeta}{\@ifstar\s@csmeta\@csmeta}
@@ -919,6 +917,6 @@ bibliography style\nlctdochyperencap}}
}%
-\AtBeginDocument{\MakeShortVerb{\|}}
+%\AtBeginDocument{\MakeShortVerb{\|}}
\endinput
diff --git a/macros/latex/contrib/nlctdoc/nlctuserguide.sty b/macros/latex/contrib/nlctdoc/nlctuserguide.sty
new file mode 100644
index 0000000000..6cb4cd7e16
--- /dev/null
+++ b/macros/latex/contrib/nlctdoc/nlctuserguide.sty
@@ -0,0 +1,3118 @@
+% This package is provided 'as is' in the event that someone
+% wants to compile the documentation that comes with my packages.
+% It is not intended for any other purpose, although you may freely
+% copy the code here to another file and modify it for your own purposes.
+% There's no guarantee that it will work with other packages.
+%
+% Copyright 2022 Nicola Talbot
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license of (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{nlctuserguide}[2022/10/14 v1.08 (NLCT)]
+
+\newcommand{\nlctdoc@loadxr}{}
+\DeclareOption{xr}{\renewcommand{\nlctdoc@loadxr}{\RequirePackage{xr-hyper}}}
+
+\newcommand{\nlct@ns@ref@cs}{\vref}
+
+\newcommand{\nlctnovref}{\renewcommand{\nlct@ns@ref@cs}{\ref}}
+\newcommand{\nlctusevref}{\renewcommand{\nlct@ns@ref@cs}{\vref}}
+
+\DeclareOption{vref}{\nlctusevref}
+\DeclareOption{novref}{\nlctnovref}
+\newif\ifnlctdoc@symgroup
+\nlctdoc@symgrouptrue
+
+\DeclareOption{atsymgroup}{\nlctdoc@symgrouptrue}
+\DeclareOption{noatsymgroup}{\nlctdoc@symgroupfalse}
+
+\newcommand{\nlctdocatnum}[1]{%
+ \nlctdoc@symgrouptrue\renewcommand{\@nlctdoc@atnum}{#1}%
+ \ifluatex
+ \renewcommand{\bibglsothergroup}{\nlctdocsymbolgrouplabel}%
+ \renewcommand{\bibglsothergrouptitle}{\nlctdocsymbolgrouptitle}%
+ \fi
+}
+\newcommand{\@nlctdoc@atnum}{630000}
+
+\DeclareOption{deephierarchy}{\setcounter{secnumdepth}{5}}
+
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries-extra}}
+
+\ProcessOptions
+
+\RequirePackage{iftex}
+\RequirePackage{etoolbox}
+
+\newcommand{\nlct@ifattachsupported}[2]{#2}
+\newcommand{\nlct@doifattachsupported}[1]{\nlct@ifattachsupported{#1}{}}
+
+\ifPDFTeX
+ \RequirePackage[T1]{fontenc}
+ \renewcommand{\nlct@ifattachsupported}[2]{#1}
+ \providecommand{\pdf@filesize}[1]{\pdffilesize#1}
+
+ % \strong is provided by fontspec
+ \providecommand*{\strong}[1]{\textbf{#1}}
+
+\else
+ \RequirePackage{fontspec}
+ \setmainfont{Linux Libertine O}
+
+ \ifluatex
+ \newcommand{\nlctdocsymbolgrouplabel}[3]{%
+ #3\directlua{if '#2'=='\@nlctdoc@atnum' then tex.print("@") else tex.print("glssymbols") end}}
+ \newcommand{\nlctdocsymbolgrouptitle}[3]{%
+ \directlua{if '#2'=='\@nlctdoc@atnum' then tex.print("@") else tex.print("\\glssymbolsgroupname") end}}
+
+ \ifnlctdoc@symgroup
+ \newcommand{\bibglsothergroup}{\nlctdocsymbolgrouplabel}
+ \newcommand{\bibglsothergrouptitle}{\nlctdocsymbolgrouptitle}
+ \else
+ \newcommand{\bibglsothergroup}[3]{glssymbols}
+ \newcommand{\bibglsothergrouptitle}[3]{\glssymbolsgroupname}
+ \fi
+
+ \renewcommand{\nlct@ifattachsupported}[2]{#1}
+ \RequirePackage{luatex85}% need \pdfxform for attachfile
+ % copied from pdftexcmds.sty
+ \providecommand{\pdf@filesize}[1]{\directlua0{%
+ oberdiek.pdftexcmds.filesize("\luaescapestring{#1}")}}
+ \fi
+\fi
+
+\RequirePackage{fontawesome}
+\RequirePackage{twemojis}
+\RequirePackage{pifont}
+\RequirePackage{amsfonts}
+\RequirePackage{textcomp}
+\RequirePackage{array}
+\RequirePackage{upquote}
+\RequirePackage{etoolbox}
+\RequirePackage{hologo}
+\RequirePackage{varioref}
+\RequirePackage{xcolor}
+
+\newcommand*{\nlct@doifkoma}[1]{}
+\@ifclassloaded{scrreprt}{\let\nlct@doifkoma\@firstofone}
+{
+ \@ifclassloaded{scrartcl}{\let\nlct@doifkoma\@firstofone}
+ {\@ifclassloaded{scrbook}{\let\nlct@doifkoma\@firstofone}{}}
+}
+
+\nlct@doifkoma{%
+ \RequirePackage{scrhack}
+ \ifnum\c@secnumdepth>3
+ \RedeclareSectionCommand[beforeskip=10pt plus -2pt minus -1pt,
+ afterskip=1sp plus -1sp minus 1sp]{paragraph}
+ \fi
+ \ifnum\c@secnumdepth>4
+ \RedeclareSectionCommand[beforeskip=10pt plus -2pt minus -1pt,
+ afterskip=1sp plus -1sp minus 1sp]{subparagraph}
+ \fi
+}
+
+\RequirePackage[breakable,skins,listings]{tcolorbox}
+\nlctdoc@loadxr
+\RequirePackage{hyperref}
+\hypersetup{hidelinks}
+
+\RequirePackage{mfirstuc}[2022/10/14]
+
+% Requires glossaries-extra v1.49+
+\RequirePackage[record=nameref,indexcounter,floats,symbols,nosuper,stylemods={mcols,bookindex,topic,longextra}]{glossaries-extra}[2022/10/14]
+\nlct@doifattachsupported{\RequirePackage{attachfile}}
+
+\renewcommand{\thepart}{\Roman{part}}
+\renewcommand{\theHpart}{\Roman{part}}
+
+\newglossary*{index}{\indexname}
+
+\newcommand*{\thispackagename}{\jobname}
+\newcommand*{\thispackage}{\styfmt{\thispackagename}}
+\newcommand*{\examplesdir}{\jobname-examples}
+
+\newcommand{\htmlavailable}{This document is also available as
+\href{\jobname.html}{HTML (\filefmt{\jobname.html})}.}
+
+\ExplSyntaxOn
+\renewcommand{\title}[1]{\gdef\@title{#1}\hypersetup{pdftitle={\text_purify:n{#1}}}}
+\ExplSyntaxOff
+
+\newcommand{\TeXLive}{\TeX\ Live}
+\newcommand{\MikTeX}{Mik\TeX}
+
+\newrobustcmd*{\texdocref}[1]{%
+ \begin{terminal}\href{https://www.tug.org/texdoc/}{texdoc} #1\end{terminal}\noindent\ignorespaces}
+
+% \tugboat{title}{year}{volume}{number}{pdf}
+\newrobustcmd{\tugboat}[5]{\href{https://tug.org/TUGboat/tb#2-#4/#5}{\qt{#1}
+\emph{TUGboat}, Volume~#3 (#2), No.~#4}}
+
+\newrobustcmd{\urlfootref}[2]{\href{#1}{#2}\glsxtrdopostpunc{\footnote{\url{#1}}}}
+\MFUexcl{\urlfootref}
+
+\newrobustcmd{\texfaq}[2]{\href{https://texfaq.org/#1}{#2}}
+\MFUexcl{\texfaq}
+
+\newrobustcmd*{\CTANpkg}[1]{%
+ \href{https://ctan.org/pkg/#1}{CTAN}%
+ \glsxtrdopostpunc{\footnote{\href{https://ctan.org/pkg/#1}{\nolinkurl{ctan.org/pkg/#1}}}}%
+}
+\MFUexcl{\CTANpkg}
+
+\newcommand*{\ctanmirrordocnofn}[2]{%
+ \href{http://mirrors.ctan.org/#1.pdf}{#2}%
+}
+
+\newrobustcmd*{\ctanmirrornofn}[2]{%
+ \href{http://mirrors.ctan.org/#1}{#2}%
+}
+\MFUexcl{\ctanmirrornofn}
+
+\newrobustcmd*{\ctanmirror}[2]{%
+ \href{http://mirrors.ctan.org/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://mirrors.ctan.org/#1}{\nolinkurl{mirrors.ctan.org/#1}}}}%
+}
+\MFUexcl{\ctanmirror}
+
+\newrobustcmd*{\ctanref}[2]{\href{https://ctan.org/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{https://ctan.org/#1}{\nolinkurl{ctan.org/#1}}}}%
+}
+\MFUexcl{\ctanpkg}
+
+\newrobustcmd*{\ctanpkg}[1]{\href{https://ctan.org/pkg/#1}{\nolinkurl{ctan.org/pkg/#1}}}
+\MFUexcl{\ctanpkg}
+\newrobustcmd*{\ctanpkgmirror}[2]{%
+ \href{http://mirrors.ctan.org/pkg/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://mirrors.ctan.org/pkg/#1}{\nolinkurl{mirrors.ctan.org/pkg/#1}}}}%
+}
+\MFUexcl{\ctanpkgmirror}
+
+\newrobustcmd*{\ctansupportmirror}[2]{%
+ \href{http://mirrors.ctan.org/support/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://mirrors.ctan.org/support/#1}{\nolinkurl{mirrors.ctan.org/support/#1}}}}%
+}
+\MFUexcl{\ctansupportmirror}
+
+\newrobustcmd{\texseref}[2]{\href{https://tex.stackexchange.com/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://tex.stackexchange.com/#1}{\nolinkurl{tex.stackexchange.com/#1}}}}%
+}
+\MFUexcl{\texseref}
+
+\newrobustcmd*{\dickimawhrefnofn}[2]{%
+ \href{https://www.dickimaw-books.com/#1}{#2}%
+}
+\MFUexcl{\dickimawhrefnofn}
+
+\newrobustcmd*{\dickimawhref}[2]{%
+ \href{https://www.dickimaw-books.com/#1}{#2}%
+ \glsxtrdopostpunc{\protect\footnote{\href{https://www.dickimaw-books.com/#1}{\nolinkurl{dickimaw-books.com/#1}}}}%
+}
+\MFUexcl{\dickimawhref}
+
+\newcommand*{\blog}[2]{%
+ \dickimawhref{blog/#1}{#2}%
+}
+\MFUexcl{\blog}
+
+\newcommand*{\gallery}[1]{%
+ \dickimawhref{gallery}{#1}%
+}
+\MFUexcl{\gallery}
+
+\newcommand*{\galleryurl}[1]{%
+ \dickimawhrefnofn{gallery/#1}{\nolinkurl{dickimaw-books.com/gallery/#1}}%
+}
+\MFUexcl{\galleryurl}
+
+\newcommand*{\galleryref}[2]{%
+ \dickimawhref{gallery/#1}{#2}%
+}
+\MFUexcl{\galleryref}
+
+\newcommand*{\gallerytopic}[1]{%
+ \dickimawhref{gallery/\##1}{\styfmt{#1} gallery}%
+}
+\MFUexcl{\gallerytopic}
+
+\newcommand*{\gallerypage}[2]{%
+ \galleryref{index.php?label=#1}{#2}%
+}
+\MFUexcl{\gallerypage}
+
+\newcommand*{\faqspkg}[1]{%
+ \dickimawhref{faqs/#1faq.html}{\styfmt{#1} FAQ}%
+}
+\MFUexcl{\faqspkg}
+
+\newcommand*{\faqpage}[2]{%
+ \dickimawhref{faq.php?category=#1}{#2}%
+}
+\MFUexcl{\faqspage}
+
+\newcommand*{\faqitem}[2]{%
+ \dickimawhref{faq.php?itemlabel=#1}{#2}%
+}
+\MFUexcl{\faqitem}
+
+\newcommand*{\menufmt}[1]{\textsf{#1}}
+\newcommand*{\menusep}{\,\ding{220}\,}
+\newrobustcmd*{\menu}[1]{%
+ \def\nlct@menusep{}%
+ \menufmt
+ {%
+ \@for\@menu@item:=#1\do{%
+ \nlct@menusep\@menu@item
+ \let\nlct@menusep\menusep
+ }%
+ }%
+}
+
+\newcommand{\refslistsep}{, }
+\newcommand{\refslistlastsep}{ \& }
+
+\newcommand*{\@refslist}[4]{%
+ \bgroup
+ \renewcommand{\DTLlistformatitem}{\ref}%
+ \renewcommand*{\DTLlistformatsep}{#2}
+ \renewcommand*{\DTLlistformatlastsep}{#3}%
+ #1\DTLformatlist{#4}%
+ \egroup
+}
+
+\newcommand*{\s@refslist}[4]{%
+ \bgroup
+ \renewcommand{\DTLlistformatitem}{\ref*}%
+ \renewcommand*{\DTLlistformatsep}{#2}
+ \renewcommand*{\DTLlistformatlastsep}{#3}%
+ #1\DTLformatlist{#4}%
+ \egroup
+}
+
+\newcommand{\sectionrefprefix}{\S}
+\newrobustcmd{\sectionref}{\@ifstar\s@sectionref\@sectionref}
+\MFUblocker{\sectionref}
+
+\newcommand*{\@sectionref}[1]{\sectionrefprefix\ref{#1}}
+\newcommand*{\s@sectionref}[1]{\sectionrefprefix\ref*{#1}}
+
+\newcommand{\Sectionrefprefix}{\S}
+\newrobustcmd{\Sectionref}{\@ifstar\s@Sectionref\@sectionref}
+
+\newcommand*{\@Sectionref}[1]{\Sectionrefprefix\ref{#1}}
+\newcommand*{\s@Sectionref}[1]{\Sectionrefprefix\ref*{#1}}
+
+\MFUaddmap{\sectionref}{\Sectionref}
+\MFUaddmap{\sectionrefprefix}{\Sectionrefprefix}
+
+\newcommand{\sectionsrefprefix}{\S\S}
+\newrobustcmd{\sectionsref}{%
+ \@ifstar
+ {\s@refslist{\sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUblocker{\sectionsref}
+
+\newcommand{\Sectionsrefprefix}{\S\S}
+\newrobustcmd{\Sectionsref}{%
+ \@ifstar
+ {\s@refslist{\Sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\Sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\sectionsref}{\Sectionsref}
+\MFUaddmap{\sectionsrefprefix}{\Sectionsrefprefix}
+
+\newcommand{\tablerefprefix}{Table~}
+\newcommand{\Tablerefprefix}{Table~}
+
+\newrobustcmd*{\tableref}{\@ifstar\s@tableref\@tableref}
+\newrobustcmd*{\Tableref}{\@ifstar\s@Tableref\@Tableref}
+
+\newcommand*{\@tableref}[1]{\tablerefprefix\nlct@ns@ref@cs{#1}}
+\newcommand*{\s@tableref}[1]{\tablerefprefix\ref*{#1}}
+
+\newcommand*{\@Tableref}[1]{\Tablerefprefix\nlct@ns@ref@cs{#1}}
+\newcommand*{\s@Tableref}[1]{\Tablerefprefix\ref*{#1}}
+
+\MFUaddmap{\tableref}{\Tableref}
+
+\newcommand{\tablesrefprefix}{tables~}
+\newcommand{\Tablesrefprefix}{Tables~}
+
+\newrobustcmd{\tablesref}{%
+ \@ifstar
+ {\s@refslist{\tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
+\newrobustcmd{\Tablesref}{%
+ \@ifstar
+ {\s@refslist{\Tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\Tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\tablesref}{\Tablesref}
+
+\newcommand{\figurerefprefix}{figure~}
+\newcommand{\Figurerefprefix}{Figure~}
+
+\newrobustcmd*{\figureref}{\@ifstar\s@figureref\@figureref}
+\newrobustcmd*{\Figureref}{\@ifstar\s@Figureref\@Figureref}
+
+\newcommand*{\@figureref}[1]{\figurerefprefix\nlct@ns@ref@cs{#1}}
+\newcommand*{\s@figureref}[1]{\figurerefprefix\ref*{#1}}
+
+\newcommand*{\@Figureref}[1]{\Figurerefprefix\nlct@ns@ref@cs{#1}}
+\newcommand*{\s@Figureref}[1]{\Figurerefprefix\ref*{#1}}
+
+\MFUaddmap{\figureref}{\Figureref}
+
+\newcommand{\figuresrefprefix}{figures~}
+\newcommand{\Figuresrefprefix}{Figures~}
+
+\newrobustcmd{\figuresref}{%
+ \@ifstar
+ {\s@refslist{\figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
+\newrobustcmd{\Figuresref}{%
+ \@ifstar
+ {\s@refslist{\Figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\Figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\figuresref}{\Figuresref}
+
+\providecommand{\examplerefprefix}{Example~}
+\providecommand{\Examplerefprefix}{Example~}
+
+\newrobustcmd*{\exampleref}{\@ifstar\s@exampleref\@exampleref}
+\newcommand*{\@exampleref}[1]{\examplerefprefix\nlct@ns@ref@cs{#1}}
+\newcommand*{\s@exampleref}[1]{\examplerefprefix\ref*{#1}}
+
+\newrobustcmd*{\Exampleref}{\@ifstar\s@Exampleref\@Exampleref}
+\newcommand*{\@Exampleref}[1]{\Examplerefprefix\nlct@ns@ref@cs{#1}}
+\newcommand*{\s@Exampleref}[1]{\Examplerefprefix\ref*{#1}}
+
+\MFUaddmap{\exampleref}{\Exampleref}
+
+\newcommand{\examplesrefprefix}{examples~}
+\newcommand{\Examplesrefprefix}{Examples~}
+
+\newrobustcmd{\examplesref}{%
+ \@ifstar
+ {\s@refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
+\newrobustcmd{\Examplesref}{%
+ \@ifstar
+ {\s@refslist{\Examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@refslist{\Examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\examplesref}{\Examplesref}
+
+\newcommand*{\plabel}[2][]{\protected@edef\@currentlabelname{#1}\label{#2}}
+
+\newcommand*{\dash}{\,---\,}
+
+\newcommand*{\tick}{\ding{51}}
+
+\newcommand*{\yes}{\ding{52}}
+\newcommand*{\no}{\ding{56}}
+
+\newrobustcmd{\advantagefmt}[1]{\textcolor{green}{#1}}
+\newrobustcmd{\disadvantagefmt}[1]{\textcolor{red}{#1}}
+
+\newcommand*{\proyes}{\advantagefmt{\yes}}
+\newcommand*{\prono}{\disadvantagefmt{\no}}
+
+\newcommand*{\conyes}{\disadvantagefmt{\yes}}
+\newcommand*{\conno}{\advantagefmt{\no}}
+
+\newcommand{\unlimited}{$\infty$}
+
+\newcommand{\fnsymmark}[1]{\rlap{#1}}
+
+\newcommand{\asteriskmarker}{\textasteriskcentered}
+\newcommand{\daggermarker}{\textdagger}
+\newcommand{\doubledaggermarker}{\textdaggerdbl}
+\newcommand{\sectionmarker}{\textsection}
+\newcommand{\lozengemarker}{$\lozenge$}
+\newcommand{\pilcrowmarker}{\textparagraph}
+\newcommand{\hashmarker}{\#}
+\newcommand{\referencemarker}{{\fontfamily{cmr}\selectfont\textreferencemark}}
+\newcommand{\vdoubleasteriskmarker}{\shortstack{*\\[-1.5ex]*}}
+\newcommand{\starmarker}{$\star$}
+\newcommand{\florettemarker}{\ding{94}}
+
+\newcommand{\fnsymmarker}[1]{%
+ \ifcase#1\relax
+ \or \asteriskmarker
+ \or \daggermarker
+ \or \doubledaggermarker
+ \or \sectionmarker
+ \or \lozengemarker
+ \or \pilcrowmarker
+ \or \hashmarker
+ \or \referencemarker
+ \or \vdoubleasteriskmarker
+ \or \starmarker
+ \or \florettemarker
+ \else
+ \number#1
+ \fi
+}
+
+\newrobustcmd*{\fnsym}[1]{%
+ \tablefnmark
+ {%
+ \fnsymmark
+ {%
+ \fnsymmarker{#1}%
+ }%
+ }%
+}
+
+\newcommand{\tablefns}[1]{\par
+ \parbox{0.8\linewidth}
+ {\raggedright
+ \smallskip\hrulefill\par\smallskip
+ \par#1%
+ }\par
+}
+
+\newcommand*{\tablefnmark}[1]{\textsuperscript{#1}}
+\newcommand{\tablefnfmt}[1]{{\footnotesize#1\par}}
+\newrobustcmd{\tablefntext}[2]{\tablefnfmt{\tablefnmark{#1}#2}}
+\newrobustcmd{\fnsymtext}[2]{\tablefntext{\fnsymmarker{#1}}{#2}}
+
+\newcommand{\settabcolsep}[1]{\setlength{\tabcolsep}{#1}}
+
+\newcommand*{\docref}[2]{#1 (\href{#2.pdf}{\nolinkurl{#2.pdf}})}
+\newcommand*{\qtdocref}[2]{\qt{#1} (\href{#2.pdf}{\nolinkurl{#2.pdf}})}
+
+% \altdocref{text}{pdf}{html}
+\newcommand*{\altdocref}[3]{#1 (\href{#2.pdf}{\nolinkurl{#2.pdf}})}
+
+% \xrsectionref{label}{html file}{html title}
+\newcommand*{\xrsectionref}[3]{Section~\ref{#1}}
+
+\newcommand{\deflist@item}[1]{\item[]#1}
+\newenvironment{itemdesc}{\par\ignorespaces}{\ignorespacesafterend}
+
+\newenvironment{deflist}
+ {\begin{description}\let\itemtitle\deflist@item}
+ {\end{description}\ignorespacesafterend}
+
+
+\newcommand*{\warningsym}{\faExclamationTriangle}
+\newcommand*{\warningtext}{Warning}
+\newcommand*{\warningdesc}{a warning}
+
+\newcommand*{\importantsym}{\faInfo}
+\newcommand*{\importanttext}{Important}
+\newcommand*{\importantdesc}{an important message}
+
+\newcommand*{\informationsym}{\faInfoCircle}
+\newcommand*{\informationtext}{Information}
+\newcommand*{\informationdesc}{prominent information}
+
+\newcommand*{\definitionsym}{\faThumbTack}
+\newcommand*{\definitiontext}{Definition}
+\newcommand*{\definitiondesc}{the syntax and usage of a command,
+environment or option etc}
+
+\newcommand*{\valuesettingsym}{\faSliders}
+\newcommand*{\valuesettingtext}{Setting}
+\newcommand*{\valuesettingdesc}{an option that takes a value}
+
+\newcommand*{\novaluesettingsym}{\faBars}
+\newcommand*{\novaluesettingtext}{Valueless Setting}
+\newcommand*{\novaluesettingdesc}{an option that doesn't take a value}
+
+\newcommand*{\toggleonsettingsym}{\faToggleOn}
+\newcommand*{\toggleonsettingtext}{Toggle (On)}
+\newcommand*{\toggleonsettingdesc}{a boolean option that is initially true}
+
+\newcommand*{\toggleoffsettingsym}{\faToggleOff}
+\newcommand*{\toggleoffsettingtext}{Toggle (Off)}
+\newcommand*{\toggleoffsettingdesc}{a boolean option that is initially false}
+
+\newcommand*{\optionvaluesym}{\faTag}
+\newcommand*{\optionvaluetext}{Option Value Definition}
+\newcommand*{\optionvaluedesc}{the definition of an option value}
+
+\newcommand*{\countersym}{\textnumero}
+\newcommand*{\countertext}{Counter}
+\newcommand*{\counterdesc}{a counter is being described}
+
+\definecolor{banned}{rgb}{0.8,0,0}
+
+\newrobustcmd{\deprecatedorbannedfmt}[1]{\textcolor{banned}{#1}}
+
+\newcommand*{\deprecatedsym}{\deprecatedorbannedfmt{\faTrashO}}
+\newcommand*{\deprecatedtext}{Deprecated}
+\newcommand*{\deprecateddesc}{a command, environment or option that
+is now deprecated}
+
+\newcommand*{\bannedsym}{\deprecatedorbannedfmt{\faBan}}
+\newcommand*{\bannedtext}{Don't use}
+\newcommand*{\banneddesc}{a command, environment or option that
+should not be used with \thispackage}
+
+\newcommand*{\terminalsym}{\faTerminal}
+\newcommand*{\terminaltext}{Terminal}
+\newcommand*{\terminaldesc}{a command-line application invocation
+that needs to be entered into a
+\href{https://www.dickimaw-books.com/latex/novices/html/terminal.html}{terminal
+or command prompt}}
+
+\newcommand*{\codesym}{\faFileTextO}
+\newcommand*{\codetext}{Input}
+\newcommand*{\codedesc}{\LaTeX\ code to insert into your document}
+
+\newrobustcmd*{\badcodesym}{\faFileTextO\llap{\deprecatedorbannedfmt{\scriptsize\faBan}}}
+\newcommand*{\badcodetext}{Problematic Input}
+\newcommand*{\badcodedesc}{problematic code which should be avoided}
+
+\newrobustcmd*{\unicodesym}{\faFileO\llap{\textsl{\tiny Uni}}}
+\newcommand*{\unicodetext}{Unicode Input}
+\newcommand*{\unicodedesc}{code that requires a native Unicode
+engine (\XeLaTeX\ or \LuaLaTeX)}
+
+\newcommand*{\resultsym}{\faFilePdfO}
+\newcommand*{\resulttext}{Result}
+\newcommand*{\resultdesc}{how the example code should appear in the PDF}
+
+\newcommand*{\transcriptsym}{\twemoji{1f50e}}
+\newcommand*{\transcripttext}{Transcript}
+\newcommand*{\transcriptdesc}{Text in a transcript or log file or written to STDOUT or STDERR}
+
+\newcommand*{\symbolentry}[1]{%
+ @icon{sym.#1,name={\expandafter\expandonce\csname #1text\endcsname},^^J
+ symbol={\expandafter\noexpand\csname #1sym\endcsname},^^J
+ description={\expandafter\expandonce\csname #1desc\endcsname}^^J
+ }^^J
+}
+
+\newcommand*{\symboldefinitions}{%
+ \symbolentry{warning}
+ \symbolentry{important}
+ \symbolentry{information}
+ \symbolentry{definition}
+ \symbolentry{optionvalue}
+ \symbolentry{valuesetting}
+ \symbolentry{novaluesetting}
+ \symbolentry{toggleonsetting}
+ \symbolentry{toggleoffsetting}
+ \symbolentry{counter}
+ \symbolentry{deprecated}
+ \symbolentry{banned}
+ \symbolentry{terminal}
+ \symbolentry{transcript}
+ \symbolentry{code}
+ \symbolentry{badcode}
+ \symbolentry{unicode}
+ \symbolentry{result}
+}
+
+\newlength\boxtitleshift
+\setlength{\boxtitleshift}{-2.5mm}
+
+\newtcolorbox{warning}[1][]{breakable,
+ title={\glssymbol{sym.warning}},
+ coltitle=red,colbacktitle=red!20!white,
+ colframe=red,colback=red!5!white,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\newtcolorbox{important}[1][]{breakable,title={\glssymbol{sym.important}},
+ coltitle=red,colbacktitle=red!20!white,
+ colframe=red,colback=red!5!white,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\newtcolorbox{information}[1][]{breakable,title={\glssymbol{sym.information}},
+ coltitle=teal,colbacktitle=teal!20!white,
+ colframe=teal,colback=teal!5!white,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\definecolor{defbackground}{rgb}{1,1,0.75}
+\definecolor{optiondefbackground}{rgb}{1,1,0.89}
+\definecolor{optionvaluedefbackground}{rgb}{1,1,0.96}
+
+\newcommand{\nlctdefaultafter}{\par\noindent\ignorespacesafterend}
+
+\newtcolorbox{pinnedbox}[1][]{unbreakable,title={\glssymbol{sym.definition}},
+ coltitle=black,colbacktitle=defbackground,
+ colframe=black,colback=defbackground,halign=flush left,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newtcolorbox{defnbox}[1][]{unbreakable,
+ colframe=black,colback=defbackground,halign=flush left,
+ after={\nlctdefaultafter},
+ #1
+}
+
+
+\newtcolorbox{settingsbox}[1][]{title={\glssymbol{sym.valuesetting}},unbreakable,
+ coltitle=black,colbacktitle=defbackground!20!white,
+ colframe=black,colback=defbackground!20!white,halign=flush left,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newtcolorbox{terminal}{unbreakable,title={\glssymbol{sym.terminal}},
+ colframe=black,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ halign=flush left,fontupper=\ttfamily,before upper={\frenchspacing\obeylines}
+}
+
+\newtcolorbox{transcript}{unbreakable,title={\glssymbol{sym.transcript}},
+ colframe=black,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ halign=flush left,fontupper=\ttfamily,before upper={\frenchspacing\obeylines}
+}
+
+\newcommand{\code@cmd}[1]{\char`\\ #1}
+\newcommand{\cmd}[1]{\texttt{\code@cmd{#1}}}
+\newcommand{\code@cbeg}[1]{\cmd{begin}\marg{#1}}
+\newcommand{\code@cend}[1]{\cmd{end}\marg{#1}}
+\newcommand{\code@comment}[1]{\mbox{\textcolor{comment}{\glspercentchar\ #1}}}%
+\newcommand{\araraline}[1]{\glspercentchar\ arara: #1}
+\newcommand{\araracont}{\araraline{-\/-> }}
+
+\newcommand*{\setupcodeenvfmts}{%
+ \let\cbeg\code@cbeg
+ \let\cend\code@cend
+ \let\comment\code@comment
+ \renewcommand*{\envfmt}[1]{##1}%
+ \renewcommand*{\styfmt}[1]{##1}%
+ \renewcommand*{\clsfmt}[1]{##1}%
+ \renewcommand*{\ctrfmt}[1]{##1}%
+ \renewcommand*{\csfmtfont}[1]{\textcolor{cs}{##1}}%
+ \let\fmtorcode\@secondoftwo
+ \let\code\@firstofone
+}
+
+\newcommand*{\initcodeenv}{%
+ \GlsXtrStartUnsetBuffering
+ \setupcodeenvfmts
+ \obeylines\frenchspacing\@vobeyspaces
+ \parindent\z@\parfillskip\@flushglue
+}
+
+\newcommand{\codefont}{\ttfamily}
+
+% inline
+\newcommand{\code}[1]{\texorpdfstring{\@code{#1}}{#1}}
+\newrobustcmd{\@code}[1]{{\setupcodeenvfmts\codefont\obeyspaces #1}}
+
+\definecolor{codebackground}{gray}{0.95}
+
+\newtcolorbox{codebox}[1][]{title={\glssymbol{sym.code}},
+ enhanced,breakable,attach boxed title to top right={yshift=\boxtitleshift},
+ halign=flush left,fontupper=\codefont,colback=codebackground,
+ before upper={%
+ \preto\glslinkpresetkeys{\setkeys{glslink}{format=glsignore}}%
+ \initcodeenv
+ },
+ after upper={\GlsXtrDiscardUnsetBuffering},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newtcolorbox{codebox*}[1][]{title={\glssymbol{sym.code}},
+ enhanced,breakable,
+ attach boxed title to top right={yshift=\boxtitleshift},
+ halign=flush left,fontupper=\codefont,colback=codebackground,
+ before upper={\initcodeenv},
+ after upper={\GlsXtrDiscardUnsetBuffering},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newenvironment{badcodebox}%
+{\begin{codebox}[title={\glssymbol{sym.badcode}}]}
+{\end{codebox}\noindent\ignorespacesafterend}
+
+\newenvironment{unicodebox}%
+{\begin{codebox}[title={\glssymbol{sym.unicode}}]}
+{\end{codebox}\noindent\ignorespacesafterend}
+
+\newtcolorbox{compactcodebox}[1][]{%
+ halign=flush left,fontupper=\codefont,colback=codebackground,
+ before upper={%
+ \renewcommand{\glslinkpresetkeys}{\setkeys{glslink}{format=glsignore}}%
+ \initcodeenv},
+ after upper={\GlsXtrDiscardUnsetBuffering},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newtcolorbox{compactcodebox*}[1][]{%
+ halign=flush left,fontupper=\codefont,colback=codebackground,
+ before upper={\initcodeenv},
+ after upper={\GlsXtrDiscardUnsetBuffering},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newcommand*{\result@attachtag}{}
+
+\newtcolorbox{resultbox}[1][]{title={\glssymbol{sym.result}},
+ coltitle=black,colbacktitle=white,
+ colframe=black,colback=white,
+ after={\nlctdefaultafter},
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\newtcolorbox{coderesult}[1][]{skin=bicolor,
+title={\glssymbol{sym.code} \glssymbol{sym.result}},
+attach boxed title to top center={yshift=\boxtitleshift},
+sidebyside,
+sidebyside align=top,
+colbacklower=white,
+fontupper=\codefont,
+before upper={%
+\renewcommand{\glslinkpresetkeys}{\setkeys{glslink}{format=glsignore}}%
+ \initcodeenv},
+after upper={\GlsXtrDiscardUnsetBuffering},
+halign upper=flush left,halign lower=justify,
+valign upper=top,valign lower=top,
+before lower={\renewcommand*{\nlct@preattachments}{\vspace*{-\baselineskip}}},
+after lower={\noindent},
+#1
+}
+
+\newtcolorbox{coderesult*}[1][]{skin=bicolor,
+title={\glssymbol{sym.code} \glssymbol{sym.result}},
+attach boxed title to top center={yshift=\boxtitleshift},
+sidebyside,
+sidebyside align=top,
+colbacklower=white,
+fontupper=\codefont,
+before upper={\initcodeenv},
+after upper={\GlsXtrDiscardUnsetBuffering},
+after lower={\noindent},
+valign upper=top,valign lower=top,
+halign upper=flush left,halign lower=justify,
+#1
+}
+
+\newenvironment{unicoderesult}%
+{\begin{coderesult}[title={\glssymbol{sym.unicode} \glssymbol{sym.result}}]}
+{\end{coderesult}\noindent\ignorespacesafterend}
+
+\newenvironment{unicoderesult*}%
+{\begin{coderesult*}[title={\glssymbol{sym.unicode} \glssymbol{sym.result}}]}
+{\end{coderesult*}\noindent\ignorespacesafterend}
+
+
+\newcommand*{\summarylocfont}{\footnotesize}
+\newcommand*{\summarylocwidth}{\marginparwidth}
+
+\definecolor{summaryloc}{rgb}{.75,.936,1} % LightBlue1
+
+\newcommand*{\summaryloc}[1]{%
+ \ifdefempty\summarylocwidth
+ {%
+ \tikz[baseline=(N.base)]
+ \node[fill=summaryloc,rounded corners,font=\summarylocfont] (N) {#1};%
+ }%
+ {%
+ \smash
+ {%
+ \tikz[baseline=(N.west)]
+ \node[anchor=west,fill=summaryloc,text width=\summarylocwidth,rounded corners,font=\summarylocfont] (N) {#1};%
+ }%
+ }%
+}
+
+\ifdef\@ptsize
+{
+ \ifboolexpr{ test {\ifdefstring\@ptsize{1}}
+ or test {\ifdefstring\@ptsize{11}}
+ or test {\ifdefstring\@ptsize{11pt}}
+ }
+ {%
+ \newcommand{\@nlct@example@fontsize}{11pt}%
+ }
+ {
+ \ifboolexpr{ test {\ifdefstring\@ptsize{2}} or test {\ifdefstring\@ptsize{12}} }
+ {%
+ \newcommand{\@nlct@example@fontsize}{12pt}%
+ }
+ {
+ \newcommand{\@nlct@example@fontsize}{10pt}
+ }
+ }
+}
+{
+ \newcommand{\@nlct@example@fontsize}{10pt}
+}
+
+\newcommand{\@nlct@example@clsname}{article}
+
+\newcommand{\@nlct@example@fontsize@prefix}{}
+
+\newcommand{\@nlct@update@example@fontsize@prefix}{%
+ \ifdefstring{\@nlct@example@clsname}{scrreport}
+ {\renewcommand{\@nlct@example@fontsize@prefix}{fontsize=}}%
+ {%
+ \ifdefstring{\@nlct@example@clsname}{scrbook}
+ {\renewcommand{\@nlct@example@fontsize@prefix}{fontsize=}}%
+ {%
+ \ifdefstring{\@nlct@example@clsname}{scrarticle}
+ {\renewcommand{\@nlct@example@fontsize@prefix}{fontsize=}}%
+ {%
+ \renewcommand{\@nlct@example@fontsize@prefix}{}
+ }%
+ }%
+ }%
+}
+
+\newcommand{\setexamplefontsize}[1]{%
+ \renewcommand{\@nlct@example@fontsize}{#1pt}%
+ \ifnum#1>12\relax
+ \renewcommand{\@nlct@example@clsname}{extarticle}%
+ \else
+ \ifnum#1<10\relax
+ \renewcommand{\@nlct@example@clsname}{extarticle}%
+ \else
+ \renewcommand{\@nlct@example@clsname}{article}%
+ \fi
+ \fi
+}
+
+\newcommand*{\nlct@create@example@preamble}{%
+ \string\documentclass[\@nlct@example@fontsize@prefix\@nlct@example@fontsize]{\@nlct@example@clsname}^^J%
+ \string\pagestyle{\@nlct@example@pagestyle}^^J}
+\newcommand*{\setexamplepreamble}[1]{\edef\create@example@preamble{\detokenize{#1}^^J}}
+\newcommand*{\addtoexamplepreamble}[1]{\eappto\create@example@preamble{\detokenize{#1}^^J}}
+
+\newwrite\nlct@exampleout
+
+\define@choicekey{nlctexample}{fontsize}%
+ {8,9,10,11,12,14,17,20}%
+ {\setexamplefontsize{#1}}
+
+\define@key{nlctexample}{class}{\renewcommand{\@nlct@example@clsname}{#1}}
+
+\newcommand{\@nlct@example@pagestyle}{empty}
+\define@key{nlctexample}{pagestyle}{\renewcommand{\@nlct@example@pagestyle}{#1}}
+
+\define@key{nlctexample}{graphicsopts}{%
+ \renewcommand*{\create@example@graphicsopts}{#1}}
+\newcommand*{\create@example@graphicsopts}{}
+
+\define@key{nlctexample}{pages}{%
+ \renewcommand*{\create@example@pages}{#1}}
+\newcommand*{\create@example@pages}{}
+
+\define@key{nlctexample}{pagesep}{%
+ \renewcommand*{\create@example@pages@sep}{#1}}
+\newcommand{\create@example@pages@sep}{1em}
+
+\define@key{nlctexample}{tex}{\renewcommand*{\create@example@tex}{#1}}
+\newcommand*{\create@example@tex}{arara --working-directory \examplesdir}
+
+\newcommand*{\nlct@create@example@precls}{%
+ \glspercentchar\space arara\string: pdflatex^^J%
+ \glspercentchar\space arara\string: pdfcrop^^J%
+}
+
+\define@key{nlctexample}{arara}{%
+ \ifdefstring{\examplesdir}{.}%
+ {\renewcommand*{\create@example@tex}{arara}}%
+ {\renewcommand*{\create@example@tex}{arara --working-directory \examplesdir}}%
+ \renewcommand*{\nlct@create@example@precls}{}%
+ \@for\nlct@thisitem:=#1\do{%
+ \eappto\nlct@create@example@precls{\glspercentchar\space arara\string:
+ \expandafter\detokenize\expandafter{\nlct@thisitem}^^J}%
+ }%
+}
+
+\providecommand{\examplename}{Example}
+\let\Examplename\examplename
+
+\newcommand*{\example@attachdesc}{\Examplename\space \theexample}
+
+\define@key{nlctexample}{description}{%
+ \renewcommand*{\example@attachdesc}{#1}%
+}
+
+\newcommand*{\example@title}{}
+
+\define@key{nlctexample}{title}{%
+ \renewcommand*{\example@title}{#1}%
+}
+
+\newcommand{\example@do@label}{}
+\newcommand{\example@label@info}{}
+
+\define@key{nlctexample}{label}{%
+ \renewcommand{\example@label@info}{\glspercentchar\space Label: #1^^J}%
+ \renewcommand*{\example@do@label}{\label{#1}}%
+}
+
+\newcounter{example}
+
+\newcommand{\exampleattachtexicon}{\faPaperclip\textsuperscript\faFileTextO}
+\newcommand{\exampleattachpdficon}{\faPaperclip\textsuperscript\faFilePdfO}
+\newcommand{\exampledownloadtexicon}{\faDownload\textsuperscript\faFileTextO}
+\newcommand{\exampledownloadpdficon}{\faDownload\textsuperscript\faFilePdfO}
+
+\newcommand{\codepar}{\par\mbox{}\par}
+
+\newcommand{\nlctexamplelets}{%
+ \let\gls\glsentrytext
+ \let\env\@firstofone
+ \let\ctr\@firstofone
+ \let\texorpdfstring\@secondoftwo
+ \def\cmd##1{\glsbackslash##1}%
+ \def\csfmt##1{\glsbackslash##1}%
+ \def\cbeg##1{\glsbackslash begin{##1}}%
+ \def\cend##1{\glsbackslash end{##1}}%
+ \def\comment##1{\glspercentchar\space ##1^^J}%
+ \def\%{\glspercentchar}%
+ \edef\#{\expandafter\@gobble\string\#}%
+ \def\-{}%
+ \def\codepar{^^J^^J}%
+ \def\marg##1{\glsopenbrace##1\glsclosebrace}%
+ \def\oarg##1{[##1]}%
+}
+
+\newcommand{\@create@example@write}{\@create@example@write@detok}
+
+\newcommand{\createexamplefirstline}{%
+ \nlct@ifattachsupported
+ {\glspercentchar\space This file is embedded in \jobname.pdf^^J}%
+ {\glspercentchar\space This file is an example from \jobname.pdf^^J}%
+}
+
+\newcommand{\@create@example@write@detok}[2]{%
+ \immediate\write\nlct@exampleout{%
+ \createexamplefirstline
+ \glspercentchar\space \Examplename\space \theexample\space\example@title^^J%
+ \example@label@info
+ \nlct@create@example@precls
+ \nlct@create@example@preamble
+ \detokenize{#1}^^J\string\begin{document}^^J\detokenize{#2}^^J%
+ \string\end{document}}%
+}
+
+\newcommand{\@create@example@write@nodetok}[2]{%
+ {\nlctexamplelets\immediate\write\nlct@exampleout{%
+ \createexamplefirstline
+ \glspercentchar\space \Examplename\space \theexample\space\example@title^^J%
+ \nlct@create@example@precls\nlct@create@example@preamble
+ #1^^J\string\begin{document}^^J#2^^J%
+ \string\end{document}}%
+ }%
+}
+
+\newcommand{\example@image}[2][]{%
+ \settowidth{\dimen@}{\expandafter\includegraphics\expandafter
+ [\create@example@graphicsopts,#1]{#2}}%
+ \ifdim\dimen@>\linewidth\preto\create@example@graphicsopts{width=\linewidth,}\fi
+ \s@example@image[#1]{#2}%
+}
+
+\newcommand{\s@example@image}[2][]{%
+ \vtop
+ {%
+ \vskip0pt
+ \hbox{\expandafter\includegraphics\expandafter
+ [\create@example@graphicsopts,#1]{#2}}%
+ }%
+}
+
+\newcommand{\nlctexampleimagelist}{%
+ \examplesdir/\nlct@example@filebasename-crop.pdf,%
+ \examplesdir/\nlct@example@filebasename.pdf%
+}
+
+\newcommand*{\nlct@include@exampleimage}{%
+ \@for\nlct@image@file:=\nlctexampleimagelist\do
+ {%
+ \IfFileExists{\nlct@image@file}%
+ {%
+ \ifdefempty\create@example@pages
+ {\example@image{\nlct@image@file}}%
+ {%
+ \ifdefempty\create@example@graphicsopts
+ {%
+ \DTLnumitemsinlist{\create@example@pages}{\@nlct@num}%
+ \edef\create@example@graphicsopts{width=\the\dimexpr\linewidth/\@nlct@num-\create@example@pages@sep}%
+ }{}%
+ \@for\@nlct@page:=\create@example@pages\do{\hfill
+ \s@example@image[page=\@nlct@page]{\nlct@image@file}\hfill}%
+ }%
+ \@endfortrue
+ }%
+ {}%
+ }%
+ \if@endfor
+ \else
+ \PackageWarning{nlctuserguide}%
+ {Missing example file `\nlct@example@filebasename.pdf'}%
+ [missing \nlct@example@filebasename.pdf]
+ \fi
+}
+
+% \createexample[options]{preamble code}{document code}
+\newcommand{\createexample}{%
+ \@nlct@update@example@fontsize@prefix
+ \@ifstar
+ {\let\@create@example@write\@create@example@write@nodetok\@createexample}%
+ {\let\@create@example@write\@create@example@write@detok\@createexample}}
+
+\newcommand{\listofexamplesname}{List of Examples}
+\newcommand{\listofexampleslabel}{\label{sec:listofexamples}}
+
+\ifdef\chapter
+{
+ \ifdef\titlepagestyle{\renewcommand{\titlepagestyle}{empty}}{}
+ \pagenumbering{alph}
+
+ \newcommand{\listofexamples}{%
+ \@ifstar{\chapter*{\listofexamplesname}\@starttoc{loe}}%
+ {\chapter{\listofexamplesname}\listofexampleslabel\@starttoc{loe}}}
+}
+{
+ \newcommand{\listofexamples}{%
+ \@ifstar{\section*{\listofexamplesname}\@starttoc{loe}}%
+ {\section{\listofexamplesname}\listofexampleslabel\@starttoc{loe}}}
+}
+
+\newcommand{\l@example}{\l@table}
+
+\newcommand\nlctexamplefilebasename{%
+ \jobname-example\ifnum\c@example<10 00\else \ifnum\c@example<100 0\fi\fi\the\c@example}%
+
+\newcommand*{\nlct@preattachments}{}
+
+\newcommand{\nlctexampledisablecmds}{}
+
+\newcommand{\nlctexampletag}{\Examplename~\theexample}
+
+\newcommand{\nlctexampletitlefmt}[1]{%
+ \nlctexampletitlefont\raggedright
+ \nlctexampletag\ifstrempty{#1}{}{: #1}\par
+}
+
+\newcommand{\nlctexampletitlebox}[2][0.8\linewidth]{%
+ \parbox[t]{#1}{\nlctexampletitlefmt{#2}}}
+
+\newcommand{\nlctexampletagattachfont}{\small}
+\newcommand{\nlctexampletitlefont}{\nlctexampletagattachfont}
+\newcommand{\nlctexampleenvtitlefont}{\bfseries\large}
+
+\newcommand{\addtolistofexamples}[1]{%
+ \addcontentsline{loe}{example}{\protect\numberline{\theexample}#1}%
+}
+
+\newif\ifnlctattachpdf
+\nlctattachpdffalse
+
+\newif\ifnlctdownloadlinks
+\nlctdownloadlinkstrue
+\newcommand*{\nlctdownloadlink}[1]{http://mirrors.ctan.org/macros/latex/contrib/\thispackagename/#1}
+
+\newcommand*{\nlct@testfile}[2]{%
+ \IfFileExists{#1}{}%
+ {%
+ \PackageWarning{nlctuserguide}{File `#1' doesn't exist.
+ Changing examples directory to `.'}%
+ \gdef\examplesdir{.}%
+ #2%
+ }%
+ \global\let\nlct@testfile\@gobblethree
+}
+
+\newcommand{\@loe@disable@cmds}{%
+ \def\dequals{\protect\dequals}%
+ \def\dhyphen{\protect\dhyphen}%
+ \def\dunderscore{\protect\dunderscore}%
+ \def\cmd##1{\protect\csfmt{##1}}%
+ \def\code##1{\protect\code{##1}}%
+ \def\optfmt##1{\protect\optfmt{##1}}%
+ \def\styfmt##1{\protect\styfmt{##1}}%
+ \def\clsfmt##1{\protect\clsfmt{##1}}%
+ \def\envfmt##1{\protect\envfmt{##1}}%
+ \def\appfmt##1{\protect\appfmt{##1}}%
+}
+
+\newcommand{\@createexample}[3][]{%
+ \begingroup
+ \refstepcounter{example}%
+ \setkeys{nlctexample}{#1}%
+ \example@do@label
+ \let\nlct@org@cmd\cmd
+ \def\cmd##1{\csfmt{##1}}%
+ \protected@edef\example@tex@title{\example@title}%
+ \@loe@disable@cmds
+ \addtolistofexamples{\example@title}%
+ \def\cmd##1{\string\\##1}%
+ \let\code\@firstofone
+ \let\optfmt\@firstofone
+ \let\styfmt\@firstofone
+ \let\clsfmt\@firstofone
+ \let\envfmt\@firstofone
+ \let\appfmt\@firstofone
+ \let\opt\@firstofone
+ \let\app\@firstofone
+ \let\sty\@firstofone
+ \let\cls\@firstofone
+ \let\glslink\@secondoftwo
+ \let\texorpdfstring\@secondoftwo
+ \let\codebackslash\glsbackslash
+ \let\-\@empty
+ \def\TeX{TeX}%
+ \def\LaTeX{LaTeX}%
+ \def\dequals{=}%
+ \def\dhyphen{-}%
+ \def\dunderscore{\_}%
+ \def\newline{^^J}%
+ \nlctexampledisablecmds
+ \protected@edef\example@pdf@title{\example@title}%
+ \protected@edef\example@attachdesc{\example@attachdesc}%
+ \def\cmd##1{\glsbackslash ##1}%
+ \protected@edef\example@title{\example@title}%
+ \let\cmd\nlct@org@cmd
+ \xdef\nlct@example@filebasename{\nlctexamplefilebasename}%
+ \immediate\openout\nlct@exampleout=\examplesdir/\nlct@example@filebasename.tex
+ \@create@example@write{#2}{#3}%
+ \immediate\closeout\nlct@exampleout
+ \nlct@testfile{\examplesdir/\nlct@example@filebasename}%
+ {%
+ \immediate\openout\nlct@exampleout=\nlct@example@filebasename.tex
+ \@create@example@write{#2}{#3}%
+ \immediate\closeout\nlct@exampleout
+ }%
+ \immediate\write18{\create@example@tex\space\nlct@example@filebasename.tex}%
+ \nlct@ifattachsupported
+ {%
+ \nlct@preattachments
+ \bgroup
+ \nlctexampletitlebox{\example@tex@title}\hfill
+ \nlctexampletagattachfont
+ \textattachfile[mimetype={application/x-tex},
+ author={\@pdfauthor},color={0 0 0},
+ size={\pdf@filesize{\examplesdir/\nlct@example@filebasename.tex}},
+ subject={\example@pdf@title\space (source code)},
+ description={\example@attachdesc\space (source code)}]%
+ {\examplesdir/\nlct@example@filebasename.tex}{\exampleattachtexicon}%
+ \ifnlctdownloadlinks
+ \space
+ \href{\nlctdownloadlink{\examplesdir/\nlct@example@filebasename.tex}}{\exampledownloadtexicon}
+ \fi
+ \ifnlctattachpdf
+ \IfFileExists{\examplesdir/\nlct@example@filebasename.pdf}
+ {%
+ \space
+ \textattachfile[mimetype={application/pdf},
+ author={\@pdfauthor},color={0 0 0},
+ size={\pdf@filesize{\examplesdir/\nlct@example@filebasename.pdf}},
+ subject={\example@pdf@title\space (PDF)},
+ description={\example@attachdesc\space (PDF)}]%
+ {\examplesdir/\nlct@example@filebasename.pdf}{\exampleattachpdficon}%
+ }%
+ {}%
+ \ifnlctdownloadlinks
+ \space
+ \href{\nlctdownloadlink{\examplesdir/\nlct@example@filebasename.pdf}}{\exampledownloadpdficon}
+ \fi
+ \else
+ \ifnlctdownloadlinks
+ \space
+ \href{\nlctdownloadlink{\examplesdir/\nlct@example@filebasename.pdf}}{\exampledownloadpdficon}
+ \fi
+ \fi
+ \par\egroup\noindent
+ }%
+ {%
+ \nlctexampletitlebox{\example@tex@title}\hfill
+ \ifnlctdownloadlinks
+ \href{\nlctdownloadlink{\examplesdir/\nlct@example@filebasename.tex}}{\exampledownloadtexicon}
+ \quad
+ \href{\nlctdownloadlink{\examplesdir/\nlct@example@filebasename.pdf}}{\exampledownloadpdficon}
+ \par\egroup\noindent
+ \fi
+ }
+ \nlct@include@exampleimage
+ \endgroup
+}
+
+\newenvironment{example}[2]{%
+ \refstepcounter{example}\label{#2}%
+ \par\vskip10pt\noindent
+ {%
+ \def\cmd##1{\csfmt{##1}}%
+ \let\nlctexampletitlefont\nlctexampleenvtitlefont
+ \nlctexampletitlefmt{#1}%
+ }%
+ {%
+ \@loe@disable@cmds
+ \addtolistofexamples{#1}%
+ }%
+ \nopagebreak\par\vskip10pt\nopagebreak
+}
+{%
+ \nopagebreak\begin{center}\rule{2in}{1pt}\end{center}%
+}
+
+
+\renewcommand{\fps@figure}{htbp}
+
+% put break before dash to avoid confusion with a hyphen
+\newcommand{\dhyphen}{%
+ \texorpdfstring
+ {\discretionary{}{}{}\texttt{-}}%
+ {-}%
+}
+
+% Redefine \- (used in entry names) so that hyphenation in command names,
+% switches, options etc., uses a serif hyphen to reduce confusion with an
+% actual hyphen in the code.
+\renewrobustcmd{\-}{%
+ \discretionary
+ {{\rmfamily\char\ifnum\hyphenchar\font<0
+ \defaulthyphenchar\else\hyphenchar\font\fi
+ }}%
+ {}{}%
+}
+
+\newcommand{\dequals}{%
+ \texorpdfstring
+ {\discretionary{}{}{}\texttt{=}\discretionary{}{}{}}%
+ {=}%
+}
+
+\newcommand{\dcomma}{%
+ \texorpdfstring
+ {\texttt{,}\discretionary{}{}{}}%
+ {,}%
+}
+
+\newcommand{\dcolon}{%
+ \texorpdfstring
+ {\texttt{:}\discretionary{}{}{}}%
+ {:}%
+}
+
+\newcommand{\dfullstop}{%
+ \texorpdfstring
+ {\texttt{.}\discretionary{}{}{}}%
+ {.}%
+}
+
+\newcommand{\dunderscore}{%
+ \texorpdfstring
+ {\discretionary{}{}{}\texttt{\_}\discretionary{}{}{}}%
+ {\_}%
+}
+
+\newcommand\dsb{\dunderscore}
+
+\pdfstringdefDisableCommands{%
+ \def\dhyphen{-}%
+ \def\dcolon{:}%
+ \def\dcomma{,}%
+ \def\dequals{=}%
+ \def\dfullstop{.}%
+ \def\dunderscore{\_}%
+ \let\-\empty
+ \let\csfmtfont\@firstofone
+}
+
+\definecolor{cs}{rgb}{.328,.436,.1} % dark green
+\definecolor{styopt}{rgb}{.408,.132,.545} % DarkOrchid4
+\definecolor{csopt}{rgb}{.408,.132,.545} % DarkOrchid4
+\definecolor{comment}{rgb}{0.37,0.37,0.37}% grey
+
+\definecolor{style1}{rgb}{.32,.545,.545} % DarkSlateGray4
+\definecolor{style2}{rgb}{.21,.392,.545} % SteelBlue4
+\definecolor{style3}{rgb}{0,0,.545} % Blue4
+\definecolor{style4}{rgb}{.332,.1,.545} % Purple4
+\definecolor{style5}{rgb}{.28,.235,.545} % SlateBlue4
+\definecolor{style6}{rgb}{.545,.352,.17} % Tan4
+
+\newcommand{\sidenote}[1]{\leavevmode\marginpar{\footnotesize#1}}
+
+\newcommand*{\csfmtfont}[1]{\ifmmode \mbox{\texttt{#1}}\else\texttt{#1}\fi}
+\newcommand*{\csfmtcolourfont}[1]{\texttt{\textcolor{cs}{#1}}}
+
+\newcommand*{\csfmt}[1]{\csfmtfont{\codebackslash #1}}
+
+\newcommand{\codebackslash}{\texorpdfstring{\char`\\}{\string\\}}
+
+\newcommand{\csmetafmt}[3]{%
+ \texorpdfstring{\csfmt{#1\meta{#2}#3}}{\string\\#1\string<#2\string>#3}%
+}
+\newcommand{\csmetametafmt}[5]{%
+ \texorpdfstring{\csfmt{#1\meta{#2}#3\meta{#4}#5}}{\string\\#1\string<#2\string>#3\string<#4\string>#5}%
+}
+
+\newcommand{\starredcs}[1]{\glslink{#1}{\csfmt{#1*}}}
+
+\glsxtraddlabelprefix{dual.}
+\glsxtraddlabelprefix{idx.}
+\glsxtraddlabelprefix{idx.sym.}
+\glsxtraddlabelprefix{}
+
+\newcommand{\idx}{\dgls}
+\newcommand{\idxpl}{\dglspl}
+\newcommand{\Idx}{\dGls}
+\newcommand{\Idxpl}{\dGlspl}
+\newcommand{\idxc}{\dglslink}
+\newcommand{\idxn}[2][]{%
+ \ifglsentryexists{dual.#2}%
+ {\glsname[#1]{dual.#2}}%
+ {\ifglsentryexists{idx.#2}{\glsname[#1]{idx.#2}}{\glsname[#1]{#2}}}%
+}
+\newcommand{\idxf}[2][]{%
+ \ifglsentryexists{dual.#2}%
+ {\glsfirst[#1]{dual.#2}}%
+ {\ifglsentryexists{idx.#2}{\glsfirst[#1]{idx.#2}}{\glsfirst[#1]{#2}}}%
+}
+
+\newcommand{\optionlistprefix}{opt.}
+\newcommand{\optionlistitemformat}[1]{\glsentrytext{#1}}
+\newcommand{\optionlisttag}{Option}
+\newcommand{\optionlisttags}{Options}
+
+\newrobustcmd{\option}[1]{%
+ \glslink{\optionlistprefix#1}%
+ {\optionlisttag\glsxtrtaggedlistsep\optionlistitemformat{\optionlistprefix#1}}%
+}
+
+\newrobustcmd{\optionsto}[2]{%
+ \optionlisttags\glsxtrtaggedlistsep
+ \glslink{\optionlistprefix#1}%
+ {\optionlistitemformat{\optionlistprefix#1}}%
+ \thinspace\textendash\thinspace
+ \glslink{\optionlistprefix#2}%
+ {\optionlistitemformat{\optionlistprefix#2}}%
+}
+
+\newrobustcmd{\options}[1]{%
+ {\def\andname{and}
+ \let\glsseeitemformat\optionlistitemformat
+ \glsxtrtaggedlist{\optionlisttag}{\optionlisttags}{\optionlistprefix}{#1}%
+ }%
+}
+
+\newrobustcmd{\optionsor}[1]{%
+ {\def\andname{or}%
+ \let\glsseeitemformat\optionlistitemformat
+ \glsxtrtaggedlist{\optionlisttag}{\optionlisttags}{\optionlistprefix}{#1}%
+ }%
+}
+
+\newcommand*{\stytext}[1]{\glsfmttext{pkg.#1}}
+\newcommand*{\clstext}[1]{\glsfmttext{cls.#1}}
+\newcommand*{\opttext}[1]{\glsfmttext{opt.#1}}
+\newcommand*{\envtext}[1]{\glsfmttext{env.#1}}
+\newcommand*{\ctrtext}[1]{\glsfmttext{ctr.#1}}
+\newcommand*{\actext}[1]{\glsfmttext{dual.#1}}
+\newcommand*{\exttext}[1]{\glsfmttext{ext.#1}}
+\newcommand*{\apptext}[1]{\glsfmttext{app.#1}}
+\newcommand*{\switchtext}[1]{\glsfmttext{switch.#1}}
+
+\glsxtrnewgls{pkg.}{\sty}
+\glsxtrnewgls{cls.}{\cls}
+\glsxtrnewgls{opt.}{\opt}
+\glsxtrnewgls{env.}{\env}
+\glsxtrnewgls{ctr.}{\ctr}
+\glsxtrnewgls{dual.}{\ac}
+\glsxtrnewgls[format=glsignore]{ext.}{\ext}
+\glsxtrnewgls{app.}{\app}
+\glsxtrnewgls{switch.}{\switch}
+\glsxtrnewgls{idx.mod.}{\cmdmod}
+
+\newdglsfield{symbol}{\sym}
+
+\newcommand{\optval}[2]{%
+ \texorpdfstring
+ {\gls{opt.#1}\optfmt{\dequals#2}}%
+ {\glsentrytext{opt.#1}=#2}%
+}
+
+\newcommand{\optvalm}[2]{%
+ \texorpdfstring
+ {\gls{opt.#1}\optfmt{\dequals\marg{#2}}}%
+ {\glsentrytext{opt.#1}=\marg{#2}}%
+}
+
+\newcommand{\opteqvalref}[2]{%
+ \texorpdfstring
+ {\gls!{opt.#1}\optfmt{\dequals}\gls{optval.#1.#2}}%
+ {\glsentrytext{opt.#1}=\glsentrytext{optval.#1.#2}}%
+}
+
+\newcommand{\optvalref}[2]{%
+ \texorpdfstring
+ {\gls{optval.#1.#2}}%
+ {\glsentrytext{optval.#1.#2}}%
+}
+
+\newcommand{\optvalrefeq}[3]{%
+ \texorpdfstring
+ {\gls{optval.#1.#2}\optfmt{\dequals#3}}%
+ {\glsentrytext{optval.#1.#2}=#3}%
+}
+
+\newcommand{\childoptval}[3]{%
+ \texorpdfstring
+ {\gls{optval.#1.#2}\optfmt{\dequals#3}}%
+ {\glsentrytext{optval.#1.#2}=#3}%
+}
+
+\newcommand{\qt}[1]{\texorpdfstring{``#1''}{"#1"}}
+\newcommand{\qtt}[1]{\qt{\,\texttt{#1}\,}}
+
+\newcommand{\booktitle}[1]{\emph{#1}}
+
+\newcommand*{\fmtorcode}[2]{#1{#2}}
+
+\newcommand*{\appfmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
+\newcommand*{\styfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\newcommand*{\clsfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\newcommand*{\envfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\newcommand*{\optfmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
+\newcommand*{\csoptfmt}[1]{\texorpdfstring{\textcolor{cs}{\optfmt{#1}}}{#1}}
+\newcommand*{\styoptfmt}[1]{\texorpdfstring{\textcolor{styopt}{\optfmt{#1}}}{#1}}
+\newcommand*{\clsoptfmt}[1]{\texorpdfstring{\textcolor{styopt}{\optfmt{#1}}}{#1}}
+\newcommand*{\ctrfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\edef\longswitch{\string-\/\string-}
+\edef\pdflongswitch{\string-\string-}
+
+\newcommand*{\longargfmt}[1]{%
+ \texorpdfstring{\texttt{\longswitch #1}}{\pdflongswitch#1}%
+}
+
+\newcommand*{\shortargfmt}[1]{\texorpdfstring{\texttt{-#1}}{\string-#1}}
+
+% \defsemanticcmd[colour]{cs}{font-cs}{prefix}
+\newcommand*{\defsemanticcmd}[4][]{%
+ \ifstrempty{#1}%
+ {%
+ \ifstrempty{#3}%
+ {%
+ \newcommand#2[1]{#4##1}%
+ }
+ {%
+ \newcommand#2[1]{\texorpdfstring{\fmtorcode#3{#4##1}}{#4##1}}%
+ }%
+ }%
+ {%
+ \ifstrempty{#3}%
+ {%
+ \newcommand#2[1]{\texorpdfstring{{\color{#1}#4##1}}{#4##1}}%
+ }%
+ {%
+ \newcommand#2[1]{\texorpdfstring{\fmtorcode#3{\color{#1}#4##1}}{#4##1}}%
+ }%
+ }%
+}
+
+\newrobustcmd*{\texmeta}[1]{{\normalfont\normalcolor$\langle$\emph{#1}$\rangle$}}
+
+\newcommand*{\meta}[1]{%
+ \texorpdfstring{\ifmmode\text{\texmeta{#1}}\else\texmeta{#1}\fi}{\string<#1\string>}%
+}
+
+\newcommand*{\oarg}[1]{\discretionary{}{}{}[#1]}
+\newcommand*{\oargm}[1]{\oarg{\meta{#1}}}
+
+% To prevent lonely [ and ] from upsetting the syntax highlighter:
+\newrobustcmd*{\nlctopensqbracket}{[}
+\newrobustcmd*{\nlctclosesqbracket}{]}
+
+% To prevent lonely ( and ) from upsetting the syntax highlighter:
+\newrobustcmd*{\nlctopenparen}{(}
+\newrobustcmd*{\nlctcloseparen}{)}
+
+\newcommand*{\marg}[1]{\texorpdfstring
+ {\discretionary{}{}{}\char`\{#1\char`\} \discretionary{}{}{}}%
+ {\{#1\}}%
+}
+
+\newcommand*{\margm}[1]{\marg{\meta{#1}}}
+
+\newcommand*{\metaboolean}{\meta{boolean}}
+\newcommand*{\keyval}{\meta{key}\dequals\meta{value}}
+\newcommand*{\keyvallist}{\meta{key\dequals value list}}
+
+\newcommand*{\keyeqvalue}[2]{#1=#2}
+\newcommand*{\keyeqvaluem}[2]{#1=\marg{#2}}
+
+\newcommand*{\file}[1]{%
+ \texorpdfstring
+ {\gls{file.#1}}%
+ {#1}%
+}
+
+\newcommand*{\filefmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
+\newcommand*{\extfmt}{\filefmt}
+
+% \metafilefmt{prefix}{val}{suffix} -> prefix<val>suffix
+\newcommand*{\metafilefmt}[3]{%
+ \filefmt{#1}\discretionary{}{}{}\meta{#2}\discretionary{}{}{}\filefmt{#3}%
+}
+
+% \metametafilefmt{prefix}{val1}{mid}{val2}{suffix} ->
+% prefix<val1>mid<val2>suffix
+\newcommand*{\metametafilefmt}[5]{%
+ \filefmt{#1}\discretionary{}{}{}\meta{#2}\discretionary{}{}{}\filefmt{#3}%
+ \discretionary{}{}{}\meta{#4}\discretionary{}{}{}\filefmt{#5}%
+}
+
+\newcommand*{\BibTeX}{\hologo{BibTeX}}
+\newcommand*{\eTeX}{\hologo{eTeX}}
+\newcommand*{\XeLaTeX}{\hologo{XeLaTeX}}
+\newcommand*{\LuaLaTeX}{\hologo{LuaLaTeX}}
+\newcommand*{\pdfLaTeX}{\hologo{pdfLaTeX}}
+\newcommand*{\LuaTeX}{\hologo{LuaTeX}}
+\newcommand*{\XeTeX}{\hologo{XeTeX}}
+\newcommand*{\pdfTeX}{\hologo{pdfTeX}}
+
+\ifdef\GlsXtrSetPlusModifier
+{\GlsXtrSetPlusModifier{format=glsnumberformat}}{}
+
+\ifdef\GlsXtrSetAltModifier
+{\GlsXtrSetAltModifier{!}{format=glsignore}}{}
+
+\newcommand{\@@mainmatteronly@op}[1]{%
+ \glsxtrtitleorpdforheading{#1}{}{}%
+}
+\newcommand{\@mainmatteronly}[1]{%
+ \texorpdfstring{\protect\@@mainmatteronly{#1}}{}%
+}
+\let\mainmatteronly\@mainmatteronly
+\let\@@mainmatteronly\@@mainmatteronly@op
+
+\ifdef\frontmatter
+{
+ \appto\frontmatter{%
+ \GlsXtrSetDefaultNumberFormat{glsignore}%
+ \let\mainmatteronly\@gobble
+ \let\@@mainmatteronly\@gobble
+ }
+}
+{%
+}
+
+\ifdef\mainmatter
+{
+ \appto\mainmatter{%
+ \GlsXtrSetDefaultNumberFormat{glsnumberformat}%
+ \let\mainmatteronly\@mainmatteronly
+ \let\@@mainmatteronly\@@mainmatteronly@op
+ }
+}
+{}
+
+\ifdef\backmatter
+{\appto\backmatter{\setupglossaries{numberedsection=nolabel}}}
+{}
+
+\ifdef\abstract
+{}
+{
+ \providecommand{\abstractname}{Abstract}
+ \newenvironment{abstract}{\begin{center}\textbf{\abstractname}\end{center}\quotation}{\endquotation}
+}
+
+\newcommand{\cmddefbookmarkleveloffset}{1}
+
+\newcommand*{\setcounterlevels}[2]{%
+ \edef\cmddefbookmarklevel{\number\numexpr#1+\cmddefbookmarkleveloffset }%
+ \def\cmddefcounter{#2}%
+ \let\pkgdefbookmarklevel\cmddefbookmarklevel
+ \def\pkgdefcounter{#2}%
+ \let\clsdefbookmarklevel\cmddefbookmarklevel
+ \def\clsdefcounter{#2}%
+ \def\currentcounterlevel{#1}%
+ \def\currentcounter{#2}%
+}
+
+\ifdef\chapter
+{
+ \preto\chapter{\setcounterlevels{0}{chapter}}
+ \setcounterlevels{0}{chapter}
+}
+{
+ \setcounterlevels{1}{section}
+}
+
+\preto\part{\setcounterlevels{-1}{part}}
+\preto\section{\setcounterlevels{1}{section}}
+\preto\subsection{\setcounterlevels{2}{subsection}}
+\preto\subsubsection{\setcounterlevels{3}{subsubsection}}
+\preto\paragraph{\setcounterlevels{4}{paragraph}}
+\preto\subparagraph{\setcounterlevels{4}{subparagraph}}
+
+\newcommand{\mainfmt}[1]{\glsnumberformat{#1}}
+
+% \createtarget{label}{text}
+\newcommand*{\createtarget}[2]{%
+ \glstarget{#1}{#2}\xGlsXtrSetField{#1}{target}{\glolinkprefix #1}%
+}
+
+\renewcommand*{\GlsXtrStandaloneEntryName}[1]{%
+ \createtarget{#1}{\glossentryname{#1}}%
+}
+
+% \targetorhyperlink{label}{text}
+\newcommand*{\targetorhyperlink}[2]{%
+ \glsxtrifhasfield*{target}{#1}%
+ {%
+ \glshyperlink[{#2}]{#1}%
+ }%
+ {%
+ \createtarget{#1}{#2}%
+ }%
+}
+
+\newcommand*{\linkedentryname}[1]{%
+ {\setkeys{printgloss}{target=true}\targetorhyperlink{#1}{\glossentryname{#1}}}%
+}
+
+\newcommand*{\optvaldefcounter}{}
+
+\newcommand*{\inlineidxdef}[1]{%
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentry{idx.#1}%
+}
+
+\newcommand*{\Inlineidxdef}[1]{%
+ \bgroup
+ \let\glossentryname\Glossentryname
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentry{idx.#1}%
+ \egroup
+}
+
+\newrobustcmd*{\inlineidxfdef}[1]{%
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentryother{}{idx.#1}{first}%
+ \glsunset{#1}%
+}
+
+\newrobustcmd*{\inlineidxpdef}[1]{%
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentryother{}{idx.#1}{plural}%
+ \glsunset{#1}%
+}
+
+\newrobustcmd*{\inlineswitchdef}[1]{%
+ \mainmatteronly{\mainglsadd{switch.#1}{}}%
+ \glsxtrglossentry{switch.#1}%
+}
+
+\newrobustcmd*{\inlineglsdef}[2][cmddef]{%
+ \mainglsadd{#2}{#1}%
+ \glsxtrglossentry{#2}%
+}
+
+\newcommand*{\mainglsadd}[3][]{%
+ \ifstrempty{#3}%
+ {\def\mainglsaddcounter{}}%
+ {%
+ \ifcsdef{#3counter}%
+ {\letcs\mainglsaddcounter{#3counter}}%
+ {\let\mainglsaddcounter\currentcounter}%
+ }%
+ \ifdefempty\mainglsaddcounter{}{\glsadd[counter=\mainglsaddcounter,format=mainfmt]{#2}}%
+ \glsadd[format=mainfmt,#1]{#2}%
+}
+
+% standalone targets
+\newcommand{\entrydefsection}{\section}
+\newcommand{\entrysec}[2][\entrydefsection]{%
+ #1{\glsxtrglossentry{#1}%
+ \glsxtrtitleorpdforheading{\mainglsadd{#1}{entrydef}}{}{}}%
+}
+
+% doesn't display any text but creates the target and principle
+% location
+\newrobustcmd{\maindef}[2][]{%
+ \glsdoifexists{#2}%
+ {%
+ \mainglsadd[#1]{#2}{maindef}\createtarget{#2}{\strut}%
+ }%
+}
+
+\newrobustcmd*{\cmddef}{\@ifstar\s@cmddef\@cmddef}
+\newcommand*{\@cmddef}[2][]{%
+ \pdfbookmark[\cmddefbookmarklevel]{\glsentryname{#2}}{csdef.#2}%
+ \nopagebreak\s@cmddef[#1]{#2}%
+}
+
+\newcommand*{\cmdnotefmt}[1]{\mbox{#1}}
+
+\newcommand*{\cmddefsyntax}[2]{%
+ \mainglsadd[#1]{#2}{cmddef}%
+ \texttt{\glsxtrglossentry{#2}\syntax{#2}}%
+}
+
+\newcommand*{\optdefsyntax}[2]{%
+ \mainglsadd[#1]{opt.#2}{optdef}%
+ \texttt{\glsxtrglossentry{opt.#2}
+ \glsxtrifhasfield{syntax}{opt.#2}{\dequals\glscurrentfieldvalue}{}}%
+}
+
+\newcommand*{\s@cmddef}[2][]{%
+ \def\cmdtitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{#2}{\def\cmdtitle{\statussym}\def\postnote{\hfill\statustext}}{}%
+ \begin{pinnedbox}[title=\cmdtitle]
+ \let\csfmtfont\@firstofone
+ \def\cmdfont##1{\textbf{\texttt{##1}}}%
+ \gathermodifiers{#2}%
+ \cmddefsyntax{#1}{#2}%
+ \def\tagsep{\hfill}%
+ \ifdefempty\nlctmodifierlist{}%
+ {\tagsep\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist\relax
+ \let\tagsep\space
+ }%
+ \glsxtrifhasfield{initvalue}{#2}
+ {\tagsep\summarytagfmt{initial}\texttt{\glscurrentfieldvalue}}%
+ {}%
+ \ifdefempty\nlctmodifierglslist{}%
+ {\@for\@nlct@label:=\nlctmodifierglslist\do
+ {\par\cmddefsyntax{#1}{\@nlct@label}}}%
+ \glsxtrifhasfield*{note}{#2}%
+ {%
+ \ifx\cmdnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\cmdnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newcommand{\gathermodifiers}[1]{%
+ \protected@edef\nlctcmddeflabel{#1}%
+ \def\nlctmodifiertag{}%
+ \def\nlctmodifierlist{}%
+ \def\nlctmodifierglslist{}%
+ \glsxtrforcsvfield*{#1}{modifiers}{\cmddefmodifierhandler}%
+}
+
+\newcommand{\cmddefmodifierhandler}[1]{%
+ \ifglsentryexists{\nlctcmddeflabel#1}%
+ {%
+ \ifdefempty\nlctmodifierglslist
+ {\eappto\nlctmodifierglslist{\nlctcmddeflabel#1}}%
+ {\eappto\nlctmodifierglslist{,\nlctcmddeflabel#1}}%
+ }%
+ {%
+ \ifdefempty\nlctmodifierlist
+ {\def\nlctmodifiertag{modifier}}%
+ {\def\nlctmodifiertag{modifiers}\appto\nlctmodifierlist{ }}%
+ \ifglsentryexists{idx.mod.#1}%
+ {\eappto\nlctmodifierlist{\noexpand\gls{idx.mod.#1}}}%
+ {\eappto\nlctmodifierlist{#1}}%
+ }%
+}
+
+\newrobustcmd*{\envdef}{\@ifstar\s@envdef\@envdef}
+\newcommand*{\@envdef}[2][]{%
+ \pdfbookmark[\cmddefbookmarklevel]{\glsentryname{env.#2}}{env.#2}%
+ \nopagebreak\s@envdef[#1]{#2}%
+}
+
+\newsavebox\entrynamebox
+
+\newcommand{\enventryname}[1]{%
+ \createtarget{#1}%
+ {%
+ \texttt
+ {%
+ \sbox\entrynamebox
+ {%
+ \csfmt{begin}%
+ \marg{\glossentryname{#1}}%
+ \glsxtrifhasfield{syntax}{#1}{\glscurrentfieldvalue}{}%
+ \meta{content}\csfmt{end}\marg{\glsentryname{#1}}%
+ }%
+ \settowidth\dimen@{\usebox\entrynamebox}%
+ \ifdim\dimen@>0.8\linewidth
+ \csfmt{begin}%
+ \marg{\glossentryname{#1}}%
+ \glsxtrifhasfield{syntax}{#1}{\glscurrentfieldvalue}{}%
+ \endgraf\meta{content}\endgraf\csfmt{end}\marg{\glsentryname{#1}}%
+ \else
+ \usebox\entrynamebox
+ \fi
+ }%
+ }%
+}
+
+\newcommand*{\s@envdef}[2][]{%
+ \def\envtitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{env.#2}{\def\envtitle{\statussym}\def\postnote{\statustext}}{}%
+ \begin{pinnedbox}[title=\envtitle]
+ \let\GlsXtrStandaloneEntryName\enventryname
+ \def\envfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd[#1]{env.#2}{cmddef}%
+ \glsxtrglossentry{env.#2}%
+ \glsxtrifhasfield*{note}{env.#2}%
+ {%
+ \ifx\cmdnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\cmdnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\pkgdef}{\@ifstar\s@pkgdef\@pkgdef}
+\newcommand*{\@pkgdef}[2][]{%
+ \pdfbookmark[\pkgdefbookmarklevel]{\glsentryname{pkg.#2}.sty}{pkgdef.#2}%
+ \nopagebreak\s@pkgdef[#1]{#2}%
+}
+
+\newcommand{\pkgentryname}[1]{%
+ \createtarget{#1}%
+ {%
+ \texttt
+ {%
+ \csfmt{usepackage}%
+ \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+ \marg{\glossentryname{#1}}%
+ }%
+ }%
+}
+
+\newcommand{\pkgnotefmt}[1]{#1}
+
+\newcommand*{\s@pkgdef}[2][]{%
+ \def\pkgtitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{pkg.#2}{\def\pkgtitle{\statussym}\def\postnote{\statustext}}{}%
+ \begin{pinnedbox}[title=\pkgtitle]
+ \let\GlsXtrStandaloneEntryName\pkgentryname
+ \def\styfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd[#1]{pkg.#2}{pkgdef}%
+ \glsxtrglossentry{pkg.#2}%
+ \glsxtrifhasfield*{note}{pkg.#2}%
+ {%
+ \ifx\pkgnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\pkgnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\clsdef}{\@ifstar\s@clsdef\@clsdef}
+\newcommand*{\@clsdef}[2][]{%
+ \pdfbookmark[\clsdefbookmarklevel]{\glsentryname{cls.#2}.sty}{clsdef.#2}%
+ \nopagebreak\s@clsdef[#1]{#2}%
+}
+
+\newcommand{\clsentryname}[1]{%
+ \createtarget{#1}%
+ {%
+ \texttt
+ {%
+ \csfmt{documentclass}%
+ \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+ \marg{\glossentryname{#1}}%
+ }%
+ }%
+}
+
+\newcommand*{\s@clsdef}[2][]{%
+ \def\clstitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{cls.#2}{\def\clstitle{\statussym}\def\postnote{\statustext}}{}%
+ \begin{pinnedbox}[title=\clstitle]
+ \let\GlsXtrStandaloneEntryName\clsentryname
+ \def\clsfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd[#1]{cls.#2}{clsdef}%
+ \glsxtrglossentry{cls.#2}%
+ \glsxtrifhasfield*{note}{cls.#2}%
+ {%
+ \ifx\pkgnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\pkgnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newcommand*{\defaultoptdefbookmarklevel}{\number\numexpr\currentcounterlevel+1 }
+\newcommand*{\optdefbookmarklevel}{\defaultoptdefbookmarklevel}
+
+\newrobustcmd*{\optiondef}{\@ifstar\s@optiondef\@optiondef}
+
+\newcommand*{\@optiondef}[1]{%
+ \glsifcategory{opt.#1}{commandoption}%
+ {%
+ \edef\optdefbookmarklevel{\number\numexpr\cmddefbookmarklevel+1 }%
+ }%
+ {%
+ \edef\optdefbookmarklevel{\defaultoptdefbookmarklevel}%
+ }%
+ \pdfbookmark[\optdefbookmarklevel]{\glsentryname{opt.#1}}{optdef.#1}%
+ \nopagebreak\s@optiondef{#1}%
+}
+
+\newcommand{\optnotefmt}[1]{#1}
+
+\newcommand*{\s@optiondef}[1]{%
+ \getinitordefval{opt.#1}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{opt.#1}%
+ {\appto\settingstitle{\statussym}\def\postnote{\statustext}}%
+ {}%
+ \begin{settingsbox}[title=\settingstitle,
+ colback=optiondefbackground,
+ colbacktitle=optiondefbackground
+ ]%
+ \def\optfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd{opt.#1}{optdef}\glsxtrglossentry{opt.#1}%
+ \glsxtrifhasfield{syntax}{opt.#1}{\texttt{=\glscurrentfieldvalue}}{}%
+ \ifdefempty\initordefval{}{\hfill\initordefval}%
+ \glsxtrifhasfield*{note}{opt.#1}%
+ {%
+ \ifx\optnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\optnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{settingsbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\optionvaldef}{\@ifstar\s@optionvaldef\@optionvaldef}
+
+\newcommand*{\@optionvaldef}[2]{%
+ \edef\optvaldefbookmarklevel{\number\numexpr\optdefbookmarklevel+1 }%
+ \pdfbookmark[\optvaldefbookmarklevel]{\glsentryname{optval.#1.#2}}{optvaldef.#1.#2}%
+ \nopagebreak\s@optionvaldef{#1}{#2}%
+}
+
+\newcommand*{\s@optionvaldef}[2]{%
+ \begin{settingsbox}[title={\glssymbol{sym.optionvalue}},
+ colback=optionvaluedefbackground,
+ colbacktitle=optionvaluedefbackground
+ ]%
+ \def\optfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd{optval.#1.#2}{optvaldef}%
+ \gls!{opt.#1}\dequals\glsxtrglossentry{optval.#1.#2}%
+ \ifnotdefaultstatus{optval.#1.#2}{\hfill\statussym}{}%
+ \glsxtrifhasfield{note}{optval.#1.#2}%
+ {%
+ \ifx\optnotefmt\@gobble
+ \else
+ \par\hfill\optnotefmt\glscurrentfieldvalue
+ \fi
+ }{}%
+ \end{settingsbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\inlineoptionvaldef}[2]{%
+ \bgroup
+ \ttfamily
+ \mainglsadd{optval.#1.#2}{optvaldef}%
+ \textbf{\glsxtrglossentry{optval.#1.#2}}%
+ \glsxtrifhasfield{syntax}{optval.#1.#2}{\dhyphen\glscurrentfieldvalue}{}%
+ \ifnotdefaultstatus{optval.#1.#2}{~\statussym}{}%
+ :\space
+ \glsxtrifhasfield{alias}{optval.#1.#2}%
+ {%
+ Synonym of \expandafter\glsfmtname\expandafter{\glscurrentfieldvalue}.%
+ }%
+ {%
+ \glossentrydesc{optval.#1.#2}\glspostdescription
+ \glsxtrifhasfield{seealso}{optval.#1.#2}%
+ {%
+ See also \glsxtrseelist{\glscurrentfieldvalue}.%
+ }%
+ {}%
+ }%
+ \egroup
+}
+
+\newcommand{\appnotefmt}[1]{#1}
+
+\newrobustcmd*{\appdef}[1]{%
+ \getinitordefval{app.#1}%
+ \def\postnote{}%
+ \begin{terminal}%
+ \def\appfmt##1{\textbf{##1}}%
+ \mainglsadd{app.#1}{appdef}\glsxtrglossentry{app.#1}%
+ \glsxtrifhasfield{syntax}{app.#1}{\space \glscurrentfieldvalue}{}%
+ \glsxtrifhasfield*{note}{app.#1}%
+ {%
+ \ifx\appnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\appnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{terminal}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\switchdef}[1]{%
+ \getinitordefval{switch.#1}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{switch.#1}%
+ {\appto\settingstitle{\statussym}\def\postnote{\statustext}}%
+ {}%
+ \begin{settingsbox}[title={\settingstitle}]%
+ \mainglsadd{switch.#1}{switchdef}\glsxtrglossentry{switch.#1}%
+ \glsxtrifhasfield{syntax}{switch.#1}{\space \glscurrentfieldvalue}{}%
+ \glsxtrifhasfield*{note}{switch.#1}%
+ {%
+ \ifx\switchnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\switchnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{settingsbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd{\mirrorsamplefile}[1]{%
+ \ctanmirrornofn{macros/latex/contrib/\thispackagename/\filedownloadsubpath/#1}{\nolinkurl{#1}}%
+}
+
+\newcommand{\filedownloadsubpath}{samples/}
+\newcommand{\filedownloadlink}[1]{\href{\nlctdownloadlink{\filedownloadsubpath #1}}{\faDownload}}
+\newcommand{\filetag}[1]{\faFileO\ifnlctdownloadlinks\filedownloadlink{#1}\fi\ }
+\newcommand*{\filedef}[1]{%
+ \par\medskip
+ \bgroup
+ \raggedright
+ \filetag{#1}%
+ \ttfamily
+ \mainglsadd{file.#1}{filedef}%
+ \glsxtrglossentry{file.#1}%
+ \egroup
+ \par\medskip\ignorespaces
+}
+
+\newrobustcmd*{\summarytagfmt}[1]{\textnormal{\em #1:} }
+
+\newcommand*{\getinitordefval}[1]{%
+ \let\currentsyntax\@empty
+ \def\settingstitle{\glssymbol{sym.valuesetting}}%
+ \def\initordefval{}%
+ \glsxtrifhasfield*{alias}{#1}%
+ {%
+ \edef\initordefval{\summarytagfmt{alias}%
+ \noexpand\gls{\expandonce\glscurrentfieldvalue}}%
+ }%
+ {}%
+ \glsxtrifhasfield*{syntax}{#1}%
+ {%
+ \let\currentsyntax\glscurrentfieldvalue
+ \glsxtrifhasfield*{defaultvalue}{#1}%
+ {%
+ \ifdefempty\initordefval{}{\appto\initordefval{; }}%
+ \eappto\initordefval{\summarytagfmt{default}%
+ \noexpand\optfmt{\expandonce\glscurrentfieldvalue}}%
+ }%
+ {}%
+ \glsxtrifhasfield*{initvalue}{#1}%
+ {%
+ \ifdefempty\initordefval{}{\appto\initordefval{; }}%
+ \eappto\initordefval{\summarytagfmt{initial}%
+ \noexpand\optfmt{\expandonce\glscurrentfieldvalue\relax}}%
+ \ifx\currentsyntax\metaboolean
+ \ifdefstring\glscurrentfieldvalue{true}
+ {%
+ \def\settingstitle{\glssymbol{sym.toggleonsetting}}%
+ }%
+ {%
+ \ifdefstring\glscurrentfieldvalue{false}
+ {%
+ \def\settingstitle{\glssymbol{sym.toggleoffsetting}}%
+ }%
+ {}%
+ }%
+ \fi
+ }%
+ {%
+ %\ifdefempty\initordefval{}{\appto\initordefval{; }}%
+ %\appto\initordefval{\textit{initial:} none}%
+ }%
+ }%
+ {\def\settingstitle{\glssymbol{sym.novaluesetting}}}%
+}
+
+\newcommand*{\ctrdefbookmarklevel}{\cmddefbookmarklevel}
+
+\newrobustcmd*{\ctrdef}{\@ifstar\s@ctrdef\@ctrdef}
+
+\newcommand*{\@ctrdef}[1]{%
+ \let\ctrdefbookmarklevel\cmddefbookmarklevel
+ \pdfbookmark[\ctrdefbookmarklevel]{#1}{ctrdef.#1}%
+ \nopagebreak\s@ctrdef{#1}%
+}
+
+\newcommand*{\s@ctrdef}[1]{%
+ \def\settingstitle{\glssymbol{sym.counter}}%
+ \ifnotdefaultstatus{ctr.#1}%
+ {\appto\settingstitle{\statussym}\def\postnote{\statustext}}%
+ {}%
+ \begin{pinnedbox}[title=\settingstitle]%
+ \def\ctrfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd{ctr.#1}{ctrdef}\glsxtrglossentry{ctr.#1}%
+ \glsxtrifhasfield*{note}{ctr.#1}%
+ {%
+ \ifx\cmdnotefmt\@gobble
+ \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+ \else
+ \par\hfill\cmdnotefmt\glscurrentfieldvalue
+ \ifdefempty\postnote{}{\preto\postnote{\space}}%
+ \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+% Defining .bib entries
+
+\newwrite\nlctuserguidebib
+
+\newcommand{\glsbibwriteentry}[3]{%
+ {%
+ \edef\dhyphen{\string-}\let\-\empty\let\dsb\empty
+ \protected@edef\entrylabel{#2}%
+ \let\dhyphen\empty\let\dsb\dunderscore
+ \immediate\write\nlctuserguidebib{@#1{\entrylabel#3}}%
+ }%
+}
+
+\newcommand{\glsbibwritefield}[2]{,^^J#1={\detokenize{#2}}}
+
+\glsaddstoragekey{modifiers}{}{\modifiers}
+\glsaddstoragekey{syntax}{}{\syntax}
+\glsaddstoragekey{defaultvalue}{}{\optdefval}
+\glsaddstoragekey{initvalue}{}{\optinitval}
+\glsaddstoragekey{status}{default}{\entrystatus}
+\glsaddstoragekey{note}{}{\note}
+\glsaddstoragekey{providedby}{}{\providedbyinfo}
+\glsaddstoragekey{pdftitlecasename}{}{\pdftitlecasename}
+
+\glsaddstoragekey{defaultkeys}{}{\defaultkeys}
+
+\renewcommand{\glslinkpresetkeys}{%
+ \glsxtrifhasfield*{defaultkeys}{\glslabel}
+ {\expandafter\setupglslink\expandafter{\glscurrentfieldvalue}}%
+ {}%
+}
+
+\newcommand{\conditionsyntax}{ \meta{true}\csfmt{else} \meta{false}\csfmt{fi}}
+
+\newrobustcmd{\initvalnotefmt}[1]{\textrm{\em #1}}
+
+\newcommand*{\nlctuserguidegls}[2][]{%
+ \bgroup
+ \let\field\glsbibwritefield
+ \def\common{\field{defaultkeys}{format=glsignore}}%
+ \def\syntax{\glsbibwritefield{syntax}}%
+ \def\parent{\glsbibwritefield{parent}}%
+ \def\inpackage##1{\glsbibwritefield{parent}{pkg.##1}}%
+ \def\inclass##1{\glsbibwritefield{parent}{cls.##1}}%
+ \def\inapp##1{\glsbibwritefield{parent}{app.##1}}%
+ \def\providedby{\glsbibwritefield{providedby}}%
+ \def\name{\glsbibwritefield{name}}%
+ \def\desc{\glsbibwritefield{description}}%
+ \def\defval{\glsbibwritefield{defaultvalue}}%
+ \def\initval{\glsbibwritefield{initvalue}}%
+ \def\initvalvaries{\glsbibwritefield{initvalue}{\initvalnotefmt{varies}}}%
+ \def\initvalempty{\glsbibwritefield{initvalue}{\initvalnotefmt{empty}}}%
+ \def\note{\glsbibwritefield{note}}%
+ \def\deprecated{\glsbibwritefield{status}{deprecated}}%
+ \def\banned{\glsbibwritefield{status}{banned}}%
+ \def\deprecatedbanned{\glsbibwritefield{status}{deprecatedbanned}}%
+ \def\gpunc##1##2{\glsbibwriteentry{punctuation}{idx.##1}{##2}}%
+ \def\gidx##1##2{\glsbibwriteentry{index}{idx.##1}{\field{name}{##1}##2}}%
+ \def\gidxpl##1##2{\glsbibwriteentry{indexplural}{idx.##1}{\field{text}{##1}##2}}%
+ \def\gfile##1##2{\glsbibwriteentry{file}{file.##1}{\field{name}{\filefmt{##1}}##2}}%
+ \def\gfilemeta##1##2##3##4{\glsbibwriteentry{file}{file.##1##2##3}{\field{name}{\metafilefmt{##1}{##2}{##3}}##4}}%
+ \def\gfilemetameta##1##2##3##4##5##6{\glsbibwriteentry{file}{file.##1##2##3##4##5}{\field{name}{\metametafilefmt{##1}{##2}{##3}{##4}{##5}}##6}}%
+ \def\gext##1##2{\glsbibwriteentry{fileformat}{ext.##1}{\field{parent}{fileformat}\field{name}{\extfmt{##1}}##2}}%
+ \def\gcmd##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}##2}}%
+ \def\gcond##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\syntax{\conditionsyntax}##2}}%
+ \def\gcmdmeta##1##2##3##4{\glsbibwriteentry{command}{##1##2##3}{\field{name}{\csmetafmt{##1}{##2}{##3}}##4}}%
+ \def\gcmdmetameta##1##2##3##4##5##6{\glsbibwriteentry{command}{##1##2##3##4##5}{\field{name}{\csmetametafmt{##1}{##2}{##3}{##4}{##5}}##6}}%
+ \def\gmod##1##2{\glsbibwriteentry{punctuation}{idx.mod.##1}{##2}}%
+ \def\gcmds##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\field{modifiers}{*}##2}}%
+ \def\gcmdsp##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\field{modifiers}{*,+}##2}}%
+ \def\gpunccmd##1##2##3{\glsbibwriteentry{punctuation}{##1}{\field{name}{\csfmt{##2}}##3}}%
+ \def\gpkg##1##2{\glsbibwriteentry{package}{pkg.##1}{\field{name}{\styfmt{##1}}##2}}%
+ \def\gcls##1##2{\glsbibwriteentry{class}{cls.##1}{\field{name}{\clsfmt{##1}}##2}}%
+ \def\genv##1##2{\glsbibwriteentry{environment}{env.##1}{\field{name}{\envfmt{##1}}##2}}%
+ \def\gctr##1##2{\glsbibwriteentry{counter}{ctr.##1}{\field{name}{\ctrfmt{##1}}##2}}%
+ \def\gopt##1##2{\glsbibwriteentry{option}{opt.##1}{\field{name}{\optfmt{##1}}##2}}%
+ \def\gcsopt##1##2{\glsbibwriteentry{commandoption}{opt.##1}{\field{name}{\csoptfmt{##1}}##2}}%
+ \def\gcsboolopt##1##2{\glsbibwriteentry{commandoption}{opt.##1}%
+ {\field{name}{\csoptfmt{##1}}\syntax{\meta{boolean}}\defval{true}##2}}%
+ \def\gstyopt##1##2{\glsbibwriteentry{packageoption}{opt.##1}{\field{name}{\styoptfmt{##1}}##2}}%
+ \def\gstyboolopt##1##2{\glsbibwriteentry{packageoption}{opt.##1}%
+ {\field{name}{\styoptfmt{##1}}\syntax{\meta{boolean}}\defval{true}##2}}%
+ \def\gclsopt##1##2{\glsbibwriteentry{classoption}{opt.##1}{\field{name}{\clsoptfmt{##1}}##2}}%
+ \def\gclsboolopt##1##2{\glsbibwriteentry{classoption}{opt.##1}%
+ {\field{name}{\clsoptfmt{##1}}\syntax{\meta{boolean}}\defval{true}##2}}%
+ \def\goptval##1##2##3{\glsbibwriteentry{optionvalue}{optval.##1.##2}{\field{name}{\optfmt{##2}}\field{parent}{opt.##1}##3}}%
+ \def\goptmetaval##1##2##3{\glsbibwriteentry{optionvalue}{optval.##1.##2}{\field{name}{\meta{##2}}\field{parent}{opt.##1}##3}}%
+ \def\gapp##1##2{\glsbibwriteentry{application}{app.##1}{\field{name}{\appfmt{##1}}##2}}%
+ \def\glongswitch##1##2{\glsbibwriteentry{switch}{switch.##1}{\field{name}{\longargfmt{##1}}##2}}%
+ \def\gshortswitch##1##2{\glsbibwriteentry{switch}{switch.##1}{\field{name}{\shortargfmt{##1}}##2}}%
+ \def\gterm{\glsbibwriteentry{term}}%
+ \def\gtermabbr##1##2##3##4{\glsbibwriteentry{termabbreviation}%
+ {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+ \def\gtermacr##1##2##3##4{\glsbibwriteentry{termacronym}%
+ {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+ \def\gabbr##1##2##3##4{\glsbibwriteentry{dualindexabbreviation}%
+ {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+ \def\gacr##1##2##3##4{\glsbibwriteentry{acronym}%
+ {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+ \immediate\openout\nlctuserguidebib=\jobname-gls.bib\relax
+ \immediate\write\nlctuserguidebib{\glspercentchar\space Encoding: UTF-8}
+ \immediate\write\nlctuserguidebib{@preamble{"\string\providecommand*{\string\csfmt}[1]{\string\glsbackslash\string\glsbackslash\glshashchar1}^^J
+ \string\providecommand{\string\dhyphen}{-}"}}
+ \immediate\write\nlctuserguidebib{\symboldefinitions}
+ \glsbibwriteentry{indexplural}{fileformat}{\glsbibwritefield{text}{file format}}
+ #2%
+ \immediate\closeout\nlctuserguidebib
+ \egroup
+ \nlctuserguideloadgls{#1}%
+}
+
+\glsdefpostdesc{dualindexabbreviation}{.}
+
+% Abbreviations with a description:
+\setabbreviationstyle[termabbreviation]{long-short-desc}
+% Common abbreviations (no full form on first use) with a description:
+\setabbreviationstyle[termacronym]{short-nolong-desc}
+
+\renewcommand{\glsxtrshortdescname}{%
+ \protect\glslongfont{\the\glslongtok}%
+ \protect\glsxtrfullsep{\the\glslabeltok}%
+ \protect\glsxtrparen{\protect\glsabbrvfont{\the\glsshorttok}}%
+}
+
+\newcommand{\nlctuserguidecustomentryaliases}{}
+
+\newcommand{\nlctuserguideignoredpuncrules}{%
+ \glshex 00AD\string;% soft hyphen
+ \glshex 2010\string;% hyphen
+ \glshex 2011\string;% non-breaking hyphen
+ \glshex 2012\string;% figure dash
+ \glshex 2013\string;% en dash
+ \glshex 2014\string;% em dash
+ \glshex 2015\string;% horizontal bar
+ \glshex 2212\string=\glshex 207B\string=\glshex 208B% minus sign
+ \string;\string'\glshex 005C\string'% backslash
+}
+
+% ASCII hyphen in non-ignored subset:
+
+\newcommand{\nlctuserguidepuncrules}{%
+ \glsxtrgeneralpuncmarksrules
+ \string<\glsxtrgeneralpuncaccentsrules
+ \string<\glsxtrgeneralpuncquoterules
+ \string<\glsxtrgeneralpuncbracketrules
+ \string<\glshex 00A7% section sign
+ \string<\glshex 00B6% pilcrow sign
+ \string<\glshex 00A9% copyright sign
+ \string<\glshex 00AE% registered sign
+ \string<\glsxtrcurrencyrules
+ \string< \string'\glshex 002A\string'% asterisk
+ \string<\string'\glshex 0026\string'% ampersand
+ \string<\string'\glshex 0023\string'% hash sign
+ \string<\string'\glshex 0025\string'% percent sign
+ \string<\string'\string-\string'% ASCII hyphen
+ \string<\string'\glshex 002B\string'% plus sign
+ \string=\glshex 207A\string=\glshex 208A% super/subscript plus sign
+ \string<\glshex 00B1% plus-minus sign
+ \string<\glshex 00F7% division sign
+ \string<\glshex 00D7% multiplication sign
+ \string<\string'\glshex 003C\string'% less-than sign
+ \string<\string'\glshex 003D\string'% equals sign
+ \string<\string'\glshex 003E\string'% greater-than sign
+ \string<\glshex 00AC% not sign
+ \string<\string'\glshex 007C\string'% vertical bar (pipe)
+ \string<\glshex 00A6% broken bar
+ \string<\glshex 00B0% degree sign
+ \string<\glshex 00B5% micron sign
+}
+\newcommand{\nlctuserguidepreletterrules}{\string<\string'\glshex 0040\string'}
+\newcommand{\nlctuserguideletterrules}{\glsxtrGeneralLatinIrules}
+\newcommand{\nlctuserguideextrarules}{\string< \glsxtrMathItalicGreekIrules}
+
+\newcommand{\nlctuserguideloadgls}[1]{%
+ \GlsXtrLoadResources[src=\jobname-gls,
+ break-at-not-match={original entrytype=(punctuation|command)},
+ sort={custom},
+ sort-rule={\glsxtrIgnorableRules
+ ;\glsxtrcombiningdiacriticrules
+ ;\nlctuserguideignoredpuncrules
+ \string< \nlctuserguidepuncrules
+ \string< \glshex 2423 % visible space
+ \string< \glsxtrdigitrules
+ \string< \glsxtrfractionrules
+ \nlctuserguidepreletterrules
+ \string< \nlctuserguideletterrules
+ \nlctuserguideextrarules},
+ selection={recorded and deps and see not also},
+ entry-type-aliases={
+ commandoption=index,
+ packageoption=index,
+ classoption=index,
+ term=dualindexentry,
+ termabbreviation=dualindexabbreviation,
+ termacronym=dualindexabbreviation,
+ fileformat=index,
+ file=index,
+ command=index,
+ package=index,
+ class=index,
+ environment=index,
+ counter=index,
+ option=index,
+ optionvalue=index,
+ application=index,
+ switch=index,
+ punctuation=symbol,
+ icon=symbol,
+ \nlctuserguidecustomentryaliases
+ },
+ replicate-fields={name=pdftitlecasename},
+ replicate-missing-field-action={fallback},
+ interpret-fields={pdftitlecasename},
+ field-case-change={pdftitlecasename=title},
+ category={same as original entry},
+ dual-category={same as primary},
+ combine-dual-locations={primary},
+ type=index,dual-type=main,
+ dual-field,
+ primary-location-formats=mainfmt,
+ save-primary-locations=retain,
+ primary-loc-counters=match,
+ save-loclist=false,
+ post-description-dot=check,
+ description-case-change=firstuc,
+ loc-counters={chapter,section,subsection,subsubsection,page,figure,table,wrglossary},
+ save-child-count,save-root-ancestor,
+ symbol-sort-fallback=name,
+ not-match={original entrytype=icon},
+ #1
+ ]%
+ \GlsXtrLoadResources[src=\jobname-gls,
+ entry-type-aliases={icon=symbol},
+ unknown-entry-alias={index},
+ match={original entrytype=icon},
+ description-case-change=firstuc,
+ post-description-dot=check,
+ save-locations=false,
+ type=symbols,
+ symbol-sort-fallback=name]
+}
+
+% Glossaries, index, summaries etc
+
+\newcommand{\statusdeprecatedsym}{\glssymbol{sym.deprecated}}
+\newcommand{\statusdeprecatedtext}{\glstext{sym.deprecated}}
+\newcommand{\statusbannedsym}{\glssymbol{sym.banned}}
+\newcommand{\statusbannedtext}{\glstext{sym.banned}}
+\newcommand{\statusdeprecatedbannedsym}{\statusdeprecatedsym\statusbannedsym}
+\newcommand{\statusdeprecatedbannedtext}{\statusdeprecatedtext\ \statusbannedtext}
+\newcommand{\statusdefaultsym}{}
+\newcommand{\statusdefaulttext}{}
+\newcommand{\statussym}{}
+\newcommand{\statustext}{}
+
+\newcommand{\ifnotdefaultstatus}[3]{%
+ \protected@edef\currentstatus{\entrystatus{#1}}%
+ \letcs\statussym{status\currentstatus sym}%
+ \letcs\statustext{status\currentstatus text}%
+ \ifglsentryexists{#1}%
+ {\ifdefstring\currentstatus{default}{#3}{#2}}%
+ {#3}%
+}
+
+\newcommand*{\statushook}[1]{\ifnotdefaultstatus{#1}{~\statussym}{}}
+
+\newcommand*{\setwidestnamehook}[1]{%
+ \ifglshasparent{#1}{}%
+ {%
+ \settowidth{\dimen@}{\glstreenamefmt{\glsentryname{#1}\quad}}%
+ \ifdim\dimen@>\gls@tmplen
+ \gls@tmplen=\dimen@
+ \eglssetwidest{\glsentryname{#1}\quad}%
+ \fi
+ }%
+ \advance\totalterms by 1\relax
+}
+
+\newcommand*{\settermshook}[1]{%
+ \advance\totalterms by 1\relax
+ \eglsupdatewidest{\glsentryname{#1}}%
+}
+
+\newcommand*{\printabbrs}[1][]{%
+ \glsxtrifemptyglossary{abbreviations}{}%
+ {%
+ \printunsrtglossary*
+ [type=abbreviations,style=alttree,title=\abbreviationsname,label=abbreviations,nonumberlist,#1]%
+ {%
+ \gls@tmplen=0pt\relax
+ \totalterms=0\relax
+ \glssetwidest{}%
+ \let\printunsrtglossaryentryprocesshook\settermshook
+ \def\printunsrtglossarypredoglossary{\entrycountprehook\totalterms}%
+ \let\glsextrapostnamehook\glsaddterm
+ }%
+ }%
+}
+
+\newcommand{\printicons}{\printunsrtglossary[type=symbols,style=long-sym-desc,groups=false,label=symbols]}
+
+\newcount\totalterms
+
+\newcommand{\termslocfmt}[1]{\hyperit{#1}}
+\newcommand{\glsaddterm}[1]{\glsadd[format=termslocfmt]{#1}}
+
+\newcommand*{\printterms}[1][]{%
+ \ifglossaryexists{abbreviations}{\printabbrs}{}%
+ \glsxtrifemptyglossary{symbols}{}{\printicons}%
+ \glsxtrifemptyglossary{main}{}%
+ {
+ \printunsrtglossary*[style=topic,nonumberlist,label=glossary,#1]%
+ {%
+ \gls@tmplen=0pt\relax
+ \totalterms=0\relax
+ \glssetwidest{}%
+ \let\printunsrtglossaryentryprocesshook\settermshook
+ \def\printunsrtglossarypredoglossary{\entrycountprehook\totalterms}%
+ \glssetcategoryattribute{term}{glossname}{firstuc}%
+ \glssetcategoryattribute{termabbreviation}{glossname}{firstuc}%
+ \let\glstopicMarker\glsaddterm
+ }%
+ }%
+}
+
+%\newcommand{\bibglsprimary}[2]{%
+ %\ifcase #1\or p.~\else pp.~\fi
+ %#2%
+%}
+
+\newcommand{\seclocfmt}[2]{#1}
+
+\newcommand{\glsxtrchapterlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsectionlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsubsectionlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsubsubsectionlocfmt}{\seclocfmt}
+\newcommand{\glsxtrparagraphlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsubparagraphlocfmt}{\seclocfmt}
+
+\newcommand{\glsxtrtablelocfmt}{\seclocfmt}
+\newcommand{\glsxtrfigurelocfmt}{\seclocfmt}
+
+\newcommand*{\locationgroupmarkerchapter}{\S}
+\newcommand*{\locationgroupmarkersection}{\S}
+\newcommand*{\locationgroupmarkersubsection}{\S}
+\newcommand*{\locationgroupmarkersubsubsection}{\S}
+\newcommand*{\locationgroupmarkerparagraph}{\S}
+\newcommand*{\locationgroupmarkersubparagraph}{\S}
+
+\newcommand*{\locationgroupmarkertable}{\tablename~}
+\newcommand*{\locationgroupmarkerfigure}{\figurename~}
+
+\newcommand*{\locationgroupmarkerpage}{p.~}
+\newcommand*{\locationgroupmarkerpages}{pp.~}
+
+\newcommand{\bibglslocationgroupsep}{; }
+
+\newcommand{\locationgroupencapchapter}[1]{\textcolor{teal}{\bfseries#1}}
+\newcommand{\locationgroupencapsection}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapsubsection}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapsubsubsection}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapparagraph}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapsubparagraph}{\locationgroupencapchapter}
+
+\newcommand{\bibglslocationgroup}[3]{%
+ \csuse{locationgroupencap#2}%
+ {%
+ \ifcsdef{locationgroupmarker#2}%
+ {\ifcase#1
+ \or
+ \csuse{locationgroupmarker#2}%
+ \else
+ \ifcsdef{locationgroupmarker#2s}%
+ {\csuse{locationgroupmarker#2s}}%
+ {%
+ \csuse{locationgroupmarker#2}%
+ \csuse{locationgroupmarker#2}%
+ }%
+ \fi
+ }%
+ {}%
+ #3%
+ }%
+}
+
+\newcommand{\summaryentrypackagebookmark}[2]{%
+ \expandafter\pdfbookmark\expandafter[#1]{\glsentryname{#2}}{summary.#2}%
+}
+
+\newcommand{\summaryentryclassbookmark}[2]{%
+ \expandafter\pdfbookmark\expandafter[#1]{\glsentryname{#2}}{summary.#2}%
+}
+
+\newcommand{\summaryentrypackage}[1]{%
+ \let\styfmt\texttt
+ \csfmt{usepackage}%
+ \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+ \marg{\textbf{\linkedentryname{#1}}}%
+}
+
+\newcommand{\summaryentryclass}[1]{%
+ \let\clsfmt\texttt
+ \csfmt{documentclass}%
+ \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+ \marg{\textbf{\linkedentryname{#1}}}
+}
+
+\newcommand{\summaryentryenvironment}[1]{%
+ \let\envfmt\texttt
+ \csfmt{begin}\marg{\textbf{\linkedentryname{#1}}}%
+ \syntax{#1}%
+ \gathermodifiers{#1}%
+ \ifdefempty\nlctmodifierlist{}
+ {%
+ \hfill\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist
+ \gdef\summaryentry@post@fill{\quad }%
+ }%
+}
+
+\newcommand{\summaryentrycommand}[1]{%
+ \textbf{\linkedentryname{#1}}%
+ \syntax{#1}%
+ \glsxtrifhasfield{initvalue}{#1}%
+ {%
+ \hfill\summarytagfmt{initial}\glscurrentfieldvalue
+ \gdef\summaryentry@post@fill{\quad }%
+ }%
+ {%
+ \gathermodifiers{#1}%
+ \ifdefempty\nlctmodifierlist{}%
+ {%
+ \hfill\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist
+ \gdef\summaryentry@post@fill{\quad }%
+ }%
+ }%
+}
+
+\newcommand{\summaryentrypackageoption}{\summaryentryoption}
+\newcommand{\summaryentryclassoption}{\summaryentryoption}
+\newcommand{\summaryentrycommandoption}{\summaryentryoption}
+\newcommand{\summaryentryenvironmentoption}{\summaryentryoption}
+
+\newcommand{\genericsummaryentryoption}[2][]{%
+ \getinitordefval{#2}%
+ \def\optiontag{#1}%
+ \textbf{\linkedentryname{#2}}%
+ \ifdefempty\currentsyntax{}{\dequals\currentsyntax}%
+ \hfill
+ \textrm{\ifdefempty\initordefval{}{\initordefval}%
+ \ifdefempty\optiontag{}{ \optiontag}}%
+ \gdef\summaryentry@post@fill{ }%
+}
+
+\newcommand{\summaryentryoption}[1]{%
+ \getinitordefval{#1}%
+ \textbf{\linkedentryname{#1}}%
+ \ifdefempty\currentsyntax{}{\dequals\currentsyntax}%
+ \hfill
+ \textrm{\ifdefempty\initordefval{}{\initordefval}%
+ \ifdefempty\settingstitle{}{ \settingstitle}}%
+ \gdef\summaryentry@post@fill{ }%
+}
+
+\newcommand{\summaryentryoptionvalue}[1]{%
+ \glsxtrifhasfield{parent}{#1}{\glsentrytext{\glscurrentfieldvalue}\dequals}{}%
+ \textbf{\linkedentryname{#1}}%
+}
+
+\newcommand{\summarylocfmt}[1]{\hyperit{#1}}
+\newcommand{\summarysubitemindent}{3em}
+\newcommand{\providedbyfmt}[1]{\textsf{\footnotesize \mbox{#1}}}
+
+\newif\ifshowsummarytopgroupheaders
+\showsummarytopgroupheaderstrue
+
+\newif\ifshowsummarysubgroupheaders
+\showsummarysubgroupheaderstrue
+
+\newcommand*{\summarynotefmt}[1]{{\small(#1)}}
+
+\newcommand{\summaryentryskip}{\par\bigskip\par}
+
+\newcommand{\summarypredesc}{%
+ \nopagebreak\summarypar\nopagebreak
+}
+
+\newcommand{\rootsummarypar}{\par}
+\newcommand{\childsummarypar}{\par}
+
+\newglossarystyle{summary}
+{%
+ \renewenvironment{theglossary}%
+ {\setlength{\parindent}{0pt}%
+ \setlength{\parskip}{0pt plus 0.3pt}%
+ \raggedbottom
+ \def\entryskip{\def\entryskip{\summaryentryskip}}%
+ \ifdefstring{\@@glossarysec}{chapter}%
+ {%
+ \hypersetup{bookmarksdepth=2}%
+ \ifnum\c@secnumdepth>0\relax
+ \setcounter{secnumdepth}{0}%
+ \fi
+ \ifnum\c@tocdepth>0\relax
+ \setcounter{tocdepth}{0}%
+ \fi
+ \def\summarysec{\section}%
+ \def\summarysecnumdepth{0}%
+ \ifshowsummarytopgroupheaders
+ \def\summarysubsec{\subsection}%
+ \def\summarysubsecnumdepth{1}%
+ \else
+ \def\summarysubsec{\section}%
+ \def\summarysubsecnumdepth{0}%
+ \fi
+ }%
+ {%
+ \hypersetup{bookmarksdepth=3}%
+ \ifnum\c@secnumdepth>1\relax
+ \setcounter{secnumdepth}{1}%
+ \fi
+ \ifnum\c@tocdepth>1\relax
+ \setcounter{tocdepth}{1}%
+ \fi
+ \def\summarysec{\subsection}%
+ \def\summarysecnumdepth{1}%
+ \ifshowsummarytopgroupheaders
+ \def\summarysubsec{\subsubsection}%
+ \def\summarysubsecnumdepth{2}%
+ \else
+ \def\summarysubsec{\subsection}%
+ \def\summarysubsecnumdepth{1}%
+ \fi
+ }%
+ \let\summary@hasgroupheading\@secondoftwo
+ \let\summary@hassubgroupheading\@secondoftwo
+ }%
+ {\par}%
+ \renewcommand*{\glossaryheader}{}%
+ \renewcommand*{\glsgroupheading}[1]{%
+ \ifshowsummarytopgroupheaders
+ \glsxtrgetgrouptitle{##1}{\glsxtr@grptitle}%
+ \summarysec[\texorpdfstring{\glossarytoctitle: \glsxtr@grptitle}{\glsxtr@grptitle}]{\glsxtr@grptitle}%
+ \label{summary.##1}%
+ \def\entryskip{\def\entryskip{\summaryentryskip}}%
+ \let\summary@hasgroupheading\@firstoftwo
+ \else
+ \let\summary@hasgroupheading\@secondoftwo
+ \fi
+ }%
+ \renewcommand*{\glssubgroupheading}[4]{%
+ \let\summary@hassubgroupheading\@secondoftwo
+ \ifshowsummarysubgroupheaders
+ \ifnum##2=1\relax
+ \glsxtrgetgrouptitle{##4}{\glsxtr@grptitle}%
+ \summarysubsec[\texorpdfstring{\glossarytoctitle: \glsxtr@grptitle}{\glsxtr@grptitle}]{\glsxtr@grptitle}%
+ \def\entryskip{\def\entryskip{\summaryentryskip}}%
+ \let\summary@hassubgroupheading\@firstoftwo
+ \fi
+ \fi
+ }%
+ \renewcommand*{\glossentry}[2]{\subglossentry{0}{##1}{##2}}%
+ \renewcommand{\subglossentry}[3]{%
+ \def\initordefval{}%
+ \edef\@this@category{\glscategory{##2}}%
+ \entryskip
+ \par\allowbreak
+ \def\summaryentry@post@fill{\hfill}%
+ \ifnum##1=0\relax
+ \ifcsdef{summaryentry\@this@category bookmark}%
+ {%
+ \summary@hasgroupheading
+ {\edef\@summary@bookmarklevel{\the\numexpr\summarysecnumdepth+2}}%
+ {\edef\@summary@bookmarklevel{\the\numexpr\summarysecnumdepth+1}}%
+ \csuse{summaryentry\@this@category bookmark}{\@summary@bookmarklevel}{##2}%
+ }%
+ {}%
+ \else
+ \ifnum##1=1\relax
+ \ifcsdef{summaryentry\@this@category bookmark}%
+ {%
+ \summary@hassubgroupheading
+ {\edef\@summary@bookmarklevel{\the\numexpr\summarysubsecnumdepth+2}}%
+ {\edef\@summary@bookmarklevel{\the\numexpr\summarysubsecnumdepth+1}}%
+ \csuse{summaryentry\@this@category bookmark}{\@summary@bookmarklevel}{##2}%
+ }%
+ {}%
+ \fi
+ \fi
+ \def\summarypar{\rootsummarypar}%
+ \ifnum##1=0\relax
+ \ifstrempty{##3}%
+ {\let\summary@do@loc\@empty}%
+ {\edef\summary@do@loc{\noexpand\makebox[0pt][l]{\noexpand\rule{\the\textwidth}{0pt}\unexpanded{\summaryloc{##3}}}}}%
+ \begin{defnbox}\summary@do@loc
+ \glsadd[format=summarylocfmt]{##2}%
+ \ifnotdefaultstatus{##2}{\statussym~}{}%
+ \texttt
+ {%
+ \ifcsdef{summaryentry\@this@category}
+ {%
+ \csuse{summaryentry\@this@category}{##2}%
+ }%
+ {%
+ \textbf{\linkedentryname{##2}}%
+ \syntax{##2}%
+ }%
+ }%
+ \glsxtrifhasfield*{providedby}{##2}%
+ {\summaryentry@post@fill\providedbyfmt{\glscurrentfieldvalue}%
+ \def\summaryentry@post@fill{\linebreak[1]\hfill}%
+ }%
+ {}%
+ \glsxtrifhasfield{note}{##2}%
+ {\summaryentry@post@fill\summarynotefmt\glscurrentfieldvalue}{}%
+ \end{defnbox}%
+ \else
+ \ifnum##1>1\relax
+ \hangindent\summarysubitemindent\relax
+ \parindent\summarysubitemindent\relax
+ \def\summarypar{\childsummarypar\hangindent\summarysubitemindent\relax
+ \parindent\summarysubitemindent\relax}%
+ \fi
+ \glsadd[format=summarylocfmt]{##2}%
+ \texttt
+ {%
+ \ifcsdef{summaryentry\@this@category}
+ {%
+ \csuse{summaryentry\@this@category}{##2}%
+ }%
+ {%
+ \textbf{\linkedentryname{##2}}%
+ \syntax{##2}%
+ }%
+ }%
+ \ifstrempty{##3}{}{\marginpar{\summaryloc{##3}}}%
+ \glsxtrifhasfield*{alias}{##2}%
+ {%
+ \summaryentry@post@fill
+ \summarytagfmt{alias}%
+ \expandafter\glsfmtname\expandafter{\glscurrentfieldvalue}%
+ \let\summaryentry@post@fill\space
+ }%
+ {}%
+ \ifnotdefaultstatus{##2}%
+ {\summaryentry@post@fill
+ \glsxtrifhasfield{useri}{##2}{\glscurrentfieldvalue~}{}\statussym
+ }%
+ {\glsxtrifhasfield{useri}{##2}{\summaryentry@post@fill\glscurrentfieldvalue}{}}%
+ \glsxtrifhasfield{note}{##2}{\summarypar\hfill\summarynotefmt\glscurrentfieldvalue}{}%
+ \fi
+ \summarypredesc
+ \glossentrydesc{##2}\glspostdescription
+ \par
+ \hangindent0pt\parindent0pt\relax
+ }%
+ \renewcommand*{\glsgroupskip}{}%
+}
+
+\newcount\totalcmds
+\newcount\totalenvs
+\newcount\totalpkgopts
+\newcount\totalclsopts
+
+\newcommand*{\summaryhook}[1]{%
+ \def\summaryhookdoskip{\printunsrtglossaryskipentry}%
+ \glsifcategory{#1}{command}%
+ {\ifglshasdesc{#1}{\advance\totalcmds by 1\relax\let\summaryhookdoskip\relax}{}}%
+ {%
+ \glsifcategory{#1}{environment}%
+ {%
+ \ifglshasdesc{#1}%
+ {\global\advance\totalenvs by 1\glsxtrcopytoglossary*{#1}{envlist}}%
+ {}%
+ }%
+ {%
+ \glsifcategory{#1}{packageoption}%
+ {%
+ \ifglshasdesc{#1}%
+ {%
+ \global\advance\totalpkgopts by 1\relax
+ \glsxtrifhasfield{parent}{#1}%
+ {%
+ \GlsXtrIfInGlossary{\glscurrentfieldvalue}{pkgoptlist}{}%
+ {\glsxtrcopytoglossary*{\glscurrentfieldvalue}{pkgoptlist}}%
+ }%
+ {}%
+ \glsxtrcopytoglossary*{#1}{pkgoptlist}%
+ }%
+ {}%
+ }%
+ {%
+ \glsifcategory{#1}{classoption}%
+ {%
+ \ifglshasdesc{#1}%
+ {%
+ \global\advance\totalclsopts by 1\relax
+ \glsxtrifhasfield{parent}{#1}%
+ {%
+ \GlsXtrIfInGlossary{\glscurrentfieldvalue}{clsoptlist}{}%
+ {\glsxtrcopytoglossary*{\glscurrentfieldvalue}{clsoptlist}}%
+ }%
+ {}%
+ \glsxtrcopytoglossary*{#1}{clsoptlist}%
+ }%
+ {}%
+ }%
+ {%
+ \glsifcategory{#1}{optionvalue}%
+ {%
+ \glsxtrifhasfield{parent}{#1}%
+ {%
+ \let\@currentparent\glscurrentfieldvalue
+ \GlsXtrIfInGlossary{\@currentparent}{clsoptlist}%
+ {\glsxtrcopytoglossary*{#1}{clsoptlist}}%
+ {%
+ \GlsXtrIfInGlossary{\@currentparent}{pkgoptlist}%
+ {\glsxtrcopytoglossary*{#1}{pkgoptlist}}%
+ {%
+ \GlsXtrIfInGlossary{\@currentparent}{envlist}%
+ {\glsxtrcopytoglossary*{#1}{envlist}}%
+ {%
+ \glsifcategory{\@currentparent}{command}%
+ {\ifglshasdesc{#1}{\let\summaryhookdoskip\relax}{}}{}%
+ }%
+ }%
+ }%
+ }%
+ {}%
+ }%
+ {}%
+ }%
+ }%
+ }%
+ }%
+ \summaryhookdoskip
+}
+
+\newcommand{\entrycountprehook}[1]{%
+ \ifnum#1<21\relax
+ \let\glsgroupheading\@gobble
+ \glsnogroupskiptrue
+ \fi
+}
+
+\provideignoredglossary{envlist}%
+\provideignoredglossary{pkgoptlist}%
+\provideignoredglossary{clsoptlist}%
+
+\newcommand*{\printsummary}{%
+ {%
+ \renewcommand{\GlsXtrLocationField}{primarylocations}%
+ \let\printunsrtglossaryentryprocesshook\summaryhook
+ \def\printunsrtglossarypredoglossary{\entrycountprehook\totalcmds}%
+ \printunsrtglossary[type=index,style=summary,title=Command Summary,
+ label={cmdsummary}]%
+ % Environment list
+ \let\printunsrtglossaryentryprocesshook\@gobble
+ \def\printunsrtglossarypredoglossary{\entrycountprehook\totalenvs}%
+ \glsxtrifemptyglossary{envlist}{}%
+ {\printunsrtglossary[type=envlist,style=summary,title=Environment Summary,
+ label={envsummary}]}%
+ % Class option list
+ \def\printunsrtglossarypredoglossary{\entrycountprehook\totalclsopts}%
+ \glsxtrifemptyglossary{clsoptlist}{}%
+ {\printunsrtglossary*[type=clsoptlist,style=summary,title=Class Option Summary,
+ label={clsoptsummary}]%
+ {\showsummarytopgroupheadersfalse}%
+ }%
+ % Package option list
+ \def\printunsrtglossarypredoglossary{\entrycountprehook\totalpkgopts}%
+ \glsxtrifemptyglossary{pkgoptlist}{}%
+ {\printunsrtglossary*[type=pkgoptlist,style=summary,title=Package Option Summary,
+ label={styoptsummary}]%
+ {\showsummarytopgroupheadersfalse}%
+ }%
+ }%
+}
+
+\newcommand*{\printcommandoptionsprocesshook}[2]{%
+ \ifdefstring#2{#1}%
+ {}%
+ {%
+ \glsxtrifhasfield*{rootancestor}{#2}%
+ {\ifdefstring\glscurrentfieldvalue{#1}{}{\printunsrtglossaryskipentry}}%
+ {\printunsrtglossaryskipentry}%
+ }%
+}
+
+\newcommand*{\printcommandoptions}[2][]{%
+ \glsdoifexistsorwarn{#2}%
+ {%
+ \printunsrtglossary*[type=index,style=summary,nogroupskip,
+ label={#2-options},
+ title={\glsentryname{#2} Options},
+ #1]%
+ {%
+ \renewcommand{\GlsXtrLocationField}{primarylocations}%
+ \def\printunsrtglossaryentryprocesshook{\printcommandoptionsprocesshook{#2}}%
+ \def\printunsrtglossarypredoglossary{\let\glsgroupheading\@gobble}%
+ }%
+ }%
+}
+
+\newcommand*{\printcommonoptionsprocesshook}[2]{%
+ \glsxtrifhasfield*{rootancestor}{#2}%
+ {\ifdefstring\glscurrentfieldvalue{#1}{}{\printunsrtglossaryskipentry}}%
+ {\printunsrtglossaryskipentry}%
+}
+
+\newcommand*{\printcommonoptions}[2][]{%
+ \glsdoifexistsorwarn{#2}%
+ {%
+ \printunsrtglossary*[type=index,style=summary,nogroupskip,
+ label={#2-optionsummary},
+ title={\texorpdfstring{\glsxtrfieldtitlecase{#2}{name}}{\pdftitlecasename{#2}} Summary},
+ leveloffset={-1},#1]%
+ {%
+ \preto\glossarypreamble{\glsadd[format=summarylocfmt]{#2}\createtarget{#2}{\strut}}%
+ \ifglshasdesc{#2}%
+ {%
+ \appto\glossarypreamble{\glossentrydesc{#2}\glspostdescription
+ \glspar\medskip\glspar}%
+ }{}%
+ \renewcommand{\GlsXtrLocationField}{primarylocations}%
+ \def\printunsrtglossaryentryprocesshook{\printcommonoptionsprocesshook{#2}}%
+ \def\printunsrtglossarypredoglossary{\let\glsgroupheading\@gobble}%
+ }%
+ }%
+}
+
+\newcount\totalindexitems
+
+\newcommand{\filteremptylocation}[1]{%
+ \glsxtrifhasfield*{location}{#1}
+ {\advance\totalindexitems by 1}% has location field
+ {%
+ \GlsXtrIfHasNonZeroChildCount*{#1}%
+ {\advance\totalindexitems by 1}%
+ {\printunsrtglossaryskipentry}%
+ }%
+}
+
+\newcommand*{\printuserguideindex}[1][]{%
+ \printunsrtglossary*[label=index,type=index,target=false,title=\indexname,style=bookindex,#1]%
+ {%
+ \let\glsextrapostnamehook\statushook
+ \renewcommand*{\glsxtrbookindexprelocation}[1]{%
+ \glsxtrifhasfield{location}{##1}%
+ {\,\textcolor{lightgray}{\dotfill}\,}%
+ {}%
+ }%
+ \let\printunsrtglossaryentryprocesshook\filteremptylocation
+ \let\glsxtrbookindexname\linkedentryname
+ \def\printunsrtglossarypredoglossary{%
+ \ifnum\totalindexitems<21\relax
+ \renewcommand*{\glsxtrbookindexmulticolsenv}{multicols*}%
+ \fi}%
+ \nlctguideindexinitpostnamehooks
+ }%
+}
+
+\newcommand{\nlctguideindexinitpostnamehooks}{%
+ \glsdefpostname{environment}{ environment}%
+ \glsdefpostname{package}{ package}%
+ \glsdefpostname{class}{ class}%
+ \glsdefpostname{counter}{ counter}%
+ \glsdefpostname{acronym}{\acrpostnamehook}%
+ \glsdefpostname{abbreviation}{\abbrpostnamehook}%
+ \glsdefpostname{termabbreviation}{\abbrpostnamehook}%
+ \glsdefpostname{dualindexabbreviation}{\abbrpostnamehook}%
+}
+
+\newcommand{\acrpostnamehook}{}
+
+\newrobustcmd{\abbrpostnamehook}{%
+ \ifglshaslong\glscurrententrylabel
+ {\space (\glsfmtlong{\glscurrententrylabel})}
+ {%
+ \glsxtrifhasfield{\GlsXtrDualField}{\glscurrententrylabel}%
+ {%
+ \ifglshaslong\glscurrentfieldvalue
+ {\space (\expandafter\glsfmtlong\expandafter{\glscurrentfieldvalue})}%
+ {}%
+ }%
+ {}%
+ }%
+}
+
+\endinput