texlive[72810] Master/texmf-dist: nlctdoc (9nov24)
commits+karl at tug.org
commits+karl at tug.org
Sat Nov 9 17:32:59 CET 2024
Revision: 72810
https://tug.org/svn/texlive?view=revision&revision=72810
Author: karl
Date: 2024-11-09 17:32:59 +0100 (Sat, 09 Nov 2024)
Log Message:
-----------
nlctdoc (9nov24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/nlctdoc/README
trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls
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 2024-11-09 16:32:48 UTC (rev 72809)
+++ trunk/Master/texmf-dist/doc/latex/nlctdoc/README 2024-11-09 16:32:59 UTC (rev 72810)
@@ -1,4 +1,4 @@
-nlctdoc.cls and nlctuserguide.sty v1.10 (2023-09-29):
+nlctdoc.cls and nlctuserguide.sty v1.11 (2024-11-09):
This class and package is provided "as is" solely for the benefit
of anyone who wants to compile the documentation for
Modified: trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls 2024-11-09 16:32:48 UTC (rev 72809)
+++ trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctdoc.cls 2024-11-09 16:32:59 UTC (rev 72810)
@@ -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-2023 Nicola Talbot
+% Copyright 2013-2024 Nicola Talbot
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -18,7 +18,7 @@
% for existing documents that use it.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{nlctdoc}[2023/09/29 v1.10 (NLCT)]
+\ProvidesClass{nlctdoc}[2024/11/09 v1.11 (NLCT)]
\RequirePackage{ifpdf}
\RequirePackage{ifxetex}
% tex4ht stopped working with koma during TL2013.
Modified: trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty 2024-11-09 16:32:48 UTC (rev 72809)
+++ trunk/Master/texmf-dist/tex/latex/nlctdoc/nlctuserguide.sty 2024-11-09 16:32:59 UTC (rev 72810)
@@ -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 2022-2023 Nicola Talbot
+% Copyright 2022-2024 Nicola Talbot
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -15,7 +15,7 @@
% version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{nlctuserguide}[2023/09/29 v1.10 (NLCT)]
+\ProvidesPackage{nlctuserguide}[2024/11/09 v1.11 (NLCT)]
\newcommand{\nlctdoc at loadxr}{}
\DeclareOption{xr}{\renewcommand{\nlctdoc at loadxr}{\RequirePackage{xr-hyper}}}
@@ -44,6 +44,99 @@
\DeclareOption{deephierarchy}{\setcounter{secnumdepth}{5}}
+\newcommand{\nlct at definesymbols}{%
+ \nlct at definefontsymbols
+}
+
+\newcommand{\nlct at definefontsymbols}{%
+% requires stix or boisk
+ \newrobustcmd{\tabsym}{%
+ \BeginAccSupp{method=hex,unicode,ActualText=21B9}%
+ \ensuremath{\barleftarrowrightarrowbar}%
+ \EndAccSupp{}%
+ }
+% requires stix
+ \newrobustcmd{\upsym}{%
+ \BeginAccSupp{method=hex,unicode,ActualText=2B71}%
+ \ensuremath{\baruparrow}%
+ \EndAccSupp{}%
+ }
+}
+
+\newcommand{\nlct at definetikzsymbols}{%
+ \RequirePackage{tikz}%
+ \usetikzlibrary{arrows.meta}%
+ \newsavebox\tabsbox
+ \sbox\tabsbox{%
+ \resizebox{!}{8pt}{%
+ \begin{tikzpicture}[thick]
+ \draw[arrows={Bar[width=8pt]Triangle[width=6pt,length=5pt]-}]
+ (0,0) -- (14pt,0);
+ \draw[arrows={-Triangle[width=6pt,length=5pt]Bar[width=8pt]}]
+ (0,-7pt) -- (14pt,-7pt);
+ \end{tikzpicture}%
+ }%
+ }
+ \newrobustcmd{\tabsym}{%
+ \BeginAccSupp{method=hex,unicode,ActualText=21B9}%
+ \thinspace
+ \usebox\tabsbox
+ \thinspace
+ \EndAccSupp{}%
+ }%
+ \newrobustcmd{\upsym}{%
+ \BeginAccSupp{method=hex,unicode,ActualText=2B71}%
+ \begin{tikzpicture}
+ \draw[arrows={-To[width=6pt,length=5pt]Bar[width=8pt]}]
+ (0,0) -- (0,2ex);
+ \end{tikzpicture}
+ \EndAccSupp{}%
+ }%
+}
+
+\DeclareOption{fontsymbols}{%
+ \renewcommand{\nlct at definesymbols}{%
+ \nlct at definefontsymbols
+ }%
+}
+
+\DeclareOption{tikzsymbols}{%
+ \renewcommand{\nlct at definesymbols}{%
+ \nlct at definetikzsymbols
+ }%
+}
+
+\newcommand{\nlct at indexmarks}{}
+\newcommand{\nlctpostindexname}[1]{}
+
+\DeclareOption{noindexmarks}{\renewcommand{\nlct at indexmarks}{}}
+
+\DeclareOption{indexmarks}{%
+ \renewcommand{\nlct at indexmarks}{%
+ \@ifpackageloaded{scrbase}%
+ {%
+ \RequirePackage{scrlayer-scrpage}%
+ \lofoot[\nlctindexfirstmark]{\nlctindexfirstmark}%
+ \lofoot[\nlctindexfirstmark]{\nlctindexfirstmark}%
+ \refoot[\nlctindexlastmark]{\nlctindexlastmark}%
+ \rofoot[\nlctindexlastmark]{\nlctindexlastmark}%
+ \renewcommand{\nlctpostindexname}[1]{\glsxtrbookindexmarkentry{##1}}%
+ }%
+ {}%
+ }%
+}
+
+% default options:
+\PassOptionsToPackage{
+ record=nameref,
+ indexcounter,
+ floats,
+ symbols,
+ accsupp,
+ nosuper,
+ stylemods={mcols,bookindex,topic,longextra}
+}{glossaries-extra}
+
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries-extra}}
\ProcessOptions
@@ -51,6 +144,9 @@
\RequirePackage{iftex}
\RequirePackage{etoolbox}
+\nlct at indexmarks
+\nlct at definesymbols
+
\newcommand{\nlct at ifattachsupported}[2]{#2}
\newcommand{\nlct at doifattachsupported}[1]{\nlct at ifattachsupported{#1}{}}
@@ -57,7 +153,6 @@
\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}}
@@ -64,7 +159,10 @@
\else
\RequirePackage{fontspec}
- \setmainfont{Linux Libertine O}
+ % v1.11 changed font from Linux Libertine O to Liberation
+ \setmainfont{FreeSerif}
+ \setsansfont{FreeSans}[Scale=.9]
+ \setmonofont{FreeMono}[Scale=1.1]
\ifluatex
\newcommand{\nlctdocsymbolgrouplabel}[3]{%
@@ -82,9 +180,6 @@
\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
@@ -100,11 +195,13 @@
\RequirePackage{varioref}
\RequirePackage{xcolor}
-\newcommand*{\nlct at doifkoma}[1]{}
-\@ifclassloaded{scrreprt}{\let\nlct at doifkoma\@firstofone}
+\newcommand*{\nlct at doifkoma}[1]{\nlct at ifkoma{#1}{}}
+\newcommand*{\nlct at ifkoma}[2]{#2}
+
+\@ifclassloaded{scrreprt}{\let\nlct at ifkoma\@firstoftwo}
{
- \@ifclassloaded{scrartcl}{\let\nlct at doifkoma\@firstofone}
- {\@ifclassloaded{scrbook}{\let\nlct at doifkoma\@firstofone}{}}
+ \@ifclassloaded{scrartcl}{\let\nlct at ifkoma\@firstoftwo}
+ {\@ifclassloaded{scrbook}{\let\nlct at ifkoma\@firstoftwo}{}}
}
\nlct at doifkoma{%
@@ -127,7 +224,7 @@
\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]
+\RequirePackage{glossaries-extra}[2022/10/14]
\nlct at doifattachsupported{\RequirePackage{attachfile}}
\renewcommand{\thepart}{\Roman{part}}
@@ -138,6 +235,25 @@
\newcommand*{\thispackagename}{\jobname}
\newcommand*{\thispackage}{\styfmt{\thispackagename}}
\newcommand*{\examplesdir}{\jobname-examples}
+\newcommand{\nlct at v@version}{}
+\newcommand{\nlct at version}{}
+\newcommand{\nlct at date}{}
+\ExplSyntaxOn
+\NewDocumentCommand \versiondate { m m }
+{
+ \tl_set:Nx \nlct at version { \tl_trim_spaces:n { #1 } }
+ \tl_set:Nx \nlct at date { \tl_trim_spaces:n { #2 } }
+ \tl_if_empty:NF \nlct at version
+ {
+ \tl_set:Nx \nlct at v@version { version ~ \nlct at version }
+ }
+ \tl_if_empty:NF \nlct at date
+ {
+ \tl_put_right:Nx \nlct at v@version { ~ \nlct at date }
+ }
+ \date{\nlct at v@version}
+}
+\ExplSyntaxOff
\newcommand{\htmlavailable}{This document is also available as
\href{\jobname.html}{HTML (\filefmt{\jobname.html})}.}
@@ -146,6 +262,10 @@
\renewcommand{\title}[1]{\gdef\@title{#1}\hypersetup{pdftitle={\text_purify:n{#1}}}}
\ExplSyntaxOff
+ \newrobustcmd{\visiblespace}{%
+ \texttt{\verbvisiblespace}%
+ }
+
\newcommand{\TeXLive}{\TeX\ Live}
\newcommand{\MikTeX}{Mik\TeX}
@@ -186,10 +306,11 @@
\newrobustcmd*{\ctanref}[2]{\href{https://ctan.org/#1}{#2}%
\glsxtrdopostpunc{\footnote{\href{https://ctan.org/#1}{\nolinkurl{ctan.org/#1}}}}%
}
-\MFUexcl{\ctanpkg}
+\MFUexcl{\ctanref}
\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}}}}%
@@ -297,6 +418,28 @@
\egroup
}
+\newcommand*{\@ref at numname}[1]{\ref{#1} (\nameref{#1})}
+\newcommand*{\s at ref@numname}[1]{\ref*{#1} (\nameref*{#1})}
+
+\newcommand*{\@numname at refslist}[4]{%
+ \bgroup
+ \let\DTLlistformatitem\@ref at numname
+ \renewcommand*{\DTLlistformatsep}{#2}%
+ \renewcommand*{\DTLlistformatlastsep}{#3}%
+ #1\DTLformatlist{#4}%
+ \egroup
+}
+
+\newcommand*{\s at numname@refslist}[4]{%
+ \bgroup
+ \let\DTLlistformatitem\s at ref@numname
+ \renewcommand*{\DTLlistformatsep}{#2}%
+ \renewcommand*{\DTLlistformatlastsep}{#3}%
+ #1\DTLformatlist{#4}%
+ \egroup
+}
+
+
\newcommand{\sectionrefprefix}{\S}
\newrobustcmd{\sectionref}{\@ifstar\s at sectionref\@sectionref}
\MFUblocker{\sectionref}
@@ -397,6 +540,8 @@
\newcommand*{\@exampleref}[1]{\examplerefprefix\nlct at ns@ref at cs{#1}}
\newcommand*{\s at exampleref}[1]{\examplerefprefix\ref*{#1}}
+\newrobustcmd*{\examplenameref}[1]{\exampleref{#1} (\nameref{#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}}
@@ -412,6 +557,12 @@
{\@refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
}
+\newrobustcmd{\examplesnameref}{%
+ \@ifstar
+ {\s at numname@refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+ {\@numname at refslist{\examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
+}
+
\newrobustcmd{\Examplesref}{%
\@ifstar
{\s at refslist{\Examplesrefprefix}{\refslistsep}{\refslistlastsep}}%
@@ -419,11 +570,19 @@
}
\MFUaddmap{\examplesref}{\Examplesref}
+\newrobustcmd{\mExampleref}[1]{\Exampleref{#1}\examplemarginref{#1}}
+\newrobustcmd{\mexampleref}[1]{\exampleref{#1}\examplemarginref{#1}}
+
+\newrobustcmd{\examplemarginref}[1]{%
+ \marginpar{\footnotesize\hyperref[#1]{\codesym}\ref{#1}\plabel{#1-backref}}%
+}
+
\newcommand*{\plabel}[2][]{\protected at edef\@currentlabelname{#1}\label{#2}}
\newcommand*{\pref}[2][]{on page~\pageref{#2}}
\newcommand*{\phyperref}[2]{\hyperref[#2]{#1} on page~\pageref{#2}}
\newcommand*{\dash}{\,---\,}
+\newcommand{\Slash}{\,\slash\,}% v1.11
\newcommand*{\tick}{\ding{51}}
@@ -441,6 +600,10 @@
\newcommand{\unlimited}{$\infty$}
+{\catcode`\^^I12\relax
+\gdef\nlctliteraltabchar{^^I}
+}
+
\newcommand{\fnsymmark}[1]{\rlap{#1}}
\newcommand{\asteriskmarker}{\textasteriskcentered}
@@ -643,6 +806,7 @@
\newcommand*{\icontext}[1]{\stepcounter{icon}\glstext[counter=icon]{sym.#1}}
\newtcolorbox{warning}[1][]{breakable,
+ before upper={\parindent12pt\noindent},
title={\icon{warning}},
coltitle=red,colbacktitle=red!20!white,
colframe=red,colback=red!5!white,
@@ -649,11 +813,13 @@
enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
\newtcolorbox{important}[1][]{breakable,title={\icon{important}},
+ before upper={\parindent12pt\noindent},
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={\icon{information}},
+ before upper={\parindent12pt\noindent},
coltitle=teal,colbacktitle=teal!20!white,
colframe=teal,colback=teal!5!white,
enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
@@ -664,26 +830,34 @@
\newcommand{\nlctdefaultafter}{\par\noindent\ignorespacesafterend}
+\newcommand{\nlctpinnedafter}{\nlctdefaultafter} % v1.11
+\newcommand{\nlctpinnedbefore}{\allowbreak\par\noindent} % v1.11
+
\newtcolorbox{pinnedbox}[1][]{unbreakable,title={\icon{definition}},
coltitle=black,colbacktitle=defbackground,
colframe=black,colback=defbackground,halign=flush left,
enhanced,attach boxed title to top right={yshift=\boxtitleshift},
- after={\nlctdefaultafter},
+ after={\nlctpinnedafter},before={\nlctpinnedbefore},
#1
}
+\newcommand{\nlctdefnafter}{\nopagebreak\nlctdefaultafter} % v1.11
+\newcommand{\nlctdefnbefore}{\allowbreak\par\noindent} % v1.11
+
\newtcolorbox{defnbox}[1][]{unbreakable,
colframe=black,colback=defbackground,halign=flush left,
- after={\nlctdefaultafter},
+ after={\nlctdefnafter},before={\nlctdefnbefore},
#1
}
+\newcommand{\nlctsettingsafter}{\nopagebreak\nlctdefaultafter} % v1.11
+\newcommand{\nlctsettingsbefore}{\allowbreak\par\noindent} % v1.11
\newtcolorbox{settingsbox}[1][]{title={\icon{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},
+ after={\nlctsettingsafter}, before={\nlctsettingsbefore},
#1
}
@@ -705,14 +879,29 @@
\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}}}%
+{\obeylines\newcommand{\code at comment}[1]{%
+ \mbox{\textcolor{comment}{\glspercentchar\ #1}}\@ifnextchar
+{}{\par}}\global\let\code at comment\code at comment\newcommand{\code at comment@dbsp}[1]{%
+ \mbox{\textcolor{comment}{\glspercentchar\ #1}}\@ifnextchar
+{}{\par}\dbspace}\global\let\code at comment@dbsp\code at comment@dbsp}
\newcommand{\araraline}[1]{\glspercentchar\ arara: #1}
\newcommand{\araracont}{\araraline{-\/-> }}
+\newcommand{\commentnl}[1]{\comment{#1}\nl}
+
\newcommand*{\setupcodeenvfmts}{%
\let\cbeg\code at cbeg
\let\cend\code at cend
\let\comment\code at comment
+ \let\commentdbsp\code at comment@dbsp
+ \def\nl{\mbox{}\newline}%
+ \def\nlsp{\nl\null\space}%
+ \def\dbspace{\mbox{}\space\space}%
+ \def\dbdbspace{\dbspace\dbspace}%
+ \def\dbdbdbspace{\dbspace\dbspace\dbspace}%
+ \def\nldbsp{\nl\null\dbspace}%
+ \def\nldbdbsp{\nl\null\dbdbspace}%
+ \def\nldbdbdbsp{\nl\null\dbdbdbspace}%
\renewcommand*{\envfmt}[1]{##1}%
\renewcommand*{\styfmt}[1]{##1}%
\renewcommand*{\clsfmt}[1]{##1}%
@@ -791,7 +980,7 @@
coltitle=black,colbacktitle=white,
colframe=black,colback=white,
after={\nlctdefaultafter},
- enhanced,attach boxed title to top right={yshift=\boxtitleshift},#1}
+ enhanced,breakable,attach boxed title to top right={yshift=\boxtitleshift},#1}
\newtcolorbox{coderesult}[1][]{skin=bicolor,
title={\icon{code} \icon{result}},
@@ -836,7 +1025,8 @@
\newcommand*{\summarylocfont}{\footnotesize}
-\newcommand*{\summarylocwidth}{\marginparwidth}
+\newcommand*{\summarylocinnersep}{.3333em}
+\newcommand*{\summarylocwidth}{\marginparwidth-.6666em}
\definecolor{summaryloc}{rgb}{.75,.936,1} % LightBlue1
@@ -850,11 +1040,20 @@
\smash
{%
\tikz[baseline=(N.west)]
- \node[anchor=west,fill=summaryloc,text width=\summarylocwidth,rounded corners,font=\summarylocfont] (N) {#1};%
+ \node[anchor=west,
+ outer sep=0pt,
+ inner sep=\summarylocinnersep,
+ fill=summaryloc,
+ text width=\summarylocwidth,
+ align=flush left,
+ rounded corners,font=\summarylocfont
+ ] (N) {#1};%
}%
}%
}
+\newcommand{\summarymarginpar}[1]{\marginpar{#1}}
+
\ifdef\@ptsize
{
\ifboolexpr{ test {\ifdefstring\@ptsize{1}}
@@ -940,6 +1139,10 @@
\renewcommand*{\create at example@pages at sep}{#1}}
\newcommand{\create at example@pages at sep}{1em}
+\define at key{nlctexample}{pagesperrow}{%
+ \renewcommand*{\create at example@pages at perrow}{#1}}
+\newcommand{\create at example@pages at perrow}{\@nlct at num}
+
\define at key{nlctexample}{tex}{\renewcommand*{\create at example@tex}{#1}}
\newcommand*{\create at example@tex}{arara --working-directory \examplesdir}
@@ -974,14 +1177,128 @@
\renewcommand*{\example at title}{#1}%
}
-\newcommand{\example at do@label}{}
+\newcommand{\nlctpostexampletitle}{\par}
+
+\define at choicekey{nlctexample}{titleskip}%
+ [\nlct at titleskip@val\nlct at titleskip@nr]%
+ {none,thin,small,medium}%
+ {%
+ \ifcase\nlct at titleskip@nr\relax
+ \renewcommand{\nlctpostexampletitle}{\endgraf}%
+ \or
+ \renewcommand{\nlctpostexampletitle}{\vspace{1pt plus 1pt}\endgraf}%
+ \or
+ \renewcommand{\nlctpostexampletitle}{\smallskip\endgraf}%
+ \or
+ \renewcommand{\nlctpostexampletitle}{\medskip\endgraf}%
+ \fi
+ }
+
+\newcommand{\example at do@label}{%
+ \ifdefempty\nlct at example@label
+ {}%
+ {%
+ \ifdefempty\example at title{}%
+ {\protected at edef\@currentlabelname{\example at title}}%
+ \label{\nlct at example@label}%
+ \example at do@extag
+ }%
+}
\newcommand{\example at label@info}{}
+\newcommand{\nlct at example@label}{}
\define at key{nlctexample}{label}{%
\renewcommand{\example at label@info}{\glspercentchar\space Label: "#1"^^J}%
- \renewcommand*{\example at do@label}{\label{#1}}%
+ \renewcommand*{\nlct at example@label}{#1}%
}
+% v1.11+
+\newcommand{\example at do@extag}{}
+
+\newcommand{\nlctextag}[1]{%
+ \protected at write\@auxout{}{\string\nlctdoc at extag{#1}{\nlct at example@label}}%
+}
+
+\ExplSyntaxOn
+\newcommand{\nlctdoc at extag}[2]{
+ \clist_map_inline:nn { #1 }
+ {
+ \seq_if_exist:cF { g__nlctdoc_example_tag_ ##1 _seq }
+ {
+ \seq_new:c { g__nlctdoc_example_tag_ ##1 _seq }
+ }
+ \seq_gput_right:cn { g__nlctdoc_example_tag_ ##1 _seq } { #2 }
+ }
+}
+
+\int_new:N \l_nlctdoc_extag_item_threshold_int
+\int_set:Nn \l_nlctdoc_extag_item_threshold_int { 4 }
+
+% Syntax: \exampletagref{tag}{trailing punctuation}
+\NewDocumentCommand \exampletagref { m m }
+{
+ \seq_if_exist:cTF { g__nlctdoc_example_tag_ #1 _seq }
+ {
+ \seq_if_empty:cTF { g__nlctdoc_example_tag_ #1 _seq }
+ {
+ ??\PackageWarning { nlctuserguide }
+ { No ~ labels ~ found ~ for ~ tag ~ `#1' }
+ }
+ {
+ \exp_args:Ncx
+ \__nlctdoc_examplerefs:Nnn
+ { g__nlctdoc_example_tag_ #1 _seq }
+ { \seq_count:c { g__nlctdoc_example_tag_ #1 _seq } }
+ { #2 }
+ }
+ }
+ {
+ ??\PackageWarning { nlctuserguide }
+ { No ~ reference ~ found ~ for ~ tag ~ `#1' }
+ }
+}
+\cs_new:Nn \__nlctdoc_examplerefs:Nnn
+{
+ \int_compare:nNnTF { #2 } = { \c_one_int }
+ {
+ \exp_args:Nx \examplenameref { \seq_item:Nn #1 { \c_one_int } } #3
+ }
+ {
+ \int_compare:nNnTF
+ { #2 } < { \l_nlctdoc_extag_item_threshold_int }
+ {
+ \exp_args:Nx \examplesnameref { \seq_use:Nn #1 { , } } #3
+ }
+ {
+ \exampletagrefprelist
+ \begin{itemize}
+ \seq_map_indexed_inline:Nn #1
+ {
+ \item \ref{ ##2 }
+ \exampletagreflistpretitle
+ \nameref{ ##2 }
+ \int_compare:nNnTF
+ { ##1 } = { #2 }
+ { #3 } { \exampletagreflistsep }
+ }
+ \end{itemize}
+ }
+ }
+}
+\ExplSyntaxOff
+\newcommand{\exampletagreflistsep}{;}
+\newcommand{\exampletagreflistpretitle}{. }
+\newcommand{\exampletagrefprelist}{the following examples:}
+
+\define at key{nlctexample}{tag}{%
+ \renewcommand{\example at do@extag}{\nlctextag{#1}}%
+}
+
+\newcommand{\nlct at exbacklink}{}
+\define at key{nlctexample}{link}{%
+ \renewcommand{\nlct at exbacklink}{#1}%
+}
+
\newcounter{example}
\newcommand{\exampleattachtexicon}{\faPaperclip\textsuperscript\faFileTextO}
@@ -991,17 +1308,23 @@
\newcommand{\codepar}{\par\mbox{}\par}
+\newcommand{\glscmd}[1]{\glsentrytext{#1}}
+
\newcommand{\nlctexamplelets}{%
\let\gls\glsentrytext
+ \let\glssymbol\glsentrysymbol
\let\glscmd\glsentrytext
\let\env\@firstofone
\let\ctr\@firstofone
\let\texorpdfstring\@secondoftwo
+ \def\starredcs##1{\glsentrytext{##1}*}%
\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\commentnl##1{\glspercentchar\space ##1^^J}%
+ \def\commentdbsp##1{\glspercentchar\space ##1^^J\dbspace}%
\def\%{\glspercentchar}%
\edef\#{\expandafter\@gobble\string\#}%
% v1.10:
@@ -1011,6 +1334,17 @@
\def\codepar{^^J^^J}%
\def\marg##1{\glsopenbrace##1\glsclosebrace}%
\def\oarg##1{[##1]}%
+% v1.11:
+ \def\nl{^^J}%
+ \def\nlsp{^^J\space}%
+ \def\dbspace{\space\space}%
+ \def\dbdbspace{\dbspace\dbspace}%
+ \def\dbdbdbspace{\dbspace\dbspace\dbspace}%
+ \def\nldbsp{^^J\dbspace}%
+ \def\nldbdbsp{^^J\dbdbspace}%
+ \def\nldbdbdbsp{^^J\dbdbdbspace}%
+ \let\tabsym\nlctliteraltabchar
+ \let\visiblespace\space
}
\newcommand{\@create at example@write}{\@create at example@write at detok}
@@ -1017,8 +1351,8 @@
\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}%
+ {\glspercentchar\space This file is embedded in \jobname.pdf \nlct at v@version^^J}%
+ {\glspercentchar\space This file is an example from \jobname.pdf \nlct at v@version^^J}%
}
\newcommand{\@create at example@write at detok}[2]{%
@@ -1075,10 +1409,10 @@
\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}%
+ \edef\create at example@graphicsopts{width=\the\dimexpr(\linewidth-\create at example@pages at sep*(\create at example@pages at perrow-1))/\create at example@pages at perrow}
}{}%
- \@for\@nlct at page:=\create at example@pages\do{\hfill
- \s at example@image[page=\@nlct at page]{\nlct at image@file}\hfill}%
+ \@for\@nlct at page:=\create at example@pages\do{\hfil
+ \s at example@image[page=\@nlct at page]{\nlct at image@file}\hfil}%
}%
\@endfortrue
}%
@@ -1101,6 +1435,22 @@
\newcommand{\listofexamplesname}{List of Examples}
\newcommand{\listofexampleslabel}{\label{sec:listofexamples}}
+% v1.11:
+\newcommand{\listofexamplesheader}{%
+\par
+If an example shows the icon \exampleattachtexicon\ then the source
+code is embedded in the PDF as an attachment. If your PDF viewer
+supports attachments, you can extract the self-contained example
+file to try it out for yourself. Alternatively, you can click on the
+download icon \exampledownloadtexicon\ which will try downloading
+the example source code from your closest CTAN mirror, but make sure
+that this user manual matches the version on CTAN first. You can
+also try using:
+\texdocref{-l \jobname-example\meta{nnn}}
+where \meta{nnn} is the example number zero-padded to three digits
+to find out if the example files are installed on your device.\par
+\bigskip
+}
\ifdef\chapter
{
@@ -1109,12 +1459,12 @@
\newcommand{\listofexamples}{%
\@ifstar{\chapter*{\listofexamplesname}\@starttoc{loe}}%
- {\chapter{\listofexamplesname}\listofexampleslabel\@starttoc{loe}}}
+ {\chapter{\listofexamplesname}\listofexampleslabel\listofexamplesheader\@starttoc{loe}}}
}
{
\newcommand{\listofexamples}{%
\@ifstar{\section*{\listofexamplesname}\@starttoc{loe}}%
- {\section{\listofexamplesname}\listofexampleslabel\@starttoc{loe}}}
+ {\section{\listofexamplesname}\listofexampleslabel\listofexamplesheader\@starttoc{loe}}}
}
\newcommand{\l at example}{\l at table}
@@ -1126,10 +1476,24 @@
\newcommand{\nlctexampletag}{\Examplename~\theexample}
+\newcommand{\nlctbacklink}[1]{%
+ \ifdefempty\nlct at exbacklink
+ {%
+ \ifdefempty\nlct at example@label{}%
+ {%
+ \ifcsdef{r@\nlct at example@label-backref}%
+ {\hyperref[\nlct at example@label-backref]{\upsym}}%
+ {}%
+ }%
+ }%
+ {\hyperref[\nlct at exbacklink]{\upsym}}%
+ #1%
+}
+
\newcommand{\nlctexampletitlefmt}[1]{%
\nlctexampletitlefont
\raggedright\exhyphenpenalty 0 % space intended
- \nlctexampletag\ifstrempty{#1}{}{: #1}\par
+ \nlctbacklink{\nlctexampletag}\ifstrempty{#1}{}{: #1}\par
}
\newcommand{\nlct at ex@title at attachments}[2]{%
@@ -1158,17 +1522,6 @@
\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}%
@@ -1182,8 +1535,30 @@
\def\appfmt##1{\protect\appfmt{##1}}%
}
+\ExplSyntaxOn
+\newcommand{\example at filesize}[1]{
+ \file_size:n { \examplesdir / \nlct at example@filebasename #1 }
+}
+\newcommand{\example at filetimestamp}[1]{
+ \file_timestamp:n { \examplesdir / \nlct at example@filebasename #1 }
+}
+\newcommand\nlct at run[1]{
+ \sys_if_shell_unrestricted:TF
+ { \sys_shell_now:e { #1 } }
+ {
+ \PackageInfo { nlctuserguide }
+ {
+ Not ~ running ~ ` #1 ' \MessageBreak
+ Unrestricted ~ shell ~ not ~ enabled. ~
+ Execute ~ outside ~ of ~ TeX ~ and ~ rerun
+ }
+ }
+}
+\ExplSyntaxOff
+
\newcommand{\@createexample}[3][]{%
- \begingroup
+ \begin{minipage}[t]{\linewidth}%
+ \raggedright
\refstepcounter{example}%
\setkeys{nlctexample}{#1}%
\example at do@label
@@ -1225,13 +1600,7 @@
\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 run{\create at example@tex\space\nlct at example@filebasename.tex}%
\nlct at ifattachsupported
{%
\bgroup
@@ -1241,7 +1610,9 @@
\nlctexampletagattachfont
\textattachfile[mimetype={application/x-tex},
author={\@pdfauthor},color={0 0 0},
- size={\pdf at filesize{\examplesdir/\nlct at example@filebasename.tex}},
+ size={\example at filesize{.tex}},
+ created={\example at filetimestamp{.tex}},
+ modified={\example at filetimestamp{.tex}},
subject={\example at pdf@title\space (source code)},
description={\example at attachdesc\space (source code)}]%
{\examplesdir/\nlct at example@filebasename.tex}{\exampleattachtexicon}%
@@ -1255,7 +1626,9 @@
\space
\textattachfile[mimetype={application/pdf},
author={\@pdfauthor},color={0 0 0},
- size={\pdf at filesize{\examplesdir/\nlct at example@filebasename.pdf}},
+ size={\example at filesize{.pdf}},
+ created={\example at filetimestamp{.pdf}},
+ modified={\example at filetimestamp{.pdf}},
subject={\example at pdf@title\space (PDF)},
description={\example at attachdesc\space (PDF)}]%
{\examplesdir/\nlct at example@filebasename.pdf}{\exampleattachpdficon}%
@@ -1272,7 +1645,8 @@
\fi
\fi
}%
- \par\egroup\noindent
+ \nlctpostexampletitle
+ \egroup\noindent
}%
{%
\nlctexampletitlebox{\example at tex@title}\hfill
@@ -1280,11 +1654,13 @@
\href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.tex}}{\exampledownloadtexicon}
\quad
\href{\nlctdownloadlink{\examplesdir/\nlct at example@filebasename.pdf}}{\exampledownloadpdficon}
- \par\egroup\noindent
+ \nlctpostexampletitle
+ \egroup\noindent
\fi
}
\nlct at include@exampleimage
- \endgroup
+ \par
+ \end{minipage}%
}
\newenvironment{example}[2]{%
@@ -1367,6 +1743,7 @@
\def\dunderscore{\_}%
\let\-\empty
\let\csfmtfont\@firstofone
+ \let\NoCaseChange\@firstofone
}
\definecolor{cs}{rgb}{.328,.436,.1} % dark green
@@ -1387,7 +1764,11 @@
\newcommand*{\csfmtcolourfont}[1]{\texttt{\textcolor{cs}{#1}}}
\newcommand*{\csfmt}[1]{\csfmtfont{\codebackslash #1}}
+\newcommand*{\cspuncfmt}[1]{\csfmt{#1}} % v1.11
+\MFUblocker{\csfmt}% v1.11
+\MFUblocker{\cspuncfmt}% v1.11
+
\newcommand{\codebackslash}{\texorpdfstring{\char`\\}{\string\\}}
\newcommand{\csmetafmt}[3]{%
@@ -1399,8 +1780,54 @@
\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*}}}
+\newcommand{\starredcs}[1]{\gls{#1}[\csfmtfont{*}]}
+\newcommand{\starredenv}[1]{\gls{env.#1}[\envfmt{*}]} % v1.11
+\newcommand{\thectr}[1]{\glslink{ctr.#1}{\csfmt{the#1}}} % v1.11
+\newcommand{\theHctr}[1]{\glslink{ctr.#1}{\csfmt{theH#1}}} % v1.11
+
+\newcommand*{\glscsname}[2][]{\glslink[#1]{#2}{\csfmtfont{#2}}}
+
+% v1.11
+\NewDocumentCommand{\predcs}{O{}m}{%
+ \glsxtrifhasfield{explsuffix}{#2}%
+ {%
+ \let\explsuffix\glscurrentfieldvalue
+ \gls[#1]{#2}%
+ }%
+ {\gls[#1]{#2}}%
+}
+
+\NewDocumentCommand{\condcsT}{O{}m}{%
+ {%
+ \def\explTFsuffix{T}%
+ \gls[#1]{#2}%
+ }%
+}
+
+\NewDocumentCommand{\condcsF}{O{}m}{%
+ {%
+ \def\explTFsuffix{F}%
+ \gls[#1]{#2}%
+ }%
+}
+
+\newcommand*{\@expfunclink}[3]{\glslink[#3]{#2}{\csfmt{#1}}}
+
+\NewDocumentCommand{\expfunc}{O{}mm}{%
+ \ifglsentryexists{#2}%
+ {%
+ \glsxtrifhasfield{base}{#2}%
+ {%
+ \expandafter\@expfunclink\expandafter{\glscurrentfieldvalue:#3}{#2}{#1}%
+ }%
+ {%
+ \gls[#1]{#2}%
+ }%
+ }%
+ {\gls[#1]{#2:#3}}%
+}
+
\glsxtraddlabelprefix{dual.}
\glsxtraddlabelprefix{idx.}
\glsxtraddlabelprefix{idx.sym.}
@@ -1414,8 +1841,6 @@
\newdglsfield{name}{\idxn}
\newdglsfield{first}{\idxf}
-\newcommand*{\glscsname}[2][]{\glslink[#1]{#2}{\csfmtfont{#2}}}
-
\newcommand{\optionlistprefix}{opt.}
\newcommand{\optionlistitemformat}[1]{\glsentrytext{#1}}
\newcommand{\optionlisttag}{Option}
@@ -1436,7 +1861,7 @@
}
\newrobustcmd{\options}[1]{%
- {\def\andname{and}
+ {\def\andname{and}%
\let\glsseeitemformat\optionlistitemformat
\glsxtrtaggedlist{\optionlisttag}{\optionlisttags}{\optionlistprefix}{#1}%
}%
@@ -1524,6 +1949,7 @@
\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-}
@@ -1556,8 +1982,10 @@
}%
}
-\newrobustcmd*{\texmeta}[1]{{\normalfont\normalcolor$\langle$\emph{#1}$\rangle$}}
+\newcommand{\faded}[1]{\texorpdfstring{\textcolor{gray}{#1}}{#1}}
+\newrobustcmd*{\texmeta}[1]{{\normalfont$\langle$\emph{#1}$\rangle$}}
+
\newcommand*{\meta}[1]{%
\texorpdfstring{\ifmmode\text{\texmeta{#1}}\else\texmeta{#1}\fi}{\string<#1\string>}%
}
@@ -1593,6 +2021,9 @@
{#1}%
}
+\newcommand{\homedir}{\string~}% v1.11
+\newcommand{\homefilefmt}[1]{\filefmt{\homedir\slash#1}}
+
\newcommand*{\filefmt}[1]{\texorpdfstring{\texttt{#1}}{#1}}
\newcommand*{\extfmt}{\filefmt}
@@ -1654,7 +2085,11 @@
{}
\ifdef\backmatter
-{\appto\backmatter{\setupglossaries{numberedsection=nolabel}}}
+{
+ \appto\backmatter{%
+ \def\theHchapter{backmatter.\arabic{chapter}}%
+ \setupglossaries{numberedsection=nolabel}}%
+ }
{}
\ifdef\appendix
@@ -1691,7 +2126,13 @@
\ifdef\chapter
{
- \preto\chapter{\setcounterlevels{0}{chapter}}
+ \nlct at ifkoma
+ {
+ \AddtoDoHook{heading/preinit/chapter}{\setcounterlevels{0}{chapter}}
+ }
+ {
+ \preto\chapter{\setcounterlevels{0}{chapter}}
+ }
\setcounterlevels{0}{chapter}
}
{
@@ -1698,12 +2139,23 @@
\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}}
+\nlct at ifkoma
+ {
+ \AddtoDoHook{heading/preinit/part}{\setcounterlevels{-1}{part}}
+ \AddtoDoHook{heading/preinit/section}{\setcounterlevels{1}{section}}
+ \AddtoDoHook{heading/preinit/subsection}{\setcounterlevels{2}{subsection}}
+ \AddtoDoHook{heading/preinit/subsubsection}{\setcounterlevels{3}{subsubsection}}
+ \AddtoDoHook{heading/preinit/paragraph}{\setcounterlevels{4}{paragraph}}
+ \AddtoDoHook{heading/preinit/subparagraph}{\setcounterlevels{4}{subparagraph}}
+ }
+ {
+ \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}}
@@ -1716,6 +2168,10 @@
\createtarget{#1}{\glossentryname{#1}}%
}
+\renewcommand*{\GlsXtrStandaloneEntryOther}[2]{%
+ \createtarget{#1}{\glossentrynameother{#1}{#2}}%
+}
+
% \targetorhyperlink{label}{text}
\newcommand*{\targetorhyperlink}[2]{%
\glsxtrifhasfield*{target}{#1}%
@@ -1789,6 +2245,18 @@
\glsxtrglossentry{pkg.#2}%
}
+% v1.11
+\newrobustcmd*{\inlinefiledef}[2][filedef]{%
+ \mainglsadd{file.#2}{#1}%
+ \glsxtrglossentry{file.#2}%
+}
+
+% v1.11
+\newrobustcmd*{\inlineappdef}[2][appdef]{%
+ \mainglsadd{app.#2}{#1}%
+ \glsxtrglossentry{app.#2}%
+}
+
\newcommand*{\mainglsadd}[3][]{%
\ifstrempty{#3}%
{\def\mainglsaddcounter{}}%
@@ -1838,17 +2306,30 @@
\glsxtrifhasfield{syntax}{opt.#2}{\dequals\glscurrentfieldvalue}{}}%
}
+\newcommand{\@cmddef at init}{%
+ \let\csfmtfont\@firstofone
+ \def\cmdfont##1{\textbf{\texttt{##1}}}%
+ \def\explTFsuffix{\@explboolsyntaxfmt{TF}}%
+}
+
\newcommand*{\s at cmddef}[2][]{%
\def\cmdtitle{\icon{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}}}%
+ \@cmddef at init
\gathermodifiers{#2}%
+ \gathervariants{#2}%
\cmddefsyntax{#1}{#2}%
\def\tagsep{\hfill}%
- \ifdefempty\nlctmodifierlist{}%
+ \ifdefempty\nlctmodifierlist
+ {%
+ \ifdefempty\nlctvariantlist
+ {}%
+ {\tagsep\summarytagfmt{\nlctvarianttag}\nlctvariantlist\relax
+ \let\tagsep\space
+ }%
+ }%
{\tagsep\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist\relax
\let\tagsep\space
}%
@@ -1858,6 +2339,15 @@
\ifdefempty\nlctmodifierglslist{}%
{\@for\@nlct at label:=\nlctmodifierglslist\do
{\par\cmddefsyntax{#1}{\@nlct at label}}}%
+ \glsxtrifhasfield{explsuffix}{#2}%
+ {%
+ \let\explsuffix\glscurrentfieldvalue
+ \let\explTFsuffix\relax
+ \let\TFsyntax\relax
+ \par\texttt{\glsentryname{#2}%
+ \syntax{#2}}%
+ }%
+ {}%
\glsxtrifhasfield*{note}{#2}%
{%
\ifx\cmdnotefmt\@gobble
@@ -1898,6 +2388,29 @@
}%
}
+\newcommand{\gathervariants}[1]{%
+ \protected at edef\nlctcmddeflabel{#1}%
+ \def\nlctvarianttag{}%
+ \def\nlctvariantlist{}%
+ \def\nlctvariantglslist{}%
+ \glsxtrforcsvfield*{#1}{variants}{\cmddefvarianthandler}%
+}
+
+\newcommand{\cmddefvarianthandler}[1]{%
+ \ifglsentryexists{\nlctcmddeflabel:#1}%
+ {%
+ \ifdefempty\nlctvariantglslist
+ {\eappto\nlctvariantglslist{\nlctcmddeflabel#1}}%
+ {\eappto\nlctvariantglslist{,\nlctcmddeflabel#1}}%
+ }%
+ {%
+ \ifdefempty\nlctvariantlist
+ {\def\nlctvarianttag{variant}}%
+ {\def\nlctvarianttag{variants}\appto\nlctvariantlist{ }}%
+ \eappto\nlctvariantlist{\noexpand\code{#1}}%
+ }%
+}
+
\newrobustcmd*{\envdef}{\@ifstar\s at envdef\@envdef}
\newcommand*{\@envdef}[2][]{%
\pdfbookmark[\cmddefbookmarklevel]{\glsentryname{env.#2}}{env.#2}%
@@ -2041,26 +2554,44 @@
\noindent\ignorespaces
}
-\newcommand*{\defaultoptdefbookmarklevel}{\number\numexpr\currentcounterlevel+1 }
+\ExplSyntaxOn
+\newcommand*{\defaultoptdefbookmarklevel}{ \int_eval:n { \currentcounterlevel + \c_one_int } }
+\ExplSyntaxOff
\newcommand*{\optdefbookmarklevel}{\defaultoptdefbookmarklevel}
\newrobustcmd*{\optiondef}{\@ifstar\s at optiondef\@optiondef}
-\newcommand*{\@optiondef}[1]{%
- \glsifcategory{opt.#1}{commandoption}%
+\NewDocumentCommand{\@optiondef}{ t+ o m }{%
+ \IfBooleanTF{#1}%
{%
- \edef\optdefbookmarklevel{\number\numexpr\cmddefbookmarklevel+1 }%
+ \edef\optdefbookmarklevel{\defaultoptdefbookmarklevel}%
}%
{%
- \edef\optdefbookmarklevel{\defaultoptdefbookmarklevel}%
+ \IfValueTF{#2}%
+ {%
+ \edef\optdefbookmarklevel{\number#2}%
+ }%
+ {%
+ \glsifcategory{opt.#3}{commandoption}%
+ {%
+ \edef\optdefbookmarklevel{\number\numexpr\cmddefbookmarklevel+1 }%
+ }%
+ {%
+ \edef\optdefbookmarklevel{\defaultoptdefbookmarklevel}%
+ }%
+ }%
}%
- \pdfbookmark[\optdefbookmarklevel]{\glsentryname{opt.#1}}{optdef.#1}%
- \nopagebreak\s at optiondef{#1}%
+ \pdfbookmark[\optdefbookmarklevel]{\glsentryname{opt.#3}}{optdef.#3}%
+ \nopagebreak\s at optiondef{#3}%
}
\newcommand{\optnotefmt}[1]{#1}
+\newcommand{\optiondefhook}{}% v1.11
+
\newcommand*{\s at optiondef}[1]{%
+ \bgroup
+ \optiondefhook
\getinitordefval{opt.#1}%
\def\postnote{}%
\ifnotdefaultstatus{opt.#1}%
@@ -2086,6 +2617,7 @@
{\ifdefempty\postnote{}{\preto\postnote{\hfill}}}%
\postnote
\end{settingsbox}%
+ \egroup
\noindent\ignorespaces
}
@@ -2314,6 +2846,9 @@
\newcommand{\glsbibwritefield}[2]{,^^J#1={\detokenize{#2}}}
\glsaddstoragekey{modifiers}{}{\modifiers}
+\glsaddstoragekey{variants}{}{\variants}
+\glsaddstoragekey{base}{}{\fnbase}
+\glsaddstoragekey{explsuffix}{}{\explsuffixfield}
\glsaddstoragekey{syntax}{}{\syntax}
\glsaddstoragekey{defaultvalue}{}{\optdefval}
\glsaddstoragekey{initvalue}{}{\optinitval}
@@ -2321,6 +2856,7 @@
\glsaddstoragekey{note}{}{\note}
\glsaddstoragekey{providedby}{}{\providedbyinfo}
\glsaddstoragekey{pdftitlecasename}{}{\pdftitlecasename}
+\glsaddstoragekey{extra}{}{\glsextra}
\glsaddstoragekey{defaultkeys}{}{\defaultkeys}
@@ -2332,6 +2868,12 @@
\newcommand{\conditionsyntax}{ \meta{true}\csfmt{else} \meta{false}\csfmt{fi}}
+\newrobustcmd{\@explboolsyntaxfmt}[1]{\underline{\emph{#1}}}
+
+\newcommand{\explsuffix}{}
+\newcommand{\explTFsuffix}{TF}
+\newcommand{\TFsyntax}{\margm{true} \margm{false}}
+
\newrobustcmd{\initvalnotefmt}[1]{\textrm{\em #1}}
\newcommand{\nlctuserguidebibextrapreamble}{}
@@ -2349,6 +2891,7 @@
\def\name{\glsbibwritefield{name}}%
\def\desc{\glsbibwritefield{description}}%
\def\defval{\glsbibwritefield{defaultvalue}}%
+ \def\defvalempty{\glsbibwritefield{defaultvalue}{\initvalnotefmt{empty}}}%
\def\initval{\glsbibwritefield{initvalue}}%
\def\initvalvaries{\glsbibwritefield{initvalue}{\initvalnotefmt{varies}}}%
\def\initvalempty{\glsbibwritefield{initvalue}{\initvalnotefmt{empty}}}%
@@ -2366,7 +2909,11 @@
\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\gcmdpunc##1##2##3{\glsbibwriteentry{command}{##1}{\field{name}{\cspuncfmt{##2}}##3}}%
\def\gcond##1##2{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1}}\syntax{\conditionsyntax}##2}}%
+ \def\gexplcond##1##2##3{\glsbibwriteentry{command}{##1:##2}{\field{name}{\csfmt{##1\explsuffix:##2\explTFsuffix}}##3}}%
+ \def\gexplpred##1##2##3{\glsbibwriteentry{command}{##1:##2}{\field{name}{\csfmt{##1\explsuffix:##2\explTFsuffix}}\field{explsuffix}{\dsb p}##3}}%
+ \def\gfn##1##2##3##4{\glsbibwriteentry{command}{##1}{\field{name}{\csfmt{##1:##2}}\field{variants}{##3}\field{base}{##1}##4}}%
\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}}%
@@ -2406,6 +2953,7 @@
\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\cspuncfmt}[1]{\string\glsbackslash\glshashchar1}^^J
\string\providecommand{\string\dhyphen}{-}^^J
\string\providecommand{\string\longargfmt}{--}^^J
\string\providecommand{\string\shortargfmt}{-}^^J
@@ -2480,6 +3028,8 @@
\newcommand{\nlctuserguideletterrules}{\glsxtrGeneralLatinIrules}
\newcommand{\nlctuserguideextrarules}{\string< \glsxtrMathItalicGreekIrules}
+\renewcommand*{\glsxtrresourceinit}{\GlsXtrResourceInitEscSequences}
+
\newcommand{\nlctuserguideloadgls}[1]{%
\GlsXtrLoadResources[src=\jobname-gls,
break-at-not-match={original entrytype=(switchpunctuation|punctuation|command)},
@@ -2518,10 +3068,13 @@
icon=symbol,
\nlctuserguidecustomentryaliases
},
- replicate-fields={name=pdftitlecasename},
- replicate-missing-field-action={fallback},
- interpret-fields={pdftitlecasename},
- field-case-change={pdftitlecasename=title},
+ assign-fields=
+ {
+ sort = name + "¯" + extra ,
+ pdftitlecasename = \INTERPRET { \FIRSTUC { name } }
+ [ entrytype->original =/term|index/ ] ,
+ pdftitlecasename = name
+ },
category={same as original entry},
dual-category={same as primary},
combine-dual-locations={primary},
@@ -2537,6 +3090,8 @@
save-child-count,save-root-ancestor,
symbol-sort-fallback=name,
not-match={original entrytype=(icon|nonindexed)},
+ labelify-replace={{\string\\-}{}},
+ labelify={alias},
#1
]%
\GlsXtrLoadResources[src=\jobname-gls,
@@ -2730,6 +3285,8 @@
}
\newcommand{\summaryentrycommand}[1]{%
+ \bgroup
+ \def\explTFsuffix{\@explboolsyntaxfmt{TF}}%
\textbf{\linkedentryname{#1}}%
\syntax{#1}%
\glsxtrifhasfield{initvalue}{#1}%
@@ -2739,12 +3296,31 @@
}%
{%
\gathermodifiers{#1}%
- \ifdefempty\nlctmodifierlist{}%
+ \ifdefempty\nlctmodifierlist
{%
+ \gathervariants{#1}%
+ \ifdefempty\nlctvariantlist
+ {}%
+ {%
+ \hfill\summarytagfmt{\nlctvarianttag}\nlctvariantlist
+ \gdef\summaryentry at post@fill{\quad }%
+ }%
+ }%
+ {%
\hfill\summarytagfmt{\nlctmodifiertag}\nlctmodifierlist
\gdef\summaryentry at post@fill{\quad }%
}%
}%
+ \glsxtrifhasfield{explsuffix}{#1}%
+ {%
+ \let\explsuffix\glscurrentfieldvalue
+ \let\explTFsuffix\relax
+ \let\TFsyntax\relax
+ \par\glossentryname{#1}%
+ \syntax{#1}%
+ }%
+ {}%
+ \egroup
}
\newcommand{\summaryentrypackageoption}{\summaryentryoption}
@@ -2803,7 +3379,8 @@
\newglossarystyle{summary}
{%
\renewenvironment{theglossary}%
- {\setlength{\parindent}{0pt}%
+ {%
+ \setlength{\parindent}{0pt}%
\setlength{\parskip}{0pt plus 0.3pt}%
\raggedbottom
\def\entryskip{\def\entryskip{\summaryentryskip}}%
@@ -2950,7 +3527,7 @@
\syntax{##2}%
}%
}%
- \ifstrempty{##3}{}{\marginpar{\summaryloc{##3}}}%
+ \ifstrempty{##3}{}{\summarymarginpar{\summaryloc{##3}}}%
\do at alias
{%
\summaryentry at post@fill
@@ -3143,7 +3720,9 @@
\preto\glossarypreamble{\glsadd[format=summarylocfmt]{#2}\createtarget{#2}{\strut}}%
\ifglshasdesc{#2}%
{%
- \appto\glossarypreamble{\glossentrydesc{#2}\glspostdescription
+ \appto\glossarypreamble{%
+ \def\glscurrententrylabel{#2}%
+ \glossentrydesc{#2}\glspostdescription
\glspar\medskip\glspar}%
}{}%
\renewcommand{\GlsXtrLocationField}{primarylocations}%
@@ -3165,18 +3744,43 @@
}%
}
+\ExplSyntaxOn
+\cs_if_exist:NT \glsxtrbookindexsubsubitem
+{
+ \renewcommand{\glsxtrbookindexsubsubitem}[1]{
+ \glstreeitem \hspace* { \dim_eval:n { #10 pt + 10pt } }
+ }
+}
+\ExplSyntaxOff
+
+% v1.11:
+\newcommand{\nlctindexfirstmark}{}
+\newcommand{\nlctindexlastmark}{}
+\newcommand\nlctprebookindex{}
+\newcommand\nlctindexmarkfmt[1]{{\small#1}}
+
\newcommand*{\printuserguideindex}[1][]{%
\printunsrtglossary*[label=index,type=index,target=false,title=\indexname,style=bookindex,#1]%
{%
- \let\glsextrapostnamehook\statushook
+ \renewcommand{\nlctindexfirstmark}{%
+ \nlctindexmarkfmt\glsxtrbookindexfirstmark}%
+ \renewcommand{\nlctindexlastmark}{%
+ \nlctindexmarkfmt\glsxtrbookindexlastmark}%
+ \renewcommand\glsextrapostnamehook[1]{%
+ \statushook{##1}%
+ \glsxtrifhasfield{extra}{##1}{ (\glscurrentfieldvalue)}{}%
+ }%
\renewcommand*{\glsxtrbookindexprelocation}[1]{%
\glsxtrifhasfield{location}{##1}%
{\,\textcolor{lightgray}{\dotfill}\,}%
{}%
}%
- \let\printunsrtglossaryentryprocesshook\filteremptylocation
- \let\glsxtrbookindexname\linkedentryname
+ \renewcommand*\glsxtrbookindexname[1]{%
+ \linkedentryname{##1}\nlctpostindexname{##1}}%
+ \renewcommand*{\glsxtrbookindexsubname}[1]{\linkedentryname{##1}}%
+ \let\printunsrtglossaryentryprocesshook\filteremptylocation
\def\printunsrtglossarypredoglossary{%
+ \nlctprebookindex
\ifnum\totalindexitems<21\relax
\renewcommand*{\glsxtrbookindexmulticolsenv}{multicols*}%
\fi}%
More information about the tex-live-commits
mailing list.