summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/dashundergaps
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/dashundergaps
Initial commit
Diffstat (limited to 'macros/latex/contrib/dashundergaps')
-rw-r--r--macros/latex/contrib/dashundergaps/README.md23
-rw-r--r--macros/latex/contrib/dashundergaps/changes.txt32
-rw-r--r--macros/latex/contrib/dashundergaps/dashundergaps-code.pdfbin0 -> 567877 bytes
-rw-r--r--macros/latex/contrib/dashundergaps/dashundergaps-code.tex5
-rw-r--r--macros/latex/contrib/dashundergaps/dashundergaps-doc.pdfbin0 -> 438978 bytes
-rw-r--r--macros/latex/contrib/dashundergaps/dashundergaps-doc.tex4
-rw-r--r--macros/latex/contrib/dashundergaps/dashundergaps.dtx1059
-rw-r--r--macros/latex/contrib/dashundergaps/dashundergaps.ins67
-rw-r--r--macros/latex/contrib/dashundergaps/l3doc-TUB.cls2306
9 files changed, 3496 insertions, 0 deletions
diff --git a/macros/latex/contrib/dashundergaps/README.md b/macros/latex/contrib/dashundergaps/README.md
new file mode 100644
index 0000000000..62bcbe1618
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/README.md
@@ -0,0 +1,23 @@
+# dashundergaps package
+
+-----
+
+This package is a reimplementation of a package with the same name
+written by Luca Merciadri in 2010. Luca is no longer maintaining it
+and so I thought I provide this update. It should be a drop-in
+replacement (except for fixing a few bugs and adding a few additional
+features). See manual for details.
+
+Package source can be found below:
+
+https://github.com/FrankMittelbach/fmitex/
+
+The license is LPPL.
+
+-----
+
+Copyright (C) 2018 Frank Mittelbach<br />
+<https://latex-project.org/> <br />
+All rights reserved.
+
+
diff --git a/macros/latex/contrib/dashundergaps/changes.txt b/macros/latex/contrib/dashundergaps/changes.txt
new file mode 100644
index 0000000000..ddb4ee6293
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/changes.txt
@@ -0,0 +1,32 @@
+2018-11-09 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * dashundergaps.dtx v2.0d
+
+ \TeacherModeOff was a copy of \TeacherModeOn and never turned
+ anything off.
+
+2018-06-27 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * dashundergaps.dtx v2.0c
+
+ (subsubsection{Gap formatting}): Added key
+ 'gap-format-adjust' to raise the underline to baseline.
+
+ (subsubsection{Gap widening}): Default minimum now 20pt (10pt on
+ each side).
+
+ (subsection{Loading and fixing/changing \pkg{ulem}}): Robustify
+ \dotuline and \uwave.
+
+ (subsection{Loading and fixing/changing \pkg{ulem}}): Change
+ default def of \uwave to react to \ULdepth.
+
+2018-06-24 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * dashundergaps.dtx v2.0b
+
+ Changed def of \UL@dischyp to not typeset the hyphen if we don't
+ want any printing.
+
+ (subsubsection{Gap formatting}): Support 'double-underline' as
+ value for \uuline.
diff --git a/macros/latex/contrib/dashundergaps/dashundergaps-code.pdf b/macros/latex/contrib/dashundergaps/dashundergaps-code.pdf
new file mode 100644
index 0000000000..81d6122575
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/dashundergaps-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/dashundergaps/dashundergaps-code.tex b/macros/latex/contrib/dashundergaps/dashundergaps-code.tex
new file mode 100644
index 0000000000..caf85830e5
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/dashundergaps-code.tex
@@ -0,0 +1,5 @@
+% this will typeset documentation + code
+
+\AtBeginDocument{\AlsoImplementation}
+\input{dashundergaps.dtx}
+
diff --git a/macros/latex/contrib/dashundergaps/dashundergaps-doc.pdf b/macros/latex/contrib/dashundergaps/dashundergaps-doc.pdf
new file mode 100644
index 0000000000..047685d56d
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/dashundergaps-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/dashundergaps/dashundergaps-doc.tex b/macros/latex/contrib/dashundergaps/dashundergaps-doc.tex
new file mode 100644
index 0000000000..b559038807
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/dashundergaps-doc.tex
@@ -0,0 +1,4 @@
+% this will typeset only documentation but not the code
+
+\AtBeginDocument{\OnlyDescription}
+\input{dashundergaps.dtx}
diff --git a/macros/latex/contrib/dashundergaps/dashundergaps.dtx b/macros/latex/contrib/dashundergaps/dashundergaps.dtx
new file mode 100644
index 0000000000..f26f362baa
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/dashundergaps.dtx
@@ -0,0 +1,1059 @@
+% \iffalse meta-comment
+%
+%% File: dashundergaps.dtx (C) Copyright 2018 Frank Mittelbach
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% https://www.latex-project.org/lppl.txt
+%
+%
+% The development version of the bundle can be found below
+%
+% https://github.com/FrankMittelbach/fmitex/
+%
+% for those people who are interested or want to report an issue.
+%
+
+\def\dashundergapsdate {2018/11/18}
+\def\dashundergapsversion{v2.0d}
+
+%<*driver>
+\let\fmipagebreak\pagebreak
+
+\RequirePackage[nohyphen]{underscore} % no hyphen after undercore
+ % in csname
+\documentclass
+ [final]
+ {l3doc-TUB}
+
+
+\setcounter{page}{1}
+
+% fix for _TF undefined,
+% https://github.com/latex3/latex3/issues/477#issuecomment-419458783
+\ExplSyntaxOn
+\cs_set_protected:Npn \__codedoc_typeset_TF:
+ {
+ \group_begin:
+ \exp_args:No \__codedoc_if_macro_internal:nT \l__codedoc_tmpa_tl
+ { \color[gray]{0.5} }
+ \itshape TF
+ \group_end:
+ }
+\ExplSyntaxOff
+
+% fix for doc/ltugboat issue
+\def\pfill{~%
+ \leaders\hbox to.6em{\hss .\hss}\hskip 0em plus 1fill
+ \kern-1.5em
+ \penalty500
+ \kern 1.5em
+ \strut\nobreak
+ \leaders\hbox to.6em{\hss .\hss}\hskip 0em plus 1fil
+ \null~\ignorespaces}%
+
+\usepackage{dashundergaps,multicol}
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+ \DocInput{dashundergaps.dtx}
+\addtolength\signaturewidth{42pt}
+\makesignature
+\end{document}
+%</driver>
+%
+% \fi
+%
+%
+% \newcommand\option[1]{\texttt{#1}}
+%
+% \DoNotIndex{}
+%
+% \title{The \texttt{dashundergaps} package\thanks{This is a
+% reimplementation (using \texttt{expl3}, the \LaTeX3 programming
+% language) of a package originally written by Luca Merciadri in
+% 2010. The current package version is \dashundergapsversion\
+% dated \dashundergapsdate.}}
+% \author{Frank Mittelbach}
+% \address{Mainz, Germany}
+% \netaddress{https://www.latex-project.org}
+% \personalURL{https://ctan.org/pkg/dashundergaps}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The \pkg{dashundergaps} package offers the possibility to replace
+% material in running text with white space in order to build up forms
+% that can be filled in at a later time.
+%
+% By default the gaps are underlined and followed by a gap number in
+% parentheses, but many other designs are possible, e.g., dashes or
+% dots instead of the underline, no gap numbers or a different format
+% for them, gap widening for easier fill-in, etc.
+%
+% There is also a teacher's mode which shows the normally hidden text
+% in a special (customizable) format.
+%
+% \medskip
+%
+% This is another article in a series of \TUB{} articles
+% describing small packages to introduce coding practices using the
+% \pkg{expl3} programming language. See~\cite{tub-wao-code} for the
+% first article in the series.
+% For more details on \pkg{expl3} refer to~\cite{expl3}.
+%
+% \end{abstract}
+%
+% \tableofcontents
+%
+%
+% \section{Introduction}
+%
+% The \pkg{dashundergaps} package provides a single command \cs{gap}
+% which takes one argument and produces a gap of the width of that
+% argument. To better mark this gap it is underlined in some form (could be
+% a solid line, a dashed or dotted line or even a \uwave{wriggling
+% line}). Furthermore, gaps can be numbered to be able to easily
+% refer to them. Figure~\ref{fig:puzzle} shows an example in the form of a
+% fill-in puzzle.
+%
+%
+% \newcommand\puzzletext{%
+% \begin{quote}
+% \addtolength\baselineskip{3pt}
+% The initial `E.' in Donald E. Knuth's name stands for \gap{Ervin}.
+% The well-known answer to the Ultimate Question \gap*{of Life, the
+% Universe, and Everything} is 42 according to \gap{Douglas Adams}.
+% The first edition of \gap{The \LaTeX{} Companion} celebrates its silver
+% anniversary in 2019. Historically speaking, \texttt{expl3} stands for
+% \gap{\textbf{EX}perimental \textbf{P}rogramming \textbf{L}anguage
+% \textbf{3}} even though it is a production language these days.
+% \end{quote}}
+%
+%
+% \dashundergapssetup{
+% ,gap-number-format = \,\textsuperscript{\normalfont
+% (\thegapnumber)}
+% ,gap-font = \itshape
+% ,teacher-gap-format = underline
+% ,gap-widen
+% }
+%
+% \begin{figure}
+% \centering
+% \setlength\fboxsep{10pt}
+% \noindent\hspace{-\marginparwidth}\fbox{\begin{minipage}{1.20\textwidth}
+% \puzzletext
+%
+% \bigskip
+%
+% And here are some hints for the puzzle if you want to fill it out:
+% \begin{quote}
+% \begin{multicols}{2}
+% \begin{enumerate}
+% \item If only everything would be that easy\newline to answer.
+% \item The author of the book ``Last Chance To~See'' and of a famous
+% radio~show.
+% \item Back then known as the doggie book.
+% \item Old names die hard.\\
+% \mbox{} ^^A manual to get same height
+% \end{enumerate}
+% \end{multicols}
+% \end{quote}
+% The answers are given in Section~\ref{sec:answer}, showing the gaps
+% filled in using the so-called teacher mode, which~can be
+% activated or deactivated at any point in the document.\raggedright
+% \end{minipage}}
+% \caption{A fill-in puzzle using \pkg{dashundergaps}}\label{fig:puzzle}
+% \end{figure}
+%
+% As you see there, some gaps are numbered with a superscript number (not the
+% default setting) while others aren't. How this is done and how to
+% change the result is explained in the next section.
+%
+% There also exists a ``teacher mode'' in which the gaps are filled
+% with the text given in the argument. This can be used to show the
+% correct answers of a test (as we do in Section~\ref{sec:answer}) or
+% to give a sample fill-in for a form, to help people fill it out
+% correctly. The ``teacher mode'' produces the same line breaks
+% because it ensures that the fill-ins take the same amount of space as the
+% gaps.
+%
+% Another important feature is the possibility to artificially widen the
+% gaps, compared to the textual material in the argument. After all,
+% when a form is filled by hand people typically need more space to
+% write some text compared to the same text being typeset. So making the
+% gaps simply as wide as the material likely results in too little
+% space.
+%
+%
+% \section{The user interface}
+%
+%
+% The \pkg{dashundergaps} package is built as a small application on top
+% of the \pkg{ulem} package, a package that defines several commands for
+% underlining \meta{simple-text} in various ways.
+% \begin{function}{\uline,\uuline,\uwave,\dashuline,\dotuline}
+% \begin{syntax}
+% \cs{uline}\Arg{simple-text} \cs{uwave}\Arg{simple-text} ...
+% \end{syntax}
+% This means that by loading
+% \pkg{dashundergaps} the \pkg{ulem} commands such as \cs{uline},
+% \cs{uwave} and so forth are automatically made available.
+% These commands are used to do most of
+% the work and the current package only makes sure that, instead of the
+% words, empty boxes of the same width are used by \pkg{ulem}. This
+% way we get underlined gaps of the right size.
+%
+% By default, \pkg{ulem} changes \cs{emph} to underline text, so
+% for this application, it is loaded with the option \texttt{normalem} to
+% prevent that from happening.
+%
+% \end{function}
+%
+%
+%
+% \begin{function}{\gap}
+% \begin{syntax}
+% \cs{gap}*\oarg{style}\Arg{text}
+% \end{syntax}
+% \noindent\llap{\small\smash{\begin{tabular}[t]{r@{ = }l} ^^A really low-level hacked
+% \multicolumn{2}{c}{}\\
+% \multicolumn{2}{c}{\hspace*{-1.2pc}Possible \meta{style}s:}\\[3pt]
+% \texttt{u} & \cs{uline} \\
+% \texttt{d} & \cs{uuline} \\
+% \texttt{w} & \cs{uwave} \\
+% \texttt{b} & \meta{blank} \\
+% \texttt{-} & \cs{dashuline} \\
+% \texttt{.} & \cs{dotuline}
+% \end{tabular}}\ }^^A
+% The main command provided by the package is \cs{gap} which expects a
+% mandatory \meta{text} argument containing the material that is used
+% to produce the gap (and is normally invisible). By default the gap is
+% underlined, though that can be changed.
+% \end{function} ^^A not really meant for no parindent and positive
+% ^^A parskip ...
+% \vspace{\parskip} ^^A ... thus manual fix for now
+%
+%
+% The optional \meta{style} argument explicitly defines a certain type
+% of underlining: |u| stands for normal underlining (via \cs{uline}),
+% |d| for double underlining (via \cs{uuline}),
+% |w| for a wavy line (via \cs{uwave}), |b| for blank (i.e., no
+% underlining whatsoever), ``|-|'' for a dash-line (via \cs{dashuline})
+% and finally ``|.|''\ for underlining with dots (via \cs{dotuline}).
+%
+% In the default configuration gaps are numbered using the counter
+% \texttt{gapnumber} and this number is shown in parentheses after
+% the gap. With the star form the generation of the number is
+% toggled, i.e., if it would be produced because of the current
+% option settings it will be suppressed; if it is suppressed through
+% an option it will be typeset. This way one can select the most
+% convenient setting via an option for the whole document and use
+% |*| to toggle it as needed.
+%
+% Since \cs{gap} uses \pkg{ulem}'s commands it inherits the limitations
+% of these commands; notably, only simple text can be used in the
+% \meta{text} argument. For example, a \cs{footnote} couldn't be used
+% in the argument (but then that wouldn't make much sense in a gap,
+% would~it?).
+%
+% \begin{function}{\TeacherModeOn,\TeacherModeOff}
+% \begin{syntax}
+% \cs{TeacherModeOn} \texttt{\,\% show gap material}
+% \cs{TeacherModeOff} \texttt{\% do not show gap material}
+% \end{syntax}
+% Also supported is a teacher mode in which the material for the gaps is
+% visible. This can be used to show the expected answers in case \cs{gap}
+% is used for preparing tests, or to show a sample fill-in of a form.
+% The teacher mode can be turned on or off anywhere in the document
+% using \cs{TeacherModeOn} or \cs{TeacherModeOff},
+% respectively. Alternatively, it can also be set via an option, as we
+% will see below.
+% \end{function}
+%
+% \begin{function}{\dashundergapssetup}
+% \begin{syntax}
+% \cs{dashundergapssetup}\Arg{comma-separated key-value list}
+% \end{syntax}
+% The package can be loaded with a number of options (discussed in
+% Section~\ref{sec:options}). A likely better approach is to set any
+% options with the declaration \cs{dashundergapssetup} which is normally
+% used in the preamble, but can be used throughout the document
+% to change settings on the fly. It only changes explicitly given options
+% so it can be used to overwrite some defaults but leave everything
+% else unchanged.
+% \end{function}
+%
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Options to customize the gap display}\label{sec:options}
+%
+% All of the package options are implemented as key/value options.
+% For boolean options one can give just the option name as a short
+% form for setting the option to |true|. Most options can be specified
+% during package loading in the optional argument of
+% \cs{usepackage}. However if the value requires some \LaTeX{} code
+% (e.g., \option{gap-font}, which expects a font declaration command)
+% then this will not work due to some limitations in the current
+% \LaTeX{} package loader. For such options use
+% \cs{dashundergapssetup} instead, which will always work.
+%
+% \subsubsection{Gap modes}
+%
+% The general processing mode is defined through the following options:
+% \begin{description}
+% \item[\option{teacher-mode}] Boolean that turns on teacher mode (i.e., the gap
+% material will be visible if set to |true|). Its default is
+% |false|.
+% \item[\option{gap-mode}] Boolean that is the inverse of \option{teacher-mode}
+% and just provided for convenience, i.e., an abbreviation
+% for \option{teacher-mode}|=false|.
+% \item[\option{teachermode}] Alternative name for \option{teacher-mode} because
+% that is what it was called in the first package release.
+% \end{description}
+%
+% \subsubsection{Gap formatting}
+%
+% Formatting of the gaps is handled by the following six options:
+% \begin{description}
+% \item[\option{gap-format}] A choice option defining how the gap is
+% marked. It accepts the following values: |underline| (default),
+% |double-underline|,
+% |dash|, |dot|, |wave|, |blank|.
+% \item[\option{gap-format-adjust}] A boolean (default |true|). If set, the
+% ``line'' below the gap is raised to be roughly at the baseline,
+% which normally looks better when there is no text above the line.
+% \item[\option{teacher-gap-format}] Another choice option, with the
+% same values as \option{gap-format}, used when we
+% are in ``teacher mode'', but this time
+% the default is |blank| as normally the gap text is typeset in the bold
+% font and is therefore already identifiable, with no need for additional
+% underlining. However, depending on the circumstances it
+% might be helpful to keep the underlining (or use a different kind of
+% underlining) while in ``teacher mode''.
+% \item[\option{gap-font}] This option expects a font directive as its value,
+% e.g., |\bfseries| (which is also the default). Using this option
+% without supplying a value is equivalent to supplying an empty
+% value. It will be used to determine the font for the gap material
+% regardless of the mode. This is important to ensure that the gaps
+% always have the same width regardless of whether or not the material
+% is shown.
+%
+% For the example puzzle above it was set to |\itshape|, which you can
+% see in the puzzle answer.
+% \item[\option{dash}] Short name for \option{gap-format}|=dash|.
+% \item[\option{dot}] Short name for \option{gap-format}|=dot|.
+% \end{description}
+%
+% \subsubsection{Gap numbers}
+%
+% Producing the gap numbers is handled by the following options:
+% \begin{description}
+% \item[\option{gap-numbers}] Boolean that determines whether or not gap numbers
+% are displayed. Default is |true|.
+%
+% \item[\option{gap-number-format}] Code that is executed when a gap number is
+% produced. Default is \verb*|\textnormal{ (\thegapnumber)}|.
+% \item[\option{numbers}] Short name for \option{gap-numbers}.
+% \end{description}
+%
+% There is also a way to control displaying the total number of gaps:
+% \begin{description}
+% \item[\option{display-total-gaps}] Boolean to determine if the total number of
+% gaps should be shown at the very end of the document. Default is
+% |false|.
+% \item[\option{displaynbgaps}] This is just another name for the same boolean;
+% it was used in the first version of the package.
+% \end{description}
+%
+%
+%
+% \subsubsection{Gap widening}
+%
+% Finally, for extending the gap width we have these options:
+% \begin{description}
+% \item[\option{gap-widen}] Boolean that decides if the gaps should be made wider
+% or not (default is |false| but mainly for historical reasons).
+% \item[\option{gap-extend-minimum}] Minimum of extra space that should be added
+% to each gap if gap widening is active. Default is |20pt|, i.e.,
+% |10pt| on either side.
+% \item[\option{gap-extend-percent}] Percentage (as a number) by which the gap should be made
+% wider if widening is active. The result is compared to
+% \option{gap-extend-minimum} and the larger of the two is
+% used. Default is |20|.
+% \item[\option{widen}] Short name for \option{gap-widen}.
+% \end{description}
+%
+%
+%
+%
+% \section{Differences from the original package}
+%
+% The main user interface of the two versions is identical, so it is
+% possible to use the new version as a drop-in replacement for the
+% old. However, the feature set in form of key/value options has been
+% greatly extended, offering functionality previously
+% unavailable. Furthermore, a number of bugs have been corrected (and
+% possibly new ones introduced).
+%
+% \begin{itemize}
+% \item
+% Stray spaces in the definition of \cs{gap} (that showed up in
+% the output) have been eliminated.
+% \item
+% Various combinations of options that didn't work are now possible.
+% \item
+% Explicit hyphenations |\-| showed up in gap mode, now they can be used.
+% \item
+% Nesting isn't possible for obvious reasons, but the fact is now
+% detected and catered to by ignoring the inner gap requests after
+% generating an error.
+% \item
+% Option names have been normalized (though the original names are
+% still available).
+% \item
+% The option \option{phantomtext} is no longer necessary, though still
+% supported (with a warning) as a no-op.
+% \item
+% The names of the \LaTeX{} counters used have changed, so if you
+% directly addressed them that would need changing.
+% \item
+% The font used in teacher mode (by default boldface) is now also
+% used if gap mode is chosen, to ensure that the output in all
+% modes produces identical line breaks; for the same reason, the
+% \pkg{ulem} machinery is always used, even if not underlining (or
+% dashing, etc.).
+% \item The gaps can be extended by a percentage or by a minimum
+% amount to ensure that there is enough space to fill in the text
+% (given that hand-written text is typically wider than typeset
+% material); the values are adjustable.
+% \item
+% \cs{gap} now has an optional argument through which you can
+% explicitly request the type of underlining you want to use.
+% \item
+% \cs{gap} also supports a star form which toggles the setting of gap numbers.
+% \item
+% The use of \cs{label} within the \cs{gap} command argument allows for
+% later reference to that gap by its number (provided a gap number is typeset).
+% \item The implementation is done with \texttt{expl3}, the programming
+% language for \LaTeX3. Although invisible to the user, in some sense
+% that was the main purpose of
+% the exercise: to see how easy it is to convert a package and use
+% the extended features of \texttt{expl3}.
+% \end{itemize}
+%
+%
+% \section{Solution to the puzzle} \label{sec:answer}
+%
+% \TeacherModeOn
+%
+% Here we repeat the puzzle from above with \cs{TeacherModeOn}.
+% \par\smallskip
+% \noindent\hfill\llap{\setlength\fboxsep{10pt}
+% \fbox{\begin{minipage}{1.2\textwidth}
+% \puzzletext
+% \end{minipage}\hskip\marginparsep}}
+% \par\smallskip
+% This was produced using the following changes to the defaults:
+% \begin{verbatim}
+% \dashundergapssetup{
+% ,gap-number-format = \,\textsuperscript{\normalfont
+% (\thegapnumber)}
+% ,gap-font = \itshape
+% ,teacher-gap-format = underline
+% ,gap-widen
+% }
+% \end{verbatim}
+% As you can see we use |\itshape| for the font (to be able to show
+% the bold face in one of the answers) and also force underlining in
+% teacher mode to better show the gap widening. The gap number is
+% raised and we separate it a tiny bit from the gap material. We also
+% use \cs{normalfont} in the formatting to ensure that the gap number
+% is set upright and not in italic shape.
+%
+%
+% \StopEventually{
+% \begin{thebibliography}{1}
+%\bibitem{tub-wao-code}
+% Frank Mittelbach.
+% \newblock The \pkg{widows-and-orphans} package.
+% \newblock \textsl{TUG}boat 39:3,
+% \ifx\thisissuepageref\undefined ^^A undefined if non-TUGboat
+% 20018.\\
+% \else \thisissuepageref{mitt-widows-code}, 2018.\fi
+% \newblock \url{https://ctan.org/pkg/widows-and-orphans}
+% \bibitem{expl3}
+% \LaTeX3 Project Team.
+% \newblock A collection of articles on \pkg{expl3}.\\
+% \url{https://latex-project.org/publications/indexbytopic/l3-expl3/}
+%\end{thebibliography}
+% \ifx\thisissuepageref\undefined ^^A is this TUB production ??? if not gen index
+% \setlength\IndexMin{200pt} \PrintIndex
+% \fi}
+%
+%
+% \newpage
+%
+%
+% \DoNotIndex{\ ,\advance,\begingroup,\bgroup,\def,\else,\endgroup,\fi}
+% \DoNotIndex{\hbox,\ifx,\kern,\let,\lower,\@M,\@empty,\c@gapnumber}
+% \DoNotIndex{\c@totalgapnumber,\hb@xt@,\LA@penalty,\UL@box,\UL@leaders}
+% \DoNotIndex{\UL@leadtype,\UL@setULdepth,\UL@skip,\UL@start,\z@,\ULdepth}
+% \DoNotIndex{\ULon,\vrule,\wd,\@width,\UL@putbox,\markoverwith}
+% \DoNotIndex{\char,\cs_new:Npn,\cs_set:Npn,\dim_new:N,\font,\global,\hyphenchar}
+% \DoNotIndex{\setbox,\string,\UL@hyphenbox,\UL@start}
+% \DoNotIndex{\tl_new:N,\tl_set:Nn,\ifnum,\UL@stop,\dim_set:Nn,\box}
+% \DoNotIndex{\discretionary,\sixly,\p@,\usepackage,\ignorespaces}
+% \DoNotIndex{\cs_set_eq:NN}
+%
+%
+%
+% \section{The implementation}
+%
+% \subsection{Loading and fixing/changing \pkg{ulem}}
+%
+% The first thing to do is to load \pkg{ulem} without changing \cs{emph}
+% or \cs{em}:
+% \begin{macrocode}
+%<*package>
+\RequirePackage[normalem]{ulem}
+% \end{macrocode}
+%
+% The code in this section follows \LaTeXe{} conventions, i.e., models
+% the commands as they look in the \pkg{ulem} package.
+%
+% \begin{macro}{\dotuline}
+% The dots produced by \cs{dotuline} depend on the current font,
+% which is a somewhat questionable design\Dash if you underline a text %part
+% with a single bold word somewhere inside it will change the
+% shape of the dot line. So we always use the \cs{normalfont}
+% dot (this is not done in the original definition).
+% \begin{macrocode}
+\def\dotuline{\bgroup
+ \UL@setULdepth
+ \markoverwith{\begingroup
+ \advance\ULdepth0.08ex
+ \lower\ULdepth\hbox{\normalfont \kern.1em .\kern.04em}%
+ \endgroup}%
+ \ULon}
+\MakeRobust\dotuline
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\uwave}
+% The original \cs{uwave} used a hard-wired value of |3.5pt| for
+% the lowering. We change that to be based on the current
+% value of \cs{ULdepth} so that the user (or this package here)
+% can change the placement.
+% \begin{macrocode}
+\def\uwave{\bgroup
+ \UL@setULdepth
+ \advance\ULdepth 0.6\p@
+ \markoverwith{\lower\ULdepth\hbox{\sixly \char58}}\ULon}
+\MakeRobust\uwave
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}[int]{\fmdug@ublank}
+% \cs{fmdug@ublank} underlines with blanks. Normally not especially useful
+% (which is why we make it internal),
+% but if we want to have \pkg{ulem} acting, but without actually
+% visibly underlining, this is the command to use.
+% \begin{macrocode}
+\def\fmdug@ublank{\bgroup\let\UL@leadtype\@empty\ULon}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}[int]{\UL@dischyp}
+% \begin{macro}[int]{\UL@putbox}
+% We need to do a little patching to ensure that nothing is output
+% by the \pkg{ulem} commands if we don't want it to. So the next two
+% commands are from \pkg{ulem} with |\box| replaced by
+% |\fmdug@box| so that we can change the behavior.
+% \begin{macrocode}
+\def\UL@dischyp{\global\setbox\UL@hyphenbox\hbox
+ {\ifnum \hyphenchar\font<\z@ \string-\else \char\hyphenchar\font \fi}%
+ \kern\wd\UL@hyphenbox \LA@penalty\@M
+ \UL@stop \kern-\wd\UL@hyphenbox
+ \discretionary{\fmdug@box\UL@hyphenbox}{}{}\UL@start}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\UL@putbox{\ifx\UL@start\@empty \else % not inner
+ \vrule\@width\z@ \LA@penalty\@M
+ {\UL@skip\wd\UL@box \UL@leaders \kern-\UL@skip}%
+ \fmdug@box\UL@box \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \begin{macro}[int]{\fmdug@box}
+% By default we output the box in the commands above, but when we
+% don't want to output anything visible we change the definition to
+% generate a box with empty content but the right size.
+% \begin{macrocode}
+\let\fmdug@box\box
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%
+%
+%
+% \subsection{The main implementation part}
+%
+% The rest of the package is written in \texttt{expl3}. We use
+% \texttt{fmdug} as our internal prefix.
+
+% \begin{macrocode}
+%<@@=fmdug>
+% \end{macrocode}
+%
+% We need the package \pkg{xparse} for specifying the document-level
+% interface commands and \pkg{l3keys2e} to use the \pkg{expl3} key
+% value methods within \LaTeXe{}. These packages automatically
+% require \pkg{expl3} so there is no need to load that explicitly.
+% \begin{macrocode}
+\RequirePackage{xparse,l3keys2e}
+% \end{macrocode}
+%
+% Here we introduce the package and specify its version number:
+% \begin{macrocode}
+\ProvidesExplPackage{dashundergaps}
+ {\dashundergapsdate}
+ {\dashundergapsversion}
+ {Dashing and underlining phantom text}
+% \end{macrocode}
+%
+%
+% \subsubsection{User interface commands}
+%
+
+% \begin{macro}{\gap}
+% The \cs{gap} command parses for a star, optional and mandatory
+% argument and then calls \cs{@@_gap:nnn} to do the work.
+% \begin{macrocode}
+\DeclareDocumentCommand \gap { som } { \@@_gap:nnn {#1}{#2}{#3} }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\dashundergapssetup}
+% Change options anywhere.
+% \begin{macrocode}
+\NewDocumentCommand \dashundergapssetup { m }
+ { \keys_set:nn {fmdug} {#1} \ignorespaces }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TeacherModeOn}
+% \begin{macro}{\TeacherModeOff}
+% We provide shortcuts for turning teacher mode on or off.
+% \begin{macrocode}
+\DeclareDocumentCommand \TeacherModeOn {}
+ { \bool_set_true:N \l_@@_teacher_bool }
+\DeclareDocumentCommand \TeacherModeOff {}
+ { \bool_set_false:N \l_@@_teacher_bool }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+% \subsubsection{Counters}
+%
+% \begin{macro}[int]{\c@gapnumber}
+% We have one user-level counter which is referenceable and holds
+% the gap number of the current gap. It can be reset to 0 to
+% restart counting.
+% \begin{macrocode}
+\newcounter{gapnumber}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}[int]{\c@totalgapnumber}
+% We also keep track of all gaps ever made using another user-level
+% counter. Since this one is supposed to keep track of the total
+% number of gaps, it makes little sense to modify it at the
+% document level. However, there may be use cases even for that and
+% more importantly, by making it a user-level counter it is
+%\fmipagebreak
+% possible to refer to the total number of gaps easily, e.g., via
+% \cs{thetotalgapnumber}.
+% ^^A\makeatletter\@endparpenalty=10000\makeatother
+% \begin{macrocode}
+\newcounter{totalgapnumber}
+% \end{macrocode}
+% \end{macro}
+
+% \begin{macro}{\l_@@_extend_dim}
+% A help register to calculate the gap width later on.
+% \begin{macrocode}
+\dim_new:N \l_@@_extend_dim
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\l_@@_extra_left_gap_tl}
+% \begin{macro}{\l_@@_extra_right_gap_tl}
+% Two scratch token lists to enlarge the gap on the left or right side.
+% \begin{macrocode}
+\tl_new:N \l_@@_extra_left_gap_tl
+\tl_new:N \l_@@_extra_right_gap_tl
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macro}{\l_@@_gap_format_tl}
+% \begin{macro}{\l_@@_teacher_gap_format_tl}
+% The gap formatting is normally handled by a \pkg{ulem}
+% command; which one depends on the options used. To record the
+% choice we store it in a token list (one for normal and one for
+% teacher mode).
+% \begin{macrocode}
+\tl_new:N \l_@@_gap_format_tl
+\tl_new:N \l_@@_teacher_gap_format_tl
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Messages}
+%
+% \begin{macrocode}
+\msg_new:nnn {dashundergaps} {deprecated}
+ { The~ #1~ `#2'~ you~ used~ \msg_line_context: \ is~ deprecated~ and~
+ there~ is~ no~ replacement.~ Since~ I~ will~ not~ guarantee~ that~
+ #1~ `#2'~ will~ be~ kept~ forever~ I~ strongly~ encourage~ you~
+ to~ remove~ it~ from~ your~ document. }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\msg_new:nnnn {dashundergaps} {nested}
+ { The~ \gap command~ can't~ be~ nested! }
+ { Nesting~ doesn't~ make~ much~ sense~ as~ the~ inner~ one~
+ wouldn't~ be~ visible.~ ~ To~ allow~ further~ processing~ it~ is~
+ handled~ as~ if~ it~ hasn't~ been~ asked~ for. }
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\msg_new:nnnn {dashundergaps} {gap-format-value}
+ { Unknown~ value~ for~ key~ '#1 gap-format'! }
+ { Supported~ values~ are~ 'underline',~ 'double-underline',\\
+ 'dash',~ 'dot',~ 'wave'~ or~ 'blank'. }
+% \end{macrocode}
+%
+%
+%
+% \subsubsection{Option handling}
+%
+% Here we define all the possible option keys for use either as package
+% options or inside
+% \cs{dashundergapssetup}. These are all straightforward assignments
+% to variables. These internal variables are declared by the key
+% declarations if unknown, so they are not separately declared beforehand.
+% \begin{macrocode}
+\keys_define:nn {fmdug}
+ {
+ % ====================================
+ ,teacher-mode .bool_set:N = \l_@@_teacher_bool
+ ,teacher-mode .default:n = true
+ ,teacher-mode .initial:n = false
+ % ------------------
+ ,gap-mode .bool_set_inverse:N = \l_@@_teacher_bool
+ % ====================================
+ ,gap-format
+ .choice:
+% \end{macrocode}
+%
+% In the case of dashes and even more so in the case of dots, it looks
+% fairly ugly if they are below the baseline as if there were text
+% above. We therefore raise them up a bit if the option
+% \texttt{gap-format-adjust} is given (which is the default).
+%
+% In the case of dots we undo
+% exactly the amount by which they are lowered in \pkg{ulem} so
+% that they end up precisely at the baseline, in case they are
+% followed by a real dot. In other cases we stay a bit below the baseline.
+%
+% The same is done below when the optional argument is
+% evaluated. But we don't do this in teacher mode since there we
+% \emph{will} have text above and we don't want to bump into that.
+%
+% \begin{macrocode}
+ ,gap-format / underline
+ .code:n = \tl_set:Nn \l_@@_gap_format_tl
+ { \@@_gap_format_adjust:n{.4pt} \uline }
+ ,gap-format / double-underline
+ .code:n = \tl_set:Nn \l_@@_gap_format_tl
+ { \@@_gap_format_adjust:n{2pt} \uuline }
+ ,gap-format / dash
+ .code:n = \tl_set:Nn \l_@@_gap_format_tl
+ { \@@_gap_format_adjust:n{0pt} \dashuline }
+ ,gap-format / dot
+ .code:n = \tl_set:Nn \l_@@_gap_format_tl
+ { \@@_gap_format_adjust:n{-.08ex} \dotuline }
+ ,gap-format / wave
+ .code:n = \tl_set:Nn \l_@@_gap_format_tl
+ { \@@_gap_format_adjust:n{1pt} \uwave }
+ ,gap-format / blank
+ .code:n = \tl_set:Nn \l_@@_gap_format_tl { \fmdug@ublank }
+ ,gap-format / unknown
+ .code:n = \msg_error:nnn{dashundergaps}{gap-format-value}{}
+ ,gap-format
+ .initial:n = underline
+ % ====================================
+% \end{macrocode}
+% This controls the raising of the gap underline by some
+% amount. We implement it as a |.choice| even though it looks like
+% a boolean.
+%\begingroup\hfuzz=15pt
+% \begin{macrocode}
+ ,gap-format-adjust
+ .choice:
+ ,gap-format-adjust / true
+ .code:n = \cs_set:Npn \@@_gap_format_adjust:n ##1
+ { \setlength\ULdepth {##1} }
+ ,gap-format-adjust / false
+ .code:n = \cs_set_eq:NN \@@_gap_format_adjust:n \use_none:n
+ ,gap-format-adjust
+ .default:n = true
+ ,gap-format-adjust
+ .initial:n = true
+ ,adjust .meta:n = { gap-format-adjust }
+ % ====================================
+ ,teacher-gap-format
+ .choice:
+ ,teacher-gap-format / underline
+ .code:n = \tl_set:Nn \l_@@_teacher_gap_format_tl { \uline }
+ ,teacher-gap-format / double-underline
+ .code:n = \tl_set:Nn \l_@@_teacher_gap_format_tl { \uuline }
+ ,teacher-gap-format / dash
+ .code:n = \tl_set:Nn \l_@@_teacher_gap_format_tl { \dashuline }
+ ,teacher-gap-format / dot
+ .code:n = \tl_set:Nn \l_@@_teacher_gap_format_tl { \dotuline }
+ ,teacher-gap-format / wave
+ .code:n = \tl_set:Nn \l_@@_teacher_gap_format_tl { \uwave }
+ ,teacher-gap-format / blank
+ .code:n = \tl_set:Nn \l_@@_teacher_gap_format_tl { \fmdug@ublank }
+ ,teacher-gap-format / unknown
+ .code:n = \msg_error:nnn{dashundergaps}{gap-format-value}{teacher-}
+ ,teacher-gap-format
+ .initial:n = blank
+ % ====================================
+ ,gap-widen .bool_set:N = \l_@@_gap_widen_bool
+ ,gap-widen .default:n = true
+ ,gap-widen .initial:n = false
+ % ------------------
+ ,widen .meta:n = { gap-widen }
+ % ------------------
+ ,gap-extend-minimum .dim_set:N = \l_@@_gap_min_dim
+ ,gap-extend-minimum .initial:n = 20pt
+ % ------------------
+ ,gap-extend-percent .tl_set:N = \l_@@_gap_percent_tl
+ ,gap-extend-percent .initial:n = 20
+ % ====================================
+ ,gap-numbers .bool_set:N = \l_@@_number_bool
+ ,gap-numbers .default:n = true
+ ,gap-numbers .initial:n = true
+ % ------------------
+ ,numbers .meta:n = { gap-numbers }
+ % ------------------
+ ,gap-number-format .tl_set:N = \l_@@_gapnum_format_tl
+ ,gap-number-format .initial:n = \textnormal{\space (\thegapnumber)}
+ % ====================================
+ ,display-total-gaps .bool_gset:N = \g_@@_display_total_gaps_bool
+ ,display-total-gaps .default:n = true
+ ,display-total-gaps .initial:n = false
+ % ====================================
+ ,gap-font .tl_set:N = \l_@@_font_tl
+ ,gap-font .default:n =
+ ,gap-font .initial:n = \bfseries
+% \end{macrocode}
+% And finally the original options, now as aliases:
+% \begin{macrocode}
+ % ====================================
+ ,teachermode .meta:n = { teacher-mode }
+ ,dash .meta:n = { gap-format = dash }
+ ,dot .meta:n = { gap-format = dot }
+ ,displaynbgaps .meta:n = { display-total-gaps }
+ % ------------------
+ ,phantomtext
+ .code:n = \msg_warning:nnnn{dashundergaps}{deprecated}
+ {option}{phantomtext}
+ % ====================================
+ }
+% \end{macrocode}
+%\endgroup
+%
+%
+% \begin{macro}{\@@_gap:nnn}
+% At last, here comes the action. \cs{@@_gap:nn} expects two
+% arguments: |#1| indicates what kind of ``underlining'' is wanted
+% (anything not recognized is ignored, in particular
+% ``--NoValue--'' if \cs{gap} was used without an optional argument)
+% and |#2| is the material to produce a gap for.
+% \begin{macrocode}
+\cs_new:Npn\@@_gap:nnn #1#2#3 {
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \group_begin:
+% \end{macrocode}
+% Define the font used inside the gap. We need to do this up front
+% since we want to measure the text (and that needs the correct
+% font already).
+% \begin{macrocode}
+ \l_@@_font_tl
+% \end{macrocode}
+% Nesting is not supported so inside the gap we redefine
+% \cs{@@_gap:nnn} to raise an error and just return the third argument if it is
+% encountered again.
+% \begin{macrocode}
+ \cs_set:Npn \@@_gap:nnn ##1##2##3
+ {
+ \msg_error:nn{dashundergaps}{nested}
+ ##3
+ }
+% \end{macrocode}
+% We always increment the counter for the total number of gaps, but
+% increment the |gapnumber| only if we are displaying it. For the latter one
+% we use \cs{refstepcounter} to make it referenceable.
+% \begin{macrocode}
+ \stepcounter{totalgapnumber}
+ \bool_xor:nnT { #1 } { \l_@@_number_bool }
+ { \refstepcounter{gapnumber} }
+% \end{macrocode}
+% Next we prepare for widening if that is being asked for: Measure
+% the width of the text and then set \cs{l_@@_extend_dim} to be the
+% requested percentage divided by two of that width (since we add
+% it later on both sides).
+% \begin{macrocode}
+ \bool_if:NTF \l_@@_gap_widen_bool
+ {
+ \settowidth \l_@@_extend_dim {#3}
+ \dim_set:Nn \l_@@_extend_dim
+ { \l_@@_gap_percent_tl \l_@@_extend_dim / 200 }
+% \end{macrocode}
+% Then compare it to the minimum / 2 and choose whatever is larger.
+% \begin{macrocode}
+ \dim_compare:nNnT \l_@@_extend_dim < { .5\l_@@_gap_min_dim }
+ { \dim_set:Nn \l_@@_extend_dim { .5\l_@@_gap_min_dim } }
+% \end{macrocode}
+% Now we prepare what needs to go to the left and the right of the gap.
+% \begin{macrocode}
+ \tl_set:Nn \l_@@_extra_left_gap_tl
+ { \hbox_to_wd:nn\l_@@_extend_dim{} \allowbreak }
+ \tl_set:Nn \l_@@_extra_right_gap_tl
+ { \allowbreak \hbox_to_wd:nn\l_@@_extend_dim{} }
+ }
+% \end{macrocode}
+% And if no widening is asked for we clear these two token lists so
+% they don't do anything.
+% \begin{macrocode}
+ {
+ \tl_clear:N \l_@@_extra_left_gap_tl
+ \tl_clear:N \l_@@_extra_right_gap_tl
+ }
+% \end{macrocode}
+% Next comes deciding the gap format. If in teacher mode it will be
+% whatever is in \cs{l_@@_teacher_gap_tl}. Otherwise, either it is
+% based on the content of the optional argument or, if that is not
+% given or unknown, it will be \cs{l_@@_gap_format_tl}.
+% \begin{macrocode}
+ \bool_if:NTF \l_@@_teacher_bool
+ { \l_@@_teacher_gap_format_tl }
+ {
+% \end{macrocode}
+% But before we execute any of the \pkg{ulem} commands we make sure
+% that they do not output text.
+% \begin{macrocode}
+ \cs_set:Npn \fmdug@box ##1 {\hbox_to_wd:nn{\box_wd:N ##1}{}}
+ \str_case:nnF {#2}
+ {
+ {u} { \@@_gap_format_adjust:n{.4pt} \uline }
+ {d} { \@@_gap_format_adjust:n{2pt} \uuline }
+ {w} { \@@_gap_format_adjust:n{1pt} \uwave }
+ {b} { \fmdug@ublank }
+ {.} { \@@_gap_format_adjust:n{-.08ex} \dotuline }
+ {-} { \@@_gap_format_adjust:n{0pt} \dashuline }
+ }
+ { \l_@@_gap_format_tl }
+ }
+% \end{macrocode}
+% Whatever was decided as the gap format, it needs one argument,
+% i.e., the material (with possible gap extension on both sides).
+% \begin{macrocode}
+ {\l_@@_extra_left_gap_tl #3 \l_@@_extra_right_gap_tl }
+% \end{macrocode}
+% Finally we typeset the gap number if that was requested.
+% \begin{macrocode}
+ \bool_xor:nnT { #1 } { \l_@@_number_bool }
+ { \l_@@_gapnum_format_tl }
+% \end{macrocode}
+% Close the group from above to keep any of the redefinitions confined.
+% \begin{macrocode}
+ \group_end:
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\@@_display_total_gaps:}
+% This command will display the total number of gaps if
+% requested. The hard-wired formatting comes from the first
+% version of the package.
+% \begin{macrocode}
+\cs_new:Npn \@@_display_total_gaps: {
+ \vfill \centering
+ \bfseries Total~ Gaps:~ \thetotalgapnumber
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsubsection{Closing shop}
+%
+% At the end of the document we typeset the total number of gaps if requested.
+% \begin{macrocode}
+\AtEndDocument{
+ \bool_if:NT \g_@@_display_total_gaps_bool
+ \@@_display_total_gaps:
+}
+% \end{macrocode}
+% So what remains to be done is executing all options passed to the
+% package via \cs{usepackage}.
+% \begin{macrocode}
+\ProcessKeysPackageOptions{fmdug}
+%<*package>
+% \end{macrocode}
+%
+% \Finale
+%
+%
+\endinput
diff --git a/macros/latex/contrib/dashundergaps/dashundergaps.ins b/macros/latex/contrib/dashundergaps/dashundergaps.ins
new file mode 100644
index 0000000000..20ebf84d7a
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/dashundergaps.ins
@@ -0,0 +1,67 @@
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the dtx file(s) in this package when run through
+%% LaTeX or TeX.
+%%
+%% Copyright 2018 Frank Mittelbach
+%%
+%%
+%% This file is part of the dashundergaps Bundle for LaTeX.
+%% -------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% 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.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% In particular, NO PERMISSION is granted to modify the contents of this
+%% file since it contains the legal notices that are placed in the files
+%% it generates.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\input l3docstrip
+
+\keepsilent
+
+\usedir{tex/latex/contrib/dashundergaps}
+
+\preamble
+
+This is a generated file.
+
+Copyright 2018 Frank Mittelbach
+
+This file was generated from file(s) of the LaTeX `dashundergaps Bundle'.
+--------------------------------------------------------------------------
+
+It may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+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.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This file may only be distributed together with a copy of the LaTeX
+`dashundergaps Bundle'. You may however distribute the `dashundergaps Bundle'
+without such generated files.
+
+The newest sources can be found below
+
+ https://github.com/FrankMittelbach/fmitex/
+
+where one can also log issues in case there are any.
+
+
+\endpreamble
+
+
+\generate{\file{dashundergaps.sty}{\from{dashundergaps.dtx}{package}}}
+
+\endbatchfile
diff --git a/macros/latex/contrib/dashundergaps/l3doc-TUB.cls b/macros/latex/contrib/dashundergaps/l3doc-TUB.cls
new file mode 100644
index 0000000000..4db508e93c
--- /dev/null
+++ b/macros/latex/contrib/dashundergaps/l3doc-TUB.cls
@@ -0,0 +1,2306 @@
+%%
+%% This is file `l3doc-TUB.cls'
+%%
+%% The original source files were:
+%%
+%% l3doc.dtx (with options: `class') + several manual changes!
+%%
+%% Copyright (C) 1990-2018 The LaTeX3 Project
+%%
+%% It may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License (LPPL), either version 1.3c of
+%% this license or (at your option) any later version. The latest
+%% version of this license is in the file:
+%%
+%% https://www.latex-project.org/lppl.txt
+%%
+%% File: l3doc.dtx Copyright (C) 1990-2018 The LaTeX3 project
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% This is really a temporary file intended for a single article
+%% written for TugBoat It is a copy of l3doc.cls with a couple of
+%% changes, nothing more Eventually this will get replaced by a real
+%% class once l3doc.cls gets properly split into a class part and a
+%% support part.
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% If you use this for anything other than processing the documents it
+%% was meant for (which so far is 1) you are on your own :-)
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\RequirePackage{expl3,xparse,calc}
+\ProvidesExplClass{l3doc-TUB}{2018/02/21}{}
+ {L3 Experimental documentation class (special version for TUGboat)}
+\clist_new:N \g_docinput_clist
+\seq_new:N \g_doc_functions_seq
+\seq_new:N \g_doc_macros_seq
+\bool_new:N \l__codedoc_detect_internals_bool
+\bool_set_true:N \l__codedoc_detect_internals_bool
+\tl_new:N \l__codedoc_detect_internals_tl
+\tl_new:N \l__codedoc_detect_internals_cs_tl
+\coffin_new:N \l__codedoc_output_coffin
+\coffin_new:N \l__codedoc_functions_coffin
+\coffin_new:N \l__codedoc_descr_coffin
+\coffin_new:N \l__codedoc_syntax_coffin
+\box_new:N \g__codedoc_syntax_box
+\bool_new:N \l__codedoc_in_function_bool
+\bool_new:N \l__codedoc_long_name_bool
+\dim_new:N \l__codedoc_trial_width_dim
+\int_new:N \l__codedoc_nested_macro_int
+\bool_new:N \l__codedoc_macro_tested_bool
+\prop_new:N \g__codedoc_missing_tests_prop
+\seq_new:N \g__codedoc_not_tested_seq
+\seq_new:N \g__codedoc_testfiles_seq
+\bool_new:N \l__codedoc_macro_internal_set_bool
+\bool_new:N \l__codedoc_macro_internal_bool
+\bool_new:N \l__codedoc_macro_TF_bool
+\bool_new:N \l__codedoc_macro_pTF_bool
+\bool_new:N \l__codedoc_macro_noTF_bool
+\bool_new:N \l__codedoc_macro_EXP_bool
+\bool_new:N \l__codedoc_macro_rEXP_bool
+\bool_new:N \l__codedoc_macro_var_bool
+\tl_new:N \l__codedoc_override_module_tl
+\tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+\tl_new:N \l__codedoc_macro_documented_tl
+\bool_new:N \g__codedoc_lmodern_bool
+\bool_new:N \g__codedoc_checkfunc_bool
+\bool_new:N \g__codedoc_checktest_bool
+\bool_new:N \g__codedoc_kernel_bool
+\tl_new:N \l__codedoc_tmpa_tl
+\tl_new:N \l__codedoc_tmpb_tl
+\int_new:N \l__codedoc_tmpa_int
+\int_new:N \l__codedoc_tmpa_seq
+\tl_new:N \l__codedoc_names_block_tl
+\seq_new:N \g__codedoc_variants_seq
+\bool_new:N \l__codedoc_names_verb_bool
+\seq_new:N \l__codedoc_names_seq
+\seq_new:N \g__codedoc_nested_names_seq
+\tl_const:Nx \c__codedoc_backslash_tl { \iow_char:N \\ }
+\exp_last_unbraced:NNo
+ \cs_new_eq:NN \c__codedoc_backslash_token { \c__codedoc_backslash_tl }
+\tl_new:N \l__codedoc_index_macro_tl
+\tl_new:N \l__codedoc_index_key_tl
+\tl_new:N \l__codedoc_index_module_tl
+\bool_new:N \l__codedoc_index_internal_bool
+\tl_new:N \g__codedoc_module_name_tl
+\tl_const:Nn \c__codedoc_iow_rule_tl
+ { ======================================== }
+\tl_const:Nn \c__codedoc_iow_mid_rule_tl
+ { -------------------------------------- }
+\box_new:N \l__codedoc_macro_box
+\box_new:N \l__codedoc_macro_index_box
+\int_new:N \l__codedoc_macro_int
+\tl_new:N \l__codedoc_cmd_tl
+\tl_new:N \l__codedoc_cmd_index_tl
+\tl_new:N \l__codedoc_cmd_module_tl
+\bool_new:N \l__codedoc_cmd_noindex_bool
+\bool_new:N \l__codedoc_cmd_replace_bool
+\bool_new:N \l__codedoc_in_implementation_bool
+\bool_new:N \g__codedoc_typeset_documentation_bool
+\bool_new:N \g__codedoc_typeset_implementation_bool
+\bool_set_true:N \g__codedoc_typeset_documentation_bool
+\bool_set_true:N \g__codedoc_typeset_implementation_bool
+\tl_new:N \g__codedoc_base_name_tl
+\prop_new:N \l__codedoc_variants_prop
+\clist_new:N \l__codedoc_function_label_clist
+\bool_new:N \l__codedoc_no_label_bool
+\tl_new:N \l__codedoc_date_added_tl
+\tl_new:N \l__codedoc_date_updated_tl
+\tl_new:N \l__codedoc_macro_argument_tl
+\cs_new_eq:NN \__codedoc_tmpa:w ?
+\cs_new_eq:NN \__codedoc_tmpb:w ?
+\cs_generate_variant:Nn \seq_set_split:Nnn { NoV }
+\cs_generate_variant:Nn \seq_gput_right:Nn { Nf }
+\cs_generate_variant:Nn \str_case:nn { fn }
+\cs_generate_variant:Nn \tl_count:n { f }
+\cs_generate_variant:Nn \tl_greplace_all:Nnn { Nx , Nno }
+\cs_generate_variant:Nn \tl_if_empty:nTF { f }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNTF { o }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o }
+\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o }
+\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF { V }
+\cs_generate_variant:Nn \tl_if_in:nnTF { no , oo }
+\cs_generate_variant:Nn \tl_if_in:NnTF { No }
+\cs_generate_variant:Nn \tl_if_in:NnT { No }
+\cs_generate_variant:Nn \tl_if_in:NnF { No }
+\cs_generate_variant:Nn \tl_remove_all:Nn { Nx }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { Nx , Nnx, No , Nno }
+\cs_generate_variant:Nn \tl_replace_once:Nnn { Noo }
+\cs_generate_variant:Nn \tl_to_str:n { f , o }
+\cs_generate_variant:Nn \prop_get:NnNTF { Nx }
+\cs_generate_variant:Nn \prop_put:Nnn { Nx }
+\cs_generate_variant:Nn \prop_gput:Nnn { NVx }
+\prg_new_protected_conditional:Npnn \__codedoc_if_almost_str:n #1 { TF , T , F }
+ {
+ \int_compare:nNnTF
+ { \tl_count:n {#1} }
+ < { \tl_count:f { \tl_to_str:f {#1} } }
+ { \prg_return_false: }
+ { \prg_return_true: }
+ }
+\cs_generate_variant:Nn \__codedoc_if_almost_str:nT { V }
+\cs_new_protected:Npn \__codedoc_trim_right:Nn #1#2
+ {
+ \cs_set:Npn \__codedoc_tmp:w ##1 #2 ##2 \q_stop { \exp_not:n {##1} }
+ \tl_set:Nx #1 { \exp_after:wN \__codedoc_tmp:w #1 #2 \q_stop }
+ }
+\cs_generate_variant:Nn \__codedoc_trim_right:Nn { No }
+\prg_new_protected_conditional:Npnn \__codedoc_str_if_begin:nn #1#2 { TF , T , F }
+ {
+ \tl_if_in:ooTF
+ { \exp_after:wN \scan_stop: \tl_to_str:n {#1} }
+ { \exp_after:wN \scan_stop: \tl_to_str:n {#2} }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+\prg_generate_conditional_variant:Nnn \__codedoc_str_if_begin:nn
+ { oo } { TF , T , F }
+\cs_new_protected:Npn \__codedoc_replace_at_at:N #1
+ {
+ \bool_if:NT \l__codedoc_in_implementation_bool
+ {
+ \bool_if:NT \l__codedoc_detect_internals_bool
+ { \__codedoc_detect_internals:N #1 }
+ }
+ \tl_if_empty:NF \g__codedoc_module_name_tl
+ {
+ \exp_args:NNo \__codedoc_replace_at_at_aux:Nn
+ #1 \g__codedoc_module_name_tl
+ }
+ }
+\cs_new_protected:Npx \__codedoc_replace_at_at_aux:Nn #1#2
+ {
+ \tl_replace_all:Nnn #1 { \token_to_str:N @ } { @ }
+ \tl_replace_all:Nnn #1 { \token_to_str:N _ } { _ }
+ \tl_replace_all:Nnn #1 { @ @ @ @ } { \token_to_str:N a a }
+ \tl_replace_all:Nnn #1 { _ _ @ @ } { _ _ #2 }
+ \tl_replace_all:Nnn #1 { _ @ @ } { _ _ #2 }
+ \tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
+ \tl_replace_all:Nnn #1 { \token_to_str:N a a } { @ @ }
+ }
+\group_begin:
+ \char_set_catcode_active:N \^^M
+ \cs_new_protected:Npn \__codedoc_detect_internals:N #1
+ {
+ \tl_set_eq:NN \l__codedoc_detect_internals_tl #1
+ \tl_replace_all:Non \l__codedoc_detect_internals_tl { \token_to_str:N _ } { _ }
+ \seq_set_split:NnV \l__codedoc_tmpa_seq { _ _ } \l__codedoc_detect_internals_tl
+ \seq_pop_left:NN \l__codedoc_tmpa_seq \l__codedoc_detect_internals_tl
+ \seq_map_variable:NNn \l__codedoc_tmpa_seq \l__codedoc_detect_internals_tl
+ {
+ \__codedoc_trim_right:No \l__codedoc_detect_internals_tl
+ \c_catcode_active_space_tl
+ \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl ^^M
+ \__codedoc_if_detect_internals_ok:NF \l__codedoc_detect_internals_tl
+ {
+ \tl_set_eq:NN \l__codedoc_detect_internals_cs_tl \l__codedoc_detect_internals_tl
+ \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl _
+ \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl :
+ \__codedoc_trim_right:No \l__codedoc_detect_internals_tl { \token_to_str:N : }
+ \msg_warning:nnxxx { l3doc-TUB } { foreign-internal }
+ { \tl_to_str:N \l__codedoc_detect_internals_cs_tl }
+ { \tl_to_str:N \l__codedoc_detect_internals_tl }
+ { \tl_to_str:N \g__codedoc_module_name_tl }
+ }
+ }
+ }
+\group_end:
+\prg_new_protected_conditional:Npnn \__codedoc_if_detect_internals_ok:N #1 { F }
+ {
+ \__codedoc_str_if_begin:ooTF {#1} { \g__codedoc_module_name_tl _ }
+ { \prg_return_true: }
+ {
+ \__codedoc_str_if_begin:ooTF {#1} { \g__codedoc_module_name_tl : }
+ { \prg_return_true: }
+ {
+ \bool_if:NTF \g__codedoc_kernel_bool
+ {
+ \__codedoc_str_if_begin:ooTF {#1} { kernel _ }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ { \prg_return_false: }
+ }
+ }
+ }
+\cs_new:Npn \__codedoc_signature_base_form:n #1
+ { \__codedoc_signature_base_form_aux:n #1 \q_stop }
+\cs_new:Npn \__codedoc_signature_base_form_aux:n #1
+ {
+ \str_case:nnTF {#1}
+ {
+ { N } { N }
+ { c } { N }
+ { n } { n }
+ { o } { n }
+ { f } { n }
+ { x } { n }
+ { V } { n }
+ { v } { n }
+ }
+ { \__codedoc_signature_base_form_aux:n }
+ { \__codedoc_signature_base_form_aux:w #1 }
+ }
+\cs_new:Npn \__codedoc_signature_base_form_aux:w #1 \q_stop
+ { \exp_not:n {#1} }
+\cs_new:Npn \__codedoc_predicate_from_base:n #1
+ {
+ \__codedoc_get_function_name:n {#1}
+ \tl_to_str:n { _p: }
+ \__codedoc_get_function_signature:n {#1}
+ }
+\cs_new:Npn \__codedoc_get_function_name:n #1
+ { \__codedoc_split_function_do:nn {#1} { \use_i:nnn } }
+\cs_new:Npn \__codedoc_get_function_signature:n #1
+ { \__codedoc_split_function_do:nn {#1} { \use_ii:nnn } }
+\cs_set_protected:Npn \__codedoc_tmpa:w #1
+ {
+ \cs_new:Npn \__codedoc_split_function_do:nn ##1
+ {
+ \exp_after:wN \__codedoc_split_function_auxi:w
+ \tl_to_str:n {##1} \q_mark \c_true_bool
+ #1 \q_mark \c_false_bool
+ \q_stop
+ }
+ \cs_new:Npn \__codedoc_split_function_auxi:w
+ ##1 #1 ##2 \q_mark ##3##4 \q_stop ##5
+ { \__codedoc_split_function_auxii:w {##5} ##1 \q_mark \q_stop {##2} ##3 }
+ \cs_new:Npn \__codedoc_split_function_auxii:w
+ ##1##2 \q_mark ##3 \q_stop
+ { ##1 {##2} }
+ }
+\exp_args:No \__codedoc_tmpa:w { \token_to_str:N : }
+\cs_generate_variant:Nn \__codedoc_split_function_do:nn { o }
+\cs_new_protected:Npn \__codedoc_key_get_base:nN #1#2
+ {
+ \__codedoc_if_almost_str:nTF {#1}
+ {
+ \__codedoc_key_get_base_TF:nN {#1} \l__codedoc_tmpa_tl
+ \tl_set:Nx #2
+ { \__codedoc_split_function_do:on \l__codedoc_tmpa_tl { \__codedoc_base_form_aux:nnN } }
+ }
+ { \tl_set:Nn #2 {#1} }
+ }
+\cs_new:Npx \__codedoc_key_get_base_TF:nN #1#2
+ {
+ \tl_set:Nx #2 { \exp_not:N \tl_to_str:n {#1} \scan_stop: }
+ \tl_if_in:NnTF #2 { \tl_to_str:n { F } \scan_stop: }
+ {
+ \tl_if_in:NnF #2 { \tl_to_str:n { TF } \scan_stop: }
+ {
+ \tl_replace_once:Nnn #2
+ { \tl_to_str:n { F } \scan_stop: }
+ { \tl_to_str:n { TF } \scan_stop: }
+ }
+ }
+ {
+ \tl_replace_once:Nnn #2
+ { \tl_to_str:n { T } \scan_stop: }
+ { \tl_to_str:n { TF } \scan_stop: }
+ }
+ \tl_remove_once:Nn #2 { \scan_stop: }
+ }
+\cs_new:Npn \__codedoc_base_form_aux:nnN #1#2#3
+ {
+ \exp_not:n {#1}
+ \bool_if:NT #3
+ {
+ \token_to_str:N :
+ \str_if_eq:nnTF { #1 ~ } { \exp_args }
+ { \exp_not:n {#2} }
+ { \__codedoc_signature_base_form:n {#2} }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_base_form_signature_do:nnn #1#2#3
+ {
+ \__codedoc_split_function_do:nn {#1}
+ { \__codedoc_base_form_aux:nnnnnN {#1} {#2} {#3} }
+ }
+\cs_new_protected:Npn \__codedoc_base_form_aux:nnnnnN #1#2#3#4#5#6
+ {
+ \bool_if:NTF #6
+ {
+ \tl_if_head_eq_charcode:nNTF {#4} :
+ { #2 {#1} }
+ {
+ \use:x
+ {
+ \exp_not:n {#3}
+ { \__codedoc_base_form_aux:nnN {#4} {#5} #6 }
+ }
+ {#4} {#5}
+ }
+ }
+ { #2 {#1} }
+ }
+\prg_new_conditional:Npnn \__codedoc_date_compare:nNn #1#2#3 { TF , T , F , p }
+ { \__codedoc_date_compare_aux:w #1--- \q_mark #2 #3--- \q_stop }
+\cs_new:Npn \__codedoc_date_compare_aux:w
+ #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop
+ {
+ \__codedoc_date_compare_aux:nnnNnnn
+ { \tl_if_empty:nTF {#1} { 0 } {#1} }
+ { \tl_if_empty:nTF {#2} { 0 } {#2} }
+ { \tl_if_empty:nTF {#3} { 0 } {#3} }
+ #5
+ { \tl_if_empty:nTF {#6} { 0 } {#6} }
+ { \tl_if_empty:nTF {#7} { 0 } {#7} }
+ { \tl_if_empty:nTF {#8} { 0 } {#8} }
+ }
+\cs_new:Npn \__codedoc_date_compare_aux:nnnNnnn #1#2#3#4#5#6#7
+ {
+ \int_compare:nNnTF {#1} = {#5}
+ {
+ \int_compare:nNnTF {#2} = {#6}
+ {
+ \int_compare:nNnTF {#3} #4 {#7}
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ {
+ \int_compare:nNnTF {#2} #4 {#6}
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ }
+ {
+ \int_compare:nNnTF {#1} #4 {#5}
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ \use_none:n
+ \q_stop
+ }
+\cs_new:Npn \__codedoc_gprop_name:n #1 { g__codedoc ~ \tl_to_str:n {#1} }
+\cs_new:Npn \__codedoc_lseq_name:n #1 { l__codedoc ~ \tl_to_str:n {#1} }
+\msg_new:nnnn { l3doc-TUB } { no-signature-TF }
+ { Function/macro~'#1'~cannot~be~turned~into~a~conditional. }
+ {
+ A~function~or~macro~environment~with~option~pTF,~TF~or~noTF~
+ received~the~argument~'#1'.~This~function's~name~has~no~
+ ':'~hence~it~is~not~clear~where~to~add~'_p'~or~'TF'.~
+ Please~follow~expl3~naming~conventions.
+ }
+\msg_new:nnn { l3doc-TUB } { deprecated-function }
+ { The~deprecated~function(s)~'#1'~should~have~been~removed~on~#2. }
+\msg_new:nnn { l3doc-TUB } { date-format }
+ { The~date~'#1'~should~be~given~in~YYYY-MM-DD~format. }
+\msg_new:nnn { l3doc-TUB } { syntax-nested-function }
+ {
+ The~'syntax'~environment~should~be~used~in~the~
+ innermost~'function'~environment.
+ }
+\msg_new:nnn { l3doc-TUB } { multiple-syntax }
+ {
+ The~'syntax'~environment~should~only~be~used~once~in~
+ a~'function'~environment.
+ }
+\msg_new:nnn { l3doc-TUB } { deprecated-option }
+ { The~option~'#1'~has~been~deprecated~for~'#2'. }
+\msg_new:nnn { l3doc-TUB } { foreign-internal }
+ {
+ A~control~sequence~of~the~form~'...__#1'~was~used.~
+ It~should~only~be~used~in~the~module~'#2'
+ \tl_if_empty:nF {#3} { ,~not~in~'#3' } .
+ }
+\DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } }
+\DeclareOption { full }
+ {
+ \bool_gset_true:N \g__codedoc_typeset_documentation_bool
+ \bool_gset_true:N \g__codedoc_typeset_implementation_bool
+ }
+\DeclareOption { onlydoc }
+ {
+ \bool_gset_true:N \g__codedoc_typeset_documentation_bool
+ \bool_gset_false:N \g__codedoc_typeset_implementation_bool
+ }
+\DeclareOption { check }
+ { \bool_gset_true:N \g__codedoc_checkfunc_bool }
+\DeclareOption { nocheck }
+ { \bool_gset_false:N \g__codedoc_checkfunc_bool }
+\DeclareOption { checktest }
+ { \bool_gset_true:N \g__codedoc_checktest_bool }
+\DeclareOption { nochecktest }
+ { \bool_gset_false:N \g__codedoc_checktest_bool }
+\DeclareOption { kernel }
+ { \bool_gset_true:N \g__codedoc_kernel_bool }
+\DeclareOption { stdmodule }
+ { \bool_gset_false:N \g__codedoc_kernel_bool }
+\DeclareOption { cm-default }
+ { \bool_gset_false:N \g__codedoc_lmodern_bool }
+\DeclareOption { lm-default }
+ { \bool_gset_true:N \g__codedoc_lmodern_bool }
+\DeclareOption* { \PassOptionsToClass { \CurrentOption } { ltugboat } }
+\ExecuteOptions { full, kernel, nocheck, nochecktest, lm-default }
+%%FMi \PassOptionsToClass { a4paper } { article }
+\msg_new:nnn { l3doc-TUB } { input-cfg }
+ { Local~config~file~l3doc-TUB.cfg~loaded. }
+\file_if_exist:nT { l3doc-TUB.cfg }
+ {
+ \file_input:nT { l3doc-TUB.cfg }
+ {
+ \cs_if_exist:cF { ExplMakeTitle }
+ { \msg_info:nn { l3doc-TUB } { input-cfg } }
+ }
+ }
+\ProcessOptions
+\LoadClass[final]{ltugboat}
+\RequirePackage{doc}
+
+\newcommand\bibname{References} % otherwise \bibname is undefined at \Finale
+\TBtocsectionspace=0pt plus 1pt
+
+\IndexPrologue
+ {\section*{Index}
+ \markboth{Index}{Index}
+ \addcontentsline{toc}{section}{Index}
+ \noindent
+ Underlined numbers point to the definition,
+ italicized numbers denote the pages where the
+ corresponding entry is described,
+ all others indicate the places where it is used.}
+%\EnableCrossrefs
+%\CodelineIndex
+
+\RequirePackage
+ {
+ microtype,
+ array,
+ alphalph,
+ amsmath,
+ amssymb,
+ booktabs,
+ color,
+ colortbl,
+ hologo,
+ enumitem,
+ pifont,
+ textcomp,
+ trace,
+ underscore,
+ csquotes,
+ fancyvrb,
+ verbatim
+ }
+\raggedbottom
+\bool_if:NT \g__codedoc_lmodern_bool
+ {
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{lmodern}
+ \group_begin:
+ \ttfamily
+ \DeclareFontShape{T1}{lmtt}{m}{it}{<->ec-lmtto10}{}
+ \group_end:
+ }
+
+\RequirePackage{hypdoc}
+
+%%FMi:
+\hypersetup{allcolors=black}
+
+\cs_gset:Npn \MakePrivateLetters
+ {
+ \char_set_catcode_letter:N \@
+ \char_set_catcode_letter:N \_
+ \char_set_catcode_letter:N \:
+ }
+\setcounter{StandardModuleDepth}{1}
+\@addtoreset{CodelineNo}{part}
+\tl_replace_once:Nnn \theCodelineNo
+ { \HDorg@theCodelineNo }
+ { \textcolor[gray]{0.5} { \sffamily\tiny\arabic{CodelineNo} } }
+\fvset{gobble=2}
+\cs_gset_eq:NN \verbatim \Verbatim
+\cs_gset_eq:NN \endverbatim \endVerbatim
+\cs_set_protected:Npn \ifnot@excluded
+ {
+ \exp_args:Nxx \expanded@notin
+ { \c__codedoc_backslash_tl \tl_to_str:N \macro@namepart , }
+ { \exp_args:NV \tl_to_str:n \index@excludelist }
+ }
+\cs_new:Npn \pdfstringnewline { : ~ }
+\DeclareExpandableDocumentCommand
+ { \__codedoc_pdfstring_newline:w } { s o m } { \pdfstringnewline #3 }
+\pdfstringdefDisableCommands
+ { \cs_set_eq:NN \\ \__codedoc_pdfstring_newline:w }
+\setlength \textwidth { 385pt }
+\addtolength \marginparwidth { 30pt }
+\addtolength \oddsidemargin { 20pt }
+\addtolength \evensidemargin { 20pt }
+\cs_new_eq:NN \__codedoc_oldlist:nn \list
+\cs_gset:Npn \list #1 #2
+ { \__codedoc_oldlist:nn {#1} { #2 \dim_zero:N \listparindent } }
+\setlength \parindent { 2em }
+\setlength \itemindent { 0pt }
+\setlength \parskip { 1pt plus 3pt minus 0pt }
+\tl_gset:Nn \partname {File}
+\@addtoreset{section}{part}
+\cs_gset:Npn \l@section #1#2
+ {
+ \ifnum \c@tocdepth >\z@
+ \addpenalty\@secpenalty
+ \addvspace{\TBtocsectionspace}%
+ \setlength\@tempdima{2.5em} % was 1.5em
+ \begingroup
+ \parindent \z@ \rightskip \@pnumwidth
+ \parfillskip -\@pnumwidth
+ \leavevmode \TBtocsectionfont
+ \advance\leftskip\@tempdima
+ \hskip -\leftskip
+ #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ \endgroup
+ \fi
+ }
+\cs_gset:Npn \l@subsection
+ { \@dottedtocline{2}{2.5em}{2.3em} } % #2 = 1.5em
+\AtBeginDocument
+ {
+ \MakeShortVerb \"
+ \MakeShortVerb \|
+ \onecolumn
+ \SelfDocumenting
+ }
+\AtEndDocument
+ {
+ \DeleteShortVerb \"
+ \DeleteShortVerb \|
+ }
+\providecommand*\eTeX{\hologo{eTeX}}
+\providecommand*\IniTeX{\hologo{iniTeX}}
+\providecommand*\Lua{Lua}
+\providecommand*\LuaTeX{\hologo{LuaTeX}}
+\providecommand*\pdfTeX{\hologo{pdfTeX}}
+\providecommand*\XeTeX{\hologo{XeTeX}}
+\providecommand*\pTeX{p\kern-.2em\hologo{TeX}}
+\providecommand*\upTeX{up\kern-.2em\hologo{TeX}}
+\providecommand*\epTeX{$\varepsilon$-\pTeX}
+\providecommand*\eupTeX{$\varepsilon$-\upTeX}
+\DeclareDocumentCommand \cmd { O{} m }
+ { \__codedoc_cmd:no {#1} { \token_to_str:N #2 } }
+\DeclareDocumentCommand \cs { O{} m }
+ { \__codedoc_cmd:no {#1} { \c__codedoc_backslash_tl #2 } }
+\DeclareDocumentCommand \tn { O{} m }
+ {
+ \__codedoc_cmd:no
+ { module = TeX , replace = false , #1 }
+ { \c__codedoc_backslash_tl #2 }
+ }
+\DeclareDocumentCommand \meta { m }
+ { \__codedoc_meta:n {#1} }
+\DeclareExpandableDocumentCommand
+ { \__codedoc_pdfstring_cmd:w } { o m } { \token_to_str:N #2 }
+\DeclareExpandableDocumentCommand
+ { \__codedoc_pdfstring_cs:w } { o m } { \textbackslash \tl_to_str:n {#2} }
+\cs_new:Npn \__codedoc_pdfstring_meta:w #1
+ { < \tl_to_str:n {#1} > }
+\pdfstringdefDisableCommands
+ {
+ \cs_set_eq:NN \cmd \__codedoc_pdfstring_cmd:w
+ \cs_set_eq:NN \cs \__codedoc_pdfstring_cs:w
+ \cs_set_eq:NN \tn \__codedoc_pdfstring_cs:w
+ \cs_set_eq:NN \meta \__codedoc_pdfstring_meta:w
+ }
+\newcommand\Arg[1]
+ { \texttt{\char`\{} \meta{#1} \texttt{\char`\}} }
+\providecommand\marg[1]{ \Arg{#1} }
+\providecommand\oarg[1]{ \texttt[ \meta{#1} \texttt] }
+\providecommand\parg[1]{ \texttt( \meta{#1} \texttt) }
+\DeclareRobustCommand \file {\nolinkurl}
+\DeclareRobustCommand \env {\texttt}
+\DeclareRobustCommand \pkg {\textsf}
+\DeclareRobustCommand \cls {\textsf}
+\NewDocumentCommand \EnableDocumentation { }
+ { \bool_gset_true:N \g__codedoc_typeset_documentation_bool }
+\NewDocumentCommand \EnableImplementation { }
+ { \bool_gset_true:N \g__codedoc_typeset_implementation_bool }
+\NewDocumentCommand \DisableDocumentation { }
+ { \bool_gset_false:N \g__codedoc_typeset_documentation_bool }
+\NewDocumentCommand \DisableImplementation { }
+ { \bool_gset_false:N \g__codedoc_typeset_implementation_bool }
+\NewDocumentEnvironment { documentation } { }
+ {
+ \bool_if:NTF \g__codedoc_typeset_documentation_bool
+ { \bool_set_false:N \l__codedoc_in_implementation_bool }
+ { \comment }
+ }
+ { \bool_if:NF \g__codedoc_typeset_documentation_bool { \endcomment } }
+\NewDocumentEnvironment { implementation } { }
+ {
+ \bool_if:NTF \g__codedoc_typeset_implementation_bool
+ { \bool_set_true:N \l__codedoc_in_implementation_bool }
+ { \comment }
+ }
+ { \bool_if:NF \g__codedoc_typeset_implementation_bool { \endcomment } }
+\DeclareDocumentEnvironment { variable } { O{} +v }
+ {
+ \bool_if:NTF \l__codedoc_in_implementation_bool
+ { \__codedoc_macro:nnw { var , #1 } {#2} }
+ { \__codedoc_function:nnw {#1} {#2} }
+ }
+ {
+ \bool_if:NTF \l__codedoc_in_implementation_bool
+ { \__codedoc_macro_end: }
+ { \__codedoc_function_end: }
+ }
+\DeclareDocumentEnvironment { function } { O{} +v }
+ { \__codedoc_function:nnw {#1} {#2} }
+ { \__codedoc_function_end: }
+\DeclareDocumentEnvironment { macro } { O{} +v }
+ { \__codedoc_macro:nnw {#1} {#2} }
+ { \__codedoc_macro_end: }
+\NewDocumentEnvironment { syntax } { }
+ { \__codedoc_syntax:w }
+ {
+ \__codedoc_syntax_end:
+ \ignorespacesafterend
+ }
+\NewDocumentEnvironment { texnote } { }
+ {
+ \endgraf
+ \vspace{3mm}
+ \small\textbf{\TeX~hackers~note:}
+ }
+ {
+ \vspace{3mm}
+ }
+\NewDocumentEnvironment { arguments } { }
+ {
+ \enumerate [
+ nolistsep ,
+ label = \texttt{\#\arabic*} ~ : ,
+ labelsep = * ,
+ ]
+ }
+ {
+ \endenumerate
+ }
+\NewDocumentCommand { \CodedocExplain } { }
+ { \CodedocExplainEXP \ \CodedocExplainREXP \ \CodedocExplainTF }
+\NewDocumentCommand { \CodedocExplainEXP } { }
+ {
+ \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{expstar}{}}%
+ \__codedoc_typeset_exp:\ indicates~fully~expandable~functions,~which~
+ can~be~used~within~an~\texttt{x}-type~argument~(in~plain~
+ \TeX{}~terms,~inside~an~\cs{edef}),~as~well~as~within~an~
+ \texttt{f}-type~argument.
+ }
+\NewDocumentCommand { \CodedocExplainREXP } { }
+ {
+ \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{rexpstar}{}}%
+ \__codedoc_typeset_rexp:\ indicates~
+ restricted~expandable~functions,~which~can~be~used~within~an~
+ \texttt{x}-type~argument~but~cannot~be~fully~expanded~within~an~
+ \texttt{f}-type~argument.
+ }
+\NewDocumentCommand { \CodedocExplainTF } { }
+ {
+ \raisebox{\baselineskip}[0pt][0pt]{\hypertarget{explTF}{}}%
+ \__codedoc_typeset_TF:\ indicates~conditional~(\texttt{if})~functions~
+ whose~variants~with~\texttt{T},~\texttt{F}~and~\texttt{TF}~
+ argument~specifiers~expect~different~
+ \enquote{true}/\enquote{false}~branches.
+ }
+\keys_define:nn { l3doc-TUB/cmd }
+ {
+ index .tl_set:N = \l__codedoc_cmd_index_tl ,
+ module .tl_set:N = \l__codedoc_cmd_module_tl ,
+ no-index .bool_set:N = \l__codedoc_cmd_noindex_bool ,
+ replace .bool_set:N = \l__codedoc_cmd_replace_bool ,
+ }
+\cs_new_protected:Npn \__codedoc_cmd:nn #1#2
+ {
+ \bool_set_false:N \l__codedoc_cmd_noindex_bool
+ \bool_set_true:N \l__codedoc_cmd_replace_bool
+ \tl_set:Nn \l__codedoc_cmd_index_tl { \q_no_value }
+ \tl_set:Nn \l__codedoc_cmd_module_tl { \q_no_value }
+ \keys_set:nn { l3doc-TUB/cmd } {#1}
+ \tl_set:Nn \l__codedoc_cmd_tl {#2}
+ \bool_if:NT \l__codedoc_cmd_replace_bool
+ {
+ \tl_set_rescan:Nnn \l__codedoc_tmpb_tl { } { _ }
+ \tl_replace_all:Non \l__codedoc_cmd_tl \l__codedoc_tmpb_tl { _ }
+ \__codedoc_replace_at_at:N \l__codedoc_cmd_tl
+ \tl_replace_all:Nno \l__codedoc_cmd_tl { _ } \l__codedoc_tmpb_tl
+ }
+ \mode_if_math:T { \mbox }
+ {
+ \verbatim@font
+ \__codedoc_if_almost_str:VT \l__codedoc_cmd_tl
+ {
+ \tl_set:Nx \l__codedoc_cmd_tl { \tl_to_str:N \l__codedoc_cmd_tl }
+ \tl_replace_all:Non \l__codedoc_cmd_tl
+ { \token_to_str:N _ } { \_ }
+ }
+ \tl_replace_all:Nnn \l__codedoc_cmd_tl { ~ } { \@xobeysp }
+ \l__codedoc_cmd_tl
+ \@
+ }
+ \bool_if:NF \l__codedoc_cmd_noindex_bool
+ {
+ \quark_if_no_value:NF \l__codedoc_cmd_index_tl
+ {
+ \tl_set:Nx \l__codedoc_cmd_tl
+ { \c_backslash_str \exp_not:o { \l__codedoc_cmd_index_tl } }
+ }
+
+ \exp_args:No \__codedoc_key_get:n { \l__codedoc_cmd_tl }
+ \quark_if_no_value:NF \l__codedoc_cmd_module_tl
+ {
+ \tl_set:Nx \l__codedoc_index_module_tl
+ { \tl_to_str:N \l__codedoc_cmd_module_tl }
+ }
+ \__codedoc_special_index_module:ooonN
+ { \l__codedoc_index_key_tl }
+ { \l__codedoc_index_macro_tl }
+ { \l__codedoc_index_module_tl }
+ { usage }
+ \l__codedoc_index_internal_bool
+ }
+ }
+\cs_generate_variant:Nn \__codedoc_cmd:nn { no }
+\cs_new_protected:Npn \__codedoc_meta:n #1
+ {
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \tl_map_inline:nn
+ { { 3 } { 4 } { 7 } { 8 } { 11 } { 12 } { 13 } }
+ {
+ \tl_set_rescan:Nnn \l__codedoc_tmpb_tl
+ { \char_set_catcode:nn { `_ } {##1} } { _ }
+ \tl_replace_all:Non \l__codedoc_tmpa_tl \l__codedoc_tmpb_tl
+ { \__codedoc_ensuremath_sb:n }
+ }
+ \exp_args:NV \__codedoc_meta_original:n \l__codedoc_tmpa_tl
+ }
+\cs_new_protected:Npn \__codedoc_ensuremath_sb:n #1
+ { \ensuremath { \sb {#1} } }
+\cs_new_protected:Npn \__codedoc_meta_original:n #1
+ {
+ \ensuremath \langle
+ \mode_if_math:T { \nfss@text }
+ {
+ \meta@font@select
+ \edef \meta@hyphen@restore
+ { \hyphenchar \the \font \the \hyphenchar \font }
+ \hyphenchar \font \m@ne
+ \language \l@nohyphenation
+ #1 \/
+ \meta@hyphen@restore
+ }
+ \ensuremath \rangle
+ }
+\cs_new_protected:Npn \__codedoc_typeset_exp:
+ { \hyperlink{expstar} {$\star$} }
+\cs_new_protected:Npn \__codedoc_typeset_rexp:
+ { \hyperlink{rexpstar} {\ding{73}} } % hollow star
+\cs_new_protected:Npn \__codedoc_typeset_TF:
+ {
+ \hyperlink{explTF}
+ {
+ \color{black}
+ \itshape TF
+ \makebox[0pt][r]
+ {
+ \color{red}
+ \underline { \phantom{\itshape TF} \kern-0.1em }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_typeset_aux:n #1
+ {
+ { \color[gray]{0.5} #1 }
+ }
+\cs_new_protected:Npn \__codedoc_get_hyper_target:nN #1#2
+ {
+ \tl_set:Nx #2 { \tl_to_str:n {#1} }
+ \tl_replace_all:Nxn #2 { \iow_char:N \_ } { / }
+ \tl_remove_all:Nx #2 { \iow_char:N \\ }
+ \tl_put_left:Nn #2 { doc/function// }
+ }
+\cs_generate_variant:Nn \__codedoc_get_hyper_target:nN { o , x }
+\cs_new_protected:Npn \__codedoc_names_get_seq:nN #1#2
+ {
+ \tl_set:Nx \l__codedoc_tmpa_tl { \tl_to_str:n {#1} }
+ \bool_if:NTF \l__codedoc_names_verb_bool
+ {
+ \seq_clear:N #2
+ \seq_put_right:NV #2 \l__codedoc_tmpa_tl
+ }
+ {
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl
+ { \iow_char:N \^^M \iow_char:N \% }
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl { \tl_to_str:n { ^ ^ A } }
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^I }
+ \tl_remove_all:Nx \l__codedoc_tmpa_tl { \iow_char:N \^^M }
+ \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
+ \exp_args:NNx \seq_set_from_clist:Nn #2
+ { \tl_to_str:N \l__codedoc_tmpa_tl }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_names_parse:
+ {
+ \tl_clear:N \l__codedoc_names_block_tl
+ \seq_map_function:NN
+ \l__codedoc_names_seq
+ \__codedoc_names_parse_one:n
+ }
+\cs_new_protected:Npn \__codedoc_names_parse_one:n #1
+ {
+ \__codedoc_split_function_do:nn {#1}
+ { \__codedoc_names_parse_one_aux:nnNn }
+ {#1}
+ }
+\cs_new_protected:Npn \__codedoc_names_parse_one_aux:nnNn #1#2#3#4
+ {
+ \bool_if:NTF #3
+ {
+ \tl_if_head_eq_charcode:nNTF {#2} :
+ { \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: } }
+ {
+ \exp_args:Nx \__codedoc_names_parse_aux:nnn
+ { \__codedoc_base_form_aux:nnN {#1} {#2} #3 }
+ {#1} {#2}
+ }
+ }
+ {
+ \bool_if:NT \l__codedoc_macro_TF_bool
+ { \msg_error:nnx { l3doc-TUB } { no-signature-TF } {#4} }
+ \__codedoc_names_parse_aux:nnn {#4} {#4} { \scan_stop: }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_names_parse_aux:nnn #1
+ { \exp_args:Nc \__codedoc_names_parse_aux:Nnn { \__codedoc_lseq_name:n {#1} } }
+\cs_new_protected:Npn \__codedoc_names_parse_aux:Nnn #1#2#3
+ {
+ \tl_if_in:NnF \l__codedoc_names_block_tl {#1}
+ {
+ \tl_put_right:Nn \l__codedoc_names_block_tl {#1}
+ \seq_clear_new:N #1
+ \seq_put_right:Nn #1 {#2}
+ }
+ \seq_put_right:Nn #1 {#3}
+ }
+\cs_new_protected:Npn \__codedoc_names_typeset:
+ {
+ \tl_map_function:NN \l__codedoc_names_block_tl
+ \__codedoc_names_typeset_auxi:n
+ }
+\cs_new_protected:Npn \__codedoc_names_typeset_auxi:n #1
+ {
+ \seq_pop:NN #1 \l__codedoc_tmpa_tl
+ \tl_gset_eq:NN \g__codedoc_base_name_tl \l__codedoc_tmpa_tl
+ \tl_greplace_all:Nno \g__codedoc_base_name_tl
+ { ~ } { \c_catcode_other_space_tl }
+ \seq_get:NN #1 \l__codedoc_tmpa_tl
+ \str_if_eq_x:nnTF { \l__codedoc_tmpa_tl } { \scan_stop: }
+ {
+ \seq_gclear:N \g__codedoc_variants_seq
+ \__codedoc_names_typeset_auxii:x { \g__codedoc_base_name_tl }
+ }
+ {
+ \seq_gset_eq:NN \g__codedoc_variants_seq #1
+ \seq_gpop:NN \g__codedoc_variants_seq \l__codedoc_tmpb_tl
+ \__codedoc_names_typeset_auxii:x
+ { \g__codedoc_base_name_tl : \l__codedoc_tmpb_tl }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_names_typeset_auxii:n #1
+ {
+ \bool_if:NT \l__codedoc_macro_pTF_bool
+ {
+ \__codedoc_names_typeset_block:xN
+ { \__codedoc_predicate_from_base:n {#1} }
+ \c_false_bool
+ }
+ \bool_if:NT \l__codedoc_macro_noTF_bool
+ { \__codedoc_names_typeset_block:nN {#1} \c_false_bool }
+ \__codedoc_names_typeset_block:nN {#1} \l__codedoc_macro_TF_bool
+ }
+\cs_generate_variant:Nn \__codedoc_names_typeset_auxii:n { x }
+\cs_new_protected:Npn \__codedoc_names_typeset_block:nN
+ {
+ \int_compare:nNnTF \l__codedoc_nested_macro_int = 0
+ { \__codedoc_typeset_function_block:nN }
+ { \__codedoc_macro_typeset_block:nN }
+ }
+\cs_generate_variant:Nn \__codedoc_names_typeset_block:nN { x }
+\prg_new_conditional:Npnn \__codedoc_if_macro_internal:n #1 { p , T , F , TF }
+ {
+ \bool_if:NTF \l__codedoc_macro_internal_set_bool
+ {
+ \bool_if:NTF \l__codedoc_macro_internal_bool
+ { \prg_return_true: } { \prg_return_false: }
+ }
+ {
+ \tl_if_empty:fTF
+ {
+ \exp_after:wN \__codedoc_if_macro_internal_aux:w
+ \tl_to_str:n { #1 ~ __ }
+ }
+ { \prg_return_false: } { \prg_return_true: }
+ }
+ }
+\exp_last_unbraced:NNNNo
+ \cs_new:Npn \__codedoc_if_macro_internal_aux:w #1 { \tl_to_str:n { __ } } { }
+\cs_new_protected:Npn \__codedoc_names_block_base_map:N #1
+ {
+ \tl_map_inline:Nn \l__codedoc_names_block_tl
+ {
+ \group_begin:
+ \seq_set_eq:NN \l__codedoc_tmpa_seq ##1
+ \seq_pop:NN \l__codedoc_tmpa_seq \l__codedoc_tmpa_tl
+ \seq_get:NN \l__codedoc_tmpa_seq \l__codedoc_tmpb_tl
+ \exp_args:NNx
+ \group_end:
+ #1
+ {
+ \l__codedoc_tmpa_tl
+ \str_if_eq_x:nnF { \l__codedoc_tmpb_tl } { \scan_stop: }
+ { : \l__codedoc_tmpb_tl }
+ \bool_if:NT \l__codedoc_macro_TF_bool { TF }
+ }
+ }
+ }
+\keys_define:nn { l3doc-TUB/function }
+ {
+ TF .value_forbidden:n = true ,
+ TF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ } ,
+ EXP .value_forbidden:n = true ,
+ EXP .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_EXP_bool
+ \bool_set_false:N \l__codedoc_macro_rEXP_bool
+ } ,
+ rEXP .value_forbidden:n = true ,
+ rEXP .code:n =
+ {
+ \bool_set_false:N \l__codedoc_macro_EXP_bool
+ \bool_set_true:N \l__codedoc_macro_rEXP_bool
+ } ,
+ pTF .value_forbidden:n = true ,
+ pTF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_pTF_bool
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ \bool_set_true:N \l__codedoc_macro_EXP_bool
+ \bool_set_false:N \l__codedoc_macro_rEXP_bool
+ } ,
+ noTF .value_forbidden:n = true ,
+ noTF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_noTF_bool
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ } ,
+ added .code:n = { \__codedoc_date_set:Nn \l__codedoc_date_added_tl {#1} },
+ updated .code:n = { \__codedoc_date_set:Nn \l__codedoc_date_updated_tl {#1} } ,
+ deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } ,
+ tested .code:n = { } ,
+ label .code:n =
+ {
+ \clist_set:Nn \l__codedoc_function_label_clist {#1}
+ \bool_set_true:N \l__codedoc_no_label_bool
+ } ,
+ verb .value_forbidden:n = true ,
+ verb .bool_set:N = \l__codedoc_names_verb_bool ,
+ module .tl_set:N = \l__codedoc_override_module_tl ,
+ }
+\cs_new_protected:Npn \__codedoc_date_set:Nn #1#2
+ {
+ \tl_set:Nn #1 {#2}
+ \regex_replace_once:nnNF
+ { \A(\d\d\d\d)[-/](\d\d?)[-/](\d\d?)\Z } { \1-\2-\3 } #1
+ {
+ \msg_error:nnn { l3doc-TUB } { date-format } {#2}
+ \tl_set:Nn #1 { 1970-01-01 }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_deprecated_on:n #1
+ {
+ \__codedoc_date_set:Nn \l__codedoc_tmpa_tl {#1}
+ \exp_args:No \__codedoc_date_compare:nNnT
+ { \l__codedoc_tmpa_tl } < { \tex_year:D - \tex_month:D - \tex_day:D }
+ {
+ \msg_error:nnxx { l3doc-TUB } { deprecated-function }
+ { \tl_to_str:N \l__codedoc_macro_argument_tl }
+ { \l__codedoc_tmpa_tl }
+ }
+ \bool_set_true:N \l__codedoc_macro_internal_bool
+ \bool_set_true:N \l__codedoc_macro_internal_set_bool
+ }
+\cs_new_protected:Npn \__codedoc_function:nnw #1#2
+ {
+ \__codedoc_function_typeset_start:
+ \__codedoc_function_init:
+ \tl_set:Nn \l__codedoc_macro_argument_tl {#2}
+ \keys_set:nn { l3doc-TUB/function } {#1}
+ \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq
+ \__codedoc_names_parse:
+ \__codedoc_function_typeset:
+ \__codedoc_function_reset:
+ \__codedoc_function_descr_start:w
+ }
+\cs_new_protected:Npn \__codedoc_function_end:
+ {
+ \__codedoc_function_descr_stop:
+ \__codedoc_function_assemble:
+ \__codedoc_function_typeset_stop:
+ }
+\cs_new_protected:Npn \__codedoc_function_typeset_start:
+ {
+ \par \bigskip \noindent
+ }
+\cs_new_protected:Npn \__codedoc_function_typeset_stop:
+ {
+ \par
+ \allowbreak
+ }
+\cs_new_protected:Npn \__codedoc_function_init:
+ {
+ \box_if_empty:NF \g__codedoc_syntax_box
+ { \msg_error:nn { l3doc-TUB } { syntax-nested-function } }
+ \coffin_clear:N \l__codedoc_descr_coffin
+ \box_gclear:N \g__codedoc_syntax_box
+ \coffin_clear:N \l__codedoc_syntax_coffin
+ \coffin_clear:N \l__codedoc_functions_coffin
+ \bool_set_false:N \l__codedoc_macro_TF_bool
+ \bool_set_false:N \l__codedoc_macro_pTF_bool
+ \bool_set_false:N \l__codedoc_macro_noTF_bool
+ \bool_set_false:N \l__codedoc_macro_EXP_bool
+ \bool_set_false:N \l__codedoc_macro_rEXP_bool
+ \bool_set_false:N \l__codedoc_no_label_bool
+ \bool_set_false:N \l__codedoc_names_verb_bool
+ \bool_set_true:N \l__codedoc_in_function_bool
+ \clist_clear:N \l__codedoc_function_label_clist
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+ \char_set_active_eq:NN \< \__codedoc_shorthand_meta:
+ \char_set_catcode_active:N \<
+ }
+\cs_new_protected:Npn \__codedoc_shorthand_meta:
+ { \mode_if_math:TF { < } { \__codedoc_shorthand_meta:w } }
+\cs_new_protected_nopar:Npn \__codedoc_shorthand_meta:w #1 > { \meta {#1} }
+\cs_new_protected:Npn \__codedoc_function_reset:
+ {
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+ }
+\cs_new_protected:Npn \__codedoc_function_typeset:
+ {
+ \dim_zero:N \l__codedoc_trial_width_dim
+ \hcoffin_set:Nn \l__codedoc_functions_coffin { \__codedoc_typeset_functions: }
+ \dim_set:Nn \l__codedoc_trial_width_dim
+ { \box_wd:N \l__codedoc_functions_coffin }
+ \bool_set:Nn \l__codedoc_long_name_bool
+ { \dim_compare_p:nNn \l__codedoc_trial_width_dim > \marginparwidth }
+ }
+\cs_new_protected:Npn \__codedoc_function_descr_start:w
+ {
+ \vcoffin_set:Nnw \l__codedoc_descr_coffin { \textwidth }
+ \noindent \ignorespaces
+ }
+\cs_new_protected:Npn \__codedoc_function_descr_stop:
+ { \vcoffin_set_end: }
+\cs_new_protected:Npn \__codedoc_function_assemble:
+ {
+ \hcoffin_set:Nn \l__codedoc_syntax_coffin
+ { \box_use_drop:N \g__codedoc_syntax_box }
+ \bool_if:NTF \l__codedoc_long_name_bool
+ {
+ \coffin_join:NnnNnnnn
+ \l__codedoc_output_coffin {hc} {vc}
+ \l__codedoc_syntax_coffin {l} {T}
+ {0pt} {0pt}
+ \coffin_join:NnnNnnnn
+ \l__codedoc_output_coffin {l} {t}
+ \l__codedoc_functions_coffin {r} {t}
+ {-\marginparsep} {0pt}
+ \coffin_join:NnnNnnnn
+ \l__codedoc_output_coffin {l} {b}
+ \l__codedoc_descr_coffin {l} {t}
+ {0.75\marginparwidth + \marginparsep} {-\medskipamount}
+ \coffin_typeset:Nnnnn \l__codedoc_output_coffin
+ {\l__codedoc_descr_coffin-l} {\l__codedoc_descr_coffin-t}
+ {0pt} {0pt}
+ }
+ {
+ \coffin_join:NnnNnnnn
+ \l__codedoc_output_coffin {hc} {vc}
+ \l__codedoc_syntax_coffin {l} {t}
+ {0pt} {0pt}
+ \coffin_join:NnnNnnnn
+ \l__codedoc_output_coffin {l} {b}
+ \l__codedoc_descr_coffin {l} {t}
+ {0pt} {-\medskipamount}
+ \coffin_join:NnnNnnnn
+ \l__codedoc_output_coffin {l} {t}
+ \l__codedoc_functions_coffin {r} {t}
+ {-\marginparsep} {0pt}
+ \coffin_typeset:Nnnnn \l__codedoc_output_coffin
+ {\l__codedoc_syntax_coffin-l} {\l__codedoc_syntax_coffin-T}
+ {0pt} {0pt}
+ }
+ }
+\cs_new_protected:Npn \__codedoc_typeset_functions:
+ {
+ \small\ttfamily
+ \HD@savedestfalse
+ \HD@target
+ \Hy@MakeCurrentHref { HD. \int_use:N \c@HD@hypercount }
+ \begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} }
+ \toprule
+ \__codedoc_function_extra_labels:
+ \__codedoc_names_typeset:
+ \__codedoc_typeset_dates:
+ \bottomrule
+ \end{tabular}
+ \normalfont\normalsize
+ }
+\cs_new_protected:Npn \__codedoc_typeset_function_block:nN #1#2
+ {
+ \__codedoc_function_index:x
+ { #1 \bool_if:NT #2 { \tl_to_str:n {TF} } }
+ \__codedoc_function_label:xN {#1} #2
+ #1
+ \bool_if:NT #2 { \__codedoc_typeset_TF: }
+ \__codedoc_typeset_expandability:
+ \seq_if_empty:NF \g__codedoc_variants_seq
+ { \__codedoc_typeset_variant_list:nN {#1} #2 }
+ \\
+ }
+\cs_generate_variant:Nn \__codedoc_typeset_function_block:nN { x }
+\cs_new_protected:Npn \__codedoc_function_index:n #1
+ {
+ \seq_gput_right:Nn \g_doc_functions_seq {#1}
+ \__codedoc_special_index:nn {#1} { usage }
+ }
+\cs_generate_variant:Nn \__codedoc_function_index:n { x }
+\cs_new_protected:Npn \__codedoc_typeset_expandability:
+ {
+ &
+ \bool_if:NT \l__codedoc_macro_EXP_bool { \__codedoc_typeset_exp: }
+ \bool_if:NT \l__codedoc_macro_rEXP_bool { \__codedoc_typeset_rexp: }
+ }
+\cs_new_protected:Npn \__codedoc_typeset_variant_list:nN #1#2
+ {
+ \\
+ \__codedoc_typeset_aux:n { \__codedoc_get_function_name:n {#1} }
+ :
+ \int_compare:nTF { \seq_count:N \g__codedoc_variants_seq == 1 }
+ { \seq_use:Nn \g__codedoc_variants_seq { } }
+ {
+ \textrm(
+ \seq_use:Nn \g__codedoc_variants_seq { \textrm| }
+ \textrm)
+ }
+ \bool_if:NT #2 { \__codedoc_typeset_TF: }
+ \__codedoc_typeset_expandability:
+ }
+\cs_new_protected:Npn \__codedoc_function_extra_labels:
+ {
+ \bool_if:NT \l__codedoc_no_label_bool
+ {
+ \clist_map_inline:Nn \l__codedoc_function_label_clist
+ {
+ \__codedoc_get_hyper_target:oN { \token_to_str:N ##1 }
+ \l__codedoc_tmpa_tl
+ \exp_args:No \label { \l__codedoc_tmpa_tl }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_function_label:nN #1#2
+ {
+ \bool_if:NF \l__codedoc_no_label_bool
+ {
+ \__codedoc_get_hyper_target:xN
+ {
+ \exp_not:n {#1}
+ \bool_if:NT #2 { \tl_to_str:n {TF} }
+ }
+ \l__codedoc_tmpa_tl
+ \exp_args:No \label { \l__codedoc_tmpa_tl }
+ }
+ }
+\cs_generate_variant:Nn \__codedoc_function_label:nN { x }
+\cs_new:Npn \__codedoc_typeset_dates:
+ {
+ \bool_lazy_and:nnF
+ { \tl_if_empty_p:N \l__codedoc_date_added_tl }
+ { \tl_if_empty_p:N \l__codedoc_date_updated_tl }
+ { \midrule }
+ \tl_if_empty:NF \l__codedoc_date_added_tl
+ {
+ \multicolumn { 2 } { @{} r @{} }
+ { \scriptsize New: \, \l__codedoc_date_added_tl } \\
+ }
+
+ \tl_if_empty:NF \l__codedoc_date_updated_tl
+ {
+ \multicolumn { 2 } { @{} r @{} }
+ { \scriptsize Updated: \, \l__codedoc_date_updated_tl } \\
+ }
+ }
+\dim_new:N \l__codedoc_syntax_dim
+\cs_new_protected:Npn \__codedoc_syntax:w
+ {
+ \box_if_empty:NF \g__codedoc_syntax_box
+ { \msg_error:nn { l3doc-TUB } { multiple-syntax } }
+ \dim_set:Nn \l__codedoc_syntax_dim
+ {
+ \textwidth
+ \bool_if:NT \l__codedoc_long_name_bool
+ { + 0.75 \marginparwidth - \l__codedoc_trial_width_dim }
+ }
+ \hbox_gset:Nw \g__codedoc_syntax_box
+ \small \ttfamily
+ \arrayrulecolor{white}
+ \begin{tabular} { @{} l @{} }
+ \toprule
+ \begin{minipage}[t]{\l__codedoc_syntax_dim}
+ \raggedright
+ \obeyspaces
+ \obeylines
+ }
+\cs_new_protected:Npn \__codedoc_syntax_end:
+ {
+ \end{minipage}
+ \end{tabular}
+ \arrayrulecolor{black}
+ \hbox_gset_end:
+ \bool_if:NF \l__codedoc_in_function_bool
+ {
+ \begin{quote}
+ \mode_leave_vertical:
+ \box_use_drop:N \g__codedoc_syntax_box
+ \end{quote}
+ }
+ }
+\keys_define:nn { l3doc-TUB/macro }
+ {
+ aux .value_forbidden:n = true ,
+ aux .code:n =
+ {
+ \msg_warning:nnnn { l3doc-TUB } { deprecated-option }
+ { aux } { function/macro }
+ } ,
+ internal .value_forbidden:n = true ,
+ internal .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_internal_bool
+ \bool_set_true:N \l__codedoc_macro_internal_set_bool
+ } ,
+ int .value_forbidden:n = true ,
+ int .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_internal_bool
+ \bool_set_true:N \l__codedoc_macro_internal_set_bool
+ } ,
+ var .value_forbidden:n = true ,
+ var .code:n =
+ { \bool_set_true:N \l__codedoc_macro_var_bool } ,
+ TF .value_forbidden:n = true ,
+ TF .code:n =
+ { \bool_set_true:N \l__codedoc_macro_TF_bool } ,
+ pTF .value_forbidden:n = true ,
+ pTF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ \bool_set_true:N \l__codedoc_macro_pTF_bool
+ \bool_set_true:N \l__codedoc_macro_EXP_bool
+ \bool_set_false:N \l__codedoc_macro_rEXP_bool
+ } ,
+ noTF .value_forbidden:n = true ,
+ noTF .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_TF_bool
+ \bool_set_true:N \l__codedoc_macro_noTF_bool
+ } ,
+ EXP .value_forbidden:n = true ,
+ EXP .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_EXP_bool
+ \bool_set_false:N \l__codedoc_macro_rEXP_bool
+ } ,
+ rEXP .value_forbidden:n = true ,
+ rEXP .code:n =
+ {
+ \bool_set_false:N \l__codedoc_macro_EXP_bool
+ \bool_set_true:N \l__codedoc_macro_rEXP_bool
+ } ,
+ tested .code:n =
+ {
+ \bool_set_true:N \l__codedoc_macro_tested_bool
+ } ,
+ added .code:n = {} , % TODO
+ updated .code:n = {} , % TODO
+ deprecated .code:n = { \__codedoc_deprecated_on:n {#1} } ,
+ verb .bool_set:N = \l__codedoc_names_verb_bool ,
+ module .tl_set:N = \l__codedoc_override_module_tl ,
+ documented-as .tl_set:N = \l__codedoc_macro_documented_tl ,
+ }
+\cs_new_protected:Npn \__codedoc_macro:nnw #1#2
+ {
+ \__codedoc_macro_init:
+ \tl_set:Nn \l__codedoc_macro_argument_tl {#2}
+ \keys_set:nn { l3doc-TUB/macro } {#1}
+ \__codedoc_names_get_seq:nN {#2} \l__codedoc_names_seq
+ \__codedoc_names_parse:
+ \__codedoc_macro_save_names:
+ \__codedoc_names_typeset:
+ \__codedoc_macro_dump:
+ \__codedoc_macro_reset:
+ }
+\cs_new_protected:Npn \__codedoc_macro_init:
+ {
+ \int_incr:N \l__codedoc_nested_macro_int
+ \bool_set_false:N \l__codedoc_macro_internal_bool
+ \bool_set_false:N \l__codedoc_macro_internal_set_bool
+ \bool_set_false:N \l__codedoc_macro_TF_bool
+ \bool_set_false:N \l__codedoc_macro_pTF_bool
+ \bool_set_false:N \l__codedoc_macro_noTF_bool
+ \bool_set_false:N \l__codedoc_macro_EXP_bool
+ \bool_set_false:N \l__codedoc_macro_rEXP_bool
+ \bool_set_false:N \l__codedoc_macro_var_bool
+ \bool_set_false:N \l__codedoc_macro_tested_bool
+ \bool_set_false:N \l__codedoc_names_verb_bool
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+ \tl_clear:N \l__codedoc_macro_documented_tl
+ \cs_set_eq:NN \testfile \__codedoc_print_testfile:n
+ \box_clear:N \l__codedoc_macro_index_box
+ \vbox_set:Nn \l__codedoc_macro_box
+ {
+ \hbox:n
+ {
+ \strut
+ \int_compare:nNnT \l__codedoc_macro_int = 0
+ { \HD@target }
+ }
+ \vskip \int_eval:n { \l__codedoc_macro_int - 1 } \baselineskip
+ }
+ }
+\cs_new_protected:Npn \__codedoc_macro_reset:
+ {
+ \tl_set:Nn \l__codedoc_override_module_tl { \q_no_value }
+ }
+\cs_new_protected:Npn \__codedoc_macro_save_names:
+ {
+ \tl_if_empty:NTF \l__codedoc_macro_documented_tl
+ { \__codedoc_names_block_base_map:N \__codedoc_macro_save_names_aux:n }
+ {
+ \seq_gput_right:Nf \g__codedoc_nested_names_seq
+ { \exp_after:wN \token_to_str:N \l__codedoc_macro_documented_tl }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_macro_save_names_aux:n #1
+ { \seq_gput_right:Nn \g__codedoc_nested_names_seq {#1} }
+\cs_new_protected:Npn \__codedoc_macro_dump:
+ {
+ \topsep\MacroTopsep
+ \trivlist
+ \cs_set:Npn \makelabel ##1
+ {
+ \llap
+ {
+ \hbox_unpack_clear:N \l__codedoc_macro_index_box
+ \vtop to \baselineskip
+ {
+ \vbox_unpack_clear:N \l__codedoc_macro_box
+ \vss
+ }
+ }
+ }
+ \item [ ]
+ }
+\cs_new_protected:Npn \__codedoc_macro_typeset_block:nN #1#2
+ {
+ \__codedoc_macro_single:nNN {#1} \c_true_bool #2
+ \seq_if_empty:NF \g__codedoc_variants_seq
+ {
+ \__codedoc_macro_typeset_variant_list:xN
+ { \__codedoc_get_function_name:n {#1} } #2
+ }
+ }
+\cs_generate_variant:Nn \__codedoc_macro_typeset_block:nN { x }
+\cs_new_protected:Npn \__codedoc_macro_typeset_variant_list:nN #1#2
+ {
+ \seq_map_inline:Nn \g__codedoc_variants_seq
+ { \__codedoc_macro_single:nNN { #1 : ##1 } \c_false_bool #2 }
+ }
+\cs_generate_variant:Nn \__codedoc_macro_typeset_variant_list:nN { x }
+\cs_new_protected:Npn \__codedoc_macro_single:nNN #1#2#3
+ {
+ \tl_set:Nn \saved@macroname {#1}
+ \__codedoc_macro_typeset_one:nN {#1} #3
+ \bool_if:NT #3 { \DoNotIndex {#1} }
+ \exp_args:Nx \__codedoc_macro_index:nN
+ { #1 \bool_if:NT #3 { \tl_to_str:n { TF } } }
+ #2
+ }
+\cs_new_protected:Npn \__codedoc_macro_index:nN #1#2
+ {
+ \DoNotIndex {#1}
+ \bool_if:NT #2
+ {
+ \__codedoc_if_macro_internal:nF {#1}
+ { \seq_gput_right:Nn \g_doc_macros_seq {#1} }
+ \hbox_set:Nw \l__codedoc_macro_index_box
+ \hbox_unpack_clear:N \l__codedoc_macro_index_box
+ \int_gincr:N \c@CodelineNo
+ \__codedoc_special_index:nn {#1} { main }
+ \int_gdecr:N \c@CodelineNo
+ \exp_args:NNNo \hbox_set_end:
+ \tl_set:Nn \saved@indexname { \l__codedoc_index_key_tl }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_macro_typeset_one:nN #1#2
+ {
+ \vbox_set:Nn \l__codedoc_macro_box
+ {
+ \vbox_unpack_clear:N \l__codedoc_macro_box
+ \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 \ } }
+ }
+ \int_incr:N \l__codedoc_macro_int
+ }
+\cs_new_protected:Npn \__codedoc_print_macroname:nN #1#2
+ {
+ \strut
+ \__codedoc_get_hyper_target:xN
+ {
+ \exp_not:n {#1}
+ \bool_if:NT #2 { \tl_to_str:n {TF} }
+ }
+ \l__codedoc_tmpa_tl
+ \cs_if_exist:cTF { r@ \l__codedoc_tmpa_tl }
+ { \exp_last_unbraced:NNo \hyperref [ \l__codedoc_tmpa_tl ] }
+ { \use:n }
+ {
+ \int_compare:nTF { \str_count:n {#1} <= 28 }
+ { \MacroFont } { \MacroLongFont }
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \tl_replace_all:Nno \l__codedoc_tmpa_tl
+ { ~ } { \c_catcode_other_space_tl }
+ \__codedoc_macroname_prefix:o \l__codedoc_tmpa_tl
+ \__codedoc_macroname_suffix:N #2
+ }
+ }
+\cs_new_protected:Npn \__codedoc_macroname_prefix:n #1
+ {
+ \__codedoc_if_macro_internal:nTF {#1}
+ { \__codedoc_typeset_aux:n {#1} } {#1}
+ }
+\cs_generate_variant:Nn \__codedoc_macroname_prefix:n { o }
+\cs_new_protected:Npn \__codedoc_macroname_suffix:N #1
+ { \bool_if:NTF #1 { \__codedoc_typeset_TF: } { } }
+\providecommand \MacroLongFont
+ {
+ \fontfamily{lmtt}\fontseries{lc}\small
+ }
+\cs_new_protected:Npn \__codedoc_print_testfile:n #1
+ {
+ \bool_set_true:N \l__codedoc_macro_tested_bool
+ \tl_if_eq:nnF {#1} {*}
+ {
+ \seq_if_in:NnF \g__codedoc_testfiles_seq {#1}
+ {
+ \seq_gput_right:Nn \g__codedoc_testfiles_seq {#1}
+ \par
+ \__codedoc_print_testfile_aux:n {#1}
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_print_testfile_aux:n #1
+ {
+ \footnotesize
+ (
+ \textit
+ {
+ The~ test~ suite~ for~ this~ command,~
+ and~ others~ in~ this~ file,~ is~ \textsf{#1}
+ }.
+ )\par
+ }
+\DeclareDocumentCommand \TestFiles {m}
+ {
+ \par
+ \textit
+ {
+ The~ following~ test~ files~ are~
+ used~ for~ this~ code:~ \textsf{#1}.
+ }
+ \par \ignorespaces
+ }
+\DeclareDocumentCommand \UnitTested { } { \testfile* }
+\DeclareDocumentCommand \TestMissing { m }
+ { \__codedoc_test_missing:n {#1} }
+\cs_new_protected:Npn \__codedoc_test_missing:n #1
+ {
+ \__codedoc_test_missing_aux:Nxn
+ \g__codedoc_missing_tests_prop
+ { \seq_use:Nn \l__codedoc_names_seq { , } }
+ { { \g_file_curr_name_str \iow_char:N \ (#1) } }
+ }
+\cs_new_protected:Npn \__codedoc_test_missing_aux:Nnn #1#2#3
+ {
+ \prop_get:NnNTF #1 {#2} \l__codedoc_tmpa_tl
+ { \tl_put_right:Nn \l__codedoc_tmpa_tl { , #3 } }
+ { \tl_set:Nn \l__codedoc_tmpa_tl {#3} }
+ \prop_put:Nno #1 {#2} \l__codedoc_tmpa_tl
+ }
+\cs_generate_variant:Nn \__codedoc_test_missing_aux:Nnn { Nx }
+\cs_new_protected:Npn \__codedoc_macro_end:
+ {
+ \endtrivlist
+ \__codedoc_macro_end_check_tested:
+ \int_compare:nNnT \l__codedoc_nested_macro_int = 1
+ { \__codedoc_macro_end_style:n { \__codedoc_print_end_definition: } }
+ }
+\cs_new_protected:Npn \__codedoc_macro_end_check_tested:
+ {
+ \bool_lazy_all:nT
+ {
+ { \g__codedoc_checktest_bool }
+ { ! \l__codedoc_macro_var_bool }
+ { ! \l__codedoc_macro_tested_bool }
+ }
+ {
+ \seq_set_filter:NNn \l__codedoc_tmpa_seq \l__codedoc_names_seq
+ { ! \__codedoc_if_macro_internal_p:n {##1} }
+ \seq_gput_right:Nx \g__codedoc_not_tested_seq
+ {
+ \seq_use:Nn \l__codedoc_tmpa_seq { , }
+ \bool_if:NTF \l__codedoc_macro_pTF_bool {~(pTF)}
+ { \bool_if:NT \l__codedoc_macro_TF_bool {~(TF)} }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_macro_end_style:n #1
+ {
+ \nobreak \noindent
+ { \footnotesize ( \emph{#1} ) \par }
+ }
+\cs_new_protected:Npn \__codedoc_macro_end_wrap_item:n #1
+ {
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \tl_replace_all:Non \l__codedoc_tmpa_tl
+ { \token_to_str:N _ } { \_ }
+ \texttt { \l__codedoc_tmpa_tl }
+ }
+\cs_new_protected:Npn \__codedoc_print_end_definition:
+ {
+ \seq_set_map:NNn \l__codedoc_tmpa_seq
+ \g__codedoc_nested_names_seq
+ { \exp_not:n { \__codedoc_macro_end_wrap_item:n {##1} } }
+ End~ definition~ for~
+ \int_compare:nTF { \seq_count:N \l__codedoc_tmpa_seq <= 3 }
+ {
+ \seq_use:Nnnn \l__codedoc_tmpa_seq
+ { \,~and~ } { \,,~ } { \,,~and~ }
+ }
+ { \seq_item:Nn \l__codedoc_tmpa_seq {1}\,~and~others }
+ \@.
+ \__codedoc_print_documented:
+ }
+\cs_new_protected:Npn \__codedoc_print_documented:
+ {
+ \seq_gset_filter:NNn \g__codedoc_nested_names_seq
+ \g__codedoc_nested_names_seq
+ { ! \__codedoc_if_macro_internal_p:n {##1} }
+ \seq_if_empty:NF \g__codedoc_nested_names_seq
+ {
+ \int_set:Nn \l__codedoc_tmpa_int
+ { \seq_count:N \g__codedoc_nested_names_seq }
+ \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~This~} {~These~}
+ \bool_if:NTF \l__codedoc_macro_var_bool {variable} {function}
+ \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~}
+ documented~on~page~
+ \__codedoc_get_hyper_target:xN
+ { \seq_item:Nn \g__codedoc_nested_names_seq { 1 } }
+ \l__codedoc_tmpa_tl
+ \exp_args:Nx \pageref { \l__codedoc_tmpa_tl } .
+ }
+ \seq_gclear:N \g__codedoc_nested_names_seq
+ }
+\newcommand*{\DescribeOption}
+ {
+ \leavevmode
+ \@bsphack
+ \begingroup
+ \MakePrivateLetters
+ \Describe@Option
+ }
+\newcommand*{\Describe@Option}[1]
+ {
+ \endgroup
+ \marginpar{
+ \raggedleft
+ \PrintDescribeEnv{#1}
+ }
+ \SpecialOptionIndex{#1}
+ \@esphack
+ \ignorespaces
+ }
+\newcommand*{\SpecialOptionIndex}[1]
+ {
+ \@bsphack
+ \begingroup
+ \HD@target
+ \let\HDorg@encapchar\encapchar
+ \edef\encapchar usage
+ {
+ \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}
+ }
+ \index
+ {
+ #1\actualchar{\protect\ttfamily#1}~(option)
+ \encapchar usage
+ }
+ \index
+ {
+ options:\levelchar#1\actualchar{\protect\ttfamily#1}
+ \encapchar usage
+ }
+ \endgroup
+ \@esphack
+ }
+\font \manual = manfnt \scan_stop:
+\cs_gset:Npn \dbend { {\manual\char127} }
+\newenvironment {danger}
+ {
+ \begin{trivlist}\item[]\noindent
+ \begingroup\hangindent=2pc\hangafter=-2
+ \cs_set:Npn \par{\endgraf\endgroup}
+ \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces
+ }
+ {
+ \par\end{trivlist}
+ }
+\newenvironment {ddanger}
+ {
+ \begin{trivlist}\item[]\noindent
+ \begingroup\hangindent=3.5pc\hangafter=-2
+ \cs_set:Npn \par{\endgraf\endgroup}
+ \hbox to0pt{\hskip-\hangindent\dbend\kern2pt\dbend\hfill}\ignorespaces
+ }{
+ \par\end{trivlist}
+ }
+\newenvironment{TemplateInterfaceDescription}[1]
+ {
+ \subsection{The~object~type~`#1'}
+ \begingroup
+ \@beginparpenalty\@M
+ \description
+ \def\TemplateArgument##1##2{\item[Arg:~##1]##2\par}
+ \def\TemplateSemantics
+ {
+ \enddescription\endgroup
+ \subsubsection*{Semantics:}
+ }
+ }
+ {
+ \par\bigskip
+ }
+\newenvironment{TemplateDescription}[2]
+ {
+ \subsection{The~template~`#2'~(object~type~#1)}
+ \subsubsection*{Attributes:}
+ \begingroup
+ \@beginparpenalty\@M
+ \description
+ \def\TemplateKey##1##2##3##4
+ {
+ \item[##1~(##2)]##3%
+ \ifx\TemplateKey##4\TemplateKey\else
+ \hfill\penalty500\hbox{}\hfill Default:~##4%
+ \nobreak\hskip-\parfillskip\hskip0pt\relax
+ \fi
+ \par
+ }
+ \def\TemplateSemantics
+ {
+ \enddescription\endgroup
+ \subsubsection*{Semantics~\&~Comments:}
+ }
+ }
+ { \par \bigskip }
+\newenvironment{InstanceDescription}[4][xxxxxxxxxxxxxxx]
+ {
+ \subsubsection{The~instance~`#3'~(template~#2/#4)}
+ \subsubsection*{Attribute~values:}
+ \begingroup
+ \@beginparpenalty\@M
+ \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\}
+ \def\InstanceSemantics{\endtabbing\endgroup
+ \vskip-30pt\vskip0pt
+ \subsubsection*{Layout~description~\&~Comments:}}
+ \tabbing
+ xxxx\=#1\=\kill
+ }
+ { \par \bigskip }
+\DeclareDocumentCommand \OnlyDescription { }
+ { \bool_gset_false:N \g__codedoc_typeset_implementation_bool }
+\DeclareDocumentCommand \AlsoImplementation { }
+ { \bool_gset_true:N \g__codedoc_typeset_implementation_bool }
+\DeclareDocumentCommand \StopEventually { m }
+ {
+ \bool_if:NTF \g__codedoc_typeset_implementation_bool
+ {
+ \@bsphack
+ \tl_gset:Nn \g__codedoc_finale_tl { #1 \check@checksum }
+ \init@checksum
+ \@esphack
+ }
+ { #1 \endinput }
+ }
+\DeclareDocumentCommand \Finale { }
+ { \tl_use:N \g__codedoc_finale_tl }
+\tl_new:N \g__codedoc_finale_tl
+\cs_new_protected:Npn \__codedoc_input:n #1
+ {
+ \tl_gclear:N \g__codedoc_module_name_tl
+ \MakePercentIgnore
+ \input{#1}
+ \MakePercentComment
+ }
+\DeclareDocumentCommand \DocInput { m }
+ {
+ \clist_map_inline:nn {#1}
+ {
+ \clist_put_right:Nn \g_docinput_clist {##1}
+ \__codedoc_input:n {##1}
+ }
+ }
+\DeclareDocumentCommand \DocInputAgain { }
+ { \clist_map_function:NN \g_docinput_clist \__codedoc_input:n }
+\NewDocumentCommand \DocInclude { m }
+ {
+ \relax\clearpage
+ \docincludeaux
+ \IfFileExists{#1.fdd}
+ { \cs_set:Npn \currentfile{#1.fdd} }
+ { \cs_set:Npn \currentfile{#1.dtx} }
+ \int_compare:nNnTF \@auxout = \@partaux
+ { \@latexerr{\string\include\space cannot~be~nested}\@eha }
+ { \@docinclude #1 }
+ }
+\cs_gset:Npn \@docinclude #1
+ {
+ \clearpage
+ \immediate\write\@mainaux{\string\@input{#1.aux}}
+ \@tempswatrue
+ \if@partsw
+ \@tempswafalse
+ \cs_set:Npx \@tempb{#1}
+ \@for\@tempa:=\@partlist\do
+ {
+ \ifx\@tempa\@tempb\@tempswatrue\fi
+ }
+ \fi
+ \if@tempswa
+ \cs_set_eq:NN \@auxout \@partaux
+ \immediate\openout\@partaux #1.aux
+ \immediate\write\@partaux{\relax}
+ \cs_set_eq:NN \@ltxdoc@PrintIndex \PrintIndex
+ \cs_set_eq:NN \PrintIndex \relax
+ \cs_set_eq:NN \@ltxdoc@PrintChanges \PrintChanges
+ \cs_set_eq:NN \PrintChanges \relax
+ \cs_set_eq:NN \@ltxdoc@theglossary \theglossary
+ \cs_set_eq:NN \@ltxdoc@endtheglossary \endtheglossary
+ \part{\currentfile}
+ {
+ \cs_set_eq:NN \ttfamily\relax
+ \cs_gset:Npx \filekey
+ { \filekey, \thepart = { \ttfamily \currentfile } }
+ }
+ \DocInput{\currentfile}
+ \cs_set_eq:NN \PrintIndex \@ltxdoc@PrintIndex
+ \cs_set_eq:NN \PrintChanges \@ltxdoc@PrintChanges
+ \cs_set_eq:NN \theglossary \@ltxdoc@theglossary
+ \cs_set_eq:NN \endtheglossary \@ltxdoc@endtheglossary
+ \clearpage
+ \@writeckpt{#1}
+ \immediate \closeout \@partaux
+ \else
+ \@nameuse{cp@#1}
+ \fi
+ \cs_set_eq:NN \@auxout \@mainaux
+ }
+\cs_gset:Npn \codeline@wrindex #1
+ {
+ \immediate\write\@indexfile
+ {
+ \string\indexentry{#1}
+ { \filesep \int_use:N \c@CodelineNo }
+ }
+ }
+\tl_gclear:N \filesep
+\cs_gset:Npn \docincludeaux
+ {
+ \tl_set:Nn \thepart { \alphalph { part } }
+ \tl_set:Nn \filesep { \thepart - }
+ \cs_set_eq:NN \filekey \use_none:n
+ \tl_gput_right:Nn \index@prologue
+ {
+ \cs_gset:Npn \@oddfoot
+ {
+ \parbox { \textwidth }
+ {
+ \strut \footnotesize
+ \raggedright { \bfseries File~Key: } ~ \filekey
+ }
+ }
+ \cs_set_eq:NN \@evenfoot \@oddfoot
+ }
+ \cs_gset_eq:NN \docincludeaux \relax
+ \cs_gset:Npn \@oddfoot
+ {
+ \cs_if_exist:cTF { ver @ \currentfile }
+ { File~\thepart :~{\ttfamily\currentfile}~ }
+ {
+ \GetFileInfo{\currentfile}
+ File~\thepart :~{\ttfamily\filename}~
+ Date:~\ExplFileDate\ % space
+ Version~\ExplFileVersion
+ }
+ \hfill \thepage
+ }
+ \cs_set_eq:NN \@evenfoot \@oddfoot
+ }
+\group_begin:
+ \char_set_catcode_other:N \^^A
+ \char_set_catcode_active:N \^^S
+ \char_set_catcode_active:N \^^B
+ \char_set_catcode_other:N \^^L
+ \char_set_catcode_other:N \^^R
+ \char_set_lccode:nn { `\^^A } { `\% }
+ \char_set_lccode:nn { `\^^S } { `\ }
+ \char_set_lccode:nn { `\^^B } { `\\ }
+ \char_set_lccode:nn { `\^^L } { `\{ }
+ \char_set_lccode:nn { `\^^R } { `\} }
+ \tex_lowercase:D
+ {
+ \group_end:
+ \cs_set_protected:Npn \xmacro@code
+ #1 ^^A ^^S^^S^^S^^S ^^Bend ^^Lmacrocode^^R
+ { \__codedoc_xmacro_code:n {#1} \end{macrocode} }
+ }
+\group_begin:
+ \char_set_catcode_active:N \<
+ \char_set_catcode_active:N \>
+ \cs_new_protected:Npn \__codedoc_xmacro_code:n #1
+ {
+ \tl_if_in:nnTF {#1} { < @ @ = }
+ { \__codedoc_xmacro_code:w #1 \q_stop }
+ {
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
+ \tl_use:N \l__codedoc_tmpa_tl
+ }
+ }
+ \cs_new_protected:Npn \__codedoc_xmacro_code:w #1 < @ @ = #2 > #3 \q_stop
+ {
+ \tl_set:Nn \l__codedoc_tmpa_tl {#1}
+ \__codedoc_replace_at_at:N \l__codedoc_tmpa_tl
+
+ \tl_gset:Nn \g__codedoc_module_name_tl {#2}
+ \tl_put_right:Nn \l__codedoc_tmpa_tl { < @ @ = #2 > }
+
+ \tl_set:Nn \l__codedoc_tmpb_tl {#3}
+ \__codedoc_replace_at_at:N \l__codedoc_tmpb_tl
+ \tl_put_right:No \l__codedoc_tmpa_tl { \l__codedoc_tmpb_tl }
+
+ \tl_use:N \l__codedoc_tmpa_tl
+ }
+\group_end:
+\iow_new:N \g__codedoc_func_iow
+\tl_new:N \l__codedoc_doc_def_tl
+\tl_new:N \l__codedoc_doc_undef_tl
+\tl_new:N \l__codedoc_undoc_def_tl
+\cs_new_protected:Npn \__codedoc_show_functions_defined:
+ {
+ \bool_lazy_and:nnT
+ { \g__codedoc_typeset_implementation_bool } { \g__codedoc_checkfunc_bool }
+ {
+ \iow_term:x { \c__codedoc_iow_separator_tl \iow_newline: }
+ \iow_open:Nn \g__codedoc_func_iow { \c_sys_jobname_str .cmds }
+
+ \tl_clear:N \l__codedoc_doc_def_tl
+ \tl_clear:N \l__codedoc_doc_undef_tl
+ \tl_clear:N \l__codedoc_undoc_def_tl
+ \seq_map_inline:Nn \g_doc_functions_seq
+ {
+ \seq_if_in:NnTF \g_doc_macros_seq {##1}
+ {
+ \tl_put_right:Nx \l__codedoc_doc_def_tl
+ { ##1 \iow_newline: }
+ \iow_now:Nn \g__codedoc_func_iow { > ~ ##1 }
+ }
+ {
+ \tl_put_right:Nx \l__codedoc_doc_undef_tl
+ { ##1 \iow_newline: }
+ \iow_now:Nn \g__codedoc_func_iow { ! ~ ##1 }
+ }
+ }
+ \seq_map_inline:Nn \g_doc_macros_seq
+ {
+ \seq_if_in:NnF \g_doc_functions_seq {##1}
+ {
+ \tl_put_right:Nx \l__codedoc_undoc_def_tl
+ { ##1 \iow_newline: }
+ \iow_now:Nn \g__codedoc_func_iow { ? ~ ##1 }
+ }
+ }
+ \__codedoc_functions_typeout:nN
+ {
+ Functions~both~documented~and~defined: \iow_newline:
+ (In~order~of~being~documented)
+ }
+ \l__codedoc_doc_def_tl
+ \__codedoc_functions_typeout:nN
+ { Functions~documented~but~not~defined: }
+ \l__codedoc_doc_undef_tl
+ \__codedoc_functions_typeout:nN
+ { Functions~defined~but~not~documented: }
+ \l__codedoc_undoc_def_tl
+
+ \iow_close:N \g__codedoc_func_iow
+ \iow_term:x { \c__codedoc_iow_separator_tl }
+ }
+ }
+\AtEndDocument { \__codedoc_show_functions_defined: }
+\cs_new_protected:Npn \__codedoc_functions_typeout:nN #1#2
+ {
+ \tl_if_empty:NF #2
+ {
+ \typeout
+ {
+ \c__codedoc_iow_midrule_tl \iow_newline:
+ #1 \iow_newline:
+ \c__codedoc_iow_midrule_tl \iow_newline:
+ #2
+ }
+ \tl_clear:N #2
+ }
+ }
+\cs_new_protected:Npn \__codedoc_show_not_tested:
+ {
+ \bool_if:NT \g__codedoc_checktest_bool
+ {
+ \tl_clear:N \l__codedoc_tmpa_tl
+ \prop_if_empty:NF \g__codedoc_missing_tests_prop
+ {
+ \cs_set:Npn \__codedoc_tmpa:w ##1##2
+ {
+ \iow_newline:
+ \space\space\space\space \exp_not:n {##1}
+ \clist_map_function:nN {##2} \__codedoc_tmpb:w
+ }
+ \cs_set:Npn \__codedoc_tmpb:w ##1
+ {
+ \iow_newline:
+ \space\space\space\space\space\space * ~ ##1
+ }
+ \tl_put_right:Nx \l__codedoc_tmpa_tl
+ {
+ \iow_newline: \iow_newline:
+ The~ following~ macro(s)~ have~ incomplete~ tests:
+ \iow_newline:
+ \prop_map_function:NN
+ \g__codedoc_missing_tests_prop \__codedoc_tmpa:w
+ }
+ }
+ \seq_if_empty:NF \g__codedoc_not_tested_seq
+ {
+ \cs_set:Npn \__codedoc_tmpa:w ##1
+ { \clist_map_function:nN {##1} \__codedoc_tmpb:w }
+ \cs_set:Npn \__codedoc_tmpb:w ##1
+ {
+ \iow_newline:
+ \space\space\space\space ##1
+ }
+ \tl_put_right:Nx \l__codedoc_tmpa_tl
+ {
+ \iow_newline:
+ \iow_newline:
+ The~ following~ macro(s)~ do~ not~ have~ any~ tests:
+ \iow_newline:
+ \seq_map_function:NN
+ \g__codedoc_not_tested_seq \__codedoc_tmpa:w
+ }
+ }
+ \tl_if_empty:NF \l__codedoc_tmpa_tl
+ {
+ \int_set:Nn \l__codedoc_tmpa_int { \etex_interactionmode:D }
+ \errorstopmode
+ \ClassError { l3doc-TUB } { \l__codedoc_tmpa_tl } { }
+ \int_set:Nn \etex_interactionmode:D { \l__codedoc_tmpa_int }
+ }
+ }
+ }
+\AtEndDocument { \__codedoc_show_not_tested: }
+\g@addto@macro \theindex { \MakePrivateLetters }
+\cs_gset:Npn \verbatimchar {&}
+\setcounter { IndexColumns } { 2 }
+\IndexPrologue
+ {
+ \section*{Index}
+ \markboth{Index}{Index}
+ \addcontentsline{toc}{section}{Index}
+ The~italic~numbers~denote~the~pages~where~the~
+ corresponding~entry~is~described,~
+ numbers~underlined~point~to~the~definition,~
+ all~others~indicate~the~places~where~it~is~used.
+ }
+\cs_gset_protected:Npn \SpecialIndex #1
+ {
+ \@bsphack
+ \__codedoc_special_index:nn {#1} { }
+ \@esphack
+ }
+\msg_new:nnn { l3doc-TUB } { print-index-howto }
+ {
+ Generate~the~index~by~executing\\
+ \iow_indent:n
+ { makeindex~-s~gind.ist~-o~\c_sys_jobname_str.ind~\c_sys_jobname_str.idx }
+ }
+\tl_gput_right:Nn \PrintIndex
+ { \AtEndDocument { \msg_info:nn { l3doc-TUB } { print-index-howto } } }
+\cs_gset_protected:Npn \it@is@a #1
+ {
+ \use:x
+ {
+ \__codedoc_special_index_module:nnnnN
+ {#1}
+ { \bslash #1 }
+ { }
+ { }
+ \c_false_bool
+ }
+ }
+\cs_new_protected:Npn \__codedoc_special_index:nn #1#2
+ {
+ \__codedoc_key_get:n {#1}
+ \quark_if_no_value:NF \l__codedoc_override_module_tl
+ { \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_override_module_tl }
+ \__codedoc_special_index_module:ooonN
+ { \l__codedoc_index_key_tl }
+ { \l__codedoc_index_macro_tl }
+ { \l__codedoc_index_module_tl }
+ {#2}
+ \l__codedoc_index_internal_bool
+ }
+\cs_generate_variant:Nn \__codedoc_special_index:nn { o }
+\tl_new:N \l__codedoc_index_escaped_macro_tl
+\tl_new:N \l__codedoc_index_escaped_key_tl
+\cs_new_protected:Npn \__codedoc_special_index_module:nnnnN #1#2#3#4#5
+ {
+ \use:x
+ {
+ \exp_not:n { \__codedoc_special_index_aux:nnnnnn {#1} {#2} }
+ \tl_if_empty:nTF {#3}
+ { { } { } { } }
+ {
+ \str_if_eq_x:nnTF {#3} { TeX }
+ {
+ { TeX~and~LaTeX2e }
+ { \string\TeX{}~and~\string\LaTeXe{} }
+ }
+ {
+ {#3}
+ { \string\pkg{#3} }
+ }
+ { \bool_if:NT #5 { ~internal } ~commands: }
+ }
+ }
+ {#4}
+ }
+\cs_generate_variant:Nn \__codedoc_special_index_module:nnnnN { ooo }
+\cs_new_protected:Npn \__codedoc_special_index_aux:nnnnnn #1#2#3#4#5#6
+ {
+ \tl_set:Nn \l__codedoc_index_escaped_key_tl {#1}
+ \__codedoc_quote_special_char:N \l__codedoc_index_escaped_key_tl
+ \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2}
+ \str_if_eq:onTF { \@currenvir } { macrocode }
+ { \codeline@wrindex }
+ {
+ \str_case:nnF {#6}
+ {
+ { main } { \codeline@wrindex }
+ { usage } { \index }
+ }
+ { \HD@target \index }
+ }
+ {
+ \tl_if_empty:nF { #3 #4 #5 }
+ { #3 #5 \actualchar #4 #5 \levelchar }
+ \l__codedoc_index_escaped_key_tl
+ \actualchar
+ {
+ \token_to_str:N \verbatim@font \c_space_tl
+ \l__codedoc_index_escaped_macro_tl
+ }
+ \encapchar
+ hdclindex{\the\c@HD@hypercount}{#6}
+ }
+ }
+\cs_new_protected:Npn \__codedoc_special_index_set:Nn #1#2
+ {
+ \tl_set:Nx #1 { \tl_to_str:n {#2} }
+ \__codedoc_if_almost_str:nTF {#2}
+ {
+ \tl_replace_all:Non #1 { \tl_to_str:n { __ } }
+ {
+ \verbatimchar
+ \token_to_str:N \_ \token_to_str:N \_
+ \token_to_str:N \verb * \verbatimchar
+ }
+ \exp_args:Nx \tl_map_inline:nn
+ { \tl_to_str:N \verbatimchar \token_to_str:N _ }
+ {
+ \tl_replace_all:Nnn #1 {##1}
+ {
+ \verbatimchar \c__codedoc_backslash_tl ##1
+ \token_to_str:N \verb * \verbatimchar
+ }
+ }
+ \tl_set:Nx #1
+ {
+ \token_to_str:N \verb * \verbatimchar
+ #1 \verbatimchar
+ }
+ }
+ {
+ \tl_set:Nn #1 {#2}
+ \tl_replace_all:Non #1
+ { \c__codedoc_backslash_tl }
+ { \token_to_str:N \bslash \c_space_tl }
+ }
+ \__codedoc_quote_special_char:N #1
+ }
+\cs_new_protected:Npn \__codedoc_quote_special_char:N #1
+ {
+ \tl_map_inline:nn { \quotechar \actualchar \encapchar \levelchar }
+ {
+ \tl_replace_all:Nxn #1
+ { \tl_to_str:N ##1 } { \quotechar \tl_to_str:N ##1 }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_key_get:n #1
+ {
+ \__codedoc_key_get_base:nN {#1} \l__codedoc_index_macro_tl
+ \tl_set:Nx \l__codedoc_index_key_tl
+ { \tl_to_str:N \l__codedoc_index_macro_tl }
+ \tl_clear:N \l__codedoc_index_module_tl
+ \tl_if_in:NoTF \l__codedoc_index_key_tl { \tl_to_str:n { __ } }
+ { \bool_set_true:N \l__codedoc_index_internal_bool }
+ { \bool_set_false:N \l__codedoc_index_internal_bool }
+ \tl_if_head_eq_charcode:oNT
+ { \l__codedoc_index_key_tl } \c__codedoc_backslash_token
+ { \__codedoc_key_pop: }
+ \tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N : }
+ { \__codedoc_key_func: }
+ {
+ \tl_if_in:NoTF \l__codedoc_index_key_tl { \token_to_str:N _ }
+ { \__codedoc_key_var: }
+ {
+ \tl_if_in:NoT \l__codedoc_index_key_tl { \token_to_str:N @ }
+ { \tl_set:Nn \l__codedoc_index_module_tl { TeX } }
+ }
+ }
+ }
+\cs_new_protected:Npn \__codedoc_key_pop:
+ {
+ \tl_set:Nx \l__codedoc_index_key_tl
+ { \tl_tail:N \l__codedoc_index_key_tl }
+ }
+\cs_new_protected:Npn \__codedoc_key_trim_module:n #1
+ {
+ \cs_set:Npn \__codedoc_tmpa:w ##1 #1 ##2 \q_stop
+ { \exp_not:n {##1} }
+ \tl_set:Nx \l__codedoc_index_module_tl
+ { \exp_after:wN \__codedoc_tmpa:w \l__codedoc_index_module_tl #1 \q_stop }
+ }
+\cs_new_protected:Npn \__codedoc_key_drop_underscores:
+ {
+ \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } _
+ { \__codedoc_key_pop: \__codedoc_key_drop_underscores: }
+ }
+\cs_new_protected:Npn \__codedoc_key_func:
+ {
+ \tl_if_head_eq_charcode:oNT { \l__codedoc_index_key_tl } .
+ { \__codedoc_key_pop: }
+ \__codedoc_key_drop_underscores:
+ \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
+ \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N : }
+ \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ }
+ }
+\cs_new_protected:Npn \__codedoc_key_var:
+ {
+ \exp_args:Nx \tl_if_head_eq_charcode:nNTF
+ { \exp_args:No \str_tail:n \l__codedoc_index_key_tl } _
+ {
+ \str_case:fn { \str_head:N \l__codedoc_index_key_tl }
+ {
+ { q } { \tl_set:Nn \l__codedoc_index_module_tl { quark } }
+ { s } { \tl_set:Nn \l__codedoc_index_module_tl { quark } }
+ }
+ \__codedoc_key_pop:
+ \__codedoc_key_pop:
+ \__codedoc_key_drop_underscores:
+ \tl_if_empty:NT \l__codedoc_index_module_tl
+ {
+ \seq_set_split:NoV \l__codedoc_tmpa_seq
+ { \token_to_str:N _ } \l__codedoc_index_key_tl
+ \tl_set:Nx \l__codedoc_index_module_tl
+ {
+ \int_case:nnF { \seq_count:N \l__codedoc_tmpa_seq }
+ {
+ { 0 } { }
+ { 1 } { int }
+ { 2 } { \seq_item:Nn \l__codedoc_tmpa_seq { 2 } }
+ }
+ { \seq_item:Nn \l__codedoc_tmpa_seq { 1 } }
+ }
+ }
+ }
+ {
+ \tl_set_eq:NN \l__codedoc_index_module_tl \l__codedoc_index_key_tl
+ \exp_args:No \__codedoc_key_trim_module:n { \token_to_str:N _ }
+ }
+ }
+\GlossaryPrologue
+ {
+ \part*{Change~History}
+ {\GlossaryParms\ttfamily\hyphenchar\font=`\-}
+ \markboth{Change~History}{Change~History}
+ \addcontentsline{toc}{part}{Change~History}
+ }
+\msg_new:nnn { l3doc-TUB } { print-changes-howto }
+ {
+ Generate~the~change~list~by~executing\\
+ \iow_indent:n
+ { makeindex~-s~gglo.ist~-o~\c_sys_jobname_str.gls~\c_sys_jobname_str.glo }
+ }
+\tl_gput_right:Nn \PrintChanges
+ { \AtEndDocument { \msg_info:nn { l3doc-TUB } { print-changes-howto } } }
+\bool_if:NTF \g__codedoc_typeset_implementation_bool
+ {
+ \RecordChanges
+ \CodelineIndex
+ \EnableCrossrefs
+ \AlsoImplementation
+ }
+ {
+ \CodelineNumbered
+ \DisableCrossrefs
+ \OnlyDescription
+ }
+
+%%FMi
+
+\def\maketitle{\@ifstar
+ {\@articletitlefalse\@r@maketitle}%
+ {\@articletitletrue\@r@maketitle}%
+}
+
+%%
+%%
+%% End of file `l3doc-TUB.cls'.