texlive[64708] Master/texmf-dist: nlctdoc (15oct22)

commits+karl at tug.org commits+karl at tug.org
Sat Oct 15 22:18:13 CEST 2022


Revision: 64708
          http://tug.org/svn/texlive?view=revision&revision=64708
Author:   karl
Date:     2022-10-15 22:18:13 +0200 (Sat, 15 Oct 2022)
Log Message:
-----------
nlctdoc (15oct22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/nlctdoc/README
    trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls

Added Paths:
-----------
    trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty

Modified: trunk/Master/texmf-dist/doc/latex/nlctdoc/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/nlctdoc/README	2022-10-15 20:16:35 UTC (rev 64707)
+++ trunk/Master/texmf-dist/doc/latex/nlctdoc/README	2022-10-15 20:18:13 UTC (rev 64708)
@@ -1,6 +1,6 @@
-nlctdoc.cls:
+nlctdoc.cls and nlctuserguide.sty v1.08 (2022-10-14):
 
-This class is provided "as is" solely for the benefit 
+This class and package is provided "as is" solely for the benefit 
 of anyone who wants to compile the documentation for
 my packages. (To comply with TeX Live requirements
 that all package documentation must be distributed with 

Modified: trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls	2022-10-15 20:16:35 UTC (rev 64707)
+++ trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls	2022-10-15 20:18:13 UTC (rev 64708)
@@ -4,7 +4,7 @@
 % copy the code here to another file and modify it for your own purposes.
 % There's no guarantee that it will work with other packages.
 %
-%  Copyright 2013-2020 Nicola Talbot
+%  Copyright 2013-2022 Nicola Talbot
 % 
 %  This work may be distributed and/or modified under the
 %  conditions of the LaTeX Project Public License, either version 1.3
@@ -13,9 +13,12 @@
 %    http://www.latex-project.org/lppl.txt
 %  and version 1.3 or later is part of all distributions of LaTeX
 %  version 2005/12/01 or later.
+%
+% This class is being phased out, but it will continue to be provided
+% for existing documents that use it.
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{nlctdoc}[2020/02/12 v1.07 (NLCT)]
+\ProvidesClass{nlctdoc}[2022/10/14 v1.08 (NLCT)]
 \RequirePackage{ifpdf}
 \RequirePackage{ifxetex}
 % tex4ht stopped working with koma during TL2013.
@@ -22,14 +25,10 @@
 % Use pdflatex with koma for the pdf version
 % and latex with one of the base classes for the html 
 % version to circumvent this.
-\ifpdf
+\ifx\HCode\UNDEFINED
   \newcommand{\@nlctdoc at if@usingtexht}[2]{#2}
 \else
-  \ifxetex
-   \newcommand{\@nlctdoc at if@usingtexht}[2]{#2}
-  \else
-   \newcommand{\@nlctdoc at if@usingtexht}[2]{#1}
-  \fi
+  \newcommand{\@nlctdoc at if@usingtexht}[2]{#1}
 \fi
 
 \@nlctdoc at if@usingtexht
@@ -120,7 +119,8 @@
   \RequirePackage{fourier}
 }%
 \RequirePackage{etoolbox}
-\RequirePackage{doc,dox}
+\RequirePackage{doc}[=v2]
+\RequirePackage{dox}
 \RequirePackage{upquote}
 
 % doc.sty interferes with upquote.sty so patch it
@@ -180,7 +180,7 @@
  \marginpar{\parbox[b][2\baselineskip]{\marginparwidth}{\nlctdocmarginfmt#1\vfill\par}}%
 }
 
-\newrobustcmd\cs[1]{\texttt{\char`\\#1}}
+\providerobustcmd\cs[1]{\texttt{\char`\\#1}}
 
 \newrobustcmd*{\mgroup}[1]{\texttt{\char`\{#1\char`\}}}
 
@@ -506,8 +506,6 @@
 \newcommand*{\tableref}[1]{\hyperref[#1]{table~\ref*{#1}}}
 \newcommand*{\Tableref}[1]{\hyperref[#1]{Table~\ref*{#1}}}
 
-\renewcommand{\SpecialMainIndex}[1]{\@bsphack \SpecialIndex@ {#1}{\nlctdocmainencap}\@esphack}
-
 \newcommand{\idxmarker at SpecialMainIndex}[1]{%
  \@bsphack \idxmarker at SpecialIndex@ {#1}{\nlctdocmainencap}\@esphack
 }
@@ -559,7 +557,7 @@
 \newrobustcmd{\ics}{\@ifstar\s at ics\@ics}
 
 \newcommand*{\s at ics}[1]{\idxmarkedfont{\cs{#1}}\idxmarker at SpecialMainIndex{#1}}
-\newcommand*{\@ics}[1]{\cs{#1}\SpecialMainIndex{#1}}
+\newcommand*{\@ics}[1]{\cs{#1}\SpecialIndex@{#1}}
 
 \newrobustcmd{\csmeta}{\@ifstar\s at csmeta\@csmeta}
 
@@ -919,6 +917,6 @@
 }%
 
 
-\AtBeginDocument{\MakeShortVerb{\|}}
+%\AtBeginDocument{\MakeShortVerb{\|}}
 
 \endinput

Added: trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty	2022-10-15 20:18:13 UTC (rev 64708)
@@ -0,0 +1,3118 @@
+% This package is provided 'as is' in the event that someone
+% wants to compile the documentation that comes with my packages.
+% It is not intended for any other purpose, although you may freely
+% copy the code here to another file and modify it for your own purposes.
+% There's no guarantee that it will work with other packages.
+%
+%  Copyright 2022 Nicola Talbot
+% 
+%  This work may be distributed and/or modified under the
+%  conditions of the LaTeX Project Public License, either version 1.3
+%  of this license of (at your option) any later version.
+%  The latest version of this license is in
+%    http://www.latex-project.org/lppl.txt
+%  and version 1.3 or later is part of all distributions of LaTeX
+%  version 2005/12/01 or later.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{nlctuserguide}[2022/10/14 v1.08 (NLCT)]
+
+\newcommand{\nlctdoc at loadxr}{}
+\DeclareOption{xr}{\renewcommand{\nlctdoc at loadxr}{\RequirePackage{xr-hyper}}}
+
+\newcommand{\nlct at ns@ref at cs}{\vref}
+
+\newcommand{\nlctnovref}{\renewcommand{\nlct at ns@ref at cs}{\ref}}
+\newcommand{\nlctusevref}{\renewcommand{\nlct at ns@ref at cs}{\vref}}
+
+\DeclareOption{vref}{\nlctusevref}
+\DeclareOption{novref}{\nlctnovref}
+\newif\ifnlctdoc at symgroup
+\nlctdoc at symgrouptrue
+
+\DeclareOption{atsymgroup}{\nlctdoc at symgrouptrue}
+\DeclareOption{noatsymgroup}{\nlctdoc at symgroupfalse}
+
+\newcommand{\nlctdocatnum}[1]{%
+ \nlctdoc at symgrouptrue\renewcommand{\@nlctdoc at atnum}{#1}%
+ \ifluatex
+   \renewcommand{\bibglsothergroup}{\nlctdocsymbolgrouplabel}%
+   \renewcommand{\bibglsothergrouptitle}{\nlctdocsymbolgrouptitle}%
+ \fi
+}
+\newcommand{\@nlctdoc at atnum}{630000}
+
+\DeclareOption{deephierarchy}{\setcounter{secnumdepth}{5}}
+
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries-extra}}
+
+\ProcessOptions
+
+\RequirePackage{iftex}
+\RequirePackage{etoolbox}
+
+\newcommand{\nlct at ifattachsupported}[2]{#2}
+\newcommand{\nlct at doifattachsupported}[1]{\nlct at ifattachsupported{#1}{}}
+
+\ifPDFTeX
+  \RequirePackage[T1]{fontenc}
+  \renewcommand{\nlct at ifattachsupported}[2]{#1}
+  \providecommand{\pdf at filesize}[1]{\pdffilesize#1}
+
+  % \strong is provided by fontspec
+  \providecommand*{\strong}[1]{\textbf{#1}}
+
+\else
+  \RequirePackage{fontspec}
+  \setmainfont{Linux Libertine O}
+
+  \ifluatex
+     \newcommand{\nlctdocsymbolgrouplabel}[3]{%
+      #3\directlua{if '#2'=='\@nlctdoc at atnum' then tex.print("@") else tex.print("glssymbols") end}}
+     \newcommand{\nlctdocsymbolgrouptitle}[3]{%
+      \directlua{if '#2'=='\@nlctdoc at atnum' then tex.print("@") else tex.print("\\glssymbolsgroupname") end}}
+
+     \ifnlctdoc at symgroup
+       \newcommand{\bibglsothergroup}{\nlctdocsymbolgrouplabel}
+       \newcommand{\bibglsothergrouptitle}{\nlctdocsymbolgrouptitle}
+     \else
+       \newcommand{\bibglsothergroup}[3]{glssymbols}
+       \newcommand{\bibglsothergrouptitle}[3]{\glssymbolsgroupname}
+     \fi
+
+    \renewcommand{\nlct at ifattachsupported}[2]{#1}
+    \RequirePackage{luatex85}% need \pdfxform for attachfile
+    % copied from pdftexcmds.sty
+    \providecommand{\pdf at filesize}[1]{\directlua0{%
+      oberdiek.pdftexcmds.filesize("\luaescapestring{#1}")}}
+  \fi
+\fi
+
+\RequirePackage{fontawesome}
+\RequirePackage{twemojis}
+\RequirePackage{pifont}
+\RequirePackage{amsfonts}
+\RequirePackage{textcomp}
+\RequirePackage{array}
+\RequirePackage{upquote}
+\RequirePackage{etoolbox}
+\RequirePackage{hologo}
+\RequirePackage{varioref}
+\RequirePackage{xcolor}
+
+\newcommand*{\nlct at doifkoma}[1]{}
+\@ifclassloaded{scrreprt}{\let\nlct at doifkoma\@firstofone}
+{
+ \@ifclassloaded{scrartcl}{\let\nlct at doifkoma\@firstofone}
+ {\@ifclassloaded{scrbook}{\let\nlct at doifkoma\@firstofone}{}}
+}
+
+\nlct at doifkoma{%
+ \RequirePackage{scrhack}
+ \ifnum\c at secnumdepth>3
+   \RedeclareSectionCommand[beforeskip=10pt plus -2pt minus -1pt,
+    afterskip=1sp plus -1sp minus 1sp]{paragraph}
+ \fi
+ \ifnum\c at secnumdepth>4
+   \RedeclareSectionCommand[beforeskip=10pt plus -2pt minus -1pt,
+    afterskip=1sp plus -1sp minus 1sp]{subparagraph}
+ \fi
+}
+
+\RequirePackage[breakable,skins,listings]{tcolorbox}
+\nlctdoc at loadxr
+\RequirePackage{hyperref}
+\hypersetup{hidelinks}
+
+\RequirePackage{mfirstuc}[2022/10/14]
+
+% Requires glossaries-extra v1.49+
+\RequirePackage[record=nameref,indexcounter,floats,symbols,nosuper,stylemods={mcols,bookindex,topic,longextra}]{glossaries-extra}[2022/10/14]
+\nlct at doifattachsupported{\RequirePackage{attachfile}}
+
+\renewcommand{\thepart}{\Roman{part}}
+\renewcommand{\theHpart}{\Roman{part}}
+
+\newglossary*{index}{\indexname}
+
+\newcommand*{\thispackagename}{\jobname}
+\newcommand*{\thispackage}{\styfmt{\thispackagename}}
+\newcommand*{\examplesdir}{\jobname-examples}
+
+\newcommand{\htmlavailable}{This document is also available as
+\href{\jobname.html}{HTML (\filefmt{\jobname.html})}.}
+
+\ExplSyntaxOn
+\renewcommand{\title}[1]{\gdef\@title{#1}\hypersetup{pdftitle={\text_purify:n{#1}}}}
+\ExplSyntaxOff
+
+\newcommand{\TeXLive}{\TeX\ Live}
+\newcommand{\MikTeX}{Mik\TeX}
+
+\newrobustcmd*{\texdocref}[1]{%
+ \begin{terminal}\href{https://www.tug.org/texdoc/}{texdoc} #1\end{terminal}\noindent\ignorespaces}
+
+% \tugboat{title}{year}{volume}{number}{pdf}
+\newrobustcmd{\tugboat}[5]{\href{https://tug.org/TUGboat/tb#2-#4/#5}{\qt{#1}
+\emph{TUGboat}, Volume~#3 (#2), No.~#4}}
+
+\newrobustcmd{\urlfootref}[2]{\href{#1}{#2}\glsxtrdopostpunc{\footnote{\url{#1}}}}
+\MFUexcl{\urlfootref}
+
+\newrobustcmd{\texfaq}[2]{\href{https://texfaq.org/#1}{#2}}
+\MFUexcl{\texfaq}
+
+\newrobustcmd*{\CTANpkg}[1]{%
+ \href{https://ctan.org/pkg/#1}{CTAN}%
+ \glsxtrdopostpunc{\footnote{\href{https://ctan.org/pkg/#1}{\nolinkurl{ctan.org/pkg/#1}}}}%
+}
+\MFUexcl{\CTANpkg}
+
+\newcommand*{\ctanmirrordocnofn}[2]{%
+ \href{http://mirrors.ctan.org/#1.pdf}{#2}%
+}
+
+\newrobustcmd*{\ctanmirrornofn}[2]{%
+ \href{http://mirrors.ctan.org/#1}{#2}%
+}
+\MFUexcl{\ctanmirrornofn}
+
+\newrobustcmd*{\ctanmirror}[2]{%
+ \href{http://mirrors.ctan.org/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://mirrors.ctan.org/#1}{\nolinkurl{mirrors.ctan.org/#1}}}}%
+}
+\MFUexcl{\ctanmirror}
+
+\newrobustcmd*{\ctanref}[2]{\href{https://ctan.org/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{https://ctan.org/#1}{\nolinkurl{ctan.org/#1}}}}%
+}
+\MFUexcl{\ctanpkg}
+
+\newrobustcmd*{\ctanpkg}[1]{\href{https://ctan.org/pkg/#1}{\nolinkurl{ctan.org/pkg/#1}}}
+\MFUexcl{\ctanpkg}
+\newrobustcmd*{\ctanpkgmirror}[2]{%
+ \href{http://mirrors.ctan.org/pkg/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://mirrors.ctan.org/pkg/#1}{\nolinkurl{mirrors.ctan.org/pkg/#1}}}}%
+}
+\MFUexcl{\ctanpkgmirror}
+
+\newrobustcmd*{\ctansupportmirror}[2]{%
+ \href{http://mirrors.ctan.org/support/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://mirrors.ctan.org/support/#1}{\nolinkurl{mirrors.ctan.org/support/#1}}}}%
+}
+\MFUexcl{\ctansupportmirror}
+
+\newrobustcmd{\texseref}[2]{\href{https://tex.stackexchange.com/#1}{#2}%
+ \glsxtrdopostpunc{\footnote{\href{http://tex.stackexchange.com/#1}{\nolinkurl{tex.stackexchange.com/#1}}}}%
+}
+\MFUexcl{\texseref}
+
+\newrobustcmd*{\dickimawhrefnofn}[2]{%
+ \href{https://www.dickimaw-books.com/#1}{#2}%
+}
+\MFUexcl{\dickimawhrefnofn}
+
+\newrobustcmd*{\dickimawhref}[2]{%
+ \href{https://www.dickimaw-books.com/#1}{#2}%
+ \glsxtrdopostpunc{\protect\footnote{\href{https://www.dickimaw-books.com/#1}{\nolinkurl{dickimaw-books.com/#1}}}}%
+}
+\MFUexcl{\dickimawhref}
+
+\newcommand*{\blog}[2]{%
+ \dickimawhref{blog/#1}{#2}%
+}
+\MFUexcl{\blog}
+
+\newcommand*{\gallery}[1]{%
+ \dickimawhref{gallery}{#1}%
+}
+\MFUexcl{\gallery}
+
+\newcommand*{\galleryurl}[1]{%
+ \dickimawhrefnofn{gallery/#1}{\nolinkurl{dickimaw-books.com/gallery/#1}}%
+}
+\MFUexcl{\galleryurl}
+
+\newcommand*{\galleryref}[2]{%
+ \dickimawhref{gallery/#1}{#2}%
+}
+\MFUexcl{\galleryref}
+
+\newcommand*{\gallerytopic}[1]{%
+ \dickimawhref{gallery/\##1}{\styfmt{#1} gallery}%
+}
+\MFUexcl{\gallerytopic}
+
+\newcommand*{\gallerypage}[2]{%
+ \galleryref{index.php?label=#1}{#2}%
+}
+\MFUexcl{\gallerypage}
+
+\newcommand*{\faqspkg}[1]{%
+ \dickimawhref{faqs/#1faq.html}{\styfmt{#1} FAQ}%
+}
+\MFUexcl{\faqspkg}
+
+\newcommand*{\faqpage}[2]{%
+ \dickimawhref{faq.php?category=#1}{#2}%
+}
+\MFUexcl{\faqspage}
+
+\newcommand*{\faqitem}[2]{%
+ \dickimawhref{faq.php?itemlabel=#1}{#2}%
+}
+\MFUexcl{\faqitem}
+
+\newcommand*{\menufmt}[1]{\textsf{#1}}
+\newcommand*{\menusep}{\,\ding{220}\,}
+\newrobustcmd*{\menu}[1]{%
+  \def\nlct at menusep{}%
+  \menufmt
+  {%
+    \@for\@menu at item:=#1\do{%
+      \nlct at menusep\@menu at item
+      \let\nlct at menusep\menusep
+    }%
+  }%
+}
+
+\newcommand{\refslistsep}{, }
+\newcommand{\refslistlastsep}{ \& }
+
+\newcommand*{\@refslist}[4]{%
+ \bgroup
+  \renewcommand{\DTLlistformatitem}{\ref}%
+  \renewcommand*{\DTLlistformatsep}{#2}
+  \renewcommand*{\DTLlistformatlastsep}{#3}%
+  #1\DTLformatlist{#4}%
+ \egroup
+}
+
+\newcommand*{\s at refslist}[4]{%
+ \bgroup
+  \renewcommand{\DTLlistformatitem}{\ref*}%
+  \renewcommand*{\DTLlistformatsep}{#2}
+  \renewcommand*{\DTLlistformatlastsep}{#3}%
+  #1\DTLformatlist{#4}%
+ \egroup
+}
+
+\newcommand{\sectionrefprefix}{\S}
+\newrobustcmd{\sectionref}{\@ifstar\s at sectionref\@sectionref}
+\MFUblocker{\sectionref}
+
+\newcommand*{\@sectionref}[1]{\sectionrefprefix\ref{#1}}
+\newcommand*{\s at sectionref}[1]{\sectionrefprefix\ref*{#1}}
+
+\newcommand{\Sectionrefprefix}{\S}
+\newrobustcmd{\Sectionref}{\@ifstar\s at Sectionref\@sectionref}
+
+\newcommand*{\@Sectionref}[1]{\Sectionrefprefix\ref{#1}}
+\newcommand*{\s at Sectionref}[1]{\Sectionrefprefix\ref*{#1}}
+
+\MFUaddmap{\sectionref}{\Sectionref}
+\MFUaddmap{\sectionrefprefix}{\Sectionrefprefix}
+
+\newcommand{\sectionsrefprefix}{\S\S}
+\newrobustcmd{\sectionsref}{%
+ \@ifstar
+  {\s at refslist{\sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUblocker{\sectionsref}
+
+\newcommand{\Sectionsrefprefix}{\S\S}
+\newrobustcmd{\Sectionsref}{%
+ \@ifstar
+  {\s at refslist{\Sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\Sectionsrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\sectionsref}{\Sectionsref}
+\MFUaddmap{\sectionsrefprefix}{\Sectionsrefprefix}
+
+\newcommand{\tablerefprefix}{Table~}
+\newcommand{\Tablerefprefix}{Table~}
+
+\newrobustcmd*{\tableref}{\@ifstar\s at tableref\@tableref}
+\newrobustcmd*{\Tableref}{\@ifstar\s at Tableref\@Tableref}
+
+\newcommand*{\@tableref}[1]{\tablerefprefix\nlct at ns@ref at cs{#1}}
+\newcommand*{\s at tableref}[1]{\tablerefprefix\ref*{#1}}
+
+\newcommand*{\@Tableref}[1]{\Tablerefprefix\nlct at ns@ref at cs{#1}}
+\newcommand*{\s at Tableref}[1]{\Tablerefprefix\ref*{#1}}
+
+\MFUaddmap{\tableref}{\Tableref}
+
+\newcommand{\tablesrefprefix}{tables~}
+\newcommand{\Tablesrefprefix}{Tables~}
+
+\newrobustcmd{\tablesref}{%
+ \@ifstar
+  {\s at refslist{\tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
+\newrobustcmd{\Tablesref}{%
+ \@ifstar
+  {\s at refslist{\Tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\Tablesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\tablesref}{\Tablesref}
+
+\newcommand{\figurerefprefix}{figure~}
+\newcommand{\Figurerefprefix}{Figure~}
+
+\newrobustcmd*{\figureref}{\@ifstar\s at figureref\@figureref}
+\newrobustcmd*{\Figureref}{\@ifstar\s at Figureref\@Figureref}
+
+\newcommand*{\@figureref}[1]{\figurerefprefix\nlct at ns@ref at cs{#1}}
+\newcommand*{\s at figureref}[1]{\figurerefprefix\ref*{#1}}
+
+\newcommand*{\@Figureref}[1]{\Figurerefprefix\nlct at ns@ref at cs{#1}}
+\newcommand*{\s at Figureref}[1]{\Figurerefprefix\ref*{#1}}
+
+\MFUaddmap{\figureref}{\Figureref}
+
+\newcommand{\figuresrefprefix}{figures~}
+\newcommand{\Figuresrefprefix}{Figures~}
+
+\newrobustcmd{\figuresref}{%
+ \@ifstar
+  {\s at refslist{\figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
+\newrobustcmd{\Figuresref}{%
+ \@ifstar
+  {\s at refslist{\Figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\Figuresrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\figuresref}{\Figuresref}
+
+\providecommand{\examplerefprefix}{Example~}
+\providecommand{\Examplerefprefix}{Example~}
+
+\newrobustcmd*{\exampleref}{\@ifstar\s at exampleref\@exampleref}
+\newcommand*{\@exampleref}[1]{\examplerefprefix\nlct at ns@ref at cs{#1}}
+\newcommand*{\s at exampleref}[1]{\examplerefprefix\ref*{#1}}
+
+\newrobustcmd*{\Exampleref}{\@ifstar\s at Exampleref\@Exampleref}
+\newcommand*{\@Exampleref}[1]{\Examplerefprefix\nlct at ns@ref at cs{#1}}
+\newcommand*{\s at Exampleref}[1]{\Examplerefprefix\ref*{#1}}
+
+\MFUaddmap{\exampleref}{\Exampleref}
+
+\newcommand{\examplesrefprefix}{examples~}
+\newcommand{\Examplesrefprefix}{Examples~}
+
+\newrobustcmd{\examplesref}{%
+ \@ifstar
+  {\s at refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
+\newrobustcmd{\Examplesref}{%
+ \@ifstar
+  {\s at refslist{\Examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+  {\@refslist{\Examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+\MFUaddmap{\examplesref}{\Examplesref}
+
+\newcommand*{\plabel}[2][]{\protected at edef\@currentlabelname{#1}\label{#2}}
+
+\newcommand*{\dash}{\,---\,}
+
+\newcommand*{\tick}{\ding{51}}
+
+\newcommand*{\yes}{\ding{52}}
+\newcommand*{\no}{\ding{56}}
+
+\newrobustcmd{\advantagefmt}[1]{\textcolor{green}{#1}}
+\newrobustcmd{\disadvantagefmt}[1]{\textcolor{red}{#1}}
+
+\newcommand*{\proyes}{\advantagefmt{\yes}}
+\newcommand*{\prono}{\disadvantagefmt{\no}}
+ 
+\newcommand*{\conyes}{\disadvantagefmt{\yes}}
+\newcommand*{\conno}{\advantagefmt{\no}}
+
+\newcommand{\unlimited}{$\infty$}
+
+\newcommand{\fnsymmark}[1]{\rlap{#1}}
+
+\newcommand{\asteriskmarker}{\textasteriskcentered}
+\newcommand{\daggermarker}{\textdagger}
+\newcommand{\doubledaggermarker}{\textdaggerdbl}
+\newcommand{\sectionmarker}{\textsection}
+\newcommand{\lozengemarker}{$\lozenge$}
+\newcommand{\pilcrowmarker}{\textparagraph}
+\newcommand{\hashmarker}{\#}
+\newcommand{\referencemarker}{{\fontfamily{cmr}\selectfont\textreferencemark}}
+\newcommand{\vdoubleasteriskmarker}{\shortstack{*\\[-1.5ex]*}}
+\newcommand{\starmarker}{$\star$}
+\newcommand{\florettemarker}{\ding{94}}
+
+\newcommand{\fnsymmarker}[1]{%
+  \ifcase#1\relax
+  \or \asteriskmarker 
+  \or \daggermarker
+  \or \doubledaggermarker 
+  \or \sectionmarker
+  \or \lozengemarker
+  \or \pilcrowmarker
+  \or \hashmarker
+  \or \referencemarker
+  \or \vdoubleasteriskmarker
+  \or \starmarker
+  \or \florettemarker
+  \else
+    \number#1
+  \fi
+}
+
+\newrobustcmd*{\fnsym}[1]{%
+ \tablefnmark
+ {%
+   \fnsymmark
+   {%
+     \fnsymmarker{#1}%
+   }%
+ }%
+}
+
+\newcommand{\tablefns}[1]{\par
+ \parbox{0.8\linewidth}
+ {\raggedright
+   \smallskip\hrulefill\par\smallskip
+   \par#1%
+ }\par
+}
+
+\newcommand*{\tablefnmark}[1]{\textsuperscript{#1}}
+\newcommand{\tablefnfmt}[1]{{\footnotesize#1\par}}
+\newrobustcmd{\tablefntext}[2]{\tablefnfmt{\tablefnmark{#1}#2}}
+\newrobustcmd{\fnsymtext}[2]{\tablefntext{\fnsymmarker{#1}}{#2}}
+
+\newcommand{\settabcolsep}[1]{\setlength{\tabcolsep}{#1}}
+
+\newcommand*{\docref}[2]{#1 (\href{#2.pdf}{\nolinkurl{#2.pdf}})}
+\newcommand*{\qtdocref}[2]{\qt{#1} (\href{#2.pdf}{\nolinkurl{#2.pdf}})}
+
+% \altdocref{text}{pdf}{html}
+\newcommand*{\altdocref}[3]{#1 (\href{#2.pdf}{\nolinkurl{#2.pdf}})}
+
+% \xrsectionref{label}{html file}{html title}
+\newcommand*{\xrsectionref}[3]{Section~\ref{#1}}
+
+\newcommand{\deflist at item}[1]{\item[]#1}
+\newenvironment{itemdesc}{\par\ignorespaces}{\ignorespacesafterend}
+
+\newenvironment{deflist}
+ {\begin{description}\let\itemtitle\deflist at item}
+ {\end{description}\ignorespacesafterend}
+
+
+\newcommand*{\warningsym}{\faExclamationTriangle}
+\newcommand*{\warningtext}{Warning}
+\newcommand*{\warningdesc}{a warning}
+
+\newcommand*{\importantsym}{\faInfo}
+\newcommand*{\importanttext}{Important}
+\newcommand*{\importantdesc}{an important message}
+
+\newcommand*{\informationsym}{\faInfoCircle}
+\newcommand*{\informationtext}{Information}
+\newcommand*{\informationdesc}{prominent information}
+
+\newcommand*{\definitionsym}{\faThumbTack}
+\newcommand*{\definitiontext}{Definition}
+\newcommand*{\definitiondesc}{the syntax and usage of a command,
+environment or option etc}
+
+\newcommand*{\valuesettingsym}{\faSliders}
+\newcommand*{\valuesettingtext}{Setting}
+\newcommand*{\valuesettingdesc}{an option that takes a value}
+
+\newcommand*{\novaluesettingsym}{\faBars}
+\newcommand*{\novaluesettingtext}{Valueless Setting}
+\newcommand*{\novaluesettingdesc}{an option that doesn't take a value}
+
+\newcommand*{\toggleonsettingsym}{\faToggleOn}
+\newcommand*{\toggleonsettingtext}{Toggle (On)}
+\newcommand*{\toggleonsettingdesc}{a boolean option that is initially true}
+
+\newcommand*{\toggleoffsettingsym}{\faToggleOff}
+\newcommand*{\toggleoffsettingtext}{Toggle (Off)}
+\newcommand*{\toggleoffsettingdesc}{a boolean option that is initially false}
+
+\newcommand*{\optionvaluesym}{\faTag}
+\newcommand*{\optionvaluetext}{Option Value Definition}
+\newcommand*{\optionvaluedesc}{the definition of an option value}
+
+\newcommand*{\countersym}{\textnumero}
+\newcommand*{\countertext}{Counter}
+\newcommand*{\counterdesc}{a counter is being described}
+
+\definecolor{banned}{rgb}{0.8,0,0}
+
+\newrobustcmd{\deprecatedorbannedfmt}[1]{\textcolor{banned}{#1}}
+
+\newcommand*{\deprecatedsym}{\deprecatedorbannedfmt{\faTrashO}}
+\newcommand*{\deprecatedtext}{Deprecated}
+\newcommand*{\deprecateddesc}{a command, environment or option that
+is now deprecated}
+
+\newcommand*{\bannedsym}{\deprecatedorbannedfmt{\faBan}}
+\newcommand*{\bannedtext}{Don't use}
+\newcommand*{\banneddesc}{a command, environment or option that
+should not be used with \thispackage}
+
+\newcommand*{\terminalsym}{\faTerminal}
+\newcommand*{\terminaltext}{Terminal}
+\newcommand*{\terminaldesc}{a command-line application invocation
+that needs to be entered into a
+\href{https://www.dickimaw-books.com/latex/novices/html/terminal.html}{terminal
+or command prompt}}
+
+\newcommand*{\codesym}{\faFileTextO}
+\newcommand*{\codetext}{Input}
+\newcommand*{\codedesc}{\LaTeX\ code to insert into your document}
+
+\newrobustcmd*{\badcodesym}{\faFileTextO\llap{\deprecatedorbannedfmt{\scriptsize\faBan}}}
+\newcommand*{\badcodetext}{Problematic Input}
+\newcommand*{\badcodedesc}{problematic code which should be avoided}
+
+\newrobustcmd*{\unicodesym}{\faFileO\llap{\textsl{\tiny Uni}}}
+\newcommand*{\unicodetext}{Unicode Input}
+\newcommand*{\unicodedesc}{code that requires a native Unicode
+engine (\XeLaTeX\ or \LuaLaTeX)}
+
+\newcommand*{\resultsym}{\faFilePdfO}
+\newcommand*{\resulttext}{Result}
+\newcommand*{\resultdesc}{how the example code should appear in the PDF}
+
+\newcommand*{\transcriptsym}{\twemoji{1f50e}}
+\newcommand*{\transcripttext}{Transcript}
+\newcommand*{\transcriptdesc}{Text in a transcript or log file or written to STDOUT or STDERR}
+
+\newcommand*{\symbolentry}[1]{%
+  @icon{sym.#1,name={\expandafter\expandonce\csname #1text\endcsname},^^J
+    symbol={\expandafter\noexpand\csname #1sym\endcsname},^^J
+    description={\expandafter\expandonce\csname #1desc\endcsname}^^J
+  }^^J
+}
+
+\newcommand*{\symboldefinitions}{%
+  \symbolentry{warning}
+  \symbolentry{important}
+  \symbolentry{information}
+  \symbolentry{definition}
+  \symbolentry{optionvalue}
+  \symbolentry{valuesetting}
+  \symbolentry{novaluesetting}
+  \symbolentry{toggleonsetting}
+  \symbolentry{toggleoffsetting}
+  \symbolentry{counter}
+  \symbolentry{deprecated}
+  \symbolentry{banned}
+  \symbolentry{terminal}
+  \symbolentry{transcript}
+  \symbolentry{code}
+  \symbolentry{badcode}
+  \symbolentry{unicode}
+  \symbolentry{result}
+}
+
+\newlength\boxtitleshift
+\setlength{\boxtitleshift}{-2.5mm}
+
+\newtcolorbox{warning}[1][]{breakable,
+ title={\glssymbol{sym.warning}},
+ coltitle=red,colbacktitle=red!20!white,
+ colframe=red,colback=red!5!white,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\newtcolorbox{important}[1][]{breakable,title={\glssymbol{sym.important}},
+ coltitle=red,colbacktitle=red!20!white,
+ colframe=red,colback=red!5!white,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\newtcolorbox{information}[1][]{breakable,title={\glssymbol{sym.information}},
+ coltitle=teal,colbacktitle=teal!20!white,
+ colframe=teal,colback=teal!5!white,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\definecolor{defbackground}{rgb}{1,1,0.75}
+\definecolor{optiondefbackground}{rgb}{1,1,0.89}
+\definecolor{optionvaluedefbackground}{rgb}{1,1,0.96}
+
+\newcommand{\nlctdefaultafter}{\par\noindent\ignorespacesafterend}
+
+\newtcolorbox{pinnedbox}[1][]{unbreakable,title={\glssymbol{sym.definition}},
+ coltitle=black,colbacktitle=defbackground,
+ colframe=black,colback=defbackground,halign=flush left,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newtcolorbox{defnbox}[1][]{unbreakable,
+ colframe=black,colback=defbackground,halign=flush left,
+ after={\nlctdefaultafter},
+ #1
+}
+
+
+\newtcolorbox{settingsbox}[1][]{title={\glssymbol{sym.valuesetting}},unbreakable,
+ coltitle=black,colbacktitle=defbackground!20!white,
+ colframe=black,colback=defbackground!20!white,halign=flush left,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ #1
+}
+
+\newtcolorbox{terminal}{unbreakable,title={\glssymbol{sym.terminal}},
+ colframe=black,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ halign=flush left,fontupper=\ttfamily,before upper={\frenchspacing\obeylines}
+}
+
+\newtcolorbox{transcript}{unbreakable,title={\glssymbol{sym.transcript}},
+ colframe=black,
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},
+ after={\nlctdefaultafter},
+ halign=flush left,fontupper=\ttfamily,before upper={\frenchspacing\obeylines}
+}
+
+\newcommand{\code at cmd}[1]{\char`\\ #1}
+\newcommand{\cmd}[1]{\texttt{\code at cmd{#1}}}
+\newcommand{\code at cbeg}[1]{\cmd{begin}\marg{#1}}
+\newcommand{\code at cend}[1]{\cmd{end}\marg{#1}}
+\newcommand{\code at comment}[1]{\mbox{\textcolor{comment}{\glspercentchar\ #1}}}%
+\newcommand{\araraline}[1]{\glspercentchar\ arara: #1}
+\newcommand{\araracont}{\araraline{-\/-> }}
+
+\newcommand*{\setupcodeenvfmts}{%
+ \let\cbeg\code at cbeg
+ \let\cend\code at cend
+ \let\comment\code at comment
+ \renewcommand*{\envfmt}[1]{##1}%
+ \renewcommand*{\styfmt}[1]{##1}%
+ \renewcommand*{\clsfmt}[1]{##1}%
+ \renewcommand*{\ctrfmt}[1]{##1}%
+ \renewcommand*{\csfmtfont}[1]{\textcolor{cs}{##1}}%
+ \let\fmtorcode\@secondoftwo
+ \let\code\@firstofone
+}
+
+\newcommand*{\initcodeenv}{%
+ \GlsXtrStartUnsetBuffering
+ \setupcodeenvfmts
+ \obeylines\frenchspacing\@vobeyspaces
+ \parindent\z@\parfillskip\@flushglue
+}
+
+\newcommand{\codefont}{\ttfamily}
+
+% inline
+\newcommand{\code}[1]{\texorpdfstring{\@code{#1}}{#1}}
+\newrobustcmd{\@code}[1]{{\setupcodeenvfmts\codefont\obeyspaces #1}}
+
+\definecolor{codebackground}{gray}{0.95}
+
+\newtcolorbox{codebox}[1][]{title={\glssymbol{sym.code}},
+ enhanced,breakable,attach boxed title to top right={yshift=\boxtitleshift},
+ halign=flush left,fontupper=\codefont,colback=codebackground,
+  before upper={%
+  \preto\glslinkpresetkeys{\setkeys{glslink}{format=glsignore}}%
+  \initcodeenv
+  },
+  after upper={\GlsXtrDiscardUnsetBuffering},
+  after={\nlctdefaultafter},
+  #1
+}
+
+\newtcolorbox{codebox*}[1][]{title={\glssymbol{sym.code}},
+ enhanced,breakable,
+ attach boxed title to top right={yshift=\boxtitleshift},
+ halign=flush left,fontupper=\codefont,colback=codebackground,
+  before upper={\initcodeenv},
+  after upper={\GlsXtrDiscardUnsetBuffering},
+  after={\nlctdefaultafter},
+  #1
+}
+
+\newenvironment{badcodebox}%
+{\begin{codebox}[title={\glssymbol{sym.badcode}}]}
+{\end{codebox}\noindent\ignorespacesafterend}
+
+\newenvironment{unicodebox}%
+{\begin{codebox}[title={\glssymbol{sym.unicode}}]}
+{\end{codebox}\noindent\ignorespacesafterend}
+
+\newtcolorbox{compactcodebox}[1][]{%
+  halign=flush left,fontupper=\codefont,colback=codebackground,
+  before upper={%
+  \renewcommand{\glslinkpresetkeys}{\setkeys{glslink}{format=glsignore}}%
+  \initcodeenv},
+  after upper={\GlsXtrDiscardUnsetBuffering},
+  after={\nlctdefaultafter},
+  #1
+}
+
+\newtcolorbox{compactcodebox*}[1][]{%
+  halign=flush left,fontupper=\codefont,colback=codebackground,
+  before upper={\initcodeenv},
+  after upper={\GlsXtrDiscardUnsetBuffering},
+  after={\nlctdefaultafter},
+  #1
+}
+
+\newcommand*{\result at attachtag}{}
+
+\newtcolorbox{resultbox}[1][]{title={\glssymbol{sym.result}},
+ coltitle=black,colbacktitle=white,
+ colframe=black,colback=white,
+ after={\nlctdefaultafter},
+ enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+
+\newtcolorbox{coderesult}[1][]{skin=bicolor,
+title={\glssymbol{sym.code} \glssymbol{sym.result}},
+attach boxed title to top center={yshift=\boxtitleshift},
+sidebyside,
+sidebyside align=top,
+colbacklower=white,
+fontupper=\codefont,
+before upper={%
+\renewcommand{\glslinkpresetkeys}{\setkeys{glslink}{format=glsignore}}%
+  \initcodeenv},
+after upper={\GlsXtrDiscardUnsetBuffering},
+halign upper=flush left,halign lower=justify,
+valign upper=top,valign lower=top,
+before lower={\renewcommand*{\nlct at preattachments}{\vspace*{-\baselineskip}}},
+after lower={\noindent},
+#1
+}
+
+\newtcolorbox{coderesult*}[1][]{skin=bicolor,
+title={\glssymbol{sym.code} \glssymbol{sym.result}},
+attach boxed title to top center={yshift=\boxtitleshift},
+sidebyside,
+sidebyside align=top,
+colbacklower=white,
+fontupper=\codefont,
+before upper={\initcodeenv},
+after upper={\GlsXtrDiscardUnsetBuffering},
+after lower={\noindent},
+valign upper=top,valign lower=top,
+halign upper=flush left,halign lower=justify,
+#1
+}
+
+\newenvironment{unicoderesult}%
+{\begin{coderesult}[title={\glssymbol{sym.unicode} \glssymbol{sym.result}}]}
+{\end{coderesult}\noindent\ignorespacesafterend}
+
+\newenvironment{unicoderesult*}%
+{\begin{coderesult*}[title={\glssymbol{sym.unicode} \glssymbol{sym.result}}]}
+{\end{coderesult*}\noindent\ignorespacesafterend}
+
+
+\newcommand*{\summarylocfont}{\footnotesize}
+\newcommand*{\summarylocwidth}{\marginparwidth}
+
+\definecolor{summaryloc}{rgb}{.75,.936,1} % LightBlue1
+
+\newcommand*{\summaryloc}[1]{%
+ \ifdefempty\summarylocwidth
+ {%
+   \tikz[baseline=(N.base)] 
+    \node[fill=summaryloc,rounded corners,font=\summarylocfont] (N) {#1};%
+ }%
+ {%
+   \smash
+   {%
+     \tikz[baseline=(N.west)] 
+      \node[anchor=west,fill=summaryloc,text width=\summarylocwidth,rounded corners,font=\summarylocfont] (N) {#1};%
+   }%
+ }%
+}
+
+\ifdef\@ptsize
+{
+  \ifboolexpr{ test {\ifdefstring\@ptsize{1}} 
+            or test {\ifdefstring\@ptsize{11}} 
+            or test {\ifdefstring\@ptsize{11pt}} 
+             }
+  {%
+    \newcommand{\@nlct at example@fontsize}{11pt}%
+  }
+  {
+     \ifboolexpr{ test {\ifdefstring\@ptsize{2}} or test {\ifdefstring\@ptsize{12}} }
+     {%
+       \newcommand{\@nlct at example@fontsize}{12pt}%
+     }
+     {
+       \newcommand{\@nlct at example@fontsize}{10pt}
+     }
+   }
+}
+{
+  \newcommand{\@nlct at example@fontsize}{10pt}
+}
+
+\newcommand{\@nlct at example@clsname}{article}
+
+\newcommand{\@nlct at example@fontsize at prefix}{}
+
+\newcommand{\@nlct at update@example at fontsize@prefix}{%
+  \ifdefstring{\@nlct at example@clsname}{scrreport}
+  {\renewcommand{\@nlct at example@fontsize at prefix}{fontsize=}}%
+  {%
+    \ifdefstring{\@nlct at example@clsname}{scrbook}
+    {\renewcommand{\@nlct at example@fontsize at prefix}{fontsize=}}%
+    {%
+      \ifdefstring{\@nlct at example@clsname}{scrarticle}
+      {\renewcommand{\@nlct at example@fontsize at prefix}{fontsize=}}%
+      {%
+        \renewcommand{\@nlct at example@fontsize at prefix}{}
+      }%
+    }%
+  }%
+}
+
+\newcommand{\setexamplefontsize}[1]{%
+  \renewcommand{\@nlct at example@fontsize}{#1pt}%
+  \ifnum#1>12\relax
+    \renewcommand{\@nlct at example@clsname}{extarticle}%
+  \else
+    \ifnum#1<10\relax
+      \renewcommand{\@nlct at example@clsname}{extarticle}%
+    \else
+      \renewcommand{\@nlct at example@clsname}{article}%
+    \fi
+  \fi
+}
+
+\newcommand*{\nlct at create@example at preamble}{%
+ \string\documentclass[\@nlct at example@fontsize at prefix\@nlct at example@fontsize]{\@nlct at example@clsname}^^J%
+ \string\pagestyle{\@nlct at example@pagestyle}^^J}
+\newcommand*{\setexamplepreamble}[1]{\edef\create at example@preamble{\detokenize{#1}^^J}}
+\newcommand*{\addtoexamplepreamble}[1]{\eappto\create at example@preamble{\detokenize{#1}^^J}}
+
+\newwrite\nlct at exampleout
+
+\define at choicekey{nlctexample}{fontsize}%
+ {8,9,10,11,12,14,17,20}%
+ {\setexamplefontsize{#1}}
+
+\define at key{nlctexample}{class}{\renewcommand{\@nlct at example@clsname}{#1}}
+
+\newcommand{\@nlct at example@pagestyle}{empty}
+\define at key{nlctexample}{pagestyle}{\renewcommand{\@nlct at example@pagestyle}{#1}}
+
+\define at key{nlctexample}{graphicsopts}{%
+ \renewcommand*{\create at example@graphicsopts}{#1}}
+\newcommand*{\create at example@graphicsopts}{}
+
+\define at key{nlctexample}{pages}{%
+ \renewcommand*{\create at example@pages}{#1}}
+\newcommand*{\create at example@pages}{}
+
+\define at key{nlctexample}{pagesep}{%
+ \renewcommand*{\create at example@pages at sep}{#1}}
+\newcommand{\create at example@pages at sep}{1em}
+
+\define at key{nlctexample}{tex}{\renewcommand*{\create at example@tex}{#1}}
+\newcommand*{\create at example@tex}{arara --working-directory \examplesdir}
+
+\newcommand*{\nlct at create@example at precls}{%
+ \glspercentchar\space arara\string: pdflatex^^J%
+ \glspercentchar\space arara\string: pdfcrop^^J%
+}
+
+\define at key{nlctexample}{arara}{%
+ \ifdefstring{\examplesdir}{.}%
+ {\renewcommand*{\create at example@tex}{arara}}%
+ {\renewcommand*{\create at example@tex}{arara --working-directory \examplesdir}}%
+ \renewcommand*{\nlct at create@example at precls}{}%
+ \@for\nlct at thisitem:=#1\do{%
+  \eappto\nlct at create@example at precls{\glspercentchar\space arara\string:
+     \expandafter\detokenize\expandafter{\nlct at thisitem}^^J}%
+ }%
+}
+
+\providecommand{\examplename}{Example}
+\let\Examplename\examplename
+
+\newcommand*{\example at attachdesc}{\Examplename\space \theexample}
+
+\define at key{nlctexample}{description}{%
+ \renewcommand*{\example at attachdesc}{#1}%
+}
+
+\newcommand*{\example at title}{}
+
+\define at key{nlctexample}{title}{%
+ \renewcommand*{\example at title}{#1}%
+}
+
+\newcommand{\example at do@label}{}
+\newcommand{\example at label@info}{}
+
+\define at key{nlctexample}{label}{%
+ \renewcommand{\example at label@info}{\glspercentchar\space Label: #1^^J}%
+ \renewcommand*{\example at do@label}{\label{#1}}%
+}
+
+\newcounter{example}
+
+\newcommand{\exampleattachtexicon}{\faPaperclip\textsuperscript\faFileTextO}
+\newcommand{\exampleattachpdficon}{\faPaperclip\textsuperscript\faFilePdfO}
+\newcommand{\exampledownloadtexicon}{\faDownload\textsuperscript\faFileTextO}
+\newcommand{\exampledownloadpdficon}{\faDownload\textsuperscript\faFilePdfO}
+
+\newcommand{\codepar}{\par\mbox{}\par}
+
+\newcommand{\nlctexamplelets}{%
+ \let\gls\glsentrytext
+ \let\env\@firstofone
+ \let\ctr\@firstofone
+ \let\texorpdfstring\@secondoftwo
+ \def\cmd##1{\glsbackslash##1}%
+ \def\csfmt##1{\glsbackslash##1}%
+ \def\cbeg##1{\glsbackslash begin{##1}}%
+ \def\cend##1{\glsbackslash end{##1}}%
+ \def\comment##1{\glspercentchar\space ##1^^J}%
+ \def\%{\glspercentchar}%
+ \edef\#{\expandafter\@gobble\string\#}%
+ \def\-{}%
+ \def\codepar{^^J^^J}%
+ \def\marg##1{\glsopenbrace##1\glsclosebrace}%
+ \def\oarg##1{[##1]}%
+}
+
+\newcommand{\@create at example@write}{\@create at example@write at detok}
+
+\newcommand{\createexamplefirstline}{%
+  \nlct at ifattachsupported
+  {\glspercentchar\space This file is embedded in \jobname.pdf^^J}%
+  {\glspercentchar\space This file is an example from \jobname.pdf^^J}%
+}
+
+\newcommand{\@create at example@write at detok}[2]{%
+  \immediate\write\nlct at exampleout{%
+    \createexamplefirstline
+    \glspercentchar\space \Examplename\space \theexample\space\example at title^^J%
+    \example at label@info
+    \nlct at create@example at precls
+    \nlct at create@example at preamble
+    \detokenize{#1}^^J\string\begin{document}^^J\detokenize{#2}^^J%
+    \string\end{document}}%
+}
+
+\newcommand{\@create at example@write at nodetok}[2]{%
+ {\nlctexamplelets\immediate\write\nlct at exampleout{%
+    \createexamplefirstline
+    \glspercentchar\space \Examplename\space \theexample\space\example at title^^J%
+    \nlct at create@example at precls\nlct at create@example at preamble
+    #1^^J\string\begin{document}^^J#2^^J%
+    \string\end{document}}%
+ }%
+}
+
+\newcommand{\example at image}[2][]{%
+  \settowidth{\dimen@}{\expandafter\includegraphics\expandafter
+    [\create at example@graphicsopts,#1]{#2}}%
+  \ifdim\dimen@>\linewidth\preto\create at example@graphicsopts{width=\linewidth,}\fi
+  \s at example@image[#1]{#2}%
+}
+
+\newcommand{\s at example@image}[2][]{%
+  \vtop
+  {%
+   \vskip0pt
+   \hbox{\expandafter\includegraphics\expandafter
+    [\create at example@graphicsopts,#1]{#2}}%
+  }%
+}
+
+\newcommand{\nlctexampleimagelist}{%
+ \examplesdir/\nlct at example@filebasename-crop.pdf,%
+ \examplesdir/\nlct at example@filebasename.pdf%
+}
+
+\newcommand*{\nlct at include@exampleimage}{%
+ \@for\nlct at image@file:=\nlctexampleimagelist\do
+ {%
+   \IfFileExists{\nlct at image@file}%
+   {%
+     \ifdefempty\create at example@pages
+     {\example at image{\nlct at image@file}}%
+     {%
+       \ifdefempty\create at example@graphicsopts
+       {%
+         \DTLnumitemsinlist{\create at example@pages}{\@nlct at num}%
+         \edef\create at example@graphicsopts{width=\the\dimexpr\linewidth/\@nlct at num-\create at example@pages at sep}%
+       }{}%
+       \@for\@nlct at page:=\create at example@pages\do{\hfill
+       \s at example@image[page=\@nlct at page]{\nlct at image@file}\hfill}%
+     }%
+     \@endfortrue
+   }%
+   {}%
+ }%
+ \if at endfor
+ \else
+   \PackageWarning{nlctuserguide}%
+      {Missing example file `\nlct at example@filebasename.pdf'}%
+     [missing \nlct at example@filebasename.pdf]
+ \fi
+}
+
+% \createexample[options]{preamble code}{document code}
+\newcommand{\createexample}{%
+ \@nlct at update@example at fontsize@prefix
+ \@ifstar
+ {\let\@create at example@write\@create at example@write at nodetok\@createexample}%
+ {\let\@create at example@write\@create at example@write at detok\@createexample}}
+
+\newcommand{\listofexamplesname}{List of Examples}
+\newcommand{\listofexampleslabel}{\label{sec:listofexamples}}
+
+\ifdef\chapter
+{
+  \ifdef\titlepagestyle{\renewcommand{\titlepagestyle}{empty}}{}
+  \pagenumbering{alph}
+
+  \newcommand{\listofexamples}{%
+   \@ifstar{\chapter*{\listofexamplesname}\@starttoc{loe}}%
+   {\chapter{\listofexamplesname}\listofexampleslabel\@starttoc{loe}}}
+}
+{
+  \newcommand{\listofexamples}{%
+   \@ifstar{\section*{\listofexamplesname}\@starttoc{loe}}%
+   {\section{\listofexamplesname}\listofexampleslabel\@starttoc{loe}}}
+}
+
+\newcommand{\l at example}{\l at table}
+
+\newcommand\nlctexamplefilebasename{%
+ \jobname-example\ifnum\c at example<10 00\else \ifnum\c at example<100 0\fi\fi\the\c at example}%
+
+\newcommand*{\nlct at preattachments}{}
+
+\newcommand{\nlctexampledisablecmds}{}
+
+\newcommand{\nlctexampletag}{\Examplename~\theexample}
+
+\newcommand{\nlctexampletitlefmt}[1]{%
+  \nlctexampletitlefont\raggedright
+  \nlctexampletag\ifstrempty{#1}{}{: #1}\par
+}
+
+\newcommand{\nlctexampletitlebox}[2][0.8\linewidth]{%
+ \parbox[t]{#1}{\nlctexampletitlefmt{#2}}}
+
+\newcommand{\nlctexampletagattachfont}{\small}
+\newcommand{\nlctexampletitlefont}{\nlctexampletagattachfont}
+\newcommand{\nlctexampleenvtitlefont}{\bfseries\large}
+
+\newcommand{\addtolistofexamples}[1]{%
+ \addcontentsline{loe}{example}{\protect\numberline{\theexample}#1}%
+}
+
+\newif\ifnlctattachpdf
+\nlctattachpdffalse
+
+\newif\ifnlctdownloadlinks
+\nlctdownloadlinkstrue
+\newcommand*{\nlctdownloadlink}[1]{http://mirrors.ctan.org/macros/latex/contrib/\thispackagename/#1}
+
+\newcommand*{\nlct at testfile}[2]{%
+  \IfFileExists{#1}{}%
+  {%
+    \PackageWarning{nlctuserguide}{File `#1' doesn't exist.
+      Changing examples directory to `.'}%
+    \gdef\examplesdir{.}%
+    #2%
+  }%
+  \global\let\nlct at testfile\@gobblethree
+}
+
+\newcommand{\@loe at disable@cmds}{%
+  \def\dequals{\protect\dequals}%
+  \def\dhyphen{\protect\dhyphen}%
+  \def\dunderscore{\protect\dunderscore}%
+  \def\cmd##1{\protect\csfmt{##1}}%
+  \def\code##1{\protect\code{##1}}%
+  \def\optfmt##1{\protect\optfmt{##1}}%
+  \def\styfmt##1{\protect\styfmt{##1}}%
+  \def\clsfmt##1{\protect\clsfmt{##1}}%
+  \def\envfmt##1{\protect\envfmt{##1}}%
+  \def\appfmt##1{\protect\appfmt{##1}}%
+}
+
+\newcommand{\@createexample}[3][]{%
+ \begingroup
+  \refstepcounter{example}%
+  \setkeys{nlctexample}{#1}%
+  \example at do@label
+  \let\nlct at org@cmd\cmd
+  \def\cmd##1{\csfmt{##1}}%
+  \protected at edef\example at tex@title{\example at title}%
+  \@loe at disable@cmds
+  \addtolistofexamples{\example at title}%
+  \def\cmd##1{\string\\##1}%
+  \let\code\@firstofone
+  \let\optfmt\@firstofone
+  \let\styfmt\@firstofone
+  \let\clsfmt\@firstofone
+  \let\envfmt\@firstofone
+  \let\appfmt\@firstofone
+  \let\opt\@firstofone
+  \let\app\@firstofone
+  \let\sty\@firstofone
+  \let\cls\@firstofone
+  \let\glslink\@secondoftwo
+  \let\texorpdfstring\@secondoftwo
+  \let\codebackslash\glsbackslash
+  \let\-\@empty
+  \def\TeX{TeX}%
+  \def\LaTeX{LaTeX}%
+  \def\dequals{=}%
+  \def\dhyphen{-}%
+  \def\dunderscore{\_}%
+  \def\newline{^^J}%
+  \nlctexampledisablecmds
+  \protected at edef\example at pdf@title{\example at title}%
+  \protected at edef\example at attachdesc{\example at attachdesc}%
+  \def\cmd##1{\glsbackslash ##1}%
+  \protected at edef\example at title{\example at title}%
+  \let\cmd\nlct at org@cmd
+  \xdef\nlct at example@filebasename{\nlctexamplefilebasename}%
+  \immediate\openout\nlct at exampleout=\examplesdir/\nlct at example@filebasename.tex
+  \@create at example@write{#2}{#3}%
+  \immediate\closeout\nlct at exampleout
+  \nlct at testfile{\examplesdir/\nlct at example@filebasename}%
+  {%
+    \immediate\openout\nlct at exampleout=\nlct at example@filebasename.tex
+    \@create at example@write{#2}{#3}%
+    \immediate\closeout\nlct at exampleout
+  }%
+  \immediate\write18{\create at example@tex\space\nlct at example@filebasename.tex}%
+  \nlct at ifattachsupported
+  {%
+    \nlct at preattachments
+    \bgroup
+    \nlctexampletitlebox{\example at tex@title}\hfill
+    \nlctexampletagattachfont
+    \textattachfile[mimetype={application/x-tex},
+      author={\@pdfauthor},color={0 0 0},
+      size={\pdf at filesize{\examplesdir/\nlct at example@filebasename.tex}},
+      subject={\example at pdf@title\space (source code)},
+      description={\example at attachdesc\space (source code)}]%
+      {\examplesdir/\nlct at example@filebasename.tex}{\exampleattachtexicon}%
+    \ifnlctdownloadlinks
+     \space
+     \href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.tex}}{\exampledownloadtexicon}
+    \fi
+    \ifnlctattachpdf
+      \IfFileExists{\examplesdir/\nlct at example@filebasename.pdf}
+      {%
+         \space
+         \textattachfile[mimetype={application/pdf},
+          author={\@pdfauthor},color={0 0 0},
+          size={\pdf at filesize{\examplesdir/\nlct at example@filebasename.pdf}},
+          subject={\example at pdf@title\space (PDF)},
+          description={\example at attachdesc\space (PDF)}]%
+         {\examplesdir/\nlct at example@filebasename.pdf}{\exampleattachpdficon}%
+      }%
+      {}%
+      \ifnlctdownloadlinks
+       \space
+       \href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.pdf}}{\exampledownloadpdficon}
+      \fi
+    \else
+      \ifnlctdownloadlinks
+       \space
+       \href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.pdf}}{\exampledownloadpdficon}
+      \fi
+    \fi
+    \par\egroup\noindent
+  }%
+  {%
+    \nlctexampletitlebox{\example at tex@title}\hfill
+   \ifnlctdownloadlinks
+    \href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.tex}}{\exampledownloadtexicon}
+    \quad
+    \href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.pdf}}{\exampledownloadpdficon}
+    \par\egroup\noindent
+   \fi
+  }
+  \nlct at include@exampleimage
+  \endgroup
+}
+
+\newenvironment{example}[2]{%
+  \refstepcounter{example}\label{#2}%
+  \par\vskip10pt\noindent
+  {%
+    \def\cmd##1{\csfmt{##1}}%
+    \let\nlctexampletitlefont\nlctexampleenvtitlefont
+    \nlctexampletitlefmt{#1}%
+  }%
+  {%
+    \@loe at disable@cmds
+    \addtolistofexamples{#1}%
+  }%
+  \nopagebreak\par\vskip10pt\nopagebreak
+}
+{%
+  \nopagebreak\begin{center}\rule{2in}{1pt}\end{center}%
+}
+
+
+\renewcommand{\fps at figure}{htbp}
+
+% put break before dash to avoid confusion with a hyphen
+\newcommand{\dhyphen}{%
+ \texorpdfstring
+ {\discretionary{}{}{}\texttt{-}}%
+ {-}%
+}
+
+% Redefine \- (used in entry names) so that hyphenation in command names, 
+% switches, options etc., uses a serif hyphen to reduce confusion with an 
+% actual hyphen in the code.
+\renewrobustcmd{\-}{%
+ \discretionary
+ {{\rmfamily\char\ifnum\hyphenchar\font<0
+  \defaulthyphenchar\else\hyphenchar\font\fi
+ }}%
+ {}{}%
+}
+
+\newcommand{\dequals}{%
+ \texorpdfstring
+ {\discretionary{}{}{}\texttt{=}\discretionary{}{}{}}%
+ {=}%
+}
+
+\newcommand{\dcomma}{%
+ \texorpdfstring
+ {\texttt{,}\discretionary{}{}{}}%
+ {,}%
+}
+
+\newcommand{\dcolon}{%
+ \texorpdfstring
+ {\texttt{:}\discretionary{}{}{}}%
+ {:}%
+}
+
+\newcommand{\dfullstop}{%
+ \texorpdfstring
+ {\texttt{.}\discretionary{}{}{}}%
+ {.}%
+}
+
+\newcommand{\dunderscore}{%
+ \texorpdfstring
+ {\discretionary{}{}{}\texttt{\_}\discretionary{}{}{}}%
+ {\_}%
+}
+
+\newcommand\dsb{\dunderscore}
+
+\pdfstringdefDisableCommands{%
+  \def\dhyphen{-}%
+  \def\dcolon{:}%
+  \def\dcomma{,}%
+  \def\dequals{=}%
+  \def\dfullstop{.}%
+  \def\dunderscore{\_}%
+  \let\-\empty
+  \let\csfmtfont\@firstofone
+}
+
+\definecolor{cs}{rgb}{.328,.436,.1} % dark green
+\definecolor{styopt}{rgb}{.408,.132,.545} % DarkOrchid4
+\definecolor{csopt}{rgb}{.408,.132,.545} % DarkOrchid4
+\definecolor{comment}{rgb}{0.37,0.37,0.37}% grey
+
+\definecolor{style1}{rgb}{.32,.545,.545} % DarkSlateGray4
+\definecolor{style2}{rgb}{.21,.392,.545} % SteelBlue4
+\definecolor{style3}{rgb}{0,0,.545} % Blue4
+\definecolor{style4}{rgb}{.332,.1,.545} % Purple4
+\definecolor{style5}{rgb}{.28,.235,.545} % SlateBlue4
+\definecolor{style6}{rgb}{.545,.352,.17} % Tan4
+
+\newcommand{\sidenote}[1]{\leavevmode\marginpar{\footnotesize#1}}
+
+\newcommand*{\csfmtfont}[1]{\ifmmode \mbox{\texttt{#1}}\else\texttt{#1}\fi}
+\newcommand*{\csfmtcolourfont}[1]{\texttt{\textcolor{cs}{#1}}}
+
+\newcommand*{\csfmt}[1]{\csfmtfont{\codebackslash #1}}
+
+\newcommand{\codebackslash}{\texorpdfstring{\char`\\}{\string\\}}
+
+\newcommand{\csmetafmt}[3]{%
+ \texorpdfstring{\csfmt{#1\meta{#2}#3}}{\string\\#1\string<#2\string>#3}%
+}
+\newcommand{\csmetametafmt}[5]{%
+ \texorpdfstring{\csfmt{#1\meta{#2}#3\meta{#4}#5}}{\string\\#1\string<#2\string>#3\string<#4\string>#5}%
+}
+
+\newcommand{\starredcs}[1]{\glslink{#1}{\csfmt{#1*}}}
+
+\glsxtraddlabelprefix{dual.}
+\glsxtraddlabelprefix{idx.}
+\glsxtraddlabelprefix{idx.sym.}
+\glsxtraddlabelprefix{}
+
+\newcommand{\idx}{\dgls}
+\newcommand{\idxpl}{\dglspl}
+\newcommand{\Idx}{\dGls}
+\newcommand{\Idxpl}{\dGlspl}
+\newcommand{\idxc}{\dglslink}
+\newcommand{\idxn}[2][]{%
+ \ifglsentryexists{dual.#2}%
+ {\glsname[#1]{dual.#2}}%
+ {\ifglsentryexists{idx.#2}{\glsname[#1]{idx.#2}}{\glsname[#1]{#2}}}%
+}
+\newcommand{\idxf}[2][]{%
+ \ifglsentryexists{dual.#2}%
+ {\glsfirst[#1]{dual.#2}}%
+ {\ifglsentryexists{idx.#2}{\glsfirst[#1]{idx.#2}}{\glsfirst[#1]{#2}}}%
+}
+
+\newcommand{\optionlistprefix}{opt.}
+\newcommand{\optionlistitemformat}[1]{\glsentrytext{#1}}
+\newcommand{\optionlisttag}{Option}
+\newcommand{\optionlisttags}{Options}
+
+\newrobustcmd{\option}[1]{%
+ \glslink{\optionlistprefix#1}%
+ {\optionlisttag\glsxtrtaggedlistsep\optionlistitemformat{\optionlistprefix#1}}%
+}
+
+\newrobustcmd{\optionsto}[2]{%
+ \optionlisttags\glsxtrtaggedlistsep
+ \glslink{\optionlistprefix#1}%
+ {\optionlistitemformat{\optionlistprefix#1}}%
+ \thinspace\textendash\thinspace
+ \glslink{\optionlistprefix#2}%
+ {\optionlistitemformat{\optionlistprefix#2}}%
+}
+
+\newrobustcmd{\options}[1]{%
+  {\def\andname{and}
+   \let\glsseeitemformat\optionlistitemformat
+   \glsxtrtaggedlist{\optionlisttag}{\optionlisttags}{\optionlistprefix}{#1}%
+  }%
+}
+
+\newrobustcmd{\optionsor}[1]{%
+  {\def\andname{or}%
+   \let\glsseeitemformat\optionlistitemformat
+   \glsxtrtaggedlist{\optionlisttag}{\optionlisttags}{\optionlistprefix}{#1}%
+  }%
+}
+
+\newcommand*{\stytext}[1]{\glsfmttext{pkg.#1}}
+\newcommand*{\clstext}[1]{\glsfmttext{cls.#1}}
+\newcommand*{\opttext}[1]{\glsfmttext{opt.#1}}
+\newcommand*{\envtext}[1]{\glsfmttext{env.#1}}
+\newcommand*{\ctrtext}[1]{\glsfmttext{ctr.#1}}
+\newcommand*{\actext}[1]{\glsfmttext{dual.#1}}
+\newcommand*{\exttext}[1]{\glsfmttext{ext.#1}}
+\newcommand*{\apptext}[1]{\glsfmttext{app.#1}}
+\newcommand*{\switchtext}[1]{\glsfmttext{switch.#1}}
+
+\glsxtrnewgls{pkg.}{\sty}
+\glsxtrnewgls{cls.}{\cls}
+\glsxtrnewgls{opt.}{\opt}
+\glsxtrnewgls{env.}{\env}
+\glsxtrnewgls{ctr.}{\ctr}
+\glsxtrnewgls{dual.}{\ac}
+\glsxtrnewgls[format=glsignore]{ext.}{\ext}
+\glsxtrnewgls{app.}{\app}
+\glsxtrnewgls{switch.}{\switch}
+\glsxtrnewgls{idx.mod.}{\cmdmod}
+
+\newdglsfield{symbol}{\sym}
+
+\newcommand{\optval}[2]{%
+ \texorpdfstring
+  {\gls{opt.#1}\optfmt{\dequals#2}}%
+  {\glsentrytext{opt.#1}=#2}%
+}
+
+\newcommand{\optvalm}[2]{%
+ \texorpdfstring
+  {\gls{opt.#1}\optfmt{\dequals\marg{#2}}}%
+  {\glsentrytext{opt.#1}=\marg{#2}}%
+}
+
+\newcommand{\opteqvalref}[2]{%
+ \texorpdfstring
+  {\gls!{opt.#1}\optfmt{\dequals}\gls{optval.#1.#2}}%
+  {\glsentrytext{opt.#1}=\glsentrytext{optval.#1.#2}}%
+}
+
+\newcommand{\optvalref}[2]{%
+ \texorpdfstring
+  {\gls{optval.#1.#2}}%
+  {\glsentrytext{optval.#1.#2}}%
+}
+
+\newcommand{\optvalrefeq}[3]{%
+ \texorpdfstring
+  {\gls{optval.#1.#2}\optfmt{\dequals#3}}%
+  {\glsentrytext{optval.#1.#2}=#3}%
+}
+
+\newcommand{\childoptval}[3]{%
+ \texorpdfstring
+  {\gls{optval.#1.#2}\optfmt{\dequals#3}}%
+  {\glsentrytext{optval.#1.#2}=#3}%
+}
+
+\newcommand{\qt}[1]{\texorpdfstring{``#1''}{"#1"}}
+\newcommand{\qtt}[1]{\qt{\,\texttt{#1}\,}}
+
+\newcommand{\booktitle}[1]{\emph{#1}}
+
+\newcommand*{\fmtorcode}[2]{#1{#2}}
+
+\newcommand*{\appfmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
+\newcommand*{\styfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\newcommand*{\clsfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\newcommand*{\envfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\newcommand*{\optfmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
+\newcommand*{\csoptfmt}[1]{\texorpdfstring{\textcolor{cs}{\optfmt{#1}}}{#1}}
+\newcommand*{\styoptfmt}[1]{\texorpdfstring{\textcolor{styopt}{\optfmt{#1}}}{#1}}
+\newcommand*{\clsoptfmt}[1]{\texorpdfstring{\textcolor{styopt}{\optfmt{#1}}}{#1}}
+\newcommand*{\ctrfmt}[1]{\texorpdfstring{\textsf{#1}}{#1}}
+\edef\longswitch{\string-\/\string-}
+\edef\pdflongswitch{\string-\string-}
+
+\newcommand*{\longargfmt}[1]{%
+ \texorpdfstring{\texttt{\longswitch #1}}{\pdflongswitch#1}%
+}
+
+\newcommand*{\shortargfmt}[1]{\texorpdfstring{\texttt{-#1}}{\string-#1}}
+
+% \defsemanticcmd[colour]{cs}{font-cs}{prefix}
+\newcommand*{\defsemanticcmd}[4][]{%
+  \ifstrempty{#1}%
+  {%
+    \ifstrempty{#3}%
+    {%
+      \newcommand#2[1]{#4##1}%
+    }
+    {%
+      \newcommand#2[1]{\texorpdfstring{\fmtorcode#3{#4##1}}{#4##1}}%
+    }%
+  }%
+  {%
+    \ifstrempty{#3}%
+    {%
+      \newcommand#2[1]{\texorpdfstring{{\color{#1}#4##1}}{#4##1}}%
+    }%
+    {%
+      \newcommand#2[1]{\texorpdfstring{\fmtorcode#3{\color{#1}#4##1}}{#4##1}}%
+    }%
+  }%
+}
+
+\newrobustcmd*{\texmeta}[1]{{\normalfont\normalcolor$\langle$\emph{#1}$\rangle$}}
+
+\newcommand*{\meta}[1]{%
+ \texorpdfstring{\ifmmode\text{\texmeta{#1}}\else\texmeta{#1}\fi}{\string<#1\string>}%
+}
+
+\newcommand*{\oarg}[1]{\discretionary{}{}{}[#1]}
+\newcommand*{\oargm}[1]{\oarg{\meta{#1}}}
+
+% To prevent lonely [ and ] from upsetting the syntax highlighter:
+\newrobustcmd*{\nlctopensqbracket}{[}
+\newrobustcmd*{\nlctclosesqbracket}{]}
+
+% To prevent lonely ( and ) from upsetting the syntax highlighter:
+\newrobustcmd*{\nlctopenparen}{(}
+\newrobustcmd*{\nlctcloseparen}{)}
+
+\newcommand*{\marg}[1]{\texorpdfstring
+ {\discretionary{}{}{}\char`\{#1\char`\} \discretionary{}{}{}}%
+ {\{#1\}}%
+}
+
+\newcommand*{\margm}[1]{\marg{\meta{#1}}}
+
+\newcommand*{\metaboolean}{\meta{boolean}}
+\newcommand*{\keyval}{\meta{key}\dequals\meta{value}}
+\newcommand*{\keyvallist}{\meta{key\dequals value list}}
+
+\newcommand*{\keyeqvalue}[2]{#1=#2}
+\newcommand*{\keyeqvaluem}[2]{#1=\marg{#2}}
+
+\newcommand*{\file}[1]{%
+ \texorpdfstring
+ {\gls{file.#1}}%
+ {#1}%
+}
+
+\newcommand*{\filefmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
+\newcommand*{\extfmt}{\filefmt}
+
+% \metafilefmt{prefix}{val}{suffix} -> prefix<val>suffix
+\newcommand*{\metafilefmt}[3]{%
+  \filefmt{#1}\discretionary{}{}{}\meta{#2}\discretionary{}{}{}\filefmt{#3}%
+}
+
+% \metametafilefmt{prefix}{val1}{mid}{val2}{suffix} ->
+% prefix<val1>mid<val2>suffix
+\newcommand*{\metametafilefmt}[5]{%
+  \filefmt{#1}\discretionary{}{}{}\meta{#2}\discretionary{}{}{}\filefmt{#3}%
+  \discretionary{}{}{}\meta{#4}\discretionary{}{}{}\filefmt{#5}%
+}
+
+\newcommand*{\BibTeX}{\hologo{BibTeX}}
+\newcommand*{\eTeX}{\hologo{eTeX}}
+\newcommand*{\XeLaTeX}{\hologo{XeLaTeX}}
+\newcommand*{\LuaLaTeX}{\hologo{LuaLaTeX}}
+\newcommand*{\pdfLaTeX}{\hologo{pdfLaTeX}}
+\newcommand*{\LuaTeX}{\hologo{LuaTeX}}
+\newcommand*{\XeTeX}{\hologo{XeTeX}}
+\newcommand*{\pdfTeX}{\hologo{pdfTeX}}
+
+\ifdef\GlsXtrSetPlusModifier
+{\GlsXtrSetPlusModifier{format=glsnumberformat}}{}
+
+\ifdef\GlsXtrSetAltModifier
+{\GlsXtrSetAltModifier{!}{format=glsignore}}{}
+
+\newcommand{\@@mainmatteronly at op}[1]{%
+ \glsxtrtitleorpdforheading{#1}{}{}%
+}
+\newcommand{\@mainmatteronly}[1]{%
+ \texorpdfstring{\protect\@@mainmatteronly{#1}}{}%
+}
+\let\mainmatteronly\@mainmatteronly
+\let\@@mainmatteronly\@@mainmatteronly at op
+
+\ifdef\frontmatter
+{
+ \appto\frontmatter{%
+   \GlsXtrSetDefaultNumberFormat{glsignore}%
+   \let\mainmatteronly\@gobble
+   \let\@@mainmatteronly\@gobble
+  }
+}
+{%
+}
+
+\ifdef\mainmatter
+{
+  \appto\mainmatter{%
+    \GlsXtrSetDefaultNumberFormat{glsnumberformat}%
+    \let\mainmatteronly\@mainmatteronly
+    \let\@@mainmatteronly\@@mainmatteronly at op
+  }
+}
+{}
+
+\ifdef\backmatter
+{\appto\backmatter{\setupglossaries{numberedsection=nolabel}}}
+{}
+
+\ifdef\abstract
+{}
+{
+ \providecommand{\abstractname}{Abstract}
+ \newenvironment{abstract}{\begin{center}\textbf{\abstractname}\end{center}\quotation}{\endquotation}
+}
+
+\newcommand{\cmddefbookmarkleveloffset}{1}
+
+\newcommand*{\setcounterlevels}[2]{%
+ \edef\cmddefbookmarklevel{\number\numexpr#1+\cmddefbookmarkleveloffset }%
+ \def\cmddefcounter{#2}%
+ \let\pkgdefbookmarklevel\cmddefbookmarklevel
+ \def\pkgdefcounter{#2}%
+ \let\clsdefbookmarklevel\cmddefbookmarklevel
+ \def\clsdefcounter{#2}%
+ \def\currentcounterlevel{#1}%
+ \def\currentcounter{#2}%
+}
+
+\ifdef\chapter
+{
+  \preto\chapter{\setcounterlevels{0}{chapter}}
+  \setcounterlevels{0}{chapter}
+}
+{
+  \setcounterlevels{1}{section}
+}
+
+\preto\part{\setcounterlevels{-1}{part}}
+\preto\section{\setcounterlevels{1}{section}}
+\preto\subsection{\setcounterlevels{2}{subsection}}
+\preto\subsubsection{\setcounterlevels{3}{subsubsection}}
+\preto\paragraph{\setcounterlevels{4}{paragraph}}
+\preto\subparagraph{\setcounterlevels{4}{subparagraph}}
+
+\newcommand{\mainfmt}[1]{\glsnumberformat{#1}}
+
+% \createtarget{label}{text}
+\newcommand*{\createtarget}[2]{%
+ \glstarget{#1}{#2}\xGlsXtrSetField{#1}{target}{\glolinkprefix #1}%
+}
+
+\renewcommand*{\GlsXtrStandaloneEntryName}[1]{%
+  \createtarget{#1}{\glossentryname{#1}}%
+}
+
+% \targetorhyperlink{label}{text}
+\newcommand*{\targetorhyperlink}[2]{%
+ \glsxtrifhasfield*{target}{#1}%
+ {%
+   \glshyperlink[{#2}]{#1}%
+ }%
+ {%
+   \createtarget{#1}{#2}%
+ }%
+}
+
+\newcommand*{\linkedentryname}[1]{%
+ {\setkeys{printgloss}{target=true}\targetorhyperlink{#1}{\glossentryname{#1}}}%
+}
+
+\newcommand*{\optvaldefcounter}{}
+
+\newcommand*{\inlineidxdef}[1]{%
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentry{idx.#1}%
+}
+
+\newcommand*{\Inlineidxdef}[1]{%
+ \bgroup
+   \let\glossentryname\Glossentryname
+   \mainmatteronly{\mainglsadd{idx.#1}{}}%
+   \glsxtrglossentry{idx.#1}%
+ \egroup
+}
+
+\newrobustcmd*{\inlineidxfdef}[1]{%
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentryother{}{idx.#1}{first}%
+ \glsunset{#1}%
+}
+
+\newrobustcmd*{\inlineidxpdef}[1]{%
+ \mainmatteronly{\mainglsadd{idx.#1}{}}%
+ \glsxtrglossentryother{}{idx.#1}{plural}%
+ \glsunset{#1}%
+}
+
+\newrobustcmd*{\inlineswitchdef}[1]{%
+ \mainmatteronly{\mainglsadd{switch.#1}{}}%
+ \glsxtrglossentry{switch.#1}%
+}
+
+\newrobustcmd*{\inlineglsdef}[2][cmddef]{%
+ \mainglsadd{#2}{#1}%
+ \glsxtrglossentry{#2}%
+}
+
+\newcommand*{\mainglsadd}[3][]{%
+ \ifstrempty{#3}%
+ {\def\mainglsaddcounter{}}%
+ {%
+   \ifcsdef{#3counter}%
+   {\letcs\mainglsaddcounter{#3counter}}%
+   {\let\mainglsaddcounter\currentcounter}%
+ }%
+ \ifdefempty\mainglsaddcounter{}{\glsadd[counter=\mainglsaddcounter,format=mainfmt]{#2}}%
+ \glsadd[format=mainfmt,#1]{#2}%
+}
+
+% standalone targets
+\newcommand{\entrydefsection}{\section}
+\newcommand{\entrysec}[2][\entrydefsection]{%
+  #1{\glsxtrglossentry{#1}%
+     \glsxtrtitleorpdforheading{\mainglsadd{#1}{entrydef}}{}{}}%
+}
+
+% doesn't display any text but creates the target and principle
+% location
+\newrobustcmd{\maindef}[2][]{%
+ \glsdoifexists{#2}%
+ {%
+   \mainglsadd[#1]{#2}{maindef}\createtarget{#2}{\strut}%
+ }%
+}
+
+\newrobustcmd*{\cmddef}{\@ifstar\s at cmddef\@cmddef}
+\newcommand*{\@cmddef}[2][]{%
+ \pdfbookmark[\cmddefbookmarklevel]{\glsentryname{#2}}{csdef.#2}%
+ \nopagebreak\s at cmddef[#1]{#2}%
+}
+
+\newcommand*{\cmdnotefmt}[1]{\mbox{#1}}
+
+\newcommand*{\cmddefsyntax}[2]{%
+ \mainglsadd[#1]{#2}{cmddef}%
+ \texttt{\glsxtrglossentry{#2}\syntax{#2}}%
+}
+
+\newcommand*{\optdefsyntax}[2]{%
+ \mainglsadd[#1]{opt.#2}{optdef}%
+ \texttt{\glsxtrglossentry{opt.#2}
+ \glsxtrifhasfield{syntax}{opt.#2}{\dequals\glscurrentfieldvalue}{}}%
+}
+
+\newcommand*{\s at cmddef}[2][]{%
+ \def\cmdtitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{#2}{\def\cmdtitle{\statussym}\def\postnote{\hfill\statustext}}{}%
+ \begin{pinnedbox}[title=\cmdtitle]
+ \let\csfmtfont\@firstofone
+ \def\cmdfont##1{\textbf{\texttt{##1}}}%
+ \gathermodifiers{#2}%
+ \cmddefsyntax{#1}{#2}%
+ \def\tagsep{\hfill}%
+ \ifdefempty\nlctmodifierlist{}%
+  {\tagsep\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist\relax
+   \let\tagsep\space
+  }%
+ \glsxtrifhasfield{initvalue}{#2}
+  {\tagsep\summarytagfmt{initial}\texttt{\glscurrentfieldvalue}}%
+  {}%
+ \ifdefempty\nlctmodifierglslist{}%
+ {\@for\@nlct at label:=\nlctmodifierglslist\do
+  {\par\cmddefsyntax{#1}{\@nlct at label}}}%
+ \glsxtrifhasfield*{note}{#2}%
+ {%
+   \ifx\cmdnotefmt\@gobble
+     \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+   \else
+     \par\hfill\cmdnotefmt\glscurrentfieldvalue
+     \ifdefempty\postnote{}{\preto\postnote{\space}}%
+   \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newcommand{\gathermodifiers}[1]{%
+ \protected at edef\nlctcmddeflabel{#1}%
+ \def\nlctmodifiertag{}%
+ \def\nlctmodifierlist{}%
+ \def\nlctmodifierglslist{}%
+ \glsxtrforcsvfield*{#1}{modifiers}{\cmddefmodifierhandler}%
+}
+
+\newcommand{\cmddefmodifierhandler}[1]{%
+  \ifglsentryexists{\nlctcmddeflabel#1}%
+  {%
+    \ifdefempty\nlctmodifierglslist
+    {\eappto\nlctmodifierglslist{\nlctcmddeflabel#1}}%
+    {\eappto\nlctmodifierglslist{,\nlctcmddeflabel#1}}%
+  }%
+  {%
+    \ifdefempty\nlctmodifierlist
+    {\def\nlctmodifiertag{modifier}}%
+    {\def\nlctmodifiertag{modifiers}\appto\nlctmodifierlist{ }}%
+    \ifglsentryexists{idx.mod.#1}%
+    {\eappto\nlctmodifierlist{\noexpand\gls{idx.mod.#1}}}%
+    {\eappto\nlctmodifierlist{#1}}%
+  }%
+}
+
+\newrobustcmd*{\envdef}{\@ifstar\s at envdef\@envdef}
+\newcommand*{\@envdef}[2][]{%
+ \pdfbookmark[\cmddefbookmarklevel]{\glsentryname{env.#2}}{env.#2}%
+ \nopagebreak\s at envdef[#1]{#2}%
+}
+
+\newsavebox\entrynamebox
+
+\newcommand{\enventryname}[1]{%
+ \createtarget{#1}%
+ {%
+   \texttt
+   {%
+     \sbox\entrynamebox
+     {%
+       \csfmt{begin}%
+       \marg{\glossentryname{#1}}%
+       \glsxtrifhasfield{syntax}{#1}{\glscurrentfieldvalue}{}%
+       \meta{content}\csfmt{end}\marg{\glsentryname{#1}}%
+     }%
+     \settowidth\dimen@{\usebox\entrynamebox}%
+     \ifdim\dimen@>0.8\linewidth
+       \csfmt{begin}%
+       \marg{\glossentryname{#1}}%
+       \glsxtrifhasfield{syntax}{#1}{\glscurrentfieldvalue}{}%
+       \endgraf\meta{content}\endgraf\csfmt{end}\marg{\glsentryname{#1}}%
+     \else
+       \usebox\entrynamebox
+     \fi
+   }%
+ }%
+}
+
+\newcommand*{\s at envdef}[2][]{%
+ \def\envtitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{env.#2}{\def\envtitle{\statussym}\def\postnote{\statustext}}{}%
+ \begin{pinnedbox}[title=\envtitle]
+ \let\GlsXtrStandaloneEntryName\enventryname
+ \def\envfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd[#1]{env.#2}{cmddef}%
+ \glsxtrglossentry{env.#2}%
+ \glsxtrifhasfield*{note}{env.#2}%
+ {%
+   \ifx\cmdnotefmt\@gobble
+     \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+   \else
+     \par\hfill\cmdnotefmt\glscurrentfieldvalue
+     \ifdefempty\postnote{}{\preto\postnote{\space}}%
+   \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\pkgdef}{\@ifstar\s at pkgdef\@pkgdef}
+\newcommand*{\@pkgdef}[2][]{%
+ \pdfbookmark[\pkgdefbookmarklevel]{\glsentryname{pkg.#2}.sty}{pkgdef.#2}%
+ \nopagebreak\s at pkgdef[#1]{#2}%
+}
+
+\newcommand{\pkgentryname}[1]{%
+ \createtarget{#1}%
+ {%
+   \texttt
+   {%
+     \csfmt{usepackage}%
+     \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+     \marg{\glossentryname{#1}}%
+   }%
+ }%
+}
+
+\newcommand{\pkgnotefmt}[1]{#1}
+
+\newcommand*{\s at pkgdef}[2][]{%
+ \def\pkgtitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{pkg.#2}{\def\pkgtitle{\statussym}\def\postnote{\statustext}}{}%
+ \begin{pinnedbox}[title=\pkgtitle]
+ \let\GlsXtrStandaloneEntryName\pkgentryname
+ \def\styfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd[#1]{pkg.#2}{pkgdef}%
+ \glsxtrglossentry{pkg.#2}%
+ \glsxtrifhasfield*{note}{pkg.#2}%
+ {%
+   \ifx\pkgnotefmt\@gobble
+     \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+   \else
+     \par\hfill\pkgnotefmt\glscurrentfieldvalue
+     \ifdefempty\postnote{}{\preto\postnote{\space}}%
+   \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newrobustcmd*{\clsdef}{\@ifstar\s at clsdef\@clsdef}
+\newcommand*{\@clsdef}[2][]{%
+ \pdfbookmark[\clsdefbookmarklevel]{\glsentryname{cls.#2}.sty}{clsdef.#2}%
+ \nopagebreak\s at clsdef[#1]{#2}%
+}
+
+\newcommand{\clsentryname}[1]{%
+ \createtarget{#1}%
+ {%
+   \texttt
+   {%
+     \csfmt{documentclass}%
+     \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+     \marg{\glossentryname{#1}}%
+   }%
+ }%
+}
+
+\newcommand*{\s at clsdef}[2][]{%
+ \def\clstitle{\glssymbol{sym.definition}}%
+ \def\postnote{}%
+ \ifnotdefaultstatus{cls.#2}{\def\clstitle{\statussym}\def\postnote{\statustext}}{}%
+ \begin{pinnedbox}[title=\clstitle]
+ \let\GlsXtrStandaloneEntryName\clsentryname
+ \def\clsfmt##1{\textbf{\texttt{##1}}}%
+ \mainglsadd[#1]{cls.#2}{clsdef}%
+ \glsxtrglossentry{cls.#2}%
+ \glsxtrifhasfield*{note}{cls.#2}%
+ {%
+   \ifx\pkgnotefmt\@gobble
+    \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+   \else
+    \par\hfill\pkgnotefmt\glscurrentfieldvalue
+    \ifdefempty\postnote{}{\preto\postnote{\space}}%
+   \fi
+ }%
+ {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+ \postnote
+ \end{pinnedbox}%
+ \noindent\ignorespaces
+}
+
+\newcommand*{\defaultoptdefbookmarklevel}{\number\numexpr\currentcounterlevel+1 }
+\newcommand*{\optdefbookmarklevel}{\defaultoptdefbookmarklevel}
+
+\newrobustcmd*{\optiondef}{\@ifstar\s at optiondef\@optiondef}
+
+\newcommand*{\@optiondef}[1]{%
+ \glsifcategory{opt.#1}{commandoption}%
+ {%
+   \edef\optdefbookmarklevel{\number\numexpr\cmddefbookmarklevel+1 }%
+ }%
+ {%
+   \edef\optdefbookmarklevel{\defaultoptdefbookmarklevel}%
+ }%
+ \pdfbookmark[\optdefbookmarklevel]{\glsentryname{opt.#1}}{optdef.#1}%
+ \nopagebreak\s at optiondef{#1}%
+}
+
+\newcommand{\optnotefmt}[1]{#1}
+
+\newcommand*{\s at optiondef}[1]{%
+  \getinitordefval{opt.#1}%
+  \def\postnote{}%
+  \ifnotdefaultstatus{opt.#1}%
+  {\appto\settingstitle{\statussym}\def\postnote{\statustext}}%
+  {}%
+  \begin{settingsbox}[title=\settingstitle,
+    colback=optiondefbackground,
+    colbacktitle=optiondefbackground
+  ]%
+   \def\optfmt##1{\textbf{\texttt{##1}}}%
+   \mainglsadd{opt.#1}{optdef}\glsxtrglossentry{opt.#1}%
+   \glsxtrifhasfield{syntax}{opt.#1}{\texttt{=\glscurrentfieldvalue}}{}%
+   \ifdefempty\initordefval{}{\hfill\initordefval}%
+   \glsxtrifhasfield*{note}{opt.#1}%
+   {%
+     \ifx\optnotefmt\@gobble
+       \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+     \else
+       \par\hfill\optnotefmt\glscurrentfieldvalue
+       \ifdefempty\postnote{}{\preto\postnote{\space}}%
+     \fi
+   }%
+   {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+   \postnote
+  \end{settingsbox}%
+  \noindent\ignorespaces
+}
+
+\newrobustcmd*{\optionvaldef}{\@ifstar\s at optionvaldef\@optionvaldef}
+
+\newcommand*{\@optionvaldef}[2]{%
+ \edef\optvaldefbookmarklevel{\number\numexpr\optdefbookmarklevel+1 }%
+ \pdfbookmark[\optvaldefbookmarklevel]{\glsentryname{optval.#1.#2}}{optvaldef.#1.#2}%
+ \nopagebreak\s at optionvaldef{#1}{#2}%
+}
+
+\newcommand*{\s at optionvaldef}[2]{%
+  \begin{settingsbox}[title={\glssymbol{sym.optionvalue}},
+    colback=optionvaluedefbackground,
+    colbacktitle=optionvaluedefbackground
+   ]%
+   \def\optfmt##1{\textbf{\texttt{##1}}}%
+   \mainglsadd{optval.#1.#2}{optvaldef}%
+   \gls!{opt.#1}\dequals\glsxtrglossentry{optval.#1.#2}%
+   \ifnotdefaultstatus{optval.#1.#2}{\hfill\statussym}{}%
+   \glsxtrifhasfield{note}{optval.#1.#2}%
+   {%
+     \ifx\optnotefmt\@gobble
+     \else
+       \par\hfill\optnotefmt\glscurrentfieldvalue
+     \fi
+   }{}%
+  \end{settingsbox}%
+  \noindent\ignorespaces
+}
+
+\newrobustcmd*{\inlineoptionvaldef}[2]{%
+ \bgroup
+  \ttfamily
+  \mainglsadd{optval.#1.#2}{optvaldef}%
+  \textbf{\glsxtrglossentry{optval.#1.#2}}%
+  \glsxtrifhasfield{syntax}{optval.#1.#2}{\dhyphen\glscurrentfieldvalue}{}%
+  \ifnotdefaultstatus{optval.#1.#2}{~\statussym}{}%
+  :\space
+  \glsxtrifhasfield{alias}{optval.#1.#2}%
+  {%
+    Synonym of \expandafter\glsfmtname\expandafter{\glscurrentfieldvalue}.%
+  }%
+  {% 
+    \glossentrydesc{optval.#1.#2}\glspostdescription
+    \glsxtrifhasfield{seealso}{optval.#1.#2}%
+    {%
+      See also \glsxtrseelist{\glscurrentfieldvalue}.%
+    }%
+    {}% 
+  }%
+ \egroup
+}
+
+\newcommand{\appnotefmt}[1]{#1}
+
+\newrobustcmd*{\appdef}[1]{%
+  \getinitordefval{app.#1}%
+  \def\postnote{}%
+  \begin{terminal}%
+   \def\appfmt##1{\textbf{##1}}%
+   \mainglsadd{app.#1}{appdef}\glsxtrglossentry{app.#1}%
+   \glsxtrifhasfield{syntax}{app.#1}{\space \glscurrentfieldvalue}{}%
+   \glsxtrifhasfield*{note}{app.#1}%
+   {%
+     \ifx\appnotefmt\@gobble
+       \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+     \else
+       \par\hfill\appnotefmt\glscurrentfieldvalue
+       \ifdefempty\postnote{}{\preto\postnote{\space}}%
+     \fi
+   }%
+   {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+   \postnote
+  \end{terminal}%
+  \noindent\ignorespaces
+}
+
+\newrobustcmd*{\switchdef}[1]{%
+  \getinitordefval{switch.#1}%
+  \def\postnote{}%
+  \ifnotdefaultstatus{switch.#1}%
+  {\appto\settingstitle{\statussym}\def\postnote{\statustext}}%
+  {}%
+  \begin{settingsbox}[title={\settingstitle}]%
+   \mainglsadd{switch.#1}{switchdef}\glsxtrglossentry{switch.#1}%
+   \glsxtrifhasfield{syntax}{switch.#1}{\space \glscurrentfieldvalue}{}%
+   \glsxtrifhasfield*{note}{switch.#1}%
+   {%
+     \ifx\switchnotefmt\@gobble
+       \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+     \else
+       \par\hfill\switchnotefmt\glscurrentfieldvalue
+       \ifdefempty\postnote{}{\preto\postnote{\space}}%
+     \fi
+   }%
+   {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+   \postnote
+  \end{settingsbox}%
+  \noindent\ignorespaces
+}
+
+\newrobustcmd{\mirrorsamplefile}[1]{%
+ \ctanmirrornofn{macros/latex/contrib/\thispackagename/\filedownloadsubpath/#1}{\nolinkurl{#1}}%
+}
+
+\newcommand{\filedownloadsubpath}{samples/}
+\newcommand{\filedownloadlink}[1]{\href{\nlctdownloadlink{\filedownloadsubpath #1}}{\faDownload}}
+\newcommand{\filetag}[1]{\faFileO\ifnlctdownloadlinks\filedownloadlink{#1}\fi\ }
+\newcommand*{\filedef}[1]{%
+  \par\medskip
+  \bgroup
+  \raggedright
+  \filetag{#1}%
+  \ttfamily
+  \mainglsadd{file.#1}{filedef}%
+  \glsxtrglossentry{file.#1}%
+  \egroup
+  \par\medskip\ignorespaces
+}
+
+\newrobustcmd*{\summarytagfmt}[1]{\textnormal{\em #1:} }
+
+\newcommand*{\getinitordefval}[1]{%
+  \let\currentsyntax\@empty
+  \def\settingstitle{\glssymbol{sym.valuesetting}}%
+  \def\initordefval{}%
+  \glsxtrifhasfield*{alias}{#1}%
+  {%
+    \edef\initordefval{\summarytagfmt{alias}%
+      \noexpand\gls{\expandonce\glscurrentfieldvalue}}%
+  }%
+  {}%
+  \glsxtrifhasfield*{syntax}{#1}%
+  {%
+    \let\currentsyntax\glscurrentfieldvalue
+    \glsxtrifhasfield*{defaultvalue}{#1}%
+    {%
+      \ifdefempty\initordefval{}{\appto\initordefval{; }}%
+      \eappto\initordefval{\summarytagfmt{default}%
+        \noexpand\optfmt{\expandonce\glscurrentfieldvalue}}%
+    }%
+    {}%
+    \glsxtrifhasfield*{initvalue}{#1}%
+    {%
+      \ifdefempty\initordefval{}{\appto\initordefval{; }}%
+      \eappto\initordefval{\summarytagfmt{initial}% 
+        \noexpand\optfmt{\expandonce\glscurrentfieldvalue\relax}}%
+      \ifx\currentsyntax\metaboolean
+        \ifdefstring\glscurrentfieldvalue{true}
+        {%
+          \def\settingstitle{\glssymbol{sym.toggleonsetting}}%
+        }%
+        {%
+          \ifdefstring\glscurrentfieldvalue{false}
+          {%
+             \def\settingstitle{\glssymbol{sym.toggleoffsetting}}%
+          }%
+          {}%
+        }%
+      \fi
+    }%
+    {%
+      %\ifdefempty\initordefval{}{\appto\initordefval{; }}%
+      %\appto\initordefval{\textit{initial:} none}%
+    }%
+  }%
+  {\def\settingstitle{\glssymbol{sym.novaluesetting}}}%
+}
+
+\newcommand*{\ctrdefbookmarklevel}{\cmddefbookmarklevel}
+
+\newrobustcmd*{\ctrdef}{\@ifstar\s at ctrdef\@ctrdef}
+
+\newcommand*{\@ctrdef}[1]{%
+ \let\ctrdefbookmarklevel\cmddefbookmarklevel
+ \pdfbookmark[\ctrdefbookmarklevel]{#1}{ctrdef.#1}%
+ \nopagebreak\s at ctrdef{#1}%
+}
+
+\newcommand*{\s at ctrdef}[1]{%
+  \def\settingstitle{\glssymbol{sym.counter}}%
+  \ifnotdefaultstatus{ctr.#1}%
+  {\appto\settingstitle{\statussym}\def\postnote{\statustext}}%
+  {}%
+  \begin{pinnedbox}[title=\settingstitle]%
+   \def\ctrfmt##1{\textbf{\texttt{##1}}}%
+   \mainglsadd{ctr.#1}{ctrdef}\glsxtrglossentry{ctr.#1}%
+   \glsxtrifhasfield*{note}{ctr.#1}%
+   {%
+     \ifx\cmdnotefmt\@gobble
+       \ifdefempty\postnote{}{\preto\postnote{\hfill}}%
+     \else
+       \par\hfill\cmdnotefmt\glscurrentfieldvalue
+       \ifdefempty\postnote{}{\preto\postnote{\space}}%
+     \fi
+   }%
+   {\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
+   \postnote
+  \end{pinnedbox}%
+  \noindent\ignorespaces
+}
+
+% Defining .bib entries
+
+\newwrite\nlctuserguidebib
+
+\newcommand{\glsbibwriteentry}[3]{%
+ {%
+   \edef\dhyphen{\string-}\let\-\empty\let\dsb\empty
+   \protected at edef\entrylabel{#2}%
+   \let\dhyphen\empty\let\dsb\dunderscore
+   \immediate\write\nlctuserguidebib{@#1{\entrylabel#3}}%
+ }%
+}
+
+\newcommand{\glsbibwritefield}[2]{,^^J#1={\detokenize{#2}}}
+
+\glsaddstoragekey{modifiers}{}{\modifiers}
+\glsaddstoragekey{syntax}{}{\syntax}
+\glsaddstoragekey{defaultvalue}{}{\optdefval}
+\glsaddstoragekey{initvalue}{}{\optinitval}
+\glsaddstoragekey{status}{default}{\entrystatus}
+\glsaddstoragekey{note}{}{\note}
+\glsaddstoragekey{providedby}{}{\providedbyinfo}
+\glsaddstoragekey{pdftitlecasename}{}{\pdftitlecasename}
+
+\glsaddstoragekey{defaultkeys}{}{\defaultkeys}
+
+\renewcommand{\glslinkpresetkeys}{%
+ \glsxtrifhasfield*{defaultkeys}{\glslabel}
+ {\expandafter\setupglslink\expandafter{\glscurrentfieldvalue}}%
+ {}%
+}
+
+\newcommand{\conditionsyntax}{ \meta{true}\csfmt{else} \meta{false}\csfmt{fi}}
+
+\newrobustcmd{\initvalnotefmt}[1]{\textrm{\em #1}}
+
+\newcommand*{\nlctuserguidegls}[2][]{%
+ \bgroup
+  \let\field\glsbibwritefield
+  \def\common{\field{defaultkeys}{format=glsignore}}%
+  \def\syntax{\glsbibwritefield{syntax}}%
+  \def\parent{\glsbibwritefield{parent}}%
+  \def\inpackage##1{\glsbibwritefield{parent}{pkg.##1}}%
+  \def\inclass##1{\glsbibwritefield{parent}{cls.##1}}%
+  \def\inapp##1{\glsbibwritefield{parent}{app.##1}}%
+  \def\providedby{\glsbibwritefield{providedby}}%
+  \def\name{\glsbibwritefield{name}}%
+  \def\desc{\glsbibwritefield{description}}%
+  \def\defval{\glsbibwritefield{defaultvalue}}%
+  \def\initval{\glsbibwritefield{initvalue}}%
+  \def\initvalvaries{\glsbibwritefield{initvalue}{\initvalnotefmt{varies}}}%
+  \def\initvalempty{\glsbibwritefield{initvalue}{\initvalnotefmt{empty}}}%
+  \def\note{\glsbibwritefield{note}}%
+  \def\deprecated{\glsbibwritefield{status}{deprecated}}%
+  \def\banned{\glsbibwritefield{status}{banned}}%
+  \def\deprecatedbanned{\glsbibwritefield{status}{deprecatedbanned}}%
+  \def\gpunc##1##2{\glsbibwriteentry{punctuation}{idx.##1}{##2}}%
+  \def\gidx##1##2{\glsbibwriteentry{index}{idx.##1}{\field{name}{##1}##2}}%
+  \def\gidxpl##1##2{\glsbibwriteentry{indexplural}{idx.##1}{\field{text}{##1}##2}}%
+  \def\gfile##1##2{\glsbibwriteentry{file}{file.##1}{\field{name}{\filefmt{##1}}##2}}%
+  \def\gfilemeta##1##2##3##4{\glsbibwriteentry{file}{file.##1##2##3}{\field{name}{\metafilefmt{##1}{##2}{##3}}##4}}%
+  \def\gfilemetameta##1##2##3##4##5##6{\glsbibwriteentry{file}{file.##1##2##3##4##5}{\field{name}{\metametafilefmt{##1}{##2}{##3}{##4}{##5}}##6}}%
+  \def\gext##1##2{\glsbibwriteentry{fileformat}{ext.##1}{\field{parent}{fileformat}\field{name}{\extfmt{##1}}##2}}%
+  \def\gcmd##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}##2}}%
+  \def\gcond##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\syntax{\conditionsyntax}##2}}%
+  \def\gcmdmeta##1##2##3##4{\glsbibwriteentry{command}{##1##2##3}{\field{name}{\csmetafmt{##1}{##2}{##3}}##4}}%
+  \def\gcmdmetameta##1##2##3##4##5##6{\glsbibwriteentry{command}{##1##2##3##4##5}{\field{name}{\csmetametafmt{##1}{##2}{##3}{##4}{##5}}##6}}%
+  \def\gmod##1##2{\glsbibwriteentry{punctuation}{idx.mod.##1}{##2}}%
+  \def\gcmds##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\field{modifiers}{*}##2}}%
+  \def\gcmdsp##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\field{modifiers}{*,+}##2}}%
+  \def\gpunccmd##1##2##3{\glsbibwriteentry{punctuation}{##1}{\field{name}{\csfmt{##2}}##3}}%
+  \def\gpkg##1##2{\glsbibwriteentry{package}{pkg.##1}{\field{name}{\styfmt{##1}}##2}}%
+  \def\gcls##1##2{\glsbibwriteentry{class}{cls.##1}{\field{name}{\clsfmt{##1}}##2}}%
+  \def\genv##1##2{\glsbibwriteentry{environment}{env.##1}{\field{name}{\envfmt{##1}}##2}}%
+  \def\gctr##1##2{\glsbibwriteentry{counter}{ctr.##1}{\field{name}{\ctrfmt{##1}}##2}}%
+  \def\gopt##1##2{\glsbibwriteentry{option}{opt.##1}{\field{name}{\optfmt{##1}}##2}}%
+  \def\gcsopt##1##2{\glsbibwriteentry{commandoption}{opt.##1}{\field{name}{\csoptfmt{##1}}##2}}%
+  \def\gcsboolopt##1##2{\glsbibwriteentry{commandoption}{opt.##1}%
+   {\field{name}{\csoptfmt{##1}}\syntax{\meta{boolean}}\defval{true}##2}}%
+  \def\gstyopt##1##2{\glsbibwriteentry{packageoption}{opt.##1}{\field{name}{\styoptfmt{##1}}##2}}%
+  \def\gstyboolopt##1##2{\glsbibwriteentry{packageoption}{opt.##1}%
+    {\field{name}{\styoptfmt{##1}}\syntax{\meta{boolean}}\defval{true}##2}}%
+  \def\gclsopt##1##2{\glsbibwriteentry{classoption}{opt.##1}{\field{name}{\clsoptfmt{##1}}##2}}%
+  \def\gclsboolopt##1##2{\glsbibwriteentry{classoption}{opt.##1}%
+   {\field{name}{\clsoptfmt{##1}}\syntax{\meta{boolean}}\defval{true}##2}}%
+  \def\goptval##1##2##3{\glsbibwriteentry{optionvalue}{optval.##1.##2}{\field{name}{\optfmt{##2}}\field{parent}{opt.##1}##3}}%
+  \def\goptmetaval##1##2##3{\glsbibwriteentry{optionvalue}{optval.##1.##2}{\field{name}{\meta{##2}}\field{parent}{opt.##1}##3}}%
+  \def\gapp##1##2{\glsbibwriteentry{application}{app.##1}{\field{name}{\appfmt{##1}}##2}}%
+  \def\glongswitch##1##2{\glsbibwriteentry{switch}{switch.##1}{\field{name}{\longargfmt{##1}}##2}}%
+  \def\gshortswitch##1##2{\glsbibwriteentry{switch}{switch.##1}{\field{name}{\shortargfmt{##1}}##2}}%
+  \def\gterm{\glsbibwriteentry{term}}%
+  \def\gtermabbr##1##2##3##4{\glsbibwriteentry{termabbreviation}%
+   {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+  \def\gtermacr##1##2##3##4{\glsbibwriteentry{termacronym}%
+   {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+  \def\gabbr##1##2##3##4{\glsbibwriteentry{dualindexabbreviation}%
+   {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+  \def\gacr##1##2##3##4{\glsbibwriteentry{acronym}%
+   {##1}{\field{short}{##2}\field{long}{##3}##4}}%
+  \immediate\openout\nlctuserguidebib=\jobname-gls.bib\relax
+  \immediate\write\nlctuserguidebib{\glspercentchar\space Encoding: UTF-8}
+  \immediate\write\nlctuserguidebib{@preamble{"\string\providecommand*{\string\csfmt}[1]{\string\glsbackslash\string\glsbackslash\glshashchar1}^^J
+    \string\providecommand{\string\dhyphen}{-}"}}
+  \immediate\write\nlctuserguidebib{\symboldefinitions}
+  \glsbibwriteentry{indexplural}{fileformat}{\glsbibwritefield{text}{file format}}
+  #2%
+  \immediate\closeout\nlctuserguidebib 
+ \egroup
+ \nlctuserguideloadgls{#1}%
+}
+
+\glsdefpostdesc{dualindexabbreviation}{.}
+
+% Abbreviations with a description:
+\setabbreviationstyle[termabbreviation]{long-short-desc}
+% Common abbreviations (no full form on first use) with a description:
+\setabbreviationstyle[termacronym]{short-nolong-desc}
+
+\renewcommand{\glsxtrshortdescname}{%
+  \protect\glslongfont{\the\glslongtok}%
+  \protect\glsxtrfullsep{\the\glslabeltok}%
+  \protect\glsxtrparen{\protect\glsabbrvfont{\the\glsshorttok}}%
+}
+
+\newcommand{\nlctuserguidecustomentryaliases}{}
+
+\newcommand{\nlctuserguideignoredpuncrules}{%
+ \glshex 00AD\string;% soft hyphen
+ \glshex 2010\string;% hyphen
+ \glshex 2011\string;% non-breaking hyphen
+ \glshex 2012\string;% figure dash
+ \glshex 2013\string;% en dash
+ \glshex 2014\string;% em dash
+ \glshex 2015\string;% horizontal bar
+ \glshex 2212\string=\glshex 207B\string=\glshex 208B% minus sign
+ \string;\string'\glshex 005C\string'% backslash
+}
+
+% ASCII hyphen in non-ignored subset:
+
+\newcommand{\nlctuserguidepuncrules}{%
+ \glsxtrgeneralpuncmarksrules
+ \string<\glsxtrgeneralpuncaccentsrules
+ \string<\glsxtrgeneralpuncquoterules
+ \string<\glsxtrgeneralpuncbracketrules
+ \string<\glshex 00A7% section sign
+ \string<\glshex 00B6% pilcrow sign
+ \string<\glshex 00A9% copyright sign
+ \string<\glshex 00AE% registered sign
+ \string<\glsxtrcurrencyrules
+ \string< \string'\glshex 002A\string'% asterisk
+ \string<\string'\glshex 0026\string'% ampersand
+ \string<\string'\glshex 0023\string'% hash sign
+ \string<\string'\glshex 0025\string'% percent sign
+ \string<\string'\string-\string'% ASCII hyphen
+ \string<\string'\glshex 002B\string'% plus sign
+  \string=\glshex 207A\string=\glshex 208A% super/subscript plus sign
+ \string<\glshex 00B1% plus-minus sign
+ \string<\glshex 00F7% division sign
+ \string<\glshex 00D7% multiplication sign
+ \string<\string'\glshex 003C\string'% less-than sign
+ \string<\string'\glshex 003D\string'% equals sign
+ \string<\string'\glshex 003E\string'% greater-than sign
+ \string<\glshex 00AC% not sign
+ \string<\string'\glshex 007C\string'% vertical bar (pipe)
+ \string<\glshex 00A6% broken bar 
+ \string<\glshex 00B0% degree sign
+ \string<\glshex 00B5% micron sign
+}
+\newcommand{\nlctuserguidepreletterrules}{\string<\string'\glshex 0040\string'}
+\newcommand{\nlctuserguideletterrules}{\glsxtrGeneralLatinIrules}
+\newcommand{\nlctuserguideextrarules}{\string< \glsxtrMathItalicGreekIrules}
+
+\newcommand{\nlctuserguideloadgls}[1]{%
+  \GlsXtrLoadResources[src=\jobname-gls,
+   break-at-not-match={original entrytype=(punctuation|command)},
+   sort={custom},
+   sort-rule={\glsxtrIgnorableRules
+   ;\glsxtrcombiningdiacriticrules
+   ;\nlctuserguideignoredpuncrules
+   \string< \nlctuserguidepuncrules 
+   \string< \glshex 2423 % visible space
+   \string< \glsxtrdigitrules 
+   \string< \glsxtrfractionrules
+   \nlctuserguidepreletterrules
+   \string< \nlctuserguideletterrules
+   \nlctuserguideextrarules},
+   selection={recorded and deps and see not also},
+   entry-type-aliases={
+     commandoption=index,
+     packageoption=index,
+     classoption=index,
+     term=dualindexentry,
+     termabbreviation=dualindexabbreviation,
+     termacronym=dualindexabbreviation,
+     fileformat=index,
+     file=index,
+     command=index,
+     package=index,
+     class=index,
+     environment=index,
+     counter=index,
+     option=index,
+     optionvalue=index,
+     application=index,
+     switch=index,
+     punctuation=symbol,
+     icon=symbol,
+     \nlctuserguidecustomentryaliases
+   },
+   replicate-fields={name=pdftitlecasename},
+   replicate-missing-field-action={fallback},
+   interpret-fields={pdftitlecasename},
+   field-case-change={pdftitlecasename=title},
+   category={same as original entry},
+   dual-category={same as primary},
+   combine-dual-locations={primary},
+   type=index,dual-type=main,
+   dual-field,
+   primary-location-formats=mainfmt,
+   save-primary-locations=retain,
+   primary-loc-counters=match,
+   save-loclist=false,
+   post-description-dot=check,
+   description-case-change=firstuc,
+   loc-counters={chapter,section,subsection,subsubsection,page,figure,table,wrglossary},
+   save-child-count,save-root-ancestor,
+   symbol-sort-fallback=name,
+   not-match={original entrytype=icon},
+   #1
+  ]%
+  \GlsXtrLoadResources[src=\jobname-gls,
+   entry-type-aliases={icon=symbol},
+   unknown-entry-alias={index},
+   match={original entrytype=icon},
+   description-case-change=firstuc,
+   post-description-dot=check,
+   save-locations=false,
+   type=symbols,
+   symbol-sort-fallback=name]
+}
+
+% Glossaries, index, summaries etc
+
+\newcommand{\statusdeprecatedsym}{\glssymbol{sym.deprecated}}
+\newcommand{\statusdeprecatedtext}{\glstext{sym.deprecated}}
+\newcommand{\statusbannedsym}{\glssymbol{sym.banned}}
+\newcommand{\statusbannedtext}{\glstext{sym.banned}}
+\newcommand{\statusdeprecatedbannedsym}{\statusdeprecatedsym\statusbannedsym}
+\newcommand{\statusdeprecatedbannedtext}{\statusdeprecatedtext\ \statusbannedtext}
+\newcommand{\statusdefaultsym}{}
+\newcommand{\statusdefaulttext}{}
+\newcommand{\statussym}{}
+\newcommand{\statustext}{}
+
+\newcommand{\ifnotdefaultstatus}[3]{%
+ \protected at edef\currentstatus{\entrystatus{#1}}%
+ \letcs\statussym{status\currentstatus sym}%
+ \letcs\statustext{status\currentstatus text}%
+ \ifglsentryexists{#1}%
+ {\ifdefstring\currentstatus{default}{#3}{#2}}%
+ {#3}%
+}
+
+\newcommand*{\statushook}[1]{\ifnotdefaultstatus{#1}{~\statussym}{}}
+
+\newcommand*{\setwidestnamehook}[1]{%
+ \ifglshasparent{#1}{}%
+ {%
+   \settowidth{\dimen@}{\glstreenamefmt{\glsentryname{#1}\quad}}%
+   \ifdim\dimen@>\gls at tmplen
+     \gls at tmplen=\dimen@
+     \eglssetwidest{\glsentryname{#1}\quad}%
+   \fi
+ }%
+ \advance\totalterms by 1\relax
+}
+
+\newcommand*{\settermshook}[1]{%
+ \advance\totalterms by 1\relax
+ \eglsupdatewidest{\glsentryname{#1}}%
+}
+
+\newcommand*{\printabbrs}[1][]{%
+ \glsxtrifemptyglossary{abbreviations}{}%
+ {%
+   \printunsrtglossary*
+   [type=abbreviations,style=alttree,title=\abbreviationsname,label=abbreviations,nonumberlist,#1]%
+   {%
+     \gls at tmplen=0pt\relax
+     \totalterms=0\relax
+     \glssetwidest{}%
+     \let\printunsrtglossaryentryprocesshook\settermshook
+     \def\printunsrtglossarypredoglossary{\entrycountprehook\totalterms}%
+     \let\glsextrapostnamehook\glsaddterm
+   }%
+ }%
+}
+
+\newcommand{\printicons}{\printunsrtglossary[type=symbols,style=long-sym-desc,groups=false,label=symbols]}
+
+\newcount\totalterms
+
+\newcommand{\termslocfmt}[1]{\hyperit{#1}}
+\newcommand{\glsaddterm}[1]{\glsadd[format=termslocfmt]{#1}}
+
+\newcommand*{\printterms}[1][]{%
+ \ifglossaryexists{abbreviations}{\printabbrs}{}%
+ \glsxtrifemptyglossary{symbols}{}{\printicons}%
+ \glsxtrifemptyglossary{main}{}%
+ {
+   \printunsrtglossary*[style=topic,nonumberlist,label=glossary,#1]%
+   {%
+     \gls at tmplen=0pt\relax
+     \totalterms=0\relax
+     \glssetwidest{}%
+     \let\printunsrtglossaryentryprocesshook\settermshook
+     \def\printunsrtglossarypredoglossary{\entrycountprehook\totalterms}%
+     \glssetcategoryattribute{term}{glossname}{firstuc}%
+     \glssetcategoryattribute{termabbreviation}{glossname}{firstuc}%
+     \let\glstopicMarker\glsaddterm
+   }%
+ }%
+}
+
+%\newcommand{\bibglsprimary}[2]{%
+ %\ifcase #1\or p.~\else pp.~\fi
+ %#2%
+%}
+
+\newcommand{\seclocfmt}[2]{#1}
+
+\newcommand{\glsxtrchapterlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsectionlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsubsectionlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsubsubsectionlocfmt}{\seclocfmt}
+\newcommand{\glsxtrparagraphlocfmt}{\seclocfmt}
+\newcommand{\glsxtrsubparagraphlocfmt}{\seclocfmt}
+
+\newcommand{\glsxtrtablelocfmt}{\seclocfmt}
+\newcommand{\glsxtrfigurelocfmt}{\seclocfmt}
+
+\newcommand*{\locationgroupmarkerchapter}{\S}
+\newcommand*{\locationgroupmarkersection}{\S}
+\newcommand*{\locationgroupmarkersubsection}{\S}
+\newcommand*{\locationgroupmarkersubsubsection}{\S}
+\newcommand*{\locationgroupmarkerparagraph}{\S}
+\newcommand*{\locationgroupmarkersubparagraph}{\S}
+
+\newcommand*{\locationgroupmarkertable}{\tablename~}
+\newcommand*{\locationgroupmarkerfigure}{\figurename~}
+
+\newcommand*{\locationgroupmarkerpage}{p.~}
+\newcommand*{\locationgroupmarkerpages}{pp.~}
+
+\newcommand{\bibglslocationgroupsep}{; }
+
+\newcommand{\locationgroupencapchapter}[1]{\textcolor{teal}{\bfseries#1}}
+\newcommand{\locationgroupencapsection}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapsubsection}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapsubsubsection}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapparagraph}{\locationgroupencapchapter}
+\newcommand{\locationgroupencapsubparagraph}{\locationgroupencapchapter}
+
+\newcommand{\bibglslocationgroup}[3]{%
+  \csuse{locationgroupencap#2}% 
+  {%
+    \ifcsdef{locationgroupmarker#2}%
+    {\ifcase#1
+     \or
+       \csuse{locationgroupmarker#2}% 
+     \else
+       \ifcsdef{locationgroupmarker#2s}%
+       {\csuse{locationgroupmarker#2s}}%
+       {%
+         \csuse{locationgroupmarker#2}% 
+         \csuse{locationgroupmarker#2}% 
+       }%
+     \fi
+    }%
+    {}%
+    #3%
+  }%
+}
+
+\newcommand{\summaryentrypackagebookmark}[2]{%
+ \expandafter\pdfbookmark\expandafter[#1]{\glsentryname{#2}}{summary.#2}%
+}
+
+\newcommand{\summaryentryclassbookmark}[2]{%
+ \expandafter\pdfbookmark\expandafter[#1]{\glsentryname{#2}}{summary.#2}%
+}
+
+\newcommand{\summaryentrypackage}[1]{%
+  \let\styfmt\texttt
+  \csfmt{usepackage}%
+  \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+  \marg{\textbf{\linkedentryname{#1}}}%
+}
+
+\newcommand{\summaryentryclass}[1]{%
+  \let\clsfmt\texttt
+  \csfmt{documentclass}%
+  \glsxtrifhasfield{syntax}{#1}{[\glscurrentfieldvalue]}{}%
+  \marg{\textbf{\linkedentryname{#1}}}
+}
+
+\newcommand{\summaryentryenvironment}[1]{%
+  \let\envfmt\texttt
+  \csfmt{begin}\marg{\textbf{\linkedentryname{#1}}}%
+  \syntax{#1}%
+  \gathermodifiers{#1}%
+  \ifdefempty\nlctmodifierlist{}
+  {%
+    \hfill\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist
+    \gdef\summaryentry at post@fill{\quad }%
+  }%
+}
+
+\newcommand{\summaryentrycommand}[1]{%
+  \textbf{\linkedentryname{#1}}%
+  \syntax{#1}%
+  \glsxtrifhasfield{initvalue}{#1}%
+  {%
+    \hfill\summarytagfmt{initial}\glscurrentfieldvalue
+    \gdef\summaryentry at post@fill{\quad }%
+  }%
+  {%
+    \gathermodifiers{#1}%
+    \ifdefempty\nlctmodifierlist{}%
+    {%
+      \hfill\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist
+      \gdef\summaryentry at post@fill{\quad }%
+    }%
+  }%
+}
+
+\newcommand{\summaryentrypackageoption}{\summaryentryoption}
+\newcommand{\summaryentryclassoption}{\summaryentryoption}
+\newcommand{\summaryentrycommandoption}{\summaryentryoption}
+\newcommand{\summaryentryenvironmentoption}{\summaryentryoption}
+
+\newcommand{\genericsummaryentryoption}[2][]{%
+  \getinitordefval{#2}%
+  \def\optiontag{#1}%
+  \textbf{\linkedentryname{#2}}%
+  \ifdefempty\currentsyntax{}{\dequals\currentsyntax}%
+  \hfill
+  \textrm{\ifdefempty\initordefval{}{\initordefval}%
+   \ifdefempty\optiontag{}{ \optiontag}}%
+  \gdef\summaryentry at post@fill{ }%
+}
+
+\newcommand{\summaryentryoption}[1]{%
+  \getinitordefval{#1}%
+  \textbf{\linkedentryname{#1}}%
+  \ifdefempty\currentsyntax{}{\dequals\currentsyntax}%
+  \hfill
+  \textrm{\ifdefempty\initordefval{}{\initordefval}%
+   \ifdefempty\settingstitle{}{ \settingstitle}}%
+  \gdef\summaryentry at post@fill{ }%
+}
+
+\newcommand{\summaryentryoptionvalue}[1]{%
+  \glsxtrifhasfield{parent}{#1}{\glsentrytext{\glscurrentfieldvalue}\dequals}{}%
+  \textbf{\linkedentryname{#1}}%
+}
+
+\newcommand{\summarylocfmt}[1]{\hyperit{#1}}
+\newcommand{\summarysubitemindent}{3em}
+\newcommand{\providedbyfmt}[1]{\textsf{\footnotesize \mbox{#1}}}
+
+\newif\ifshowsummarytopgroupheaders
+\showsummarytopgroupheaderstrue
+
+\newif\ifshowsummarysubgroupheaders
+\showsummarysubgroupheaderstrue
+
+\newcommand*{\summarynotefmt}[1]{{\small(#1)}}
+
+\newcommand{\summaryentryskip}{\par\bigskip\par}
+
+\newcommand{\summarypredesc}{%
+ \nopagebreak\summarypar\nopagebreak
+}
+
+\newcommand{\rootsummarypar}{\par}
+\newcommand{\childsummarypar}{\par}
+
+\newglossarystyle{summary}
+{%
+  \renewenvironment{theglossary}%
+  {\setlength{\parindent}{0pt}%
+   \setlength{\parskip}{0pt plus 0.3pt}%
+   \raggedbottom
+   \def\entryskip{\def\entryskip{\summaryentryskip}}%
+   \ifdefstring{\@@glossarysec}{chapter}%
+   {%
+     \hypersetup{bookmarksdepth=2}%
+     \ifnum\c at secnumdepth>0\relax
+      \setcounter{secnumdepth}{0}%
+     \fi
+     \ifnum\c at tocdepth>0\relax
+      \setcounter{tocdepth}{0}%
+     \fi
+     \def\summarysec{\section}%
+     \def\summarysecnumdepth{0}%
+     \ifshowsummarytopgroupheaders
+       \def\summarysubsec{\subsection}%
+       \def\summarysubsecnumdepth{1}%
+     \else
+       \def\summarysubsec{\section}%
+       \def\summarysubsecnumdepth{0}%
+     \fi
+   }%
+   {%
+     \hypersetup{bookmarksdepth=3}%
+     \ifnum\c at secnumdepth>1\relax
+       \setcounter{secnumdepth}{1}%
+     \fi
+     \ifnum\c at tocdepth>1\relax
+       \setcounter{tocdepth}{1}%
+     \fi
+     \def\summarysec{\subsection}%
+     \def\summarysecnumdepth{1}%
+     \ifshowsummarytopgroupheaders
+       \def\summarysubsec{\subsubsection}%
+       \def\summarysubsecnumdepth{2}%
+     \else
+       \def\summarysubsec{\subsection}%
+       \def\summarysubsecnumdepth{1}%
+     \fi
+   }%
+   \let\summary at hasgroupheading\@secondoftwo
+   \let\summary at hassubgroupheading\@secondoftwo
+  }%
+  {\par}%
+  \renewcommand*{\glossaryheader}{}%
+  \renewcommand*{\glsgroupheading}[1]{%
+    \ifshowsummarytopgroupheaders
+      \glsxtrgetgrouptitle{##1}{\glsxtr at grptitle}%
+      \summarysec[\texorpdfstring{\glossarytoctitle: \glsxtr at grptitle}{\glsxtr at grptitle}]{\glsxtr at grptitle}%
+      \label{summary.##1}%
+      \def\entryskip{\def\entryskip{\summaryentryskip}}%
+      \let\summary at hasgroupheading\@firstoftwo
+    \else
+      \let\summary at hasgroupheading\@secondoftwo
+    \fi
+  }%
+  \renewcommand*{\glssubgroupheading}[4]{%
+    \let\summary at hassubgroupheading\@secondoftwo
+    \ifshowsummarysubgroupheaders
+      \ifnum##2=1\relax
+        \glsxtrgetgrouptitle{##4}{\glsxtr at grptitle}%
+        \summarysubsec[\texorpdfstring{\glossarytoctitle: \glsxtr at grptitle}{\glsxtr at grptitle}]{\glsxtr at grptitle}%
+        \def\entryskip{\def\entryskip{\summaryentryskip}}%
+        \let\summary at hassubgroupheading\@firstoftwo
+      \fi
+    \fi
+  }%
+  \renewcommand*{\glossentry}[2]{\subglossentry{0}{##1}{##2}}%
+  \renewcommand{\subglossentry}[3]{%
+    \def\initordefval{}%
+    \edef\@this at category{\glscategory{##2}}%
+    \entryskip
+    \par\allowbreak
+    \def\summaryentry at post@fill{\hfill}%
+    \ifnum##1=0\relax
+      \ifcsdef{summaryentry\@this at category bookmark}%
+      {%
+        \summary at hasgroupheading
+        {\edef\@summary at bookmarklevel{\the\numexpr\summarysecnumdepth+2}}%
+        {\edef\@summary at bookmarklevel{\the\numexpr\summarysecnumdepth+1}}%
+        \csuse{summaryentry\@this at category bookmark}{\@summary at bookmarklevel}{##2}%
+      }%
+      {}%
+    \else
+    \ifnum##1=1\relax
+        \ifcsdef{summaryentry\@this at category bookmark}%
+        {%
+          \summary at hassubgroupheading
+          {\edef\@summary at bookmarklevel{\the\numexpr\summarysubsecnumdepth+2}}%
+          {\edef\@summary at bookmarklevel{\the\numexpr\summarysubsecnumdepth+1}}%
+          \csuse{summaryentry\@this at category bookmark}{\@summary at bookmarklevel}{##2}%
+        }%
+        {}%
+      \fi
+    \fi
+    \def\summarypar{\rootsummarypar}%
+    \ifnum##1=0\relax
+     \ifstrempty{##3}%
+     {\let\summary at do@loc\@empty}%
+     {\edef\summary at do@loc{\noexpand\makebox[0pt][l]{\noexpand\rule{\the\textwidth}{0pt}\unexpanded{\summaryloc{##3}}}}}%
+     \begin{defnbox}\summary at do@loc
+      \glsadd[format=summarylocfmt]{##2}%
+      \ifnotdefaultstatus{##2}{\statussym~}{}%
+      \texttt
+      {%
+        \ifcsdef{summaryentry\@this at category}
+        {%
+          \csuse{summaryentry\@this at category}{##2}%
+        }%
+        {%
+          \textbf{\linkedentryname{##2}}%
+          \syntax{##2}%
+        }%
+      }%
+      \glsxtrifhasfield*{providedby}{##2}%
+      {\summaryentry at post@fill\providedbyfmt{\glscurrentfieldvalue}%
+       \def\summaryentry at post@fill{\linebreak[1]\hfill}%
+      }%
+      {}%
+      \glsxtrifhasfield{note}{##2}%
+      {\summaryentry at post@fill\summarynotefmt\glscurrentfieldvalue}{}%
+     \end{defnbox}%
+    \else
+      \ifnum##1>1\relax
+        \hangindent\summarysubitemindent\relax
+        \parindent\summarysubitemindent\relax
+        \def\summarypar{\childsummarypar\hangindent\summarysubitemindent\relax
+          \parindent\summarysubitemindent\relax}%
+      \fi
+      \glsadd[format=summarylocfmt]{##2}%
+      \texttt
+      {%
+        \ifcsdef{summaryentry\@this at category}
+        {%
+          \csuse{summaryentry\@this at category}{##2}%
+        }%
+        {%
+          \textbf{\linkedentryname{##2}}%
+          \syntax{##2}%
+        }%
+      }%
+      \ifstrempty{##3}{}{\marginpar{\summaryloc{##3}}}%
+      \glsxtrifhasfield*{alias}{##2}%
+      {%
+        \summaryentry at post@fill
+        \summarytagfmt{alias}%
+        \expandafter\glsfmtname\expandafter{\glscurrentfieldvalue}%
+        \let\summaryentry at post@fill\space
+      }%
+      {}%
+      \ifnotdefaultstatus{##2}%
+      {\summaryentry at post@fill
+        \glsxtrifhasfield{useri}{##2}{\glscurrentfieldvalue~}{}\statussym
+      }%
+      {\glsxtrifhasfield{useri}{##2}{\summaryentry at post@fill\glscurrentfieldvalue}{}}%
+      \glsxtrifhasfield{note}{##2}{\summarypar\hfill\summarynotefmt\glscurrentfieldvalue}{}%
+    \fi
+    \summarypredesc
+    \glossentrydesc{##2}\glspostdescription
+    \par
+    \hangindent0pt\parindent0pt\relax
+  }%
+  \renewcommand*{\glsgroupskip}{}%
+}
+
+\newcount\totalcmds
+\newcount\totalenvs
+\newcount\totalpkgopts
+\newcount\totalclsopts
+
+\newcommand*{\summaryhook}[1]{%
+ \def\summaryhookdoskip{\printunsrtglossaryskipentry}%
+ \glsifcategory{#1}{command}%
+ {\ifglshasdesc{#1}{\advance\totalcmds by 1\relax\let\summaryhookdoskip\relax}{}}%
+ {%
+   \glsifcategory{#1}{environment}%
+   {%
+     \ifglshasdesc{#1}%
+     {\global\advance\totalenvs by 1\glsxtrcopytoglossary*{#1}{envlist}}%
+     {}%
+   }%
+   {%
+     \glsifcategory{#1}{packageoption}%
+     {%
+       \ifglshasdesc{#1}%
+       {%
+         \global\advance\totalpkgopts by 1\relax
+         \glsxtrifhasfield{parent}{#1}%
+         {%
+           \GlsXtrIfInGlossary{\glscurrentfieldvalue}{pkgoptlist}{}%
+           {\glsxtrcopytoglossary*{\glscurrentfieldvalue}{pkgoptlist}}%
+         }%
+         {}%
+         \glsxtrcopytoglossary*{#1}{pkgoptlist}%
+       }%
+       {}%
+     }%
+     {%
+       \glsifcategory{#1}{classoption}%
+       {%
+         \ifglshasdesc{#1}%
+         {%
+           \global\advance\totalclsopts by 1\relax
+           \glsxtrifhasfield{parent}{#1}%
+           {%
+             \GlsXtrIfInGlossary{\glscurrentfieldvalue}{clsoptlist}{}%
+             {\glsxtrcopytoglossary*{\glscurrentfieldvalue}{clsoptlist}}%
+           }%
+           {}%
+           \glsxtrcopytoglossary*{#1}{clsoptlist}%
+         }%
+         {}%
+       }%
+       {%
+         \glsifcategory{#1}{optionvalue}%
+         {%
+           \glsxtrifhasfield{parent}{#1}%
+           {%
+             \let\@currentparent\glscurrentfieldvalue
+             \GlsXtrIfInGlossary{\@currentparent}{clsoptlist}%
+             {\glsxtrcopytoglossary*{#1}{clsoptlist}}%
+             {%
+               \GlsXtrIfInGlossary{\@currentparent}{pkgoptlist}%
+               {\glsxtrcopytoglossary*{#1}{pkgoptlist}}%
+               {%
+                 \GlsXtrIfInGlossary{\@currentparent}{envlist}%
+                 {\glsxtrcopytoglossary*{#1}{envlist}}%
+                 {%
+                   \glsifcategory{\@currentparent}{command}%
+                   {\ifglshasdesc{#1}{\let\summaryhookdoskip\relax}{}}{}%
+                 }%
+               }%
+             }%
+           }%
+           {}%
+         }%
+         {}%
+       }%
+     }%
+   }%
+ }%
+ \summaryhookdoskip
+}
+
+\newcommand{\entrycountprehook}[1]{%
+  \ifnum#1<21\relax
+    \let\glsgroupheading\@gobble
+    \glsnogroupskiptrue
+  \fi
+}
+
+\provideignoredglossary{envlist}%
+\provideignoredglossary{pkgoptlist}%
+\provideignoredglossary{clsoptlist}%
+
+\newcommand*{\printsummary}{%
+ {%
+   \renewcommand{\GlsXtrLocationField}{primarylocations}%
+   \let\printunsrtglossaryentryprocesshook\summaryhook
+   \def\printunsrtglossarypredoglossary{\entrycountprehook\totalcmds}%
+   \printunsrtglossary[type=index,style=summary,title=Command Summary,
+    label={cmdsummary}]%
+   % Environment list
+   \let\printunsrtglossaryentryprocesshook\@gobble
+   \def\printunsrtglossarypredoglossary{\entrycountprehook\totalenvs}%
+   \glsxtrifemptyglossary{envlist}{}%
+   {\printunsrtglossary[type=envlist,style=summary,title=Environment Summary,
+      label={envsummary}]}%
+   % Class option list
+   \def\printunsrtglossarypredoglossary{\entrycountprehook\totalclsopts}%
+   \glsxtrifemptyglossary{clsoptlist}{}%
+   {\printunsrtglossary*[type=clsoptlist,style=summary,title=Class Option Summary,
+    label={clsoptsummary}]%
+    {\showsummarytopgroupheadersfalse}%
+   }%
+   % Package option list
+   \def\printunsrtglossarypredoglossary{\entrycountprehook\totalpkgopts}%
+   \glsxtrifemptyglossary{pkgoptlist}{}%
+   {\printunsrtglossary*[type=pkgoptlist,style=summary,title=Package Option Summary,
+    label={styoptsummary}]%
+    {\showsummarytopgroupheadersfalse}%
+   }%
+ }%
+}
+
+\newcommand*{\printcommandoptionsprocesshook}[2]{%
+  \ifdefstring#2{#1}%
+  {}%
+  {%
+   \glsxtrifhasfield*{rootancestor}{#2}%
+   {\ifdefstring\glscurrentfieldvalue{#1}{}{\printunsrtglossaryskipentry}}%
+   {\printunsrtglossaryskipentry}%
+  }%
+}
+
+\newcommand*{\printcommandoptions}[2][]{%
+ \glsdoifexistsorwarn{#2}%
+ {%
+   \printunsrtglossary*[type=index,style=summary,nogroupskip,
+     label={#2-options},
+     title={\glsentryname{#2} Options},
+     #1]%
+   {%
+     \renewcommand{\GlsXtrLocationField}{primarylocations}%
+     \def\printunsrtglossaryentryprocesshook{\printcommandoptionsprocesshook{#2}}%
+      \def\printunsrtglossarypredoglossary{\let\glsgroupheading\@gobble}%
+   }%
+ }%
+}
+
+\newcommand*{\printcommonoptionsprocesshook}[2]{%
+ \glsxtrifhasfield*{rootancestor}{#2}%
+ {\ifdefstring\glscurrentfieldvalue{#1}{}{\printunsrtglossaryskipentry}}%
+ {\printunsrtglossaryskipentry}%
+}
+
+\newcommand*{\printcommonoptions}[2][]{%
+ \glsdoifexistsorwarn{#2}%
+ {%
+   \printunsrtglossary*[type=index,style=summary,nogroupskip,
+     label={#2-optionsummary},
+     title={\texorpdfstring{\glsxtrfieldtitlecase{#2}{name}}{\pdftitlecasename{#2}} Summary},
+     leveloffset={-1},#1]%
+   {%
+     \preto\glossarypreamble{\glsadd[format=summarylocfmt]{#2}\createtarget{#2}{\strut}}%
+     \ifglshasdesc{#2}%
+     {%
+       \appto\glossarypreamble{\glossentrydesc{#2}\glspostdescription
+         \glspar\medskip\glspar}%
+     }{}%
+     \renewcommand{\GlsXtrLocationField}{primarylocations}%
+     \def\printunsrtglossaryentryprocesshook{\printcommonoptionsprocesshook{#2}}%
+      \def\printunsrtglossarypredoglossary{\let\glsgroupheading\@gobble}%
+   }%
+ }%
+}
+
+\newcount\totalindexitems
+
+\newcommand{\filteremptylocation}[1]{%
+  \glsxtrifhasfield*{location}{#1}
+  {\advance\totalindexitems by 1}% has location field
+  {%
+    \GlsXtrIfHasNonZeroChildCount*{#1}%
+    {\advance\totalindexitems by 1}%
+    {\printunsrtglossaryskipentry}%
+  }%
+}
+
+\newcommand*{\printuserguideindex}[1][]{%
+ \printunsrtglossary*[label=index,type=index,target=false,title=\indexname,style=bookindex,#1]%
+ {%
+   \let\glsextrapostnamehook\statushook
+   \renewcommand*{\glsxtrbookindexprelocation}[1]{%
+     \glsxtrifhasfield{location}{##1}%
+     {\,\textcolor{lightgray}{\dotfill}\,}%
+     {}%
+   }%
+  \let\printunsrtglossaryentryprocesshook\filteremptylocation
+  \let\glsxtrbookindexname\linkedentryname
+   \def\printunsrtglossarypredoglossary{%
+    \ifnum\totalindexitems<21\relax
+     \renewcommand*{\glsxtrbookindexmulticolsenv}{multicols*}%
+    \fi}%
+  \nlctguideindexinitpostnamehooks
+ }%
+}
+
+\newcommand{\nlctguideindexinitpostnamehooks}{%
+  \glsdefpostname{environment}{ environment}%
+  \glsdefpostname{package}{ package}%
+  \glsdefpostname{class}{ class}%
+  \glsdefpostname{counter}{ counter}%
+  \glsdefpostname{acronym}{\acrpostnamehook}%
+  \glsdefpostname{abbreviation}{\abbrpostnamehook}%
+  \glsdefpostname{termabbreviation}{\abbrpostnamehook}%
+  \glsdefpostname{dualindexabbreviation}{\abbrpostnamehook}%
+}
+
+\newcommand{\acrpostnamehook}{}
+
+\newrobustcmd{\abbrpostnamehook}{%
+ \ifglshaslong\glscurrententrylabel
+ {\space (\glsfmtlong{\glscurrententrylabel})}
+ {%
+   \glsxtrifhasfield{\GlsXtrDualField}{\glscurrententrylabel}%
+   {%
+     \ifglshaslong\glscurrentfieldvalue
+     {\space (\expandafter\glsfmtlong\expandafter{\glscurrentfieldvalue})}%
+     {}%
+   }%
+   {}%
+ }%
+}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the tex-live-commits mailing list.