summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-05-12 03:03:03 +0000
committerNorbert Preining <norbert@preining.info>2020-05-12 03:03:03 +0000
commit675bcc9067ccef91624a9eca025506a4ce1d37b3 (patch)
tree03c68d83f091c038ad751310955938e407b46ff4 /macros
parentfd95e879442e050790f06552eb074eeb7c5b4cab (diff)
CTAN sync 202005120303
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/caption/README2
-rw-r--r--macros/latex/contrib/caption/caption.dtx123
-rw-r--r--macros/latex/contrib/caption/caption3.dtx604
-rw-r--r--macros/latex/contrib/draftwatermark/README34
-rw-r--r--macros/latex/contrib/draftwatermark/README.md33
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.dtx105
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.ins36
-rw-r--r--macros/latex/contrib/draftwatermark/draftwatermark.pdfbin182386 -> 264359 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/README3
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/lecturebib-english.pdfbin85104 -> 85104 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/lecturehandout-english.pdfbin57923 -> 57923 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/lecturepresentation-english.pdfbin84606 -> 84606 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/lectureprogram-english.pdfbin56905 -> 56905 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/lecturescript-english.pdfbin34575 -> 34575 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/membertable-blank-english.pdfbin28442 -> 28442 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/membertable-filled-english.pdfbin28450 -> 28450 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/presencetable-blank-english.pdfbin27974 -> 27974 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/presencetable-filled-english.pdfbin26752 -> 26752 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/English/presentation-list-english.pdfbin25688 -> 25688 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/lecturebib.pdfbin85488 -> 85488 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/lecturehandout.pdfbin59148 -> 59148 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/lecturepresentation.pdfbin84992 -> 84992 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/lectureprogram.pdfbin57899 -> 57899 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/lecturescript.pdfbin34772 -> 34772 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/membertable-blank.pdfbin28387 -> 28387 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/membertable-filled.pdfbin28509 -> 28509 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/presencetable-blank.pdfbin27896 -> 27896 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/presencetable-filled.pdfbin26784 -> 26784 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/examples/German/presentation-list.pdfbin26864 -> 26864 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/jslectureplanner.pdfbin457635 -> 478838 bytes
-rw-r--r--macros/latex/contrib/jslectureplanner/jslectureplanner.sty284
-rw-r--r--macros/latex/contrib/jslectureplanner/jslectureplanner.tex266
-rw-r--r--macros/latex/contrib/jslectureplanner/jsmembertable.sty4
-rw-r--r--macros/latex/contrib/l3kernel/CHANGELOG.md8
-rw-r--r--macros/latex/contrib/l3kernel/README.md2
-rw-r--r--macros/latex/contrib/l3kernel/expl3.dtx19
-rw-r--r--macros/latex/contrib/l3kernel/expl3.pdfbin584652 -> 584772 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.pdfbin1544267 -> 1544205 bytes
-rw-r--r--macros/latex/contrib/l3kernel/interface3.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3.ins2
-rw-r--r--macros/latex/contrib/l3kernel/l3alloc.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3basics.dtx85
-rw-r--r--macros/latex/contrib/l3kernel/l3bootstrap.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3box.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3candidates.dtx43
-rw-r--r--macros/latex/contrib/l3kernel/l3clist.dtx171
-rw-r--r--macros/latex/contrib/l3kernel/l3coffins.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3color-base.dtx23
-rw-r--r--macros/latex/contrib/l3kernel/l3debug.dtx51
-rw-r--r--macros/latex/contrib/l3kernel/l3deprecation.dtx18
-rw-r--r--macros/latex/contrib/l3kernel/l3doc.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3docstrip.pdfbin263236 -> 263360 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3expan.dtx116
-rw-r--r--macros/latex/contrib/l3kernel/l3file.dtx160
-rw-r--r--macros/latex/contrib/l3kernel/l3final.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3flag.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3format.ins2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-assign.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-aux.dtx47
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-basics.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-convert.dtx6
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-expo.dtx6
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-extended.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-logic.dtx28
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-parse.dtx46
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-random.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-round.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-traps.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp-trig.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fp.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3fparray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3int.dtx81
-rw-r--r--macros/latex/contrib/l3kernel/l3intarray.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3kernel-functions.dtx100
-rw-r--r--macros/latex/contrib/l3kernel/l3keys.dtx166
-rw-r--r--macros/latex/contrib/l3kernel/l3legacy.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3luatex.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3msg.dtx51
-rw-r--r--macros/latex/contrib/l3kernel/l3names.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3news.pdfbin379228 -> 379248 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news01.pdfbin113529 -> 113529 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news02.pdfbin140777 -> 140776 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news03.pdfbin137983 -> 144784 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news04.pdfbin107122 -> 107117 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news05.pdfbin105090 -> 105090 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news06.pdfbin140797 -> 140797 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news07.pdfbin119092 -> 119092 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news08.pdfbin152413 -> 152413 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news09.pdfbin235516 -> 235323 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news10.pdfbin140297 -> 147096 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news11.pdfbin159154 -> 165956 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3news12.pdfbin192383 -> 199153 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3prefixes.pdfbin75066 -> 75066 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3prg.dtx46
-rw-r--r--macros/latex/contrib/l3kernel/l3prop.dtx66
-rw-r--r--macros/latex/contrib/l3kernel/l3quark.dtx399
-rw-r--r--macros/latex/contrib/l3kernel/l3regex.dtx53
-rw-r--r--macros/latex/contrib/l3kernel/l3seq.dtx34
-rw-r--r--macros/latex/contrib/l3kernel/l3skip.dtx40
-rw-r--r--macros/latex/contrib/l3kernel/l3sort.dtx78
-rw-r--r--macros/latex/contrib/l3kernel/l3str-convert.dtx150
-rw-r--r--macros/latex/contrib/l3kernel/l3str.dtx140
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.pdfbin279985 -> 280109 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3styleguide.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.pdfbin228282 -> 228403 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3syntax-changes.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3sys.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.pdfbin186503 -> 186619 bytes
-rw-r--r--macros/latex/contrib/l3kernel/l3term-glossary.tex2
-rw-r--r--macros/latex/contrib/l3kernel/l3text-case.dtx56
-rw-r--r--macros/latex/contrib/l3kernel/l3text-purify.dtx45
-rw-r--r--macros/latex/contrib/l3kernel/l3text.dtx96
-rw-r--r--macros/latex/contrib/l3kernel/l3tl-analysis.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/l3tl.dtx203
-rw-r--r--macros/latex/contrib/l3kernel/l3token.dtx93
-rw-r--r--macros/latex/contrib/l3kernel/l3unicode.dtx2
-rw-r--r--macros/latex/contrib/l3kernel/source3.pdfbin5830603 -> 5890263 bytes
-rw-r--r--macros/latex/contrib/l3kernel/source3.tex2
-rw-r--r--macros/latex/contrib/l3kernel/source3body.tex2
-rw-r--r--macros/latex/contrib/longdivision/README.md31
-rw-r--r--macros/latex/contrib/longdivision/longdivision.sty956
-rw-r--r--macros/latex/contrib/longdivision/longdivision_manual.pdfbin135922 -> 155728 bytes
-rw-r--r--macros/latex/contrib/longdivision/longdivision_manual.tex88
-rw-r--r--macros/latex/contrib/tasks/README11
-rw-r--r--macros/latex/contrib/tasks/tasks-manual.pdfbin464408 -> 464450 bytes
-rw-r--r--macros/latex/contrib/tasks/tasks.sty13
127 files changed, 3600 insertions, 1783 deletions
diff --git a/macros/latex/contrib/caption/README b/macros/latex/contrib/caption/README
index fc43fccd45..317e095646 100644
--- a/macros/latex/contrib/caption/README
+++ b/macros/latex/contrib/caption/README
@@ -1,7 +1,7 @@
==========================================================================
The `caption' package bundle
-Release 2020-01-22
+Release 2020-05-10
Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
License: LPPL = LaTeX Project Public Licence
diff --git a/macros/latex/contrib/caption/caption.dtx b/macros/latex/contrib/caption/caption.dtx
index 1c5a196e13..06c2832c70 100644
--- a/macros/latex/contrib/caption/caption.dtx
+++ b/macros/latex/contrib/caption/caption.dtx
@@ -28,7 +28,7 @@
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{3044}
+% \CheckSum{2977}
%
% \iffalse
%<*driver>
@@ -218,13 +218,13 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption}[2020/01/03 v3.4h Customizing captions (AR)]
+\ProvidesPackage{caption}[2020/05/10 v3.4j Customizing captions (AR)]
% \end{macrocode}
%
% \section{Loading the kernel}
%
% \begin{macrocode}
-\RequirePackage{caption3}[2020/01/03] % needs v1.8h or newer
+\RequirePackage{caption3}[2020/05/10] % needs v1.10 or newer
% \end{macrocode}
%
% \section{Check against unknown document classes}
@@ -282,123 +282,6 @@
%
% \section{Declaration of options}
%
-% \subsection{Options for figure and table}
-%
-% \changes{v3.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
-% \begin{macrocode}
-\DeclareCaptionOption{figureposition}{%
- \captionsetup*[figure]{position=#1}}
-\@onlypreamble@key{caption}{figureposition}
-% \end{macrocode}
-% \begin{macrocode}
-\DeclareCaptionOption{tableposition}{%
- \captionsetup*[table]{position=#1}}
-\@onlypreamble@key{caption}{tableposition}
-% \end{macrocode}
-%
-% \changes{v3.0d}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
-% \changes{v3.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
-% \changes{v3.1f}{2007/11/18}{Option \opt{name} added}
-% \begin{macrocode}
-\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
-\@onlypreamble@key{caption}{figurename}
-\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
-\@onlypreamble@key{caption}{tablename}
-% \end{macrocode}
-%
-% \changes{v3.1g}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
-% \begin{macrocode}
-\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
-\@onlypreamble@key{caption}{listfigurename}
-\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
-\@onlypreamble@key{caption}{listtablename}
-% \end{macrocode}
-%
-% \begin{macro}{\caption@SetName}
-% \changes{v3.1}{2007/07/04}{This macro added}
-% \changes{v3.1f}{2007/11/18}{After-preamble variant added}
-% \changes{v3.1g}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
-% \changes{v3.1i}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
-% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
-% \changes{v3.2f}{2012/01/12}{Bugfix: Uses \cs{caption@NewFloat} now}
-% |\caption@SetName|\marg{float}\marg{name}
-% \begin{macrocode}
-\newcommand*\caption@SetName[2]{%
- \caption@NewFloat{\newfloat@setname{#1}{#2}}}
-\@onlypreamble\caption@SetName
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-\DeclareCaptionOption{name}{\caption@setname\@captype{#1}}
-% \end{macrocode}
-% \begin{macro}{\caption@setname}
-% |\caption@setname|\marg{float}\marg{name}
-% \begin{macrocode}
-\newcommand*\caption@setname[2]{%
- \@namedef{#1name}{#2}}
-% \end{macrocode}
-% \end{macro}
-%
-% \changes{v3.1f}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
-% \changes{v3.1i}{2008/04/13}{Option \opt{within} added}
-% \changes{v3.1l}{2010/01/09}{The \opt{within} options are now available within the document, too}
-% \changes{v3.1l}{2010/01/09}{The global \opt{within} option will now affect user-defined
-% floats declared with \cs{DeclareCaptionType}, too}
-%
-% \begin{macro}{\caption@DeclareWithinOption}
-% \changes{v3.1l}{2010/01/09}{This macro and its usage added}
-% |\caption@DeclareWithinOption|\marg{float}
-% declares the options \meta{float}\texttt{within} and \meta{float}\texttt{without},
-% e.g. \texttt{figurewithin} and \texttt{figurewithout}.
-% \begin{macrocode}
-\newcommand*\caption@DeclareWithinOption[1]{%
- \DeclareCaptionOption{#1within}{\caption@Within{#1}{##1}}%
- \DeclareCaptionOptionNoValue{#1without}{\caption@Within{#1}{none}}}
-\@onlypreamble\caption@DeclareWithinOption
-% \end{macrocode}
-% \end{macro}
-% \begin{macrocode}
-\caption@DeclareWithinOption{figure}
-\caption@DeclareWithinOption{table}
-% \end{macrocode}
-% \begin{macrocode}
-\DeclareCaptionOption{within}{%
- \caption@NewFloat{\newfloatsetup{within=#1}}}
-\DeclareCaptionOptionNoValue{without}{%
- \caption@NewFloat{\newfloatsetup{without}}}
-% \end{macrocode}
-% \begin{macro}{\caption@Within}
-% \changes{v3.1}{2007/12/21}{This macro added}
-% \changes{v3.2d}{2011/10/29}{Outsourced to \package{newfloat} package}
-% \changes{v3.2f}{2012/01/12}{Bugfix: Uses \cs{caption@NewFloat} now}
-% |\caption@Within|\marg{float}\marg{value}
-% \begin{macrocode}
-\newcommand*\caption@Within[2]{%
- \caption@NewFloat{\newfloat@setwithin{#1}{#2}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@NewFloat}
-% \changes{v3.2f}{2012/01/12}{This macro added}
-% \changes{v3.4h}{2020/01/03}{Usage of \cs{caption@ifpackageloaded} replaced by \cs{RequirePackage}}
-% |\caption@NewFloat|\marg{code}
-% loads the \package{newfloat} package and executes the given code afterwards.
-% Note: Since the \package{newfloat} package uses the crappy \package{keyval}
-% package, too, we need to save \& restore some macros here, otherwise this
-% recursion won't work properly.
-% {\itshape (TODO: Re-write \package{newfloat} so it uses \package{kvoptions} instead.)}
-% \begin{macrocode}
-\newcommand*\caption@NewFloat[1]{%
- \let\KV@prefix@ORI\KV@prefix
- \let\@tempc@ORI\@tempc
- \caption@ifdefined\newfloatsetup{}{\RequirePackage{newfloat}}%
- #1%
- \let\@tempc\@tempc@ORI
- \let\KV@prefix\KV@prefix@ORI}
-% \end{macrocode}
-% \end{macro}
-%
% \subsection{Miscellaneous options}
%
% \begin{macrocode}
diff --git a/macros/latex/contrib/caption/caption3.dtx b/macros/latex/contrib/caption/caption3.dtx
index 5cd6a8d9ea..7319d178df 100644
--- a/macros/latex/contrib/caption/caption3.dtx
+++ b/macros/latex/contrib/caption/caption3.dtx
@@ -28,7 +28,7 @@
% caption-deu.tex, caption-eng.tex, caption-rus.tex.
%
% \fi
-% \CheckSum{3476}
+% \CheckSum{3573}
%
% \iffalse
%<*driver>
@@ -191,7 +191,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{caption3}[2020/01/03 v1.8h caption3 kernel (AR)]
+\ProvidesPackage{caption3}[2020/05/10 v1.11 caption3 kernel (AR)]
% \end{macrocode}
%
% \section{Workaround for bug in package \package{arabtex}}
@@ -773,7 +773,6 @@
% \begin{macro}{\caption@checkoptions}
% \changes{v1.8h}{2020/01/03}{This macro added}
% Check the syntax of the given options by executing them inside a group.
-% (This way the \package{ragged2e} package check will be done for these options, too.)
% \begin{macrocode}
\newcommand*\caption@checkoptions[1]{%
\begingroup
@@ -781,11 +780,21 @@
\caption@setup{#1}%
\endgroup}
% \end{macrocode}
-% Some caption options depend on the definition of |\@captype|,
-% so we set it to |figure| before executing them.
% \begin{macrocode}
-\newcommand*\caption@prepare@optioncheck{%
- \def\@captype{figure}}
+\providecommand*\caption@prepare@optioncheck{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfCaptionOptionCheck}
+% \changes{v1.10}{2020/05/10}{This macro added}
+% |\IfCaptionOptionCheck|\marg{yes-code}\marg{no-code}
+% executes the \meta{yes-code} if options are just checked for syntax, and \meta{no-code} if not.
+% \begin{macrocode}
+\let\IfCaptionOptionCheck\@secondoftwo
+% \end{macrocode}
+% \begin{macrocode}
+\g@addto@macro\caption@prepare@optioncheck{%
+ \let\IfCaptionOptionCheck\@firstoftwo}
% \end{macrocode}
% \end{macro}
%
@@ -1078,17 +1087,17 @@
% will both be mapped to \meta{code} with \meta{package} and \meta{options}
% as arguments |#1| and |#2|. (This helps avoiding ``Option clash'' errors.)
% \begin{macrocode}
-\newcommand*\caption@packagelist{}
-\@onlypreamble\caption@packagelist
-% \end{macrocode}
-% \begin{macrocode}
\newcommand\caption@SetupOptions[2]{%
\@namedef{caption@setkeys@#1}##1##2{#2}%
\expandafter\@onlypreamble\csname caption@setkeys@#1\endcsname
- \@cons\caption@packagelist{{#1}}}
+ \@cons\caption@SetupOptions@list{{#1}}}
\@onlypreamble\caption@SetupOptions
% \end{macrocode}
% \begin{macrocode}
+\newcommand*\caption@SetupOptions@list{}
+\@onlypreamble\caption@SetupOptions@list
+% \end{macrocode}
+% \begin{macrocode}
\let\caption@onefilewithoptions\@onefilewithoptions
\def\@onefilewithoptions#1[#2]{%
\begingroup
@@ -1104,7 +1113,7 @@
\caption@ExecuteOptions{#1}{#2}%
\caption@onefilewithoptions{#1}[]}%
\fi}
- \caption@packagelist
+ \caption@SetupOptions@list
\@tempa}
\@onlypreamble\caption@onefilewithoptions
% \end{macrocode}
@@ -1891,16 +1900,44 @@
% \changes{v1.0a}{2004/01/22}{Bugfix: Multi token arguments are allowed now}
% \changes{v1.1}{2007/05/07}{Internal: Uses \cs{caption@fnt} instead of \cs{caption@temp} now}
% \changes{v1.8h}{2020/01/03}{Check for \package{ragged2e} package related options added}
-% |\DeclareCaptionFont|\marg{name}\marg{code}
+% \changes{v1.10}{2020/05/10}{Optional argument \opt{package} added}
+% |\DeclareCaptionFont|\oarg{package}\marg{name}\marg{code}
% \begin{macrocode}
-\newcommand*\DeclareCaptionFont[2]{%
- \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#2}}}
+\newcommand*\DeclareCaptionFont{%
+ \@ifnextchar[%]
+ \caption@declare@font
+ \caption@declarefont}
\@onlypreamble\DeclareCaptionFont
% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@addto@fnt[1]{%
- \caption@check@ragged{#1}%
- \l@addto@macro\caption@fnt{#1}}
+\def\caption@declare@font[#1]#2{%
+ \global\@namedef{caption@fnt@#2@package}{#1}%
+ \caption@@declarefont{#2}}
+\@onlypreamble\caption@declare@font
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@declarefont[1]{%
+ \global\@nameundef{caption@fnt@#1@package}%
+ \caption@@declarefont{#1}}
+\@onlypreamble\caption@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@declarefont[2]{%
+ \define@key{caption@fnt}{#1}[]{\caption@addto@fnt{#1}{#2}}%
+ \caption@@@declarefont{#1}{#2}}
+\@onlypreamble\caption@@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@@declarefont[2]{}% will be used by \DeclareCaptionJustification
+\@onlypreamble\caption@@@declarefont
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@addto@fnt[2]{%
+ \expandafter\let\expandafter\caption@package\csname caption@fnt@#1@package\endcsname
+ \caption@ifdefined\caption@package
+ {\caption@requirepackage\caption@package{#1}}% load package, if necessary
+ {}%
+ \l@addto@macro\caption@fnt{#2}}
% \end{macrocode}
% \end{macro}
%
@@ -2078,26 +2115,8 @@
\DeclareCaptionFont{larger}{\caption@larger}
% \end{macrocode}
%
-% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
-% \begin{macrocode}
-\DeclareCaptionFont{sansmath}{\sansmath}
-% \end{macrocode}
-%
-% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
-% \changes{v1.2d}{2009/10/09}{Bugfix 09-05-18: \package{setspace} package support revised}
-% \begin{macrocode}
-\DeclareCaptionFont{singlespacing}{%
- \caption@ifdefined\setspace@singlespace{%
- \setstretch\setspace@singlespace}{}}% normally 1
-\DeclareCaptionFont{onehalfspacing}{%
- \caption@setspace{onehalfspacing}\onehalfspacing\relax}
-\DeclareCaptionFont{doublespacing}{%
- \caption@setspace{doublespacing}\doublespacing\relax}
-\DeclareCaptionFont{stretch}{%
- \caption@setspace{stretch}\setstretch\@gobble{#1}}
-% \end{macrocode}
% \begin{macrocode}
-\newcommand*\caption@setspace{\caption@ifpackageloaded{setspace}}
+\DeclareCaptionFont{singlespacing}{}
% \end{macrocode}
%
% \begin{macrocode}
@@ -2128,9 +2147,11 @@
% \changes{v1.1}{2007/07/03}{Mapped to \cs{DeclareCaptionFont}}
% |\DeclareCaptionJustification|\marg{name}\marg{code}
% \begin{macrocode}
-\newcommand*\DeclareCaptionJustification[2]{%
- \global\@namedef{caption@hj@#1}{#2}% for compatibility to v1.0
- \DeclareCaptionFont{#1}{#2}}
+\newcommand*\DeclareCaptionJustification{%
+ \def\caption@@@declarefont##1##2{%
+ \global\@namedef{caption@hj@##1}{##2}% for compatibility to v1.0, needed by floatrow package
+ \let\caption@@@declarefont\@gobbletwo}%
+ \DeclareCaptionFont}
\@onlypreamble\DeclareCaptionJustification
% \end{macrocode}
% \end{macro}
@@ -2203,119 +2224,6 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{The ragged2e package}
-% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
-% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
-%
-% We also support the upper-case commands offered by the \package{ragged2e}
-% package.
-% Note that these just map to their lower-case variants if the
-% \package{ragged2e} package is not available.
-% \begin{macrocode}
-\DeclareCaptionJustification{Centering}{\caption@Centering}
-\DeclareCaptionJustification{RaggedLeft}{\caption@RaggedLeft}
-\DeclareCaptionJustification{RaggedRight}{\caption@RaggedRight}
-% \end{macrocode}
-% \begin{macrocode}
-\newcommand*\caption@Centering{%
- \caption@ragged{Centering}\Centering\centering}
-\newcommand*\caption@RaggedLeft{%
- \caption@ragged{RaggedLeft}\RaggedLeft\raggedleft}
-\newcommand*\caption@RaggedRight{%
- \caption@ragged{RaggedRight}\RaggedRight\raggedright}
-% \end{macrocode}
-%
-% \begin{macro}{\caption@ragged}
-% \changes{v1.0n}{2007/04/07}{The `ragged2e' package will now only been loaded when needed}
-% \changes{v1.0o}{2007/04/11}{Bugfix: Usage of \cs{caption@Info} replaced by \cs{caption@Debug}}
-% \changes{v1.1}{2007/04/16}{A different warning will be given on first \LaTeX\ run}
-% \changes{v1.4f}{2012/01/12}{Uses \cs{caption@ifpackageloaded} now}
-% |\caption@ragged|\marg{yes-code}\marg{no-code}
-% executes the \meta{yes-code} if the \package{ragged2e} package is loaded and \meta{no-code} if not.
-% \begin{macrocode}
-\newcommand*\caption@ragged{\caption@ifpackageloaded{ragged2e}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@ifpackageloaded}
-% \changes{v1.4f}{2012/01/12}{This macro added}
-% \changes{v1.8h}{2020/01/03}{Does not load the package anymore but issue an error message instead}
-% |\caption@ifpackageloaded|\marg{package}\marg{option}\marg{yes-code}\marg{no-code}
-% executes the \meta{yes-code} if the given package is loaded and \meta{no-code} if not.
-% \begin{macrocode}
-\newcommand*\caption@ifpackageloaded[4]{%
- \caption@ifdefined#3#3{%
- \caption@Error{Option `#2' requires the `#1' package\MessageBreak
- (or an alternative definition of \string#3)}%
- #4}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@pkg@list}
-% \changes{v1.4f}{2012/01/12}{This macro added}
-% We use this as list of packages loaded |\AtBeginDocument|.
-% (Note: Old |.aux| files could contain |\@cons|\-|\caption@pkg@list|\-|{{|\meta{package}|}}|,
-% so this macro should always be defined, even if we change the following code in the future.)
-% \begin{macrocode}
-\newcommand*\caption@pkg@list{}
-% \end{macrocode}
-% \begin{macrocode}
-\caption@AtBeginDocument{%
- \def\caption@tempa{\endgroup}%
- \begingroup
- \def\@elt#1{%
- \g@addto@macro\caption@tempa{%
- \caption@InfoNoLine{Load package `#1'}%
- \RequirePackage{#1}\relax}}%
- \caption@pkg@list
- \caption@tempa}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\caption@check@ragged}
-% \changes{v1.4h}{2020/01/03}{This macro added}
-% In the past we tried to load the \package{ragged2e} package automatically if needed.
-% But since we have dropped this unreliable code users will get an error message instead.
-% To compensate for this change we try to detect the usage of the \package{ragged2e}
-% at least within the preamble of the document.
-% (Note: Checking the name of the option is not sufficient here since it could have
-% been re-defined by the user. So we have to check the option code instead.)
-% \begin{macrocode}
-\@ifpackageloaded{ragged2e}{\let\caption@check@ragged\@gobble}{%
-% \end{macrocode}
-% \begin{macrocode}
- \newcommand*\caption@check@ragged[1]{%
- \begingroup
- \def\caption@tempa{#1}%
- \caption@check@ragged@{Centering}%
- \caption@check@ragged@{RaggedLeft}%
- \caption@check@ragged@{RaggedRight}%
- \endgroup}%
-% \end{macrocode}
-% \begin{macrocode}
- \newcommand*\caption@check@ragged@[1]{%
- \expandafter\def\expandafter\caption@tempb\expandafter{\csname caption@#1\endcsname}%
- \ifx\caption@tempa\caption@tempb % our definition of `ragged2e' option?
- \@ifundefined{#1}{%
- \caption@Info{Usage of `ragged2e' command \expandafter\string\csname #1\endcsname\space detected}%
- \@cons\caption@pkg@list{{ragged2e}}% load `ragged2e' package later on
- \global\let\caption@check@ragged\@gobble}{}%
- \fi
- }%
-% \end{macrocode}
-% \begin{macrocode}
- \caption@AtBeginDocument{%
- \let\caption@check@ragged\@gobble
- \let\caption@check@ragged@\@undefined}}
-% \end{macrocode}
-% Make the \package{subfig} package documentation compile.
-% \begin{macrocode}
-%%\@ifl@aded{dtx}{subfig}{\RequirePackage{ragged2e}\relax}{} % not needed
-\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
-\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
-% \end{macrocode}
-% \end{macro}
-%
% \section{Vertical spaces before and after captions}
%
% \begin{macro}{\abovecaptionskip}
@@ -2369,6 +2277,17 @@
% \begin{macrocode}
\DeclareCaptionOption{position}{\caption@setposition{#1}}
% \end{macrocode}
+% \changes{v1.0a}{2004/01/09}{Options \opt{figureposition} and \opt{tableposition} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figureposition}{%
+ \captionsetup*[figure]{position=#1}}
+\@onlypreamble@key{caption}{figureposition}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareCaptionOption{tableposition}{%
+ \captionsetup*[table]{position=#1}}
+\@onlypreamble@key{caption}{tableposition}
+% \end{macrocode}
%
% \begin{macro}{\caption@setposition}
% \changes{v1.0a}{2004/01/22}{Now the positions \opt{t}, \opt{above}, \opt{b},
@@ -3067,6 +2986,312 @@
%
% TODO: babel-latvian/latvian.ldf
%
+% \section{Package support}
+%
+% \begin{macro}{\caption@xpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% |\caption@xpackage|\marg{macro}\marg{package}\marg{option}
+% expands the given macro if the given package is not loaded.
+% (Note: We cannot use |\@ifpackageloaded| here since it's not available after |\AtBeginDocument|.)
+% \begin{macrocode}
+\newcommand*\caption@xpackage[2]{%
+ \expandafter\ifx\csname ver@#2.\caption@pkgextension\endcsname\relax
+ \expandafter\@firstofone
+ \else
+ \expandafter\@gobbletwo
+ \fi
+ {#1{#2}}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\caption@pkgextension\@pkgextension
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@loadpackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% |\caption@loadpackage|\marg{package}\marg{caption option}
+% loads the given package immediately.
+% \begin{macrocode}
+\newcommand*\caption@loadpackage{%
+ \caption@xpackage\caption@@loadpackage}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@loadpackage[2]{%
+ \caption@Info{Option `#2' requires the `#1' package}%
+ \RequirePackage{#1}\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@requirepackage}
+% \changes{v1.10}{2020/05/10}{This macro added}
+% |\caption@requirepackage|\marg{package}\marg{caption option}
+% indicates that the given package option needs a package.
+% \begin{macrocode}
+\newcommand*\caption@requirepackage{%
+ \caption@xpackage\caption@@requirepackage}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\caption@@requirepackage[2]{%
+ \@cons\caption@packagelist{{#1}{#2}}}% load package later on
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@pkg@list}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% We used this in the past as list of packages loaded |\AtBeginDocument|.
+% (Note: Old |.aux| files could contain |\@cons|\-|\caption@pkg@list|\-|{{|\meta{package}|}}|,
+% so this macro should always be defined, even if we change the following code in the future.)
+% \begin{macrocode}
+\newcommand*\caption@pkg@list{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@packagelist}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% We use this as list of packages loaded |\AtBeginDocument|.
+% \begin{macrocode}
+\newcommand*\caption@packagelist{}
+\@onlypreamble\caption@packagelist
+% \end{macrocode}
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\caption@tempa{\endgroup}%
+ \begingroup
+ \def\@elt#1#2{%
+ \g@addto@macro\caption@tempa{%
+ \caption@loadpackage{#1}{#2}}}%
+ \caption@packagelist
+ \caption@tempa
+% \end{macrocode}
+% \begin{macrocode}
+ \renewcommand*\caption@@loadpackage[2]{%
+ \caption@Error{Option `#2' requires the `#1' package}}%
+ \let\caption@@requirepackage\caption@@loadpackage
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\caption@usepackage}
+% \changes{v1.11}{2020/05/10}{This macro added}
+% |\caption@usepackage|\marg{package}\marg{option}\marg{code}
+% loads the given package and executes the given code.
+% (Note: Since the package might use the crappy \package{keyval}
+% package, too, we need to save \& restore some macros here, otherwise this
+% recursion won't work properly.)
+% \begin{macrocode}
+\newcommand*\caption@usepackage[3]{%
+ \IfCaptionOptionCheck
+ {\caption@requirepackage{#1}{#2}}%
+ {\let\KV@prefix@ORI\KV@prefix
+ \let\@tempc@ORI\@tempc
+ \caption@loadpackage{#1}{#2}%
+ #3%
+ \let\@tempc\@tempc@ORI
+ \let\KV@prefix\KV@prefix@ORI}}
+% \end{macro}
+%
+% \subsection{The newfloat package}
+%
+% \begin{macro}{\caption@newfloat}
+% \changes{v1.4b}{2012/01/12}{This macro added}
+% \changes{v1.8h}{2020/01/03}{Usage of \cs{caption@ifpackageloaded} replaced by \cs{RequirePackage}}
+% \changes{v1.11}{2020/05/10}{Usage of \cs{RequirePackage} replaced by \cs{caption@usepackage}}
+% |\caption@newfloat|\marg{option}\marg{code}
+% loads the \package{newfloat} package and executes the given code afterwards.
+% \begin{macrocode}
+\newcommand*\caption@newfloat{\caption@usepackage{newfloat}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.0c}{2004/08/03}{Options \opt{figurename} and \opt{tablename} added}
+% \changes{v1.1}{2007/07/04}{Options \opt{figurename} and \opt{tablename} re-written}
+% \changes{v1.2}{2007/11/18}{Option \opt{name} added}
+% \begin{macrocode}
+\DeclareCaptionOption{figurename}{\caption@SetName{figure}{#1}}
+\@onlypreamble@key{caption}{figurename}
+\DeclareCaptionOption{tablename}{\caption@SetName{table}{#1}}
+\@onlypreamble@key{caption}{tablename}
+% \end{macrocode}
+%
+% \changes{v1.2a}{2008/02/28}{Options \opt{listfigurename} and \opt{listtablename} added}
+% \begin{macrocode}
+\DeclareCaptionOption{listfigurename}{\caption@SetName{listfigure}{#1}}
+\@onlypreamble@key{caption}{listfigurename}
+\DeclareCaptionOption{listtablename}{\caption@SetName{listtable}{#1}}
+\@onlypreamble@key{caption}{listtablename}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@SetName}
+% \changes{v1.1}{2007/07/04}{This macro added}
+% \changes{v1.2}{2007/11/18}{After-preamble variant added}
+% \changes{v1.2a}{2008/02/28}{Renamed from \cs{caption@SetFloatName} to \cs{caption@SetName}}
+% \changes{v1.2b}{2008/08/02}{Bugfix: Works now without \cs{addto}, too}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
+% |\caption@SetName|\marg{float}\marg{name}
+% \begin{macrocode}
+\newcommand*\caption@SetName[2]{%
+ \caption@newfloat{#1name}{\newfloat@setname{#1}{#2}}}
+\@onlypreamble\caption@SetName
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{name}{%
+ \IfCaptionOptionCheck{}{\caption@setname\@captype{#1}}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@setname}
+% |\caption@setname|\marg{float}\marg{name}
+% \begin{macrocode}
+\newcommand*\caption@setname[2]{%
+ \@namedef{#1name}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2}{2007/12/21}{Options \opt{figurewithin} and \opt{tablewithin} added}
+% \changes{v1.2e}{2010/01/09}{The \opt{within} options are now available within the document, too}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{figurewithin}{\caption@within{figure}{#1}}
+\DeclareCaptionOptionNoValue{figurewithout}{\caption@within{figure}{none}}
+\DeclareCaptionOption{tablewithin}{\caption@within{table}{#1}}
+\DeclareCaptionOptionNoValue{tablewithout}{\caption@within{table}{none}}
+% \end{macrocode}
+%
+% \begin{macro}{\caption@within}
+% \changes{v1.2}{2007/12/21}{This macro added}
+% \changes{v1.4a}{2011/10/29}{Outsourced to \package{newfloat} package}
+% \changes{v1.4b}{2012/01/12}{Bugfix: Uses \cs{caption@newfloat} now}
+% |\caption@within|\marg{float}\marg{value}
+% \begin{macrocode}
+\newcommand*\caption@within[2]{%
+ \caption@newfloat{#1within}{\newfloat@setwithin{#1}{#2}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v1.2b}{2008/04/13}{Option \opt{within} added}
+% \changes{v1.2e}{2010/01/09}{The global \opt{within} option will now affect user-defined floats declared with \cs{DeclareCaptionType}, too}
+%
+% \begin{macrocode}
+\DeclareCaptionOption{within}{%
+ \caption@newfloat{within}{\newfloatsetup{within=#1}}}
+\DeclareCaptionOptionNoValue{without}{%
+ \caption@newfloat{without}{\newfloatsetup{without}}}
+% \end{macrocode}
+%
+% \subsection{The ragged2e package}
+% \changes{v1.0b}{2004/05/16}{Improved \package{ragged2e} package support}
+% \changes{v1.8h}{2020/01/03}{Revised \package{ragged2e} package support}
+% \changes{v1.9}{2020/05/05}{Enhanced \package{ragged2e} package support}
+% \changes{v1.10}{2020/05/10}{Revised \package{ragged2e} package support}
+%
+% We support the upper-case commands offered by the \package{ragged2e}
+% package.
+% \begin{macrocode}
+\DeclareCaptionJustification[ragged2e]{Justified}{\justifying}
+\DeclareCaptionJustification[ragged2e]{Centering}{\Centering}
+\DeclareCaptionJustification[ragged2e]{RaggedLeft}{\RaggedLeft}
+\DeclareCaptionJustification[ragged2e]{RaggedRight}{\RaggedRight}
+% \end{macrocode}
+%
+% \subsection{The sansmath package}
+% \changes{v1.3}{2011/01/01}{\package{sansmath} package support added}
+% \changes{v1.10}{2020/05/10}{\package{sansmath} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionFont[sansmath]{sansmath}{\sansmath}
+% \end{macrocode}
+%
+% \subsection{The setspace package}
+% \changes{v1.0n}{2007/04/02}{\package{setspace} package support added}
+% \changes{v1.2d}{2009/10/09}{\package{setspace} package support revised}
+%
+% \begin{macrocode}
+\DeclareCaptionFont{singlespacing}{%
+ \caption@ifdefined\setspace@singlespace{%
+ \setstretch\setspace@singlespace}{}}% normally 1
+\DeclareCaptionFont[setspace]{onehalfspacing}{\onehalfspacing}
+\DeclareCaptionFont[setspace]{doublespacing}{\doublespacing}
+\DeclareCaptionFont[setspace]{stretch}{\setstretch{#1}}
+% \end{macrocode}
+%
+% \subsection{The subfig package}
+% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
+% \changes{v1.4a}{2011/11/01}{Test for the \package{subfig} package revised}
+%
+% Since the \package{subfig} package is not maintained anymore,
+% we have to make several adaptions to \thispackage~\version{1.1} here.
+% Please note that we only support the version $1.3$ of the \package{subfig} package here.
+% So older versions do not work with this version of \thispackage, and newer
+% versions are expected to be adapted.
+% \begin{macrocode}
+\caption@AtBeginDocument{%
+ \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
+ \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
+ \caption@InfoNoLine{subfig package v1.3 is loaded}%
+% \end{macrocode}
+% \begin{macrocode}
+ \let\caption@setfloattype\@gobble
+ \let\@dottedxxxline\sf@NEW@dottedxxxline
+ \let\sf@subfloat\sf@NEW@subfloat
+% \end{macrocode}
+% \begin{macrocode}
+ \fi
+ \let\sf@NEW@dottedxxxline\@undefined
+ \let\sf@NEW@subfloat\@undefined}
+% \end{macrocode}
+%
+% \begin{macro}{\@dottedxxxline}
+% New version of |\@dottedxxxline|
+% \begin{macrocode}
+\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
+ \begingroup
+ \caption@setfloattype{#1}%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub#1}%
+ \ifnum #3>\@nameuse{c@#2depth}\else
+ \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sf@subfloat}
+% \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption@warmup} added}
+% New version of |\sf@subfloat|
+% \begin{macrocode}
+\def\sf@NEW@subfloat{%
+ \begingroup
+ \@nameuse{caption@warmup}%
+ \caption@setfloattype\@captype
+ \sf@ifpositiontop{%
+ \maincaptiontoptrue
+ }{%
+ \maincaptiontopfalse
+ }%
+ \caption@setoptions{subfloat}%
+ \caption@setoptions{sub\@captype}%
+ \let\sf@oldlabel=\label
+ \let\label=\subfloat@label
+ \ifmaincaptiontop\else
+ \advance\@nameuse{c@\@captype}\@ne
+ \fi
+ \refstepcounter{sub\@captype}%
+ \setcounter{sub\@captype @save}{\value{sub\@captype}}%
+ \@ifnextchar [% %] match left bracket
+ {\sf@@subfloat}%
+ {\sf@@subfloat[\@empty]}}
+% \end{macrocode}
+% \end{macro}
+%
+% Make the \package{subfig} package documentation compile.
+% \begin{macrocode}
+%%\@ifl@aded{dtx}{subfig}{\caption@loadpackage{ragged2e}{}}{} % not needed
+\DeclareCaptionOption{lofdepth}[2]{\caption@ifdefined\c@lofdepth{\setcounter{lofdepth}{#1}}{}}
+\DeclareCaptionOption{lotdepth}[2]{\caption@ifdefined\c@lotdepth{\setcounter{lotdepth}{#1}}{}}
+% \end{macrocode}
+%
% \section{Execution of options}
%
% \begin{macrocode}
@@ -3644,7 +3869,7 @@
% |\DeclareCaptionType|\oarg{options}\marg{environment}\oarg{name}\oarg{list name}
% \begin{macrocode}
\newcommand*\DeclareCaptionType{%
- \RequirePackage{newfloat}%
+ \caption@loadpackage{newfloat}{}%
\DeclareFloatingEnvironment}
\@onlypreamble\DeclareCaptionType
% \end{macrocode}
@@ -3882,75 +4107,6 @@
% \end{macrocode}
% \end{macro}
%
-% \section{subfig package adaptions}
-% \changes{v1.1}{2007/07/07}{Several adaptions to the \package{subfig} package added}
-% \changes{v1.4a}{2011/11/01}{Bugfix 11-11-01: Test for the \package{subfig} package revised}
-%
-% Since the \package{subfig} package is not maintained anymore,
-% we have to make several adaptions to \thispackage~\version{1.1} here.
-% Please note that we only support the version $1.3$ of the \package{subfig} package here.
-% So older versions do not work with this version of \thispackage, and newer
-% versions are expected to be adapted.
-% \begin{macrocode}
-\caption@AtBeginDocument{%
- \def\@tempa{2005/06/28 ver: 1.3 subfig package}%
- \expandafter\ifx\csname ver@subfig.sty\endcsname\@tempa
- \caption@InfoNoLine{subfig package v1.3 is loaded}%
-% \end{macrocode}
-% \begin{macrocode}
- \let\caption@setfloattype\@gobble
- \let\@dottedxxxline\sf@NEW@dottedxxxline
- \let\sf@subfloat\sf@NEW@subfloat
-% \end{macrocode}
-% \begin{macrocode}
- \fi
- \let\sf@NEW@dottedxxxline\@undefined
- \let\sf@NEW@subfloat\@undefined}
-% \end{macrocode}
-%
-% \begin{macro}{\@dottedxxxline}
-% New version of |\@dottedxxxline|
-% \begin{macrocode}
-\def\sf@NEW@dottedxxxline#1#2#3#4#5#6#7{%
- \begingroup
- \caption@setfloattype{#1}%
- \caption@setoptions{subfloat}%
- \caption@setoptions{sub#1}%
- \ifnum #3>\@nameuse{c@#2depth}\else
- \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
- \fi
- \endgroup}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sf@subfloat}
-% \changes{v1.4b}{2011/12/29}{Bugfix 11-12-23: Usage of \cs{caption@warmup} added}
-% New version of |\sf@subfloat|
-% \begin{macrocode}
-\def\sf@NEW@subfloat{%
- \begingroup
- \@nameuse{caption@warmup}%
- \caption@setfloattype\@captype
- \sf@ifpositiontop{%
- \maincaptiontoptrue
- }{%
- \maincaptiontopfalse
- }%
- \caption@setoptions{subfloat}%
- \caption@setoptions{sub\@captype}%
- \let\sf@oldlabel=\label
- \let\label=\subfloat@label
- \ifmaincaptiontop\else
- \advance\@nameuse{c@\@captype}\@ne
- \fi
- \refstepcounter{sub\@captype}%
- \setcounter{sub\@captype @save}{\value{sub\@captype}}%
- \@ifnextchar [% %] match left bracket
- {\sf@@subfloat}%
- {\sf@@subfloat[\@empty]}}
-% \end{macrocode}
-% \end{macro}
-%
% \iffalse
%</package>
% \fi
diff --git a/macros/latex/contrib/draftwatermark/README b/macros/latex/contrib/draftwatermark/README
deleted file mode 100644
index 9d68bbedc5..0000000000
--- a/macros/latex/contrib/draftwatermark/README
+++ /dev/null
@@ -1,34 +0,0 @@
-The "draftwatermark" package extends LaTeX providing a means to add a textual
-gray or colored watermark on every page or on the first page of a
-document. Typical usage may consist in writing words such as "DRAFT" or
-"CONFIDENTIAL" across document pages. The package may remind in some sense
-"draftcopy" by Dr. Juergen Vollmer, but its implementation is lighter (as the
-reduced code footprint shows) and does not rely on postscript specials, making
-the package fully compatible with pdfLaTeX, xelatex and lualatex. The package
-depends on package "everypage" by the same author.
-
-The package focus is on simplicity, for complex layouts please consider
-scrlayer.sty in the KOMA script bundle.
-
-The "draftwatermark" package is copyright 2006, 2012, 2020 by Sergio Callegari
-<sergio.callegari@gmail.com>
-
-It comprises this README file, as well as files
-draftwatermark.dtx
-draftwatermark.ins
-
-To install the package, run LaTeX on the installation script
-draftwatermark.ins and follow the instructions provided by the script
-itself.
-
-"draftwatermark" may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3 of
-this licence, or any later version. The latest version of this license
-is at http://www.latex-project.org/lppl.txt and version 1.3 is part of
-all distributions of LaTeX version 2003/06/01 or later.
-
-This work has the LPPL maintenance status "author-maintained".
-
-Development happens on github at
- https://github.com/callegar/LaTeX-draftwatermark
-Please refer to that site for bug tracking. \ No newline at end of file
diff --git a/macros/latex/contrib/draftwatermark/README.md b/macros/latex/contrib/draftwatermark/README.md
new file mode 100644
index 0000000000..7b22c3a1fc
--- /dev/null
+++ b/macros/latex/contrib/draftwatermark/README.md
@@ -0,0 +1,33 @@
+# The `draftwatermark` LaTeX package
+
+The `draftwatermark` package extends LaTeX providing a means to add a textual
+gray or colored watermark on every page or on the first page of a
+document. Typical usage may consist in writing words such as "DRAFT" or
+"CONFIDENTIAL" across document pages. The package may remind in some sense
+`draftcopy` by Dr. Juergen Vollmer, but its implementation is lighter (as the
+reduced code footprint shows) and does not rely on postscript specials, making
+the package fully compatible with pdfLaTeX, XeLaTeX and LuaLaTeX. The package
+depends on `everypage.sty` by the same author.
+
+The package focus is on simplicity, for complex layouts please consider
+`scrlayer.sty` in the KOMA script bundle.
+
+The `draftwatermark` package is copyright 2006, 2012, 2020 by Sergio Callegari
+<sergio.callegari@gmail.com>.
+
+This work consists of this `README.md` file, as well as files `draftwatermark.dtx`,
+`draftwatermark.ins` and the derived file `draftwatermark.sty`.
+
+To install the package, run LaTeX on the installation script
+`draftwatermark.ins` and follow the instructions provided by the script itself.
+
+This work may be distributed and/or modified under the conditions of the LaTeX
+Project Public License version 1.3. This license is available at
+<https://www.latex-project.org/lppl/> and it is part of all distributions of
+LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "author-maintained".
+
+Development happens on github at
+<https://github.com/callegar/LaTeX-draftwatermark>. Please refer to that site
+for bug tracking.
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.dtx b/macros/latex/contrib/draftwatermark/draftwatermark.dtx
index 2cd35a1bbd..ab5cb3b948 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.dtx
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.dtx
@@ -9,10 +9,9 @@
% ---------------------------------------------
%
% It may be distributed and/or modified under the conditions of the
-% LaTeX Project Public License, either version 1.3 of this licence, or
-% any later version. The latest version of this license is at
-% http://www.latex-project.org/lppl.txt and version 1.3 is part
-% of all distributions of LaTeX version 2003/06/01 or later.
+% LaTeX Project Public License, version 1.3. This license is at
+% https://www.latex-project.org/lppl/ and is part
+% of all distributions of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "author-maintained".
%
@@ -45,7 +44,7 @@
\DoNotIndex{\DeclareBoolOption, \DeclareComplementaryOption,
\DeclareStringOption, \def, \define@key, \dimexpr, \DisableKeyvalOption,
\do, \documentclass, \dp}
-\DoNotIndex{\expandafter}
+\DoNotIndex{\edef, \expandafter}
\DoNotIndex{\fbox, \fontsize}
\DoNotIndex{\hbox, \hspace, \hss, \ht}
\DoNotIndex{\let, \lipsum}
@@ -73,9 +72,9 @@
% \CheckSum{288}
%
% \def\filename{draftwatermark.dtx}
-% \def\fileversion{2.0}
-% \def\filedate{2020/03/14}
-% \def\docdate{2020/03/14}
+% \def\fileversion{2.1}
+% \def\filedate{2020/05/11}
+% \def\docdate{2020/05/11}
%
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\texttt {#1}} ^^A typeset an option
@@ -245,8 +244,8 @@
% Defines the horizontal position of the watermark anchor
% point. Specifically, |l| stands for \emph{left}, |c| for \emph{center}
% and |r| for \emph{right}. See also the |anchor| option.
-% \item \verb!hanchor=t|m|b!\\
-% Default is |c|.\\
+% \item \verb!vanchor=t|m|b!\\
+% Default is |m|.\\
% Defines the vertical position of the watermark anchor
% point. Specifically, |t| stands for \emph{top}, |m| for \emph{middle}
% and |b| for \emph{bottom}. See also the |anchor| option.
@@ -385,13 +384,22 @@
%
% As a final remark, observe that the specification of the positioning
% coordinates can be based on \LaTeX\ macros. For instance, one can set
-% the horizontal position at |0.5\paperwidth| (for centering) or at
+% the horizontal position |hpos| at |0.5\paperwidth| (for centering) or at
% |\dimexpr\paperwidth-5mm| (for placement at the right hand side of the
% page). Interestingly, \Lpack{draftwatermark} re-evaluates the
% positioning coordinates on every page. This means that positions based
% on |\paperwidth| or |\paperheight| should dynamically adjust if the page
-% size is changed through the document.
-%
+% size is changed through the document. To some extent, this is also true
+% of the anchor options. For instance, one may set the horizontal anchor
+% |hanchor| at |\ifodd\thepage r\else l\fi| causing the anchor point to
+% alternate between |r| and |l| at every new page. In conjunction with a
+% similarly conditional |hpos| setting, for instance
+% |\ifodd\thepage \dimexpr\paperwidth-5mm\else 5mm\fi|, this enables
+% interesting effects, like placing the watermark close to the right side
+% of the page on odd pages and to the left side of the page on even
+% pages. Obviously, this kind of setting is only applicable with the
+% |hanchor| and |vanchor| options, and not with the |anchor| shorthand.
+%
% \section{The standard watermark and ways of overriding it}
% \label{sec:markcmd}
%
@@ -426,8 +434,7 @@
%
% \end{sloppy}
%
-% \section{Compatibility notes for version 2.0 of the package and later
-% versions}
+% \section{Compatibility notes for package version 2.0 and later}
%
% Version 2.0 of the package is an almost complete rewrite with respect to
% version 1.2. Specifically, all the configuration mechanism has been
@@ -477,6 +484,7 @@
% possible with the modern interface.
%
% \section{Examples}
+% \label{sec:examples}
%
% \subsection{Plain case, using the modern package interface}
%
@@ -590,13 +598,56 @@
% \fi
% \makeatletter \c@CodelineNo\z@ \makeatother
%
+% Another interesting possibility of the modern interface derives from the
+% fact that the positioning and anchoring options are re-evaluated for
+% every page. This allows the positioning to dynamically change following
+% other parameters (for instance the |\paperwidth|) or to take advantage
+% of conditionals to achieve effects such as differentiating the watermark
+% for odd and even pages, as shown in the following code:
+% \iffalse
+%<*samplecode-dynamic>
+% \fi
+% \begin{macrocode}
+\documentclass{article}
+\usepackage[named]{xcolor}
+\usepackage[T1]{fontenc}
+\usepackage[color=red, fontsize=32pt]{draftwatermark}
+\usepackage{mathptmx}
+\usepackage{lipsum}
+\title{Sample document for the draftwatermark package}
+\author{}
+
+\DraftwatermarkOptions{%
+ angle=0,
+ text={\ifodd\thepage ODD\else EVEN\fi},
+ hpos={\ifodd\thepage \dimexpr\paperwidth-5mm\else 5mm\fi},
+ vpos=5mm,
+ vanchor=t,
+ hanchor={\ifodd\thepage r\else l\fi}
+}
+
+\begin{document}
+\maketitle
+
+\section{One}
+\lipsum[1-3]
+
+\section{Two}
+\lipsum[4-6]
+
+\end{document}
+% \end{macrocode}
+% \iffalse
+%</samplecode-dynamic>
+% \fi
+% \makeatletter \c@CodelineNo\z@ \makeatother
+%
% \subsection{Maximum freedom with a custom watermarking command}
%
-% As a final example, see how maximum freedom can be obtained with a
-% custom watermarking command. The following document source lets one have
-% a watermark on the top right corner of odd pages and on the top left
-% corner of even pages.
-% \iffalse
+% Maximum freedom can be obtained with a custom watermarking command. The
+% following example shows how it can be used, once again differentiating
+% the watermark for odd and even pages.
+%\iffalse
%<*samplecode-custom>
% \fi
% \begin{macrocode}
@@ -659,6 +710,8 @@
% \item[1.2 - 2015/02/19] Add support for watermark position.
% \item[2.0 - 2020/03/08] Configuration management overhaul; introduction
% of a legacy interface for compatibility.
+% \item[2.1 - 2020/05/11] Allow anchor information to be re-evaluated on
+% every page
% \end{description}
%
% \StopEventually {}
@@ -673,7 +726,7 @@
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{draftwatermark}%
- [2020/03/14 2.0 Put a gray textual watermark on document pages]
+ [2020/05/11 2.1 Put a gray textual watermark on document pages]
% \end{macrocode}
%
@@ -859,10 +912,10 @@
\sbox\@tempboxa{#1}%
\setlength{\@tempdima}{\draftwatermark@hpos}%
\setlength{\@tempdimb}{\draftwatermark@vpos}%
- \let \draftwatermark@tempa \draftwatermark@hanchor
+ \edef \draftwatermark@tempa{\draftwatermark@hanchor}%
\@onelevel@sanitize \draftwatermark@tempa
\expandafter\def\expandafter\draftwatermark@tempb
- \expandafter{\expandafter\@car \draftwatermark@tempa\@nil}
+ \expandafter{\expandafter\@car \draftwatermark@tempa\@nil}%
\if \draftwatermark@tempb r%
\addtolength\@tempdima{-\wd\@tempboxa}%
\else\if \draftwatermark@tempb c%
@@ -874,10 +927,10 @@
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to left side.}%
\fi\fi\fi
- \let \draftwatermark@tempa \draftwatermark@vanchor
+ \edef \draftwatermark@tempa{\draftwatermark@vanchor}%
\@onelevel@sanitize \draftwatermark@tempa
\expandafter\def\expandafter\draftwatermark@tempb
- \expandafter{\expandafter\@car \draftwatermark@tempa\@nil}
+ \expandafter{\expandafter\@car \draftwatermark@tempa\@nil}%
\if \draftwatermark@tempb b%
\addtolength\@tempdimb{-\ht\@tempboxa}%
\addtolength\@tempdimb{-\dp\@tempboxa}%
@@ -891,7 +944,7 @@
Illegal anchor directive `\draftwatermark@tempb'}%
{Anchoring to top side.}%
\fi\fi\fi
- \vbox to 0pt {
+ \vbox to 0pt {%
\vspace*{-1in}%
\vspace*{\@tempdimb}%
\hbox to 0pt {%
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.ins b/macros/latex/contrib/draftwatermark/draftwatermark.ins
index f1ec2f8ded..1365e64ebf 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.ins
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.ins
@@ -1,5 +1,5 @@
%% draftwatermark.ins
-%% Copyright 2006
+%% Copyright 2006-2020
%% Sergio Callegari <sergio.callegari@gmail.com>
%%
%% ---------------------------------------------
@@ -7,15 +7,14 @@
%% a contribution to the LaTeX2e system.
%% ---------------------------------------------
%%
-%% It may be distributed and/or modified under the conditions of the
-%% LaTeX Project Public License, either version 1.3 of this licence, or
-%% any later version. The latest version of this license is at
-%% http://www.latex-project.org/lppl.txt and version 1.3 is part
-%% of all distributions of LaTeX version 2003/06/01 or later.
+%% It may be distributed and/or modified under the conditions of the LaTeX
+%% Project Public License, version 1.3. The license is at
+%% https://www.latex-project.org/lppl/ and is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status "author-maintained".
%%
-%% This program consists of the files listed in the README file
+%% This program consists of the files listed in the README.md file
%% included in the package.
%%
%% This file will generate fast loadable files and documentation
@@ -36,24 +35,23 @@
Copyright 2006, 2020
Sergio Callegari <sergio.callegari@gmail.com>
----------------------------------------------
+------------------------------------------------
This file is part of the draftwatermark package,
a contribution to the LaTeX2e system.
----------------------------------------------
+------------------------------------------------
-This program consists of the files listed in the README file included
+This program consists of the files listed in the README.md file included
in the package.
-Any modified versions of this file must be renamed with new filenames
-distinct from draftwatermark.sty.
+Any modified versions of this file must be renamed with new filenames distinct
+from draftwatermark.sty.
-For distribution of the original source see the terms
-for copying and modification in the file draftwatermark.dtx.
+For distribution of the original source see the terms for copying and
+modification in the file draftwatermark.dtx.
-This generated file may be distributed as long as the
-original source files, as listed above, are part of the
-same distribution. (The sources need not necessarily be
-in the same archive or directory.)
+This generated file may be distributed as long as the original source files, as
+listed above, are part of the same distribution. (The sources need not
+necessarily be in the same archive or directory.)
\endpreamble
@@ -72,6 +70,8 @@ in the same archive or directory.)
\generate{\file{test_draftwatermark3.tex}{%
\from{draftwatermark.dtx}{samplecode-anchor}}}
\generate{\file{test_draftwatermark4.tex}{%
+ \from{draftwatermark.dtx}{samplecode-dynamic}}}
+\generate{\file{test_draftwatermark5.tex}{%
\from{draftwatermark.dtx}{samplecode-custom}}}
%\ReportTotals
diff --git a/macros/latex/contrib/draftwatermark/draftwatermark.pdf b/macros/latex/contrib/draftwatermark/draftwatermark.pdf
index 41c67efb51..059d0262dc 100644
--- a/macros/latex/contrib/draftwatermark/draftwatermark.pdf
+++ b/macros/latex/contrib/draftwatermark/draftwatermark.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/README b/macros/latex/contrib/jslectureplanner/README
index 9d1d09cea4..5f9da681e1 100644
--- a/macros/latex/contrib/jslectureplanner/README
+++ b/macros/latex/contrib/jslectureplanner/README
@@ -68,6 +68,9 @@ instructions; also have a look at the example files.
== CHANGES ==
+* V. 1.11 (2020-05-11): - Allow for customization of program and presentation lists.
+ - Correctly set first session in presentation list.
+
* V. 1.10 (2020-04-30): - Do not increment session topic counter for cancelled sessions
and breaks.
- Add session option topicnumber to reset topic number in draft mode.
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/lecturebib-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/lecturebib-english.pdf
index 8ee99de4cd..ae0607b469 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/lecturebib-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/lecturebib-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/lecturehandout-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/lecturehandout-english.pdf
index 174d1d40bb..54a3fe2529 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/lecturehandout-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/lecturehandout-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/lecturepresentation-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/lecturepresentation-english.pdf
index 1b8c27038b..1d90d42f0c 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/lecturepresentation-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/lecturepresentation-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/lectureprogram-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/lectureprogram-english.pdf
index 4be1c094ff..ac529f1a97 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/lectureprogram-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/lectureprogram-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/lecturescript-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/lecturescript-english.pdf
index 9183f3c466..f949f346aa 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/lecturescript-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/lecturescript-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/membertable-blank-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/membertable-blank-english.pdf
index 25e1e676aa..8618c4a994 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/membertable-blank-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/membertable-blank-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/membertable-filled-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/membertable-filled-english.pdf
index 52869faee2..619c62ce97 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/membertable-filled-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/membertable-filled-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/presencetable-blank-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/presencetable-blank-english.pdf
index 0d7916a417..826431e8b1 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/presencetable-blank-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/presencetable-blank-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/presencetable-filled-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/presencetable-filled-english.pdf
index 3374c33a77..a51da79d67 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/presencetable-filled-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/presencetable-filled-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/English/presentation-list-english.pdf b/macros/latex/contrib/jslectureplanner/examples/English/presentation-list-english.pdf
index 77bdc57f1f..3effb91217 100644
--- a/macros/latex/contrib/jslectureplanner/examples/English/presentation-list-english.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/English/presentation-list-english.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/lecturebib.pdf b/macros/latex/contrib/jslectureplanner/examples/German/lecturebib.pdf
index adfe94072a..a30a8d7d73 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/lecturebib.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/lecturebib.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/lecturehandout.pdf b/macros/latex/contrib/jslectureplanner/examples/German/lecturehandout.pdf
index 3995760271..4df0807950 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/lecturehandout.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/lecturehandout.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/lecturepresentation.pdf b/macros/latex/contrib/jslectureplanner/examples/German/lecturepresentation.pdf
index f34eddf664..7494a82a67 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/lecturepresentation.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/lecturepresentation.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/lectureprogram.pdf b/macros/latex/contrib/jslectureplanner/examples/German/lectureprogram.pdf
index a45658c81f..326beb4f68 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/lectureprogram.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/lectureprogram.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/lecturescript.pdf b/macros/latex/contrib/jslectureplanner/examples/German/lecturescript.pdf
index 4b40e63e82..d353936903 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/lecturescript.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/lecturescript.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/membertable-blank.pdf b/macros/latex/contrib/jslectureplanner/examples/German/membertable-blank.pdf
index da80a5f638..3ecc09846a 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/membertable-blank.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/membertable-blank.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/membertable-filled.pdf b/macros/latex/contrib/jslectureplanner/examples/German/membertable-filled.pdf
index f4185515ed..303b1dae40 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/membertable-filled.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/membertable-filled.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/presencetable-blank.pdf b/macros/latex/contrib/jslectureplanner/examples/German/presencetable-blank.pdf
index cd749eb1e0..464a6c7f3b 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/presencetable-blank.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/presencetable-blank.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/presencetable-filled.pdf b/macros/latex/contrib/jslectureplanner/examples/German/presencetable-filled.pdf
index fd02425a5f..d09b39386e 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/presencetable-filled.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/presencetable-filled.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/examples/German/presentation-list.pdf b/macros/latex/contrib/jslectureplanner/examples/German/presentation-list.pdf
index 8c0539e596..0050ea7045 100644
--- a/macros/latex/contrib/jslectureplanner/examples/German/presentation-list.pdf
+++ b/macros/latex/contrib/jslectureplanner/examples/German/presentation-list.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/jslectureplanner.pdf b/macros/latex/contrib/jslectureplanner/jslectureplanner.pdf
index bedf7f4281..7a0c357150 100644
--- a/macros/latex/contrib/jslectureplanner/jslectureplanner.pdf
+++ b/macros/latex/contrib/jslectureplanner/jslectureplanner.pdf
Binary files differ
diff --git a/macros/latex/contrib/jslectureplanner/jslectureplanner.sty b/macros/latex/contrib/jslectureplanner/jslectureplanner.sty
index 975be52a0d..72c62b27fa 100644
--- a/macros/latex/contrib/jslectureplanner/jslectureplanner.sty
+++ b/macros/latex/contrib/jslectureplanner/jslectureplanner.sty
@@ -23,8 +23,8 @@
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\filedate{2020/04/30}
-\def\fileversion{1.10}
+\def\filedate{2020/05/11}
+\def\fileversion{1.11}
\def\filename{jslectureplanner.sty}
\NeedsTeXFormat{LaTeX2e}
@@ -88,7 +88,7 @@
\def\programlistexam{}
\def\programlistbeamer{}
\def\programlistbeamerexam{}
-\def\programblocklistbeamer{\item}
+\def\programblocklistbeamer{}
\def\jsbiblist{}
@@ -182,7 +182,7 @@
% Beamer program heading
\newcommand*\lecprogram{Programm}
% Program list indentation
-\newcommand*\lecprogramlistindent{\textbf{88.\,88.}}
+\newcommand*\lecprogramlistindent{\programdateformat{88.\,88.}}
% Session topic placeholder
\newcommand*\sestopic{Thema~\thesestopic}
% Time slot
@@ -540,19 +540,93 @@
% Program generation
\newcommand\makeprogram{%
\raggedright
- \begin{labeling}{\lecprogramlistindent}
+ \begin{ProgramList}
\programlist
- \end{labeling}
+ \end{ProgramList}
}
% Exam schedule generation
\newcommand\makeexamprogram{%
\raggedright
- \begin{labeling}{\lecprogramlistindent}
+ \begin{ProgramListExam}
\programlistexam
- \end{labeling}
+ \end{ProgramListExam}
}
+% Customizable environments for formatting the lists
+
+% ProgramList is the list used in programs
+\newenvironment{ProgramList}{\begin{labeling}{\lecprogramlistindent}}{\end{labeling}}
+
+% BeamerProgramList is the list used in programs
+\newenvironment{BeamerProgramList}{\begin{description}[\lecprogramlistindent]}{\end{description}}
+
+% ProgramListExam is the list used in exam schedules. By default identical to ProgramList
+\newenvironment{ProgramListExam}{\begin{ProgramList}}{\end{ProgramList}}
+
+% PresList is the list of presenting students
+\newenvironment{PresList}{\begin{ProgramList}}{\end{ProgramList}}
+
+% Same for beamer
+\newenvironment{BeamerPresList}{\begin{BeamerProgramList}}{\end{BeamerProgramList}}
+\newenvironment{BeamerProgramListExam}{\begin{BeamerProgramList}}{\end{BeamerProgramList}}
+
+% Text format of program date
+\newcommand*\programdateformat[1]{\textbf{#1}}
+% Text format of program title
+\newcommand*\sestitleformat[1]{#1}
+% Text format of program title
+\newcommand*\exsestitleformat[1]{\sestitleformat{#1}}
+% Text format of canceled session titles
+\newcommand*\cansestitleformat[1]{\textbf{#1}}
+% Text format of block titles
+\newcommand*\blocktitleformat[1]{\textbf{#1}}
+% Text format of block numbers
+\newcommand*\blocknumberformat[1]{\textbf{#1}}
+
+% ProgramListItem, ProgramListExamItem and ProgramListCancelItem typeset a single
+% session. Arguments: #1 date, #2 title, #3 title separator, #4 subtitle
+\newcommand*{\ProgramListItem}[4]{\item[\programdateformat{#1}] \sestitleformat{#2#3#4}}
+\newcommand*{\ProgramListCancelItem}[4]{\item[\programdateformat{#1}] \cansestitleformat{#2#3#4\leccancel}}
+\newcommand*{\ProgramListExamItem}[4]{\item[\programdateformat{#1}] \exsestitleformat{#2#3#4}}
+
+% Same for beamer program
+\newcommand*{\BeamerProgramListItem}[4]{\item[\programdateformat{#1}] \sestitleformat{#2#3#4}}
+\newcommand*{\BeamerProgramListCancelItem}[4]{\item[\programdateformat{#1}] \cansestitleformat{#2#3#4\leccancel}}
+\newcommand*{\BeamerProgramListExamItem}[4]{\item[\programdateformat{#1}] \exsestitleformat{#2#3#4}}
+
+% PresListItem: Program line for student presentation lists
+\newcommand*\PresListItem[4]{%
+ \ProgramListItem{#1}{#2}{#3}{#4}%
+}
+
+\newcommand*\BeamerPresListItem[4]{%
+ \BeamerProgramListItem{#1}{#2}{#3}{#4}%
+}
+
+% Format break event
+\newcommand*\breakevent[3]{\ifx\empty#1 #2\else#1#2#3\fi}
+% ProgramListBreak typesets a break.
+% Optional argument is date range, #2 is name of break
+\newcommand*{\ProgramListBreak}[2][\empty]%
+{%
+ \begin{center}
+ (\breakevent{#1}{: }{#2})
+ \end{center}%
+}
+
+% ProgramListBlock
+\newenvironment{ProgramListBlock}[2]%
+ {%
+ \ProgramBlockItem{#1}{#2}
+ \begin{ProgramList}%
+ }%
+ {\end{ProgramList}}
+
+\newcommand*{\ProgramBlockItem}[2]{\item[\blocknumberformat{#1}.] \blocktitleformat{#2}}
+\newcommand*{\BeamerProgramBlockItem}[2]{\item[\blocknumberformat{#1}.] \blocktitleformat{#2}}
+\newcommand*{\BeamerProgramBlockBlocksOnlyItem}[2]{\item[#1.] #2}
+
%
% Beamer program generation
\define@key{beamerprogram}{title}{\csdef{@bptitle}{#1}}
@@ -566,6 +640,11 @@
\define@boolkey{beamerprogram}{blocksonly}[true]{}
\define@boolkey{beamerprogram}{uncover}[true]{}
+% Overlay specifications for uncover programs
+\newcommand*\beameruncoverspec{\beamerdefaultoverlayspecification{<+(1)->}}
+\newcommand*\beameruncoverffslidesspec{\beamerdefaultoverlayspecification{<+(-1)->}}
+\newcommand*\beameruncoverblocksonlyspec{\beamerdefaultoverlayspecification{<+->}}
+
\newcommand*\makebeamerprogram[1][]{%
\csdef{@bptitle}{\lecprogram}
\def\btitleapp{}
@@ -574,7 +653,7 @@
\setkeys{beamerprogram}{blocksonly=false}
\setkeys{beamerprogram}{uncover=false}
\setkeys{beamerprogram}{#1}
- \def\bpdescbeg{\begin{description}[\lecprogramlistindent]}
+ \def\bpdescbeg{\begin{BeamerProgramList}}
\ifKV@beamerprogram@alerted
\fi
\providebool{uncoveredlist}
@@ -599,13 +678,10 @@
\begin{frame}[label=beamerprogram]{\csuse{@bptitle}\btitleapp}
}%
}%
- \ifbool{uncoveredlist}{%
- \begin{description}[<+->][\lecprogramlistindent]
- }{%
- \begin{description}[\lecprogramlistindent]
- }
- \programblocklistbeamer
- \end{description}
+ \ifbool{uncoveredlist}{\beameruncoverblocksonlyspec}{}
+ \begin{BeamerProgramList}
+ \ifcsempty{programblocklistbeamer}{\BeamerProgramBlockBlocksOnlyItem{}{}}{\programblocklistbeamer}
+ \end{BeamerProgramList}
\end{frame}
\else% not \ifKV@beamerprogram@blocksonly
% All but last slide(s) are generated in what follows
@@ -626,13 +702,10 @@
\begin{frame}[label=beamerprogram]{\csuse{@bptitle}\btitleapp}
}%
}%
- \ifbool{uncoveredlist}{%
- \begin{description}[<+(1)->][\lecprogramlistindent]
- }{%
- \begin{description}[\lecprogramlistindent]
- }
+ \ifbool{uncoveredlist}{\beameruncoverspec}{}
+ \begin{BeamerProgramList}
\programlistbeamerii
- \end{description}
+ \end{BeamerProgramList}
\end{frame}
}
\@ifundefined{programlistbeameriii}{}{%
@@ -652,13 +725,10 @@
\begin{frame}[label=beamerprogram2]{\csuse{@bptitle}\btitleapp}
}%
}%
- \ifbool{uncoveredlist}{%
- \begin{description}[<+->][\lecprogramlistindent]
- }{%
- \begin{description}[\lecprogramlistindent]
- }
+ \ifbool{uncoveredlist}{\beameruncoverffslidesspec}{}
+ \begin{BeamerProgramList}
\programlistbeameriii
- \end{description}
+ \end{BeamerProgramList}
\end{frame}
}
\@ifundefined{programlistbeameriv}{}{%
@@ -678,13 +748,10 @@
\begin{frame}[label=beamerprogram3]{\csuse{@bptitle}\btitleapp}
}%
}%
- \ifbool{uncoveredlist}{%
- \begin{description}[+(1)->][\lecprogramlistindent]
- }{%
- \begin{description}[\lecprogramlistindent]
- }
+ \ifbool{uncoveredlist}{\beameruncoverffslidesspec}{}
+ \begin{BeamerProgramList}
\programlistbeameriv
- \end{description}
+ \end{BeamerProgramList}
\end{frame}
}
% The last slide is generated separately:
@@ -758,14 +825,10 @@
}%
}%
}%
-
- \ifbool{uncoveredlist}{%
- \begin{description}[<+->][\lecprogramlistindent]
- }{%
- \begin{description}[\lecprogramlistindent]
- }
+ \ifbool{uncoveredlist}{\beameruncoverffslidesspec}{}
+ \begin{BeamerProgramList}
\programlistbeamer
- \end{description}
+ \end{BeamerProgramList}
\end{frame}
\fi%\else\ifKV@beamerprogram@blocksonly
}
@@ -780,7 +843,7 @@
\setkeys{beamerprogram}{blocksonly=false}
\setkeys{beamerprogram}{uncover=false}
\setkeys{beamerprogram}{#1}
- \def\bpdescbeg{\begin{description}[\lecprogramlistindent]}
+ \def\bpdescbeg{\begin{BeamerProgramList}}
\ifKV@beamerprogram@alerted
\fi
\providebool{uncoveredlist}
@@ -792,33 +855,30 @@
\ifKV@beamerprogram@blocksonly
\else% not \ifKV@beamerprogram@blocksonly
% All but last slide(s) are generated in what follows
- \@ifundefined{programlistbeamerexam}{}{%
- \def\btitleapp{}
- \ifcsdef{@bpolarg}{%
- \ifcsdef{@bpopts}{%
- \begingroup\edef\tempa{\endgroup\noexpand%
- \begin{frame}<\csuse{@bpolarg}>[\csuse{@bpopts}]{\csuse{@bptitle}\btitleapp}}\tempa
- }{%
- \begin{frame}<\csuse{@bpolarg}>[label=beamerprogram]{\csuse{@bptitle}\btitleapp}
- }%
- }{%
- \ifcsdef{@bpopts}{%
- \begingroup\edef\tempa{\endgroup\noexpand%
- \begin{frame}[\csuse{@bpopts}]{\csuse{@bptitle}\btitleapp}}\tempa
- }{%
- \begin{frame}[label=beamerprogram]{\csuse{@bptitle}\btitleapp}
- }%
- }%
- \ifbool{uncoveredlist}{%
- \begin{description}[<+->][\lecprogramlistindent]
- }{%
- \begin{description}[\lecprogramlistindent]
- }
- \programlistbeamerexam
- \end{description}
- \end{frame}
+ \ifcsempty{programlistbeamerexam}{}{%
+ \def\btitleapp{}
+ \ifcsdef{@bpolarg}{%
+ \ifcsdef{@bpopts}{%
+ \begingroup\edef\tempa{\endgroup\noexpand%
+ \begin{frame}<\csuse{@bpolarg}>[\csuse{@bpopts}]{\csuse{@bptitle}\btitleapp}}\tempa
+ }{%
+ \begin{frame}<\csuse{@bpolarg}>[label=beamerprogram]{\csuse{@bptitle}\btitleapp}
+ }%
+ }{%
+ \ifcsdef{@bpopts}{%
+ \begingroup\edef\tempa{\endgroup\noexpand%
+ \begin{frame}[\csuse{@bpopts}]{\csuse{@bptitle}\btitleapp}}\tempa
+ }{%
+ \begin{frame}[label=beamerprogram]{\csuse{@bptitle}\btitleapp}
+ }%
+ }%
+ \ifbool{uncoveredlist}{\beameruncoverspec}{}
+ \begin{BeamerProgramListExam}
+ \programlistbeamerexam
+ \end{BeamerProgramListExam}
+ \end{frame}
+ }%
\fi%\else\ifKV@beamerprogram@blocksonly
- }%
}
@@ -943,20 +1003,14 @@
\protected@csxdef{sesblockno\thesnum}{\csuse{@currentblockno}}
\ifKV@session@cancel
\stepcounter{cancellations}
- \protected@eappto\programlist{\noexpand\item[{\noexpand\bfseries\csuse{sesshortdate\thesnum}}]%
- \noexpand\bgroup\noexpand\bfseries\csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}%
- \noexpand\leccancel\noexpand\egroup}
- \protected@eappto\programlistbeamer{\noexpand\item[{\noexpand\bfseries\csuse{sesshortdate\thesnum}}]%
- \noexpand\bgroup\noexpand\bfseries\csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}%
- \noexpand\leccancel\noexpand\egroup}
+ \protected@eappto\programlist{\noexpand\ProgramListCancelItem{\csuse{sesshortdate\thesnum}}{\csuse{sestitle\thesnum}}{\csuse{@sestitlesep}}{\csuse{@sessubtitle}}}
+ \protected@eappto\programlistbeamer{\noexpand\BeamerProgramListCancelItem{\csuse{sesshortdate\thesnum}}{\csuse{sestitle\thesnum}}{\csuse{@sestitlesep}}{\csuse{@sessubtitle}}}
\else
\ifKV@session@exam
\stepcounter{exams}
\protected@csxdef{examsesno\theexams}{\thesnum}
- \protected@eappto\programlistexam{\noexpand\item[{\noexpand\bfseries\csuse{sesshortdate\thesnum}}]%
- \csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}}
- \protected@eappto\programlistbeamerexam{\noexpand\item[{\noexpand\bfseries\csuse{sesshortdate\thesnum}}]%
- \csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}}
+ \protected@eappto\programlistexam{\noexpand\ProgramListExamItem{\csuse{sesshortdate\thesnum}}{\csuse{sestitle\thesnum}}{\csuse{@sestitlesep}}{\csuse{@sessubtitle}}}
+ \protected@eappto\programlistbeamerexam{\noexpand\BeamerProgramListExamItem{\csuse{sesshortdate\thesnum}}{\csuse{sestitle\thesnum}}{\csuse{@sestitlesep}}{\csuse{@sessubtitle}}}
\ifcsempty{sesbib\thesnum}{}{%
\xappto\jsbiblist{\noexpand\section{\csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}}%
\noexpand\nocite{*}%
@@ -967,10 +1021,8 @@
\ifKV@session@draft
\ifcsempty{@sestitle}{\protected@csxdef{sestitle\thesnum}{\sestopic}}{}
\fi
- \protected@eappto\programlist{\noexpand\item[{\noexpand\bfseries\csuse{sesshortdate\thesnum}}]%
- \csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}}
- \protected@eappto\programlistbeamer{\noexpand\item[{\noexpand\bfseries\csuse{sesshortdate\thesnum}}]%
- \csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}}
+ \protected@eappto\programlist{\noexpand\ProgramListItem{\csuse{sesshortdate\thesnum}}{\csuse{sestitle\thesnum}}{\csuse{@sestitlesep}}{\csuse{@sessubtitle}}}
+ \protected@eappto\programlistbeamer{\noexpand\BeamerProgramListItem{\csuse{sesshortdate\thesnum}}{\csuse{sestitle\thesnum}}{\csuse{@sestitlesep}}{\csuse{@sessubtitle}}}
\ifcsempty{sesbib\thesnum}{}{%
\xappto\jsbiblist{\noexpand\section{\csuse{sestitle\thesnum}\csuse{@sestitlesep}\csuse{@sessubtitle}}%
\noexpand\nocite{*}%
@@ -993,10 +1045,10 @@
}{\stepcounter{autooffsetcounter}}
}{}
\ifx\empty#1
- \protected@eappto\programlist{\noexpand\begin{center} (#2) \noexpand\end{center}}
+ \protected@eappto\programlist{\noexpand\ProgramListBreak{#2}}
\protected@eappto\programlistbeamer{\noexpand\begin{center} (#2) \noexpand\end{center}}
\else
- \protected@eappto\programlist{\noexpand\begin{center} (#1: #2) \noexpand\end{center}}
+ \protected@eappto\programlist{\noexpand\ProgramListBreak[#1]{#2}}
\protected@eappto\programlistbeamer{\noexpand\begin{center} (#1: #2) \noexpand\end{center}}
\fi
}
@@ -1026,10 +1078,10 @@
\stepcounter{loopcounter}
\repeat
\ifcsempty{@breakspan}{%
- \protected@eappto\programlist{\noexpand\begin{center} (#2) \noexpand\end{center}}
+ \protected@eappto\programlist{\noexpand\ProgramListBreak{#2}}
\protected@eappto\programlistbeamer{\noexpand\begin{center} (#2) \noexpand\end{center}}
}{%
- \protected@eappto\programlist{\noexpand\begin{center} (\csuse{@breakspan}: #2) \noexpand\end{center}}
+ \protected@eappto\programlist{\noexpand\ProgramListBreak[\csuse{@breakspan}]{#2}}
\protected@eappto\programlistbeamer{\noexpand\begin{center} (\csuse{@breakspan}: #2) \noexpand\end{center}}
}
}
@@ -1051,21 +1103,18 @@
\newtoggle{inblock}
\newcommand*\StartBlock[1]{%
\stepcounter{blocks}%
- \protected@eappto\programlist{\noexpand\item[{\noexpand\bfseries\Roman{blocks}}.]%
- \noexpand\bgroup\noexpand\bfseries #1\noexpand\egroup}%
- \gappto\programlist{\begin{labeling}{\lecprogramlistindent}}%
- \protected@eappto\programlistbeamer{\noexpand\item[{\noexpand\bfseries\Roman{blocks}}.]%
- \noexpand\bgroup\noexpand\bfseries #1\noexpand\egroup}%
- \gappto\programlistbeamer{\begin{description}[\lecprogramlistindent]}
- \protected@xappto\programblocklistbeamer{\noexpand\item[{\Roman{blocks}}.] #1}%
+ \protected@eappto\programlist{\noexpand\begin{ProgramListBlock}{\Roman{blocks}}{#1}}
+ \protected@eappto\programlistbeamer{\noexpand\BeamerProgramBlockItem{\Roman{blocks}}{#1}}%
+ \gappto\programlistbeamer{\begin{BeamerProgramList}}
+ \protected@xappto\programblocklistbeamer{\noexpand\BeamerProgramBlockBlocksOnlyItem{\Roman{blocks}}{#1}}%
\csxdef{@currentblock}{#1}%
\csxdef{@currentblockno}{\Roman{blocks}}%
\global\toggletrue{inblock}%
}
\newcommand*\EndBlock{%
- \gappto\programlist{\end{labeling}}
- \gappto\programlistbeamer{\end{description}}
+ \gappto\programlist{\end{ProgramListBlock}}
+ \gappto\programlistbeamer{\end{BeamerProgramList}}
\csxdef{@currentblock}{}%
\csxdef{@currentblockno}{}%
\global\togglefalse{inblock}%
@@ -1077,14 +1126,12 @@
}
\newcommand*\@PauseBlock{%
- \gappto\programlist{\end{labeling}}
- \gappto\programlistbeamer{\end{description}}
+ \gappto\programlistbeamer{\end{BeamerProgramList}}
}
\newcommand*\@ResumeBlock{%
% the \item here is necessary since this is nested immediately into another list
- \gappto\programlist{\item \begin{labeling}{\lecprogramlistindent}}%
- \gappto\programlistbeamer{\item \begin{description}[\lecprogramlistindent]}
+ \gappto\programlistbeamer{\item \begin{BeamerProgramList}}
}
\newenvironment{SessionBlock}[1]{\StartBlock{#1}}{\EndBlock}
@@ -1136,6 +1183,7 @@
%
\newcounter{pressession}
+\setcounter{pressession}{1}
\newcounter{lastpressession}
\providebool{deflastpressession}
@@ -1154,46 +1202,52 @@
\newcommand\makepreslist{%
\@ifstar{\@makeblankpreslist}{\@makepreslist}%
}
+\newcommand*\emptypressession{---}
+\newcommand*\presseparator{\par}
% Unstarred: use sespresstudents
\newcommand\@makepreslist{%
\ifbool{deflastpressession}{}{\setcounter{lastpressession}{\thesnum}}%
- \begin{labeling}{\lecprogramlistindent}
+ \begin{PresList}
\whiledo {\not{\value{pressession} > \value{lastpressession}}}%
{%
\ThisSession{\thepressession}%
\if\relax\sespresstudents\relax
- \MakeProgramline{\thepressession}\par
- ---
+ \MakePresListLine{\thepressession}\presseparator%
+ \emptypressession
\else
- \MakeProgramline{\thepressession}\par
+ \MakePresListLine{\thepressession}\presseparator%
\SessionPresStudents{\thepressession}
\fi
\stepcounter{pressession}%
}
- \end{labeling}
+ \end{PresList}
}
+\newlength\blankpreslistvspace
+\setlength\blankpreslistvspace{2\baselineskip}
% Starred: blank list
\newcommand\@makeblankpreslist{%
\ifbool{deflastpressession}{}{\setcounter{lastpressession}{\thesnum}}%
- \begin{labeling}{\lecprogramlistindent}
+ \begin{PresList}
\whiledo {\not{\value{pressession} > \value{lastpressession}}}%
{%
- \MakeProgramline{\thepressession}\vspace{2\baselineskip}
+ \MakePresListLine{\thepressession}\vspace{\blankpreslistvspace}
\stepcounter{pressession}%
}
- \end{labeling}
+ \end{PresList}
}
% A beamer-specific version
+\newcommand*\beamerpresseparator{:\ }
\newcommand\makebeamerpreslist{%
\ifbool{deflastpressession}{}{\setcounter{lastpressession}{\thesnum}}%
- \begin{description}[\lecprogramlistindent]
+ \begin{BeamerPresList}
\whiledo {\not{\value{pressession} > \value{lastpressession}}}%
{%
- \MakeProgramline{\thepressession}: \SessionPresStudents{\thepressession}
+ \MakeBeamerPresListLine{\thepressession}\beamerpresseparator%
+ \SessionPresStudents{\thepressession}
\stepcounter{pressession}%
}
- \end{description}
+ \end{BeamerPresList}
}
@@ -1398,6 +1452,16 @@
\lsestitle\lsestitlesep\lsessubtitle%
}
+% Program line suitable for preslist
+\newcommand*\MakePresListLine[1]{%
+ \LocalSession{#1}%
+ \PresListItem{\lsesshortdate}{\lsestitle}{\lsestitlesep}{\lsessubtitle}%
+}
+\newcommand*\MakeBeamerPresListLine[1]{%
+ \LocalSession{#1}%
+ \BeamerPresListItem{\lsesshortdate}{\lsestitle}{\lsestitlesep}{\lsessubtitle}%
+}
+
% Get information for adjacent (next, previous etc.) sessions
%
% Full title
diff --git a/macros/latex/contrib/jslectureplanner/jslectureplanner.tex b/macros/latex/contrib/jslectureplanner/jslectureplanner.tex
index a5aff8fa2a..4792ba03bb 100644
--- a/macros/latex/contrib/jslectureplanner/jslectureplanner.tex
+++ b/macros/latex/contrib/jslectureplanner/jslectureplanner.tex
@@ -1,3 +1,4 @@
+% !TeX spellcheck = en_US
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% File jslectureplanner.tex
%%
@@ -54,6 +55,20 @@
\vfuzz \hfuzz
\raggedbottom
+\usepackage[bookmarks=true,
+bookmarksnumbered=false,
+bookmarksopen=false,
+breaklinks=false,
+pdfborder={0 0 0},
+backref=false,
+colorlinks=false
+]{hyperref}
+\hypersetup{%
+ pdftitle={The jslectureplanner manual},
+ pdfauthor={Jürgen Spitzmüller},
+ pdfkeywords={latex,course planning}
+}
+
\usepackage{microtype}
\usepackage{babel}
@@ -72,7 +87,7 @@
\author{Jürgen Spitzmüller%
\thanks{Please report issues via \protect\url{https://github.com/jspitz/jslectureplanner}.}}
-\date{Version 1.10, 2020/04/30}
+\date{Version 1.11, 2020/05/11}
\maketitle
@@ -343,6 +358,8 @@ your university
\item \jcsmacro{SessionTitleSep\{\jparam{separator}\}}: Specify a default separator between session title and subtitle (e.\,g., ``. '' or `` -- ''). This is used if no specific separator has been specified in the session entry (see sec.~\ref{sec:lecplan}); by default, no separator is defined.
\end{itemize}
+\clearpage
+
\section{Setting up a course schedule}\label{sec:lecplan}
In the metadata file, you can set up a schedule for the course by entering
@@ -355,7 +372,7 @@ macro:
Valid \joption{\jparam{options}} include:
\begin{itemize}
\item \joption{draft=\jparam{true|false}}: If \joption{true}, a placeholder text (by default: ``Thema \jparam{n}'',
- see sec.~\ref{sec:misccust}) will be output if no session title is defined.
+ see sec.~\ref{sec:listcust}) will be output if no session title is defined.
This might be handy for planning the schedule.
\item \joption{topicnumber=\jparam{n}}: In draft mode, reset the current topic number of this session to \jparam{n}.
All subsequent topics will be calculated from this unless reset again. This might be useful if only part of
@@ -523,10 +540,11 @@ e-learning platform
\item \jcsmacro{officenumber}: Outputs the office (room) number
\end{itemize}
-\subsection{Generating course programs}
+\subsection{Generating course programs}\label{subsec:genprog}
\label{sec:lecprog}
\begin{itemize}
-\item \jcsmacro{makeprogram}: Generates a course program in the form:
+\item \jcsmacro{makeprogram}: Generates a course program that, by default,
+expands to the form:
\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
frame=single,escapechar=\$]
\begin{labeling}{\lecprogramlistindent}
@@ -540,6 +558,7 @@ e-learning platform
The \jmacro{labeling} environment is defined by the KOMA classes.
The package provides a fallback, however, if a different class is used.
+The list type can also be customized. See sec.~\ref{sec:listcust} for details.
\item \jcsmacro{makebeamerprogram[\jparam{options}]}: Generates
a beamer-suited lecture program from the metadata in the form
@@ -557,6 +576,8 @@ a beamer-suited lecture program from the metadata in the form
\end{frame}
\end{lstlisting}
+Again, see sec.~\ref{sec:listcust} for customization possibilities.
+
Note that
\begin{itemize}
\item multiple subsequent frames (not just slides) are generated if the metadata
@@ -644,6 +665,7 @@ presenting students, i.\,e., it expands to code in the form:
\end{lstlisting}
If no presenting students have been assigned to a given session,
an em-dash (---) is output instead.
+This all can be customized (please refer to sec.~\ref{sec:listcust} for details).
A starred version of the macro outputs a ``blank'' presentation list that just consists of
the session dates and titles with enough space to fill in student names manually.
@@ -910,31 +932,237 @@ As for the time span, this is defined in the macro \jcsmacro{jstimeslot}, which
\end{lstlisting}
The time format itself can be customized by the means of \textsf{datetime2} (timestyle). Please refer to the package's manual for details.
-\subsection{Misc. customizing}\label{sec:misccust}
-The canceling output is ``Session title -- keine \jparam{Session}'' (``keine''
+\subsection{Customizing program and presentation list appearance}\label{sec:listcust}
+
+\subsubsection{List layout}
+The course program generated by \jcsmacro{makeprogram} is typeset using
+a \textit{labeling} list, i.\,e., a description list
+with a customizable indentation (see sec.~\ref{subsec:genprog}).
+Since \jslp\ uses customizable environments, this can be easily changed.
+Simply redefine the following environment (\jcsmacro{lecprogramlistindent}
+holds a string that represents the indentation width; see below):
+
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[1]{lecprogramlistindent}}]
+\newenvironment{ProgramList}{\begin{labeling}{\lecprogramlistindent}}{\end{labeling}}
+\end{lstlisting}
+%
+This will also change the list of the exam sessions generated by \jcsmacro{makeexamprogram}
+and the student presentation lists generated by \jcsmacro{makepreslist}.
+If you want these lists to look different from the normal program list, redefine:
+
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single]
+\newenvironment{ProgramListExam}{\begin{ProgramList}}{\end{ProgramList}}
+\end{lstlisting}
+%
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single]
+\newenvironment{PresList}{\begin{ProgramList}}{\end{ProgramList}}
+\end{lstlisting}
+%
+For beamer programs, exam and presentation lists, a description environment is used instead,
+and the respective commands are
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[1]{lecprogramlistindent}}]
+\newenvironment{BeamerProgramList}{\begin{description}[\lecprogramlistindent]}%
+ {\end{description}}
+\end{lstlisting}
+%
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[1]{lecprogramlistindent}}]
+\newenvironment{BeamerPresList}{\begin{BeamerProgramList}}{\end{BeamerProgramList}}
+\end{lstlisting}
+%
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[1]{lecprogramlistindent}}]
+\newenvironment{BeamerProgramListExam}{\begin{BeamerProgramList}}{\end{BeamerProgramList}}
+\end{lstlisting}
+%
+The individual lines of the program are defined in the following macro that can be redefined
+(\texttt{\#1} represents the date, \texttt{\#2} the session title, \texttt{\#3} the session title--subtitle separator,
+and \texttt{\#4} the session subtitle; for the used text formatting macros, see sec.~\ref{subsec:textform}):
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{ProgramListItem,programdateformat,sestitleformat}}]
+\newcommand*{\ProgramListItem}[4]{\item[\programdateformat{#1}] \sestitleformat{#2#3#4}}
+\end{lstlisting}
+%
+This also redefines the presentation list items.
+If you want these lists to look different from the normal program list, redefine:
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[2]{PresListItem,ProgramListItem}}]
+\newcommand*\PresListItem[4]{%
+ \ProgramListItem{#1}{#2}{#3}{#4}%
+}
+\end{lstlisting}
+%
+Analogous macros for canceled session items, exam items and presentation list items are:
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{ProgramListCancelItem,programdateformat,cansestitleformat}}]
+\newcommand*{\ProgramListCancelItem}[4]{\item[\programdateformat{#1}]
+ \cansestitleformat{#2#3#4 \leccancel}}
+\end{lstlisting}
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{ProgramListExamItem,programdateformat,exsestitleformat}}]
+\newcommand*{\ProgramListExamItem}[4]{\item[\programdateformat{#1}]
+ \exsestitleformat{#2#3#4}}
+\end{lstlisting}
+%
+For the beamer program, the respective macros are:
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{BeamerProgramListItem,programdateformat,sestitleformat}}]
+\newcommand*{\BeamerProgramListItem}[4]{\item[\programdateformat{#1}]
+ \sestitleformat{#2#3#4}}
+\end{lstlisting}
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[2]{BeamerPresListItem,BeamerProgramListItem}}]
+\newcommand*\BeamerPresListItem[4]{%
+ \BeamerProgramListItem{#1}{#2}{#3}{#4}%
+}
+\end{lstlisting}
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{BeamerProgramListCancelItem,programdateformat,cansestitleformat}}]
+\newcommand*{\BeamerProgramListCancelItem}[4]{\item[\programdateformat{#1}]
+ \cansestitleformat{#2#3#4\leccancel}}
+\end{lstlisting}
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{BeamerProgramListExamItem,programdateformat,exsestitleformat}}]
+\newcommand*{\BeamerProgramListExamItem}[4]{\item[\programdateformat{#1}]
+ \exsestitleformat{#2#3#4}}
+\end{lstlisting}
+%
+The program block titles are set in the embedding list via the following macro:
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{ProgramBlockItem,blocknumberformat,blocktitleformat}}]
+\newcommand*{\ProgramBlockItem}[2]{\item[\blocknumberformat{#1}.] \blocktitleformat{#2}}
+\end{lstlisting}
+%
+For beamer, the following is used with \joption{blocksonly=false}:
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[3]{BeamerProgramBlockItem,blocknumberformat,blocktitleformat}}]
+\newcommand*{\BeamerProgramBlockItem}[2]{\item[\blocknumberformat{#1}.]
+ \blocktitleformat{#2}}
+\end{lstlisting}
+%
+and the following is used with \joption{blocksonly=true}:
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},
+frame=single,moretexcs={[1]{BeamerProgramBlockBlocksOnlyItem}}]
+\newcommand*{\BeamerProgramBlockBlocksOnlyItem}[2]{\item[#1.] #2}
+\end{lstlisting}
+%
+The indentation used in program lists can be changed by redefining
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+moretexcs={[2]{lecprogramlistindent,programdateformat}}]
+\newcommand*\lecprogramlistindent{\programdateformat{88.\,88.}}
+\end{lstlisting}
+%
+The vertical space that separates lines in blank presentation lists can be changed
+by redefining
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+moretexcs={[2]{blankpreslistvspace,setlength}}]
+\setlength\blankpreslistvspace{2\baselineskip}
+\end{lstlisting}
+%
+The separator between session title and presenting students in presentation lists
+can be adjusted by changing
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+moretexcs={[1]{presseparator}}]
+\newcommand*\presseparator{\par}
+\end{lstlisting}
+%
+For beamer presentation lists, the adaptation can be done by changing
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+moretexcs={[1]{beamerpresseparator}}]
+\newcommand*\beamerpresseparator{:\ }
+\end{lstlisting}
+
+
+\subsubsection{Text formatting}\label{subsec:textform}
+
+If you only want to change the formatting of lines, you do not need to redefine the whole macros
+describe above. You can simply adjust the respective markup macros, as described in what follows.
+
+The dates in the program are bold by default. You can change this globally by redefining
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+moretexcs={[1]{programdateformat}}]
+\newcommand*\programdateformat[1]{\textbf{#1}}
+\end{lstlisting}
+%
+Cancelled session titles in the program are bold by default as well. You can change this globally by redefining
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+frame=single,moretexcs={[1]{cansestitleformat}}]
+\newcommand*\cansestitleformat[1]{\textbf{#1}}
+\end{lstlisting}
+%
+Normal session titles, on the other hand, are by default not emphasized at all. You can also change this
+globally by redefining
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+frame=single,moretexcs={[1]{sestitleformat}}]
+\newcommand*\sestitleformat[1]{#1}
+\end{lstlisting}
+%
+Exam session titles are copies of the above. You can also change this
+globally by redefining
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+frame=single,moretexcs={[2]{exsestitleformat,sestitleformat}}]
+\newcommand*\exsestitleformat[1]{\sestitleformat{#1}}
+\end{lstlisting}
+%
+Session block titles and session block numbers can be redefined by changing
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+frame=single,moretexcs={[1]{blocktitleformat}}]
+\newcommand*\blocktitleformat[1]{\textbf{#1}}
+\end{lstlisting}
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+frame=single,moretexcs={[1]{blocknumberformat}}]
+\newcommand*\blocknumberformat[1]{\textbf{#1}}
+\end{lstlisting}
+%
+If you want to change the line in which semester breaks are output, redefine
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+frame=single,moretexcs={[1]{breakevent}}]
+\newcommand*{\ProgramListBreak}[2][\empty]%
+{%
+ \begin{center}
+ (\breakevent{#1}{: }{#2})
+ \end{center}%
+}
+\end{lstlisting}
+%
+\jcsmacro{breakevent} thereby checks whether a date range has been given (\texttt{\#1}),
+and if so, it is output followed by the separator given as second argument and the break
+title (\texttt{\#2}). If not, only the break title (\texttt{\#2}) is output.
+
+\subsubsection{Strings}
+
+For canceled sessions, the program outputs
+``\jparam{Session title} -- keine \jparam{Session}'' (``keine''
is German for ``no''). To modify or translate this, redefine the
following macro
-\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single]
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+ moretexcs={[2]{leccancel,lectypesession}}]
\newcommand*\leccancel{\ -- keine \lectypesession}
\end{lstlisting}
The default program string used in beamer frames can be changed by
redefining
-\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single]
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+ moretexcs={[1]{lecprogram}}]
\newcommand*\lecprogram{Programm}
\end{lstlisting}
-The indentation used in program lists can be changed by redefining
-\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single]
-\newcommand*\lecprogramlistindent{\textbf{88.\,88.}}
-\end{lstlisting}
The placeholder text for session without title with \joption{draft=true}
(see sec.~\ref{sec:lecplan}) is ``Thema \jparam{n}'' (``Thema'' is German for ``topic'').
-It can be changed by redefinition of this macro (\lstinline|\thesestopic| outputs
+It can be changed by redefinition of this macro (\jcsmacro{thesestopic} outputs
the value of the internal topic counter).
-\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single]
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+ moretexcs={[2]{sestopic,thesestopic}}]
\newcommand*\sestopic{Thema~\thesestopic}
\end{lstlisting}
-Use \jfcsmacro{renewcommand{*}} for the redefinitions.
+%
+The placeholder for presentation sessions with no students assigned (by default
+an em-dash), can be redefined by changing
+\begin{lstlisting}[language={[LaTeX]TeX},basicstyle={\small\ttfamily},frame=single,
+moretexcs={[1]{emptypressession}}]
+\newcommand*\emptypressession{---}
+\end{lstlisting}
\subsection{Using styles}\label{sec:styles}
@@ -1190,7 +1418,8 @@ a \emph{stackexchange} post by Enrico Gregorio (\url{http://tex.stackexchange.co
The time span calculation uses code provided by Christian Hupfer at
\url{https://tex.stackexchange.com/a/473552/19291}.
Thank you, Herbert, Enrico and Christian!
-Richard Zach provided a fix and enhancement to \jcsmacro{SetAutoOffset}. Many thanks for this.
+Richard Zach provided a fix and enhancement to \jcsmacro{SetAutoOffset} and code to customize
+the program list. Many thanks for this.
Finally, Dominik Waßenhoven tested the package and provided
me with multiple suggestions, which effectively manifested in major new features such as
the \jslp\ style files. Thanks, Dominik.
@@ -1198,6 +1427,11 @@ the \jslp\ style files. Thanks, Dominik.
\section{Release History}
\begin{itemize}
+\item 2020/05/11 (v. 1.11):
+ \begin{itemize}
+ \item Allow for customization of program and presentation lists (see sec.~\ref{sec:listcust}).
+ \item Correctly set first session in presentation list.
+ \end{itemize}
\item 2020/04/30 (v. 1.10):
\begin{itemize}
\item Do not increment session topic counter for cancelled sessions and breaks.
diff --git a/macros/latex/contrib/jslectureplanner/jsmembertable.sty b/macros/latex/contrib/jslectureplanner/jsmembertable.sty
index 7ec35c292d..8d8b634bba 100644
--- a/macros/latex/contrib/jslectureplanner/jsmembertable.sty
+++ b/macros/latex/contrib/jslectureplanner/jsmembertable.sty
@@ -24,8 +24,8 @@
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\filedate{2020/04/30}
-\def\fileversion{1.10}
+\def\filedate{2020/05/11}
+\def\fileversion{1.11}
\def\filename{jsmembertable.sty}
\NeedsTeXFormat{LaTeX2e}
diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md
index fdcb30461f..5baa671d01 100644
--- a/macros/latex/contrib/l3kernel/CHANGELOG.md
+++ b/macros/latex/contrib/l3kernel/CHANGELOG.md
@@ -7,6 +7,11 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2020-05-11]
+
+### Changed
+- Internal changes to quark handling
+
## [2020-05-05]
### Added
@@ -673,7 +678,8 @@ this project uses date-based 'snapshot' version identifiers.
- Step func­tions have been added for dim vari­ables,
e.g. `\dim_step_in­line:nnnn`
-[Unreleased]: https://github.com/latex3/latex3/compare/2020-05-05...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2020-05-11...HEAD
+[2020-05-11]: https://github.com/latex3/latex3/compare/2020-05-05...2020-05-11
[2020-05-05]: https://github.com/latex3/latex3/compare/2020-04-06...2020-05-05
[2020-04-06]: https://github.com/latex3/latex3/compare/2020-03-06...2020-04-06
[2020-03-06]: https://github.com/latex3/latex3/compare/2020-03-03...2020-03-06
diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md
index 2dc96da2b8..3a7c3730b9 100644
--- a/macros/latex/contrib/l3kernel/README.md
+++ b/macros/latex/contrib/l3kernel/README.md
@@ -1,7 +1,7 @@
LaTeX3 Programming Conventions
==============================
-Release 2020-05-05
+Release 2020-05-11
Overview
--------
diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx
index 3c90cc81a3..a24e520f45 100644
--- a/macros/latex/contrib/l3kernel/expl3.dtx
+++ b/macros/latex/contrib/l3kernel/expl3.dtx
@@ -24,7 +24,7 @@
%
%<*driver|generic|package|2ekernel>
%</driver|generic|package|2ekernel>
-\def\ExplFileDate{2020-05-05}%
+\def\ExplFileDate{2020-05-11}%
%<*driver>
\documentclass[full]{l3doc}
\usepackage{graphicx}
@@ -51,7 +51,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1334,6 +1334,17 @@
{ \sys_everyjob: }
% \end{macrocode}
%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks. This code has to be reload-safe, so this one
+% has to be guarded with \cs{if_cs_exist:N} (\cs{cs_if_exist:NF}) wouldn't
+% do because it returns false for control sequences equal to \cs{scan_stop:}.
+% \begin{macrocode}
+\reverse_if:N \if_cs_exist:N \s_@@_stop
+ \scan_new:N \s_@@_stop
+\fi:
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\@pushfilename, \@popfilename}
% \begin{macro}{\@@_status_pop:w}
% The idea here is to use \LaTeXe{}'s \tn{@pushfilename} and
@@ -1372,14 +1383,14 @@
\__kernel_file_input_pop:
\tl_if_empty:NTF \l_@@_status_stack_tl
{ \ExplSyntaxOff }
- { \exp_after:wN \@@_status_pop:w \l_@@_status_stack_tl \q_stop }
+ { \exp_after:wN \@@_status_pop:w \l_@@_status_stack_tl \s_@@_stop }
}
% \end{macrocode}
% The pop auxiliary function removes the first item from the stack,
% saves the rest of the stack and then does the test. The flag here
% is not a proper \texttt{bool}, so a low-level test is used.
% \begin{macrocode}
-\cs_gset_protected:Npn \@@_status_pop:w #1#2 \q_stop
+\cs_gset_protected:Npn \@@_status_pop:w #1#2 \s_@@_stop
{
\tl_set:Nn \l_@@_status_stack_tl {#2}
\int_if_odd:nTF {#1}
diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf
index 7c1568abfb..b16b80e0c7 100644
--- a/macros/latex/contrib/l3kernel/expl3.pdf
+++ b/macros/latex/contrib/l3kernel/expl3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf
index 302d3f088b..f91da62ed4 100644
--- a/macros/latex/contrib/l3kernel/interface3.pdf
+++ b/macros/latex/contrib/l3kernel/interface3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex
index 7b0c6e179b..e1b46c0897 100644
--- a/macros/latex/contrib/l3kernel/interface3.tex
+++ b/macros/latex/contrib/l3kernel/interface3.tex
@@ -54,7 +54,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2020-05-05}
+\date{Released 2020-05-11}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/l3kernel/l3.ins b/macros/latex/contrib/l3kernel/l3.ins
index 86d4ac5280..04d1e18a34 100644
--- a/macros/latex/contrib/l3kernel/l3.ins
+++ b/macros/latex/contrib/l3kernel/l3.ins
@@ -65,9 +65,9 @@ and all files in that bundle must be distributed together.
\from{l3names.dtx} {package}
\from{l3basics.dtx} {package}
\from{l3expan.dtx} {package}
+ \from{l3quark.dtx} {package}
\from{l3tl.dtx} {package}
\from{l3str.dtx} {package}
- \from{l3quark.dtx} {package}
\from{l3seq.dtx} {package}
\from{l3int.dtx} {package}
\from{l3flag.dtx} {package}
diff --git a/macros/latex/contrib/l3kernel/l3alloc.dtx b/macros/latex/contrib/l3kernel/l3alloc.dtx
index fee2e0fdfa..188477adcf 100644
--- a/macros/latex/contrib/l3kernel/l3alloc.dtx
+++ b/macros/latex/contrib/l3kernel/l3alloc.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx
index 5784ade6f5..22b7a75d15 100644
--- a/macros/latex/contrib/l3kernel/l3basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1368,6 +1368,7 @@
\tex_let:D \if_charcode:w \tex_if:D
\tex_let:D \if_catcode:w \tex_ifcat:D
\tex_let:D \if_meaning:w \tex_ifx:D
+\tex_let:D \if_bool:N \tex_ifodd:D
% \end{macrocode}
% \end{macro}
%
@@ -1693,7 +1694,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}
+% \begin{macro}[EXP]
% {
% \use_i_delimit_by_q_nil:nw ,
% \use_i_delimit_by_q_stop:nw ,
@@ -1846,6 +1847,14 @@
% two arguments are absorbed then the code would work.
% \end{macro}
%
+% \begin{macro}[EXP]{\@@_use_none_delimit_by_q_recursion_stop:w}
+% Private version of \cs{use_none_delimit_by_q_recursion_stop:w}.
+% \begin{macrocode}
+\cs_set:Npn \@@_use_none_delimit_by_q_recursion_stop:w
+ #1 \q_@@_recursion_stop { }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}
% {
% \prg_set_conditional:Npnn ,
@@ -1981,17 +1990,17 @@
\exp_not:N \@@_generate_conditional:NNnnnnNw
\exp_not:n { #4 #5 {#1} {#2} {#6} }
\@@_generate_conditional_test:w
- #8 \q_mark
+ #8 \s_@@_mark
\@@_generate_conditional_fast:nw
- \prg_return_true: \else: \prg_return_false: \fi: \q_mark
+ \prg_return_true: \else: \prg_return_false: \fi: \s_@@_mark
\use_none:n
\exp_not:n { {#8} \use_i_ii:nnn }
\tl_to_str:n {#7}
- \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
+ \exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop }
}
}
\cs_set:Npn \@@_generate_conditional_test:w
- #1 \prg_return_true: \else: \prg_return_false: \fi: \q_mark #2
+ #1 \prg_return_true: \else: \prg_return_false: \fi: \s_@@_mark #2
{ #2 {#1} }
\cs_set:Npn \@@_generate_conditional_fast:nw #1#2 \exp_not:n #3
{ \exp_not:n { {#1} \use_i:nn } }
@@ -2006,8 +2015,8 @@
% \begin{macrocode}
\cs_set_protected:Npn \@@_generate_conditional:NNnnnnNw #1#2#3#4#5#6#7#8 ,
{
- \if_meaning:w \q_recursion_tail #8
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \if_meaning:w \q_@@_recursion_tail #8
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\fi:
\use:c { @@_generate_ #8 _form:wNNnnnnN }
\tl_if_empty:nF {#8}
@@ -2017,7 +2026,7 @@
{#8} { \token_to_str:c { #3 : #4 } }
}
\use_none:nnnnnnnn
- \q_stop
+ \s_@@_stop
#1 #2 {#3} {#4} {#5} {#6} #7
\@@_generate_conditional:NNnnnnNw #1 #2 {#3} {#4} {#5} {#6} #7
}
@@ -2052,7 +2061,7 @@
% nesting of conditionals.
% \begin{macrocode}
\cs_set_protected:Npn \@@_generate_p_form:wNNnnnnN
- #1 \q_stop #2#3#4#5#6#7#8
+ #1 \s_@@_stop #2#3#4#5#6#7#8
{
\if_meaning:w e #3
\exp_after:wN \use_i:nn
@@ -2071,7 +2080,7 @@
}
}
\cs_set_protected:Npn \@@_generate_T_form:wNNnnnnN
- #1 \q_stop #2#3#4#5#6#7#8
+ #1 \s_@@_stop #2#3#4#5#6#7#8
{
#8
{ \exp_args:Nc #2 { #4 : #5 T } #6 }
@@ -2079,7 +2088,7 @@
{ #7 \exp_after:wN \use_ii:nn \fi: \use_none:n }
}
\cs_set_protected:Npn \@@_generate_F_form:wNNnnnnN
- #1 \q_stop #2#3#4#5#6#7#8
+ #1 \s_@@_stop #2#3#4#5#6#7#8
{
#8
{ \exp_args:Nc #2 { #4 : #5 F } #6 }
@@ -2087,7 +2096,7 @@
{ #7 \exp_after:wN \use_none:nn \fi: \use:n }
}
\cs_set_protected:Npn \@@_generate_TF_form:wNNnnnnN
- #1 \q_stop #2#3#4#5#6#7#8
+ #1 \s_@@_stop #2#3#4#5#6#7#8
{
#8
{ \exp_args:Nc #2 { #4 : #5 TF } #6 }
@@ -2104,8 +2113,8 @@
% The setting-equal functions. Split both functions and feed
% \Arg{name_1} \Arg{signature_1} \meta{boolean_1}
% \Arg{name_2} \Arg{signature_2} \meta{boolean_2}
-% \meta{copying~function} \meta{conditions} |,| \cs{q_recursion_tail}
-% |,| \cs{q_recursion_stop}
+% \meta{copying~function} \meta{conditions} |,| \cs{q_@@_recursion_tail}
+% |,| \cs{q_@@_recursion_stop}
% to a first auxiliary.
% \begin{macrocode}
\cs_set_protected:Npn \prg_set_eq_conditional:NNn
@@ -2121,7 +2130,7 @@
\cs_split_function:N #3
\exp_not:N #1
\tl_to_str:n {#4}
- \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
+ \exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop }
}
}
% \end{macrocode}
@@ -2156,19 +2165,19 @@
\if_meaning:w \c_false_bool #3
\__kernel_msg_error:nnx { kernel } { missing-colon }
{ \token_to_str:c {#1} }
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\fi:
\if_meaning:w \c_false_bool #6
\__kernel_msg_error:nnx { kernel } { missing-colon }
{ \token_to_str:c {#4} }
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\fi:
\@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#4} {#5}
}
\cs_set_protected:Npn \@@_set_eq_conditional_loop:nnnnNw #1#2#3#4#5#6 ,
{
- \if_meaning:w \q_recursion_tail #6
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \if_meaning:w \q_@@_recursion_tail #6
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\fi:
\use:c { @@_set_eq_conditional_ #6 _form:wNnnnn }
\tl_if_empty:nF {#6}
@@ -2178,17 +2187,17 @@
{#6} { \token_to_str:c { #1 : #2 } }
}
\use_none:nnnnnn
- \q_stop
+ \s_@@_stop
#5 {#1} {#2} {#3} {#4}
\@@_set_eq_conditional_loop:nnnnNw {#1} {#2} {#3} {#4} #5
}
-\cs_set:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \q_stop #2#3#4#5#6
+\cs_set:Npn \@@_set_eq_conditional_p_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 _p : #4 } { #5 _p : #6 } }
-\cs_set:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \q_stop #2#3#4#5#6
+\cs_set:Npn \@@_set_eq_conditional_TF_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 : #4 TF } { #5 : #6 TF } }
-\cs_set:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \q_stop #2#3#4#5#6
+\cs_set:Npn \@@_set_eq_conditional_T_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 : #4 T } { #5 : #6 T } }
-\cs_set:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \q_stop #2#3#4#5#6
+\cs_set:Npn \@@_set_eq_conditional_F_form:wNnnnn #1 \s_@@_stop #2#3#4#5#6
{ #2 { #3 : #4 F } { #5 : #6 F } }
% \end{macrocode}
% \end{macro}
@@ -2335,12 +2344,12 @@
% First ensure that we actually get a properly evaluated string by
% expanding \cs{cs_to_str:N} twice. If the function contained a
% colon, the auxiliary takes as |#1| the function name, delimited by
-% the first colon, then the signature |#2|, delimited by \cs{q_mark},
-% then \cs{c_true_bool} as |#3|, and |#4| cleans up until \cs{q_stop}.
-% Otherwise, the |#1| contains the function name and \cs{q_mark}
+% the first colon, then the signature |#2|, delimited by \cs{s_@@_mark},
+% then \cs{c_true_bool} as |#3|, and |#4| cleans up until \cs{s_@@_stop}.
+% Otherwise, the |#1| contains the function name and \cs{s_@@_mark}
% \cs{c_true_bool}, |#2| is empty, |#3| is \cs{c_false_bool}, and |#4|
% cleans up. The second
-% auxiliary trims the trailing \cs{q_mark} from the function name if
+% auxiliary trims the trailing \cs{s_@@_mark} from the function name if
% present (that is, if the original function had no colon).
% \begin{macrocode}
\cs_set_protected:Npn \@@_tmp:w #1
@@ -2349,13 +2358,13 @@
{
\exp_after:wN \exp_after:wN \exp_after:wN
\@@_split_function_auxi:w
- \cs_to_str:N ##1 \q_mark \c_true_bool
- #1 \q_mark \c_false_bool \q_stop
+ \cs_to_str:N ##1 \s_@@_mark \c_true_bool
+ #1 \s_@@_mark \c_false_bool \s_@@_stop
}
\cs_set:Npn \@@_split_function_auxi:w
- ##1 #1 ##2 \q_mark ##3##4 \q_stop
- { \@@_split_function_auxii:w ##1 \q_mark \q_stop {##2} ##3 }
- \cs_set:Npn \@@_split_function_auxii:w ##1 \q_mark ##2 \q_stop
+ ##1 #1 ##2 \s_@@_mark ##3##4 \s_@@_stop
+ { \@@_split_function_auxii:w ##1 \s_@@_mark \s_@@_stop {##2} ##3 }
+ \cs_set:Npn \@@_split_function_auxii:w ##1 \s_@@_mark ##2 \s_@@_stop
{ {##1} }
}
\exp_after:wN \@@_tmp:w \token_to_str:N :
@@ -3158,7 +3167,7 @@
\use:x
{
\exp_not:n { \cs_new:Npn \@@_prefix_arg_replacement:wN #1 }
- \tl_to_str:n { macro : } \exp_not:n { #2 -> #3 \q_stop #4 }
+ \tl_to_str:n { macro : } \exp_not:n { #2 -> #3 \s_@@_stop #4 }
}
{ #4 {#1} {#2} {#3} }
\cs_new:Npn \cs_prefix_spec:N #1
@@ -3166,7 +3175,7 @@
\token_if_macro:NTF #1
{
\exp_after:wN \@@_prefix_arg_replacement:wN
- \token_to_meaning:N #1 \q_stop \use_i:nnn
+ \token_to_meaning:N #1 \s_@@_stop \use_i:nnn
}
{ \scan_stop: }
}
@@ -3175,7 +3184,7 @@
\token_if_macro:NTF #1
{
\exp_after:wN \@@_prefix_arg_replacement:wN
- \token_to_meaning:N #1 \q_stop \use_ii:nnn
+ \token_to_meaning:N #1 \s_@@_stop \use_ii:nnn
}
{ \scan_stop: }
}
@@ -3184,7 +3193,7 @@
\token_if_macro:NTF #1
{
\exp_after:wN \@@_prefix_arg_replacement:wN
- \token_to_meaning:N #1 \q_stop \use_iii:nnn
+ \token_to_meaning:N #1 \s_@@_stop \use_iii:nnn
}
{ \scan_stop: }
}
diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
index 224163be1b..4ff6267be1 100644
--- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx
+++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx
index 3c8e9d93f2..7c6b12dd78 100644
--- a/macros/latex/contrib/l3kernel/l3box.dtx
+++ b/macros/latex/contrib/l3kernel/l3box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx
index 7ae1a7afe8..c97fb26e25 100644
--- a/macros/latex/contrib/l3kernel/l3candidates.dtx
+++ b/macros/latex/contrib/l3kernel/l3candidates.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1001,8 +1001,8 @@
\cs_new:Npn \@@_expandable_error_module:nn #1#2
{
\exp_after:wN \exp_after:wN
- \exp_after:wN \use_none_delimit_by_q_stop:w
- \use:n { \::error ! ~ #2 : ~ #1 } \q_stop
+ \exp_after:wN \@@_use_none_delimit_by_s_stop:w
+ \use:n { \::error ! ~ #2 : ~ #1 } \s_@@_stop
}
% \end{macrocode}
% \end{macro}
@@ -1079,6 +1079,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}[EXP, noTF]{\bool_case_true:n, \bool_case_false:n}
% \begin{macro}{\@@_case:NnTF}
% \begin{macro}{\@@_case_true:w, \@@_case_false:w, \@@_case_end:nw}
@@ -1104,7 +1112,7 @@
\cs_new:Npn \@@_case:NnTF #1#2#3#4
{
\bool_if:NTF #1 \@@_case_true:w \@@_case_false:w
- #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop
+ #2 #1 { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop
}
\cs_new:Npn \@@_case_true:w #1#2
{
@@ -1118,7 +1126,7 @@
{ \@@_case_false:w }
{ \@@_case_end:nw {#2} }
}
-\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop
{ \exp_end: #1 #4 }
% \end{macrocode}
% \end{macro}
@@ -1131,6 +1139,13 @@
%<@@=prop>
% \end{macrocode}
%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[EXP]
% {\prop_rand_key_value:N, \prop_rand_key_value:c}
% \begin{macro}[EXP]{\@@_rand_item:w}
@@ -1146,14 +1161,14 @@
{
\exp_after:wN \@@_rand_item:w
\int_value:w \int_rand:nn { 1 } { \prop_count:N #1 }
- #1 \q_stop
+ #1 \s_@@_stop
}
}
\cs_generate_variant:Nn \prop_rand_key_value:N { c }
\cs_new:Npn \@@_rand_item:w #1 \s_@@ \@@_pair:wn #2 \s_@@ #3
{
\int_compare:nNnF {#1} > 1
- { \use_i_delimit_by_q_stop:nw { \exp_not:n { {#2} {#3} } } }
+ { \@@_use_i_delimit_by_s_stop:nw { \exp_not:n { {#2} {#3} } } }
\exp_after:wN \@@_rand_item:w
\int_value:w \int_eval:n { #1 - 1 } \s_@@
}
@@ -1189,25 +1204,25 @@
% worrying about which is longer.
% \begin{macrocode}
\cs_new:Npn \seq_mapthread_function:NNN #1#2#3
- { \exp_after:wN \@@_mapthread_function:wNN #2 \q_stop #1 #3 }
-\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \q_stop #2#3
+ { \exp_after:wN \@@_mapthread_function:wNN #2 \s_@@_stop #1 #3 }
+\cs_new:Npn \@@_mapthread_function:wNN \s_@@ #1 \s_@@_stop #2#3
{
- \exp_after:wN \@@_mapthread_function:wNw #2 \q_stop #3
+ \exp_after:wN \@@_mapthread_function:wNw #2 \s_@@_stop #3
#1 { ? \prg_break: } { }
\prg_break_point:
}
-\cs_new:Npn \@@_mapthread_function:wNw \s_@@ #1 \q_stop #2
+\cs_new:Npn \@@_mapthread_function:wNw \s_@@ #1 \s_@@_stop #2
{
\@@_mapthread_function:Nnnwnn #2
#1 { ? \prg_break: } { }
- \q_stop
+ \s_@@_stop
}
-\cs_new:Npn \@@_mapthread_function:Nnnwnn #1#2#3#4 \q_stop #5#6
+\cs_new:Npn \@@_mapthread_function:Nnnwnn #1#2#3#4 \s_@@_stop #5#6
{
\use_none:n #2
\use_none:n #5
#1 {#3} {#6}
- \@@_mapthread_function:Nnnwnn #1 #4 \q_stop
+ \@@_mapthread_function:Nnnwnn #1 #4 \s_@@_stop
}
\cs_generate_variant:Nn \seq_mapthread_function:NNN { Nc , c , cc }
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx
index ec24d2de47..0b011f80e0 100644
--- a/macros/latex/contrib/l3kernel/l3clist.dtx
+++ b/macros/latex/contrib/l3kernel/l3clist.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -94,8 +94,7 @@
% than their sequence analogues for large lists. However, these
% functions work slowly for \enquote{unsafe} items that must be braced,
% and may produce errors when their argument contains |{|, |}| or |#|
-% (assuming the usual \TeX{} category codes apply). In addition, comma
-% lists cannot store quarks \cs{q_mark} or \cs{q_stop}. The sequence
+% (assuming the usual \TeX{} category codes apply). The sequence
% data type should thus certainly be preferred to comma lists to store
% such items.
%
@@ -785,6 +784,41 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_use_none_delimit_by_s_stop:w,
+% \@@_use_i_delimit_by_s_stop:nw
+% }
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_break:nN,\@@_if_recursion_tail_stop:n}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_break:nN
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:n
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_tmp:w}
% A temporary function for various purposes.
% \begin{macrocode}
@@ -826,11 +860,11 @@
{
\exp_after:wN \@@_sanitize:Nn \exp_after:wN \c_empty_tl
\exp:w \@@_trim_next:w \prg_do_nothing:
- #1 , \q_recursion_tail , \q_recursion_stop
+ #1 , \q_@@_recursion_tail , \q_@@_recursion_stop
}
\cs_new:Npn \@@_sanitize:Nn #1#2
{
- \quark_if_recursion_tail_stop:n {#2}
+ \@@_if_recursion_tail_stop:n {#2}
#1 \@@_wrap_item:w #2 ,
\exp_after:wN \@@_sanitize:Nn \exp_after:wN ,
\exp:w \@@_trim_next:w \prg_do_nothing:
@@ -850,7 +884,7 @@
% \end{itemize}
% All \pkg{l3clist} functions go through the same test when they need
% to determine whether to brace an item, so it is not a problem that
-% this test has false positives such as \enquote{\cs{q_mark}
+% this test has false positives such as \enquote{\cs{s_@@_mark}
% \texttt{?}}. If the argument starts or end with a space or contains
% a comma then one of the three arguments of \cs{@@_if_wrap:w} will
% have its end delimiter (partly) in one of the three copies of |#1|
@@ -865,7 +899,8 @@
\tl_if_empty:oTF
{
\@@_if_wrap:w
- \q_mark ? #1 ~ \q_mark ? ~ #1 \q_mark , ~ \q_mark #1 ,
+ \s_@@_mark ? #1 ~ \s_@@_mark ? ~ #1
+ \s_@@_mark , ~ \s_@@_mark #1 ,
}
{
\tl_if_head_is_group:nTF { #1 { } }
@@ -882,7 +917,7 @@
}
{ \prg_return_true: }
}
-\cs_new:Npn \@@_if_wrap:w #1 \q_mark ? ~ #2 ~ \q_mark #3 , { }
+\cs_new:Npn \@@_if_wrap:w #1 \s_@@_mark ? ~ #2 ~ \s_@@_mark #3 , { }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1180,10 +1215,10 @@
\if_meaning:w #1 \c_empty_clist
\tl_set:Nn #2 { \q_no_value }
\else:
- \exp_after:wN \@@_get:wN #1 , \q_stop #2
+ \exp_after:wN \@@_get:wN #1 , \s_@@_stop #2
\fi:
}
-\cs_new_protected:Npn \@@_get:wN #1 , #2 \q_stop #3
+\cs_new_protected:Npn \@@_get:wN #1 , #2 \s_@@_stop #3
{ \tl_set:Nn #3 {#1} }
\cs_generate_variant:Nn \clist_get:NN { c }
% \end{macrocode}
@@ -1199,8 +1234,8 @@
% An empty clist leads to \cs{q_no_value}, otherwise grab until the
% first comma and assign to the variable. The second argument of
% \cs{@@_pop:wwNNN} is a comma list ending in a comma and
-% \cs{q_mark}, unless the original clist contained exactly one item:
-% then the argument is just \cs{q_mark}. The next auxiliary picks
+% \cs{s_@@_mark}, unless the original clist contained exactly one item:
+% then the argument is just \cs{s_@@_mark}. The next auxiliary picks
% either \cs{exp_not:n} or \cs{use_none:n} as |#2|, ensuring that the
% result can safely be an empty comma list.
% \begin{macrocode}
@@ -1213,21 +1248,21 @@
\if_meaning:w #2 \c_empty_clist
\tl_set:Nn #3 { \q_no_value }
\else:
- \exp_after:wN \@@_pop:wwNNN #2 , \q_mark \q_stop #1#2#3
+ \exp_after:wN \@@_pop:wwNNN #2 , \s_@@_mark \s_@@_stop #1#2#3
\fi:
}
-\cs_new_protected:Npn \@@_pop:wwNNN #1 , #2 \q_stop #3#4#5
+\cs_new_protected:Npn \@@_pop:wwNNN #1 , #2 \s_@@_stop #3#4#5
{
\tl_set:Nn #5 {#1}
#3 #4
{
\@@_pop:wN \prg_do_nothing:
#2 \exp_not:o
- , \q_mark \use_none:n
- \q_stop
+ , \s_@@_mark \use_none:n
+ \s_@@_stop
}
}
-\cs_new:Npn \@@_pop:wN #1 , \q_mark #2 #3 \q_stop { #2 {#1} }
+\cs_new:Npn \@@_pop:wN #1 , \s_@@_mark #2 #3 \s_@@_stop { #2 {#1} }
\cs_generate_variant:Nn \clist_pop:NN { c }
\cs_generate_variant:Nn \clist_gpop:NN { c }
% \end{macrocode}
@@ -1246,7 +1281,7 @@
\if_meaning:w #1 \c_empty_clist
\prg_return_false:
\else:
- \exp_after:wN \@@_get:wN #1 , \q_stop #2
+ \exp_after:wN \@@_get:wN #1 , \s_@@_stop #2
\prg_return_true:
\fi:
}
@@ -1260,7 +1295,7 @@
\if_meaning:w #2 \c_empty_clist
\prg_return_false:
\else:
- \exp_after:wN \@@_pop:wwNNN #2 , \q_mark \q_stop #1#2#3
+ \exp_after:wN \@@_pop:wwNNN #2 , \s_@@_mark \s_@@_stop #1#2#3
\prg_return_true:
\fi:
}
@@ -1364,13 +1399,13 @@
% the expanded comma list, and another copy of the \meta{item}.
% The loop is controlled by the argument grabbed by
% \cs{@@_remove_all:w}: when the item was found,
-% the \cs{q_mark} delimiter used is the one inserted by
-% \cs{@@_tmp:w}, and \cs{use_none_delimit_by_q_stop:w}
+% the \cs{s_@@_mark} delimiter used is the one inserted by
+% \cs{@@_tmp:w}, and \cs{@@_use_none_delimit_by_s_stop:w}
% is deleted. At the end, the final \meta{item} is
% grabbed, and the argument of \cs{@@_tmp:w} contains
-% \cs{q_mark}: in that case, \cs{@@_remove_all:w}
-% removes the second \cs{q_mark} (inserted by \cs{@@_tmp:w}),
-% and lets \cs{use_none_delimit_by_q_stop:w} act.
+% \cs{s_@@_mark}: in that case, \cs{@@_remove_all:w}
+% removes the second \cs{s_@@_mark} (inserted by \cs{@@_tmp:w}),
+% and lets \cs{@@_use_none_delimit_by_s_stop:w} act.
%
% No brace is lost because items are always grabbed with a leading comma.
% The result of the first assignment has an extra leading comma,
@@ -1396,13 +1431,13 @@
\cs_set:Npn \@@_tmp:w ##1 , #4 ,
{
##1
- , \q_mark , \use_none_delimit_by_q_stop:w ,
+ , \s_@@_mark , \@@_use_none_delimit_by_s_stop:w ,
\@@_remove_all:
}
#2 #3
{
\exp_after:wN \@@_remove_all:
- #3 , \q_mark , #4 , \q_stop
+ #3 , \s_@@_mark , #4 , \s_@@_stop
}
\clist_if_empty:NF #3
{
@@ -1416,7 +1451,7 @@
}
\cs_new:Npn \@@_remove_all:
{ \exp_after:wN \@@_remove_all:w \@@_tmp:w , }
-\cs_new:Npn \@@_remove_all:w #1 , \q_mark , #2 , { \exp_not:n {#1} }
+\cs_new:Npn \@@_remove_all:w #1 , \s_@@_mark , #2 , { \exp_not:n {#1} }
\cs_generate_variant:Nn \clist_remove_all:Nn { c }
\cs_generate_variant:Nn \clist_gremove_all:Nn { c }
% \end{macrocode}
@@ -1448,19 +1483,19 @@
% \begin{macro}[EXP]{\clist_reverse:n}
% \begin{macro}[EXP]{\@@_reverse:wwNww, \@@_reverse_end:ww}
% The reversed token list is built one item at a time, and stored
-% between \cs{q_stop} and \cs{q_mark}, in the form of |?| followed by
+% between \cs{s_@@_stop} and \cs{s_@@_mark}, in the form of |?| followed by
% zero or more instances of \enquote{\meta{item}\texttt{,}}. We start from a comma
% list \enquote{\meta{item_1}\texttt{,\ldots,}\meta{item_n}}. During the loop,
% the auxiliary \cs{@@_reverse:wwNww} receives \enquote{\texttt{?}\meta{item_i}} as
% |#1|, \enquote{\meta{item_{i+1}}\texttt{,\ldots,}\meta{item_n}} as |#2|,
-% \cs{@@_reverse:wwNww} as |#3|, what remains until \cs{q_stop} as
+% \cs{@@_reverse:wwNww} as |#3|, what remains until \cs{s_@@_stop} as
% |#4|, and \enquote{\meta{item_{i-1}}\texttt{,\ldots,}\meta{item_1}\texttt{,}} as |#5|.
% The auxiliary moves |#1| just before |#5|, with a comma, and calls
% itself (|#3|). After the last item is moved, \cs{@@_reverse:wwNww}
-% receives \enquote{\cs{q_mark} \cs{@@_reverse:wwNww} \texttt{!}} as its argument
+% receives \enquote{\cs{s_@@_mark} \cs{@@_reverse:wwNww} \texttt{!}} as its argument
% |#1|, thus \cs{@@_reverse_end:ww} as its argument |#3|. This second
% auxiliary cleans up until the marker~|!|, removes the trailing comma
-% (introduced when the first item was moved after \cs{q_stop}), and
+% (introduced when the first item was moved after \cs{s_@@_stop}), and
% leaves its argument~|#1| within \cs{exp_not:n}. There is also a
% need to remove a leading comma, hence \cs{exp_not:o} and
% \cs{use_none:n}.
@@ -1468,14 +1503,14 @@
\cs_new:Npn \clist_reverse:n #1
{
\@@_reverse:wwNww ? #1 ,
- \q_mark \@@_reverse:wwNww ! ,
- \q_mark \@@_reverse_end:ww
- \q_stop ? \q_mark
+ \s_@@_mark \@@_reverse:wwNww ! ,
+ \s_@@_mark \@@_reverse_end:ww
+ \s_@@_stop ? \s_@@_mark
}
\cs_new:Npn \@@_reverse:wwNww
- #1 , #2 \q_mark #3 #4 \q_stop ? #5 \q_mark
- { #3 ? #2 \q_mark #3 #4 \q_stop #1 , #5 \q_mark }
-\cs_new:Npn \@@_reverse_end:ww #1 ! #2 , \q_mark
+ #1 , #2 \s_@@_mark #3 #4 \s_@@_stop ? #5 \s_@@_mark
+ { #3 ? #2 \s_@@_mark #3 #4 \s_@@_stop #1 , #5 \s_@@_mark }
+\cs_new:Npn \@@_reverse_end:ww #1 ! #2 , \s_@@_mark
{ \exp_not:o { \use_none:n #2 } }
% \end{macrocode}
% \end{macro}
@@ -1511,14 +1546,14 @@
% item is non-blank, exit: the second auxiliary grabs
% \cs{prg_return_false:} as |#2|, unless every item in
% the comma list was blank and the loop actually got broken
-% by the trailing |\q_mark \prg_return_false:| item.
+% by the trailing \cs{s_@@_mark} \cs{prg_return_false:} item.
% \begin{macrocode}
\prg_new_conditional:Npnn \clist_if_empty:n #1 { p , T , F , TF }
{
\@@_if_empty_n:w ? #1
- , \q_mark \prg_return_false:
- , \q_mark \prg_return_true:
- \q_stop
+ , \s_@@_mark \prg_return_false:
+ , \s_@@_mark \prg_return_true:
+ \s_@@_stop
}
\cs_new:Npn \@@_if_empty_n:w #1 ,
{
@@ -1526,7 +1561,7 @@
{ \@@_if_empty_n:w ? }
{ \@@_if_empty_n:wNw }
}
-\cs_new:Npn \@@_if_empty_n:wNw #1 \q_mark #2#3 \q_stop {#2}
+\cs_new:Npn \@@_if_empty_n:wNw #1 \s_@@_mark #2#3 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1595,7 +1630,7 @@
% If the variable is empty, the mapping is skipped (otherwise,
% that comma-list would be seen as consisting of one empty item).
% Then loop over the comma-list, grabbing one comma-delimited
-% item at a time. The end is marked by \cs{q_recursion_tail}.
+% item at a time. The end is marked by \cs{q_@@_recursion_tail}.
% The auxiliary function \cs{@@_map_function:Nw} is also used
% in \cs{clist_map_inline:Nn}.
% \begin{macrocode}
@@ -1604,13 +1639,13 @@
\clist_if_empty:NF #1
{
\exp_last_unbraced:NNo \@@_map_function:Nw #2 #1
- , \q_recursion_tail ,
+ , \q_@@_recursion_tail ,
\prg_break_point:Nn \clist_map_break: { }
}
}
\cs_new:Npn \@@_map_function:Nw #1#2 ,
{
- \quark_if_recursion_tail_break:nN {#2} \clist_map_break:
+ \@@_if_recursion_tail_break:nN {#2} \clist_map_break:
#1 {#2}
\@@_map_function:Nw #1
}
@@ -1634,12 +1669,12 @@
\cs_new:Npn \clist_map_function:nN #1#2
{
\exp_after:wN \@@_map_function_n:Nn \exp_after:wN #2
- \exp:w \@@_trim_next:w \prg_do_nothing: #1 , \q_recursion_tail ,
+ \exp:w \@@_trim_next:w \prg_do_nothing: #1 , \q_@@_recursion_tail ,
\prg_break_point:Nn \clist_map_break: { }
}
\cs_new:Npn \@@_map_function_n:Nn #1 #2
{
- \quark_if_recursion_tail_break:nN {#2} \clist_map_break:
+ \@@_if_recursion_tail_break:nN {#2} \clist_map_break:
\@@_map_unbrace:Nw #1 #2,
\exp_after:wN \@@_map_function_n:Nn \exp_after:wN #1
\exp:w \@@_trim_next:w \prg_do_nothing:
@@ -1675,7 +1710,7 @@
{ @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2}
\exp_last_unbraced:Nco \@@_map_function:Nw
{ @@_map_ \int_use:N \g__kernel_prg_map_int :w }
- #1 , \q_recursion_tail ,
+ #1 , \q_@@_recursion_tail ,
\prg_break_point:Nn \clist_map_break:
{ \int_gdecr:N \g__kernel_prg_map_int }
}
@@ -1702,7 +1737,7 @@
% The quark test is done before assigning the item to the variable:
% this avoids storing a quark which the user wouldn't expect.
% The strange \cs{use:n} avoids unlikely problems when |#2| would
-% contain \cs{q_recursion_stop}.
+% contain \cs{q_@@_recursion_stop}.
% \begin{macrocode}
\cs_new_protected:Npn \clist_map_variable:NNn #1#2#3
{
@@ -1711,7 +1746,7 @@
\exp_args:Nno \use:nn
{ \@@_map_variable:Nnw #2 {#3} }
#1
- , \q_recursion_tail , \q_recursion_stop
+ , \q_@@_recursion_tail , \q_@@_recursion_stop
\prg_break_point:Nn \clist_map_break: { }
}
}
@@ -1722,7 +1757,7 @@
}
\cs_new_protected:Npn \@@_map_variable:Nnw #1#2#3,
{
- \quark_if_recursion_tail_stop:n {#3}
+ \@@_if_recursion_tail_stop:n {#3}
\tl_set:Nn #1 {#3}
\use:n {#2}
\@@_map_variable:Nnw #1 {#2}
@@ -1769,13 +1804,13 @@
{
0
\exp_not:N \@@_count:w \c_space_tl
- #1 \exp_not:n { , \q_recursion_tail , \q_recursion_stop }
+ #1 \exp_not:n { , \q_@@_recursion_tail , \q_@@_recursion_stop }
}
}
\cs_new:Npn \@@_count:n #1 { + 1 }
\cs_new:Npx \@@_count:w #1 ,
{
- \exp_not:n { \exp_args:Nf \quark_if_recursion_tail_stop:n } {#1}
+ \exp_not:n { \exp_args:Nf \@@_if_recursion_tail_stop:n } {#1}
\exp_not:N \tl_if_blank:nF {#1} { + 1 }
\exp_not:N \@@_count:w \c_space_tl
}
@@ -1801,15 +1836,15 @@
% quarks), 5: the rest of the comma list, 6: a \meta{continuation}
% function (\texttt{use_ii} or \texttt{use_iii} with its
% \meta{separator} argument), 7: junk, and 8: the temporary result,
-% which is built in a brace group following \cs{q_stop}. The
+% which is built in a brace group following \cs{q_@@_stop}. The
% \meta{separator} and the first of the three items are placed in the
% result, then we use the \meta{continuation}, placing the remaining
% two items after it. When we begin this loop, the three items really
-% belong to the comma list, the first \cs{q_mark} is taken as a
+% belong to the comma list, the first \cs{q_@@_mark} is taken as a
% delimiter to the \texttt{use_ii} function, and the continuation is
% \texttt{use_ii} itself. When we reach the last two items of the
-% original token list, \cs{q_mark} is taken as a third item, and now
-% the second \cs{q_mark} serves as a delimiter to \texttt{use_ii},
+% original token list, \cs{q_@@_mark} is taken as a third item, and now
+% the second \cs{q_@@_mark} serves as a delimiter to \texttt{use_ii},
% switching to the other \meta{continuation}, \texttt{use_iii}, which
% uses the \meta{separator between final two}.
% \begin{macrocode}
@@ -1826,9 +1861,9 @@
{
\exp_after:wN \@@_use:nwwwwnwn
\exp_after:wN { \exp_after:wN } #1 ,
- \q_mark , { \@@_use:nwwwwnwn {#3} }
- \q_mark , { \@@_use:nwwn {#4} }
- \q_stop { }
+ \s_@@_mark , { \@@_use:nwwwwnwn {#3} }
+ \s_@@_mark , { \@@_use:nwwn {#4} }
+ \s_@@_stop { }
}
}
{
@@ -1839,9 +1874,9 @@
\cs_generate_variant:Nn \clist_use:Nnnn { c }
\cs_new:Npn \@@_use:wwn #1 , #2 , #3 { \exp_not:n { #1 #3 #2 } }
\cs_new:Npn \@@_use:nwwwwnwn
- #1#2 , #3 , #4 , #5 \q_mark , #6#7 \q_stop #8
- { #6 {#3} , {#4} , #5 \q_mark , {#6} #7 \q_stop { #8 #1 #2 } }
-\cs_new:Npn \@@_use:nwwn #1#2 , #3 \q_stop #4
+ #1#2 , #3 , #4 , #5 \s_@@_mark , #6#7 \s_@@_stop #8
+ { #6 {#3} , {#4} , #5 \s_@@_mark , {#6} #7 \s_@@_stop { #8 #1 #2 } }
+\cs_new:Npn \@@_use:nwwn #1#2 , #3 \s_@@_stop #4
{ \exp_not:n { #4 #1 #2 } }
\cs_new:Npn \clist_use:Nn #1#2
{ \clist_use:Nnnn #1 {#2} {#2} {#2} }
@@ -1877,21 +1912,21 @@
\int_compare:nNnTF {#2} < 0
{
\int_compare:nNnTF {#2} < { - #1 }
- { \use_none_delimit_by_q_stop:w }
+ { \@@_use_none_delimit_by_s_stop:w }
{ \exp_args:Nf #4 { \int_eval:n { #2 + 1 + #1 } } }
}
{
\int_compare:nNnTF {#2} > {#1}
- { \use_none_delimit_by_q_stop:w }
+ { \@@_use_none_delimit_by_s_stop:w }
{ #4 {#2} }
}
- { } , #3 , \q_stop
+ { } , #3 , \s_@@_stop
}
\cs_generate_variant:Nn \@@_item:nnnN { ffo, ff }
\cs_new:Npn \@@_item_N_loop:nw #1 #2,
{
\int_compare:nNnTF {#1} = 0
- { \use_i_delimit_by_q_stop:nw { \exp_not:n {#2} } }
+ { \@@_use_i_delimit_by_s_stop:nw { \exp_not:n {#2} } }
{ \exp_args:Nf \@@_item_N_loop:nw { \int_eval:n { #1 - 1 } } }
}
\cs_generate_variant:Nn \clist_item:Nn { c }
@@ -1936,7 +1971,7 @@
}
}
}
-\cs_new:Npn \@@_item_n_end:n #1 #2 \q_stop
+\cs_new:Npn \@@_item_n_end:n #1 #2 \s_@@_stop
{ \tl_trim_spaces_apply:nN {#1} \@@_item_n_strip:n }
\cs_new:Npn \@@_item_n_strip:n #1 { \@@_item_n_strip:w #1 , }
\cs_new:Npn \@@_item_n_strip:w #1 , { \exp_not:n {#1} }
diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx
index fb7d09bcc7..47fca97465 100644
--- a/macros/latex/contrib/l3kernel/l3coffins.dtx
+++ b/macros/latex/contrib/l3kernel/l3coffins.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3color-base.dtx b/macros/latex/contrib/l3kernel/l3color-base.dtx
index 124d07bccd..0555edc19c 100644
--- a/macros/latex/contrib/l3kernel/l3color-base.dtx
+++ b/macros/latex/contrib/l3kernel/l3color-base.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -147,6 +147,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\@@_select:n, \@@_select:V}
% \begin{macro}{\@@_select:w}
% \begin{macro}
@@ -156,17 +163,17 @@
% higher-level experimental material.
% \begin{macrocode}
\cs_new_protected:Npn \@@_select:n #1
- { \@@_select:w #1 \q_stop }
+ { \@@_select:w #1 \s_@@_stop }
\cs_generate_variant:Nn \@@_select:n { V }
-\cs_new_protected:Npn \@@_select:w #1 ~ #2 \q_stop
- { \use:c { @@_select_ #1 :w } #2 \q_stop }
-\cs_new_protected:Npn \@@_select_cmyk:w #1 ~ #2 ~ #3 ~ #4 \q_stop
+\cs_new_protected:Npn \@@_select:w #1 ~ #2 \s_@@_stop
+ { \use:c { @@_select_ #1 :w } #2 \s_@@_stop }
+\cs_new_protected:Npn \@@_select_cmyk:w #1 ~ #2 ~ #3 ~ #4 \s_@@_stop
{ \@@_backend_cmyk:nnnn {#1} {#2} {#3} {#4} }
-\cs_new_protected:Npn \@@_select_gray:w #1 \q_stop
+\cs_new_protected:Npn \@@_select_gray:w #1 \s_@@_stop
{ \@@_backend_gray:n {#1} }
-\cs_new_protected:Npn \@@_select_rgb:w #1 ~ #2 ~ #3 \q_stop
+\cs_new_protected:Npn \@@_select_rgb:w #1 ~ #2 ~ #3 \s_@@_stop
{ \@@_backend_rgb:nnn {#1} {#2} {#3} }
-\cs_new_protected:Npn \@@_select_spot:w #1 ~ #2 \q_stop
+\cs_new_protected:Npn \@@_select_spot:w #1 ~ #2 \s_@@_stop
{ \@@_backend_spot:nn {#1} {#2} }
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx
index 2e80e1b8a3..df79d6a031 100644
--- a/macros/latex/contrib/l3kernel/l3debug.dtx
+++ b/macros/latex/contrib/l3kernel/l3debug.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -131,6 +131,37 @@
\ProvidesExplFile{l3debug.def}{2019-04-06}{}{L3 Debugging support}
% \end{macrocode}
%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:N}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w
+ #1 \q_@@_recursion_stop { }
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\debug_on:n, \debug_off:n, \@@_all_on:, \@@_all_off:}
% \begin{macrocode}
\cs_set_protected:Npn \debug_on:n #1
@@ -314,9 +345,9 @@
{ \exp_args:NNf \@@_chk_var_scope_aux:Nn #1 { \cs_to_str:N #2 } }
\cs_new_protected:Npn \@@_chk_var_scope_aux:Nn #1#2
{
- \if:w _ \use_i:nn \use_i_delimit_by_q_stop:nw #2 ? ? \q_stop
+ \if:w _ \use_i:nn \@@_use_i_delimit_by_s_stop:nw #2 ? ? \s_@@_stop
\exp_after:wN \@@_chk_var_scope_aux:NNn
- \use_i_delimit_by_q_stop:nw #2 ? \q_stop
+ \@@_use_i_delimit_by_s_stop:nw #2 ? \s_@@_stop
#1 {#2}
\else:
\exp_args:Nc \@@_chk_var_scope_aux:NNn
@@ -489,16 +520,16 @@
\cs_new:Npn \@@_build_parm_text:n #1
{
\@@_arg_list_from_signature:nNN { 1 } \c_false_bool #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
\cs_new:Npn \@@_build_arg_list:n #1
{
\@@_arg_list_from_signature:nNN { 1 } \c_true_bool #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
\cs_new:Npn \@@_arg_list_from_signature:nNN #1 #2 #3
{
- \quark_if_recursion_tail_stop:N #3
+ \@@_if_recursion_tail_stop:N #3
\@@_arg_check_invalid:N #3
\bool_if:NT #2 { \@@_arg_if_braced:NT #3 { \use_none:n } }
\use:n { \c_hash_str \int_eval:n {#1} }
@@ -523,7 +554,7 @@
\exp_end:
}
\cs_new:Npn \@@_parm_terminate:w
- { \exp_after:wN \use_none_delimit_by_q_recursion_stop:w \exp:w }
+ { \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w \exp:w }
\prg_new_conditional:Npnn \@@_arg_if_braced:N #1 { T }
{ \exp_args:Nf \@@_arg_if_braced:n { \@@_get_base_form:N #1 } }
\cs_new:Npn \@@_arg_if_braced:n #1
@@ -649,7 +680,7 @@
####2 \tl_to_str:n { -> }
####3 \c_backslash_str \tl_to_str:n { __debug_ }
\cs_to_str:N #1
- ####4 \exp_not:N \q_mark
+ ####4 \s_@@_stop
{
\exp_not:N \exp_args:Nx \exp_not:N \tex_scantokens:D
{
@@ -663,7 +694,7 @@
}
}
}
- \exp_after:wN \@@_tmp:w \cs_meaning:N #1 \q_mark
+ \exp_after:wN \@@_tmp:w \cs_meaning:N #1 \s_@@_stop
}
% \end{macrocode}
% Some functions, however, won't work with the signature reading setup
@@ -1380,7 +1411,7 @@
\__kernel_chk_expr:nNnN
{##1} \tex_glueexpr:D { } \skip_if_finite:n
; \prg_return_false:
- #1 ; \prg_return_true: \q_stop
+ #1 ; \prg_return_true: \s_@@_stop
}
}
\exp_args:No \@@_tmp:w { \tl_to_str:n { fil } }
diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx
index ab3f7a3dee..f84e9faea3 100644
--- a/macros/latex/contrib/l3kernel/l3deprecation.dtx
+++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -109,15 +109,23 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}[EXP]{\@@_date_compare:nNnTF, \@@_date_compare_aux:w}
% Expects |#1| and |#3| to be dates in the format YYYY-MM-DD (but
% accepts YYYY or YYYY-MM too, filling in zeros for the missing data).
% Compares them using |#2| (one of |<|, |=|, |>|).
% \begin{macrocode}
\cs_new:Npn \@@_date_compare:nNnTF #1#2#3
- { \@@_date_compare_aux:w #1 -0-0- \q_mark #2 #3 -0-0- \q_stop }
+ { \@@_date_compare_aux:w #1 -0-0- \s_@@_mark #2 #3 -0-0- \s_@@_stop }
\cs_new:Npn \@@_date_compare_aux:w
- #1 - #2 - #3 - #4 \q_mark #5 #6 - #7 - #8 - #9 \q_stop
+ #1 - #2 - #3 - #4 \s_@@_mark #5 #6 - #7 - #8 - #9 \s_@@_stop
{
\int_compare:nNnTF {#1} = {#6}
{
@@ -155,7 +163,7 @@
\exp_args:Nf \@@_date_compare:nNnTF
{
\exp_after:wN \@@_minus_six_months:w
- \ExplLoaderFileDate -0-0- \q_stop
+ \ExplLoaderFileDate -0-0- \s_@@_stop
} < {#1}
{
\bool_set_true:N \l_@@_grace_period_bool
@@ -164,7 +172,7 @@
{ \use_ii:nn }
}
}
-\cs_new:Npn \@@_minus_six_months:w #1 - #2 - #3 - #4 \q_stop
+\cs_new:Npn \@@_minus_six_months:w #1 - #2 - #3 - #4 \s_@@_stop
{
\int_compare:nNnTF {#2} > 6
{ #1 - \int_eval:n { #2 - 6 } - #3 }
diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx
index 94217cd8c5..9ef8771afb 100644
--- a/macros/latex/contrib/l3kernel/l3doc.dtx
+++ b/macros/latex/contrib/l3kernel/l3doc.dtx
@@ -79,7 +79,7 @@ and all files in that bundle must be distributed together.
%
% \title{The \cls{l3doc} class}
% \author{\Team}
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
% \maketitle
% \tableofcontents
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx
index ab79ecabf1..044e3fbab5 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.dtx
+++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx
@@ -63,7 +63,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf
index 00c3018ede..870f43aacb 100644
--- a/macros/latex/contrib/l3kernel/l3docstrip.pdf
+++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx
index 7eb3465b7c..0841f43fc4 100644
--- a/macros/latex/contrib/l3kernel/l3expan.dtx
+++ b/macros/latex/contrib/l3kernel/l3expan.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -2165,6 +2165,35 @@
%<@@=cs>
% \end{macrocode}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks. No \pkg{l3quark} yet, so do things by hand.
+% \begin{macrocode}
+\cs_new_eq:NN \s_@@_mark \scan_stop:
+\cs_new_eq:NN \s_@@_stop \scan_stop:
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_recursion_stop}
+% Internal recursion quarks. No \pkg{l3quark} yet, so do things by hand.
+% \begin{macrocode}
+\cs_new:Npn \q_@@_recursion_stop { \q_@@_recursion_stop }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_use_none_delimit_by_s_stop:w,
+% \@@_use_i_delimit_by_s_stop:nw,
+% \@@_use_none_delimit_by_q_recursion_stop:w
+% }
+% Internal scan marks.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+\cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w
+ #1 \q_@@_recursion_stop { }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\cs_generate_variant:Nn, \cs_generate_variant:cn}
% \begin{arguments}
% \item Base form of a function; \emph{e.g.},~\cs{tl_set:Nn}
@@ -2189,7 +2218,7 @@
\exp_not:N #1
\tl_to_str:n {#2} ,
\exp_not:N \scan_stop: ,
- \exp_not:N \q_recursion_stop
+ \exp_not:N \q_@@_recursion_stop
}
}
\cs_new_protected:Npn \cs_generate_variant:cn
@@ -2217,7 +2246,7 @@
% \verb*|\protected |, \verb*|\protected\long |, |\first|, |\top|,
% |\bot|, |\splittop|, or |\splitbot|, with |\| replaced by the
% appropriate escape character. If |pr| appears in the part before
-% |ma|, the first \cs{q_mark} is taken as an argument of the |wwNw|
+% |ma|, the first \cs{s_@@_mark} is taken as an argument of the |wwNw|
% auxiliary, and |#3| is \cs{cs_new_protected:Npx}, otherwise it
% is \cs{cs_new:Npx}.
% \begin{macrocode}
@@ -2229,20 +2258,20 @@
\exp_not:N \else:
\exp_not:N \exp_after:wN \exp_not:N \@@_generate_variant:ww
\exp_not:N \token_to_meaning:N #1 \tl_to_str:n { ma }
- \exp_not:N \q_mark
- \exp_not:N \q_mark \cs_new_protected:Npx
+ \s_@@_mark
+ \s_@@_mark \cs_new_protected:Npx
\tl_to_str:n { pr }
- \exp_not:N \q_mark \cs_new:Npx
- \exp_not:N \q_stop
+ \s_@@_mark \cs_new:Npx
+ \s_@@_stop
\exp_not:N \fi:
}
\exp_last_unbraced:NNNNo
\cs_new_protected:Npn \@@_generate_variant:ww
- #1 { \tl_to_str:n { ma } } #2 \q_mark
+ #1 { \tl_to_str:n { ma } } #2 \s_@@_mark
{ \@@_generate_variant:wwNw #1 }
\exp_last_unbraced:NNNNo
\cs_new_protected:Npn \@@_generate_variant:wwNw
- #1 { \tl_to_str:n { pr } } #2 \q_mark #3 #4 \q_stop
+ #1 { \tl_to_str:n { pr } } #2 \s_@@_mark #3 #4 \s_@@_stop
{ \cs_set_eq:NN \@@_tmp:w #3 }
% \end{macrocode}
% \end{macro}
@@ -2265,7 +2294,7 @@
\if_meaning:w \c_false_bool #3
\__kernel_msg_error:nnx { kernel } { missing-colon }
{ \token_to_str:c {#1} }
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\fi:
\@@_generate_variant:Nnnw #4 {#1}{#2}
}
@@ -2312,8 +2341,8 @@
% We compare the base and variant signatures one character at a time
% within |x|-expansion. The result is given to
% \cs{@@_generate_variant:wwNN} (defined later) in the form
-% \meta{processed variant signature} \cs{q_mark} \meta{errors}
-% \cs{q_stop} \meta{base function} \meta{new function}. If all went
+% \meta{processed variant signature} \cs{s_@@_mark} \meta{errors}
+% \cs{s_@@_stop} \meta{base function} \meta{new function}. If all went
% well, \meta{errors} is empty; otherwise, it is a kernel error
% message and some clean-up code.
%
@@ -2325,7 +2354,7 @@
\cs_new_protected:Npn \@@_generate_variant:Nnnw #1#2#3#4 ,
{
\if_meaning:w \scan_stop: #4
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\fi:
\use:x
{
@@ -2333,11 +2362,11 @@
\@@_generate_variant_loop:nNwN { }
#4
\@@_generate_variant_loop_end:nwwwNNnn
- \q_mark
+ \s_@@_mark
#3 ~
{ ~ { } \fi: \@@_generate_variant_loop_long:wNNnn } ~
{ }
- \q_stop
+ \s_@@_stop
\exp_not:N #1 {#2} {#4}
}
\@@_generate_variant:Nnnw #1 {#2} {#3}
@@ -2407,7 +2436,7 @@
% argument: this empty brace group produces the correct signature for
% the full variant.
% \begin{macrocode}
-\cs_new:Npn \@@_generate_variant_loop:nNwN #1#2#3 \q_mark #4
+\cs_new:Npn \@@_generate_variant_loop:nNwN #1#2#3 \s_@@_mark #4
{
\if:w #2 #4
\exp_after:wN \@@_generate_variant_loop_same:w
@@ -2426,7 +2455,7 @@
#1
\prg_do_nothing:
#2
- \@@_generate_variant_loop:nNwN { } #3 \q_mark
+ \@@_generate_variant_loop:nNwN { } #3 \s_@@_mark
}
\cs_new:Npn \@@_generate_variant_loop_base:N #1
{
@@ -2454,46 +2483,45 @@
#1 \prg_do_nothing: #2#3#4
{ #3 { #1 \@@_generate_variant_same:N #2 } }
\cs_new:Npn \@@_generate_variant_loop_end:nwwwNNnn
- #1#2 \q_mark #3 ~ #4 \q_stop #5#6#7#8
+ #1#2 \s_@@_mark #3 ~ #4 \s_@@_stop #5#6#7#8
{
\scan_stop: \scan_stop: \fi:
- \exp_not:N \q_mark
- \exp_not:N \q_stop
+ \s_@@_mark \s_@@_stop
\exp_not:N #6
\exp_not:c { #7 : #8 #1 #3 }
}
-\cs_new:Npn \@@_generate_variant_loop_long:wNNnn #1 \q_stop #2#3#4#5
+\cs_new:Npn \@@_generate_variant_loop_long:wNNnn #1 \s_@@_stop #2#3#4#5
{
\exp_not:n
{
- \q_mark
+ \s_@@_mark
\__kernel_msg_error:nnxx { kernel } { variant-too-long }
{#5} { \token_to_str:N #3 }
\use_none:nnn
- \q_stop
+ \s_@@_stop
#3
#3
}
}
\cs_new:Npn \@@_generate_variant_loop_invalid:NNwNNnn
- #1#2 \fi: \fi: \fi: #3 \q_stop #4#5#6#7
+ #1#2 \fi: \fi: \fi: #3 \s_@@_stop #4#5#6#7
{
\fi: \fi: \fi:
\exp_not:n
{
- \q_mark
+ \s_@@_mark
\__kernel_msg_error:nnxxxx { kernel } { invalid-variant }
{#7} { \token_to_str:N #5 } {#1} {#2}
\use_none:nnn
- \q_stop
+ \s_@@_stop
#5
#5
}
}
\cs_new:Npn \@@_generate_variant_loop_special:NNwNNnn
- #1#2#3 \q_stop #4#5#6#7
+ #1#2#3 \s_@@_stop #4#5#6#7
{
- #3 \q_stop #4 #5 {#6} {#7}
+ #3 \s_@@_stop #4 #5 {#6} {#7}
\exp_not:n
{
\__kernel_msg_error:nnxxxx
@@ -2534,7 +2562,7 @@
% combining the |\exp_args:N #3| variant and the base function.
% \begin{macrocode}
\cs_new_protected:Npn \@@_generate_variant:wwNN
- #1 \q_mark #2 \q_stop #3#4
+ #1 \s_@@_mark #2 \s_@@_stop #3#4
{
#2
\cs_if_free:NT #4
@@ -2568,20 +2596,20 @@
\cs_new_protected:Npx \@@_generate_internal_variant:n #1
{
\exp_not:N \@@_generate_internal_variant:wwnNwn
- #1 \exp_not:N \q_mark
+ #1 \s_@@_mark
{ \cs_set_eq:NN \exp_not:N \@@_tmp:w \cs_new_protected:Npx }
\cs_new_protected:cpn
\use:x
- \token_to_str:N x \exp_not:N \q_mark
+ \token_to_str:N x \s_@@_mark
{ }
\cs_new:cpn
\exp_not:N \tex_expanded:D
- \exp_not:N \q_stop
+ \s_@@_stop
{#1}
}
\exp_last_unbraced:NNNNo
\cs_new_protected:Npn \@@_generate_internal_variant:wwnNwn #1
- { \token_to_str:N x } #2 \q_mark #3#4#5#6 \q_stop #7
+ { \token_to_str:N x } #2 \s_@@_mark #3#4#5#6 \s_@@_stop #7
{
#3
\cs_if_free:cT { exp_args:N #7 }
@@ -2600,7 +2628,7 @@
\exp_after:wN \@@_generate_internal_test_aux:w \exp_after:wN #1
\fi:
##3
- \q_mark
+ \s_@@_mark
{
\use:x
{
@@ -2609,12 +2637,12 @@
}
}
#1
- \q_mark
+ \s_@@_mark
{ \exp_not:n { \@@_generate_internal_one_go:NNn ##1 ##2 {##3} } }
- \q_stop
+ \s_@@_stop
}
\cs_new_protected:Npn \@@_generate_internal_test_aux:w
- ##1 #1 ##2 \q_mark ##3 ##4 \q_stop {##3}
+ ##1 #1 ##2 \s_@@_mark ##3 ##4 \s_@@_stop {##3}
\cs_if_exist:NTF \tex_expanded:D
{
\cs_new_eq:NN \@@_generate_internal_test:Nw
@@ -2722,20 +2750,20 @@
\if_meaning:w \c_false_bool #3
\__kernel_msg_error:nnx { kernel } { missing-colon }
{ \token_to_str:c {#1} }
- \use_i_delimit_by_q_stop:nw
+ \@@_use_i_delimit_by_s_stop:nw
\fi:
\exp_after:wN \@@_generate_variant:w
- \tl_to_str:n {#5} , \scan_stop: , \q_recursion_stop
- \use_none_delimit_by_q_stop:w \q_mark {#1} {#2} {#4} \q_stop
+ \tl_to_str:n {#5} , \scan_stop: , \q_@@_recursion_stop
+ \@@_use_none_delimit_by_s_stop:w \s_@@_mark {#1} {#2} {#4} \s_@@_stop
}
\cs_new_protected:Npn \@@_generate_variant:w
- #1 , #2 \q_mark #3#4#5
+ #1 , #2 \s_@@_mark #3#4#5
{
\if_meaning:w \scan_stop: #1 \scan_stop:
- \if_meaning:w \q_nil #1 \q_nil
+ \if_meaning:w \q_@@_nil #1 \q_@@_nil
\use_i:nnn
\fi:
- \exp_after:wN \use_none_delimit_by_q_recursion_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_q_recursion_stop:w
\else:
\cs_if_exist_use:cTF { @@_generate_variant_#1_form:nnn }
{ {#3} {#4} {#5} }
@@ -2745,7 +2773,7 @@
{#1} { \token_to_str:c { #3 : #4 } }
}
\fi:
- \@@_generate_variant:w #2 \q_mark {#3} {#4} {#5}
+ \@@_generate_variant:w #2 \s_@@_mark {#3} {#4} {#5}
}
\cs_new_protected:Npn \@@_generate_variant_p_form:nnn #1#2
{ \cs_generate_variant:cn { #1 _p : #2 } }
diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx
index a3e398c2e8..c816d771fb 100644
--- a/macros/latex/contrib/l3kernel/l3file.dtx
+++ b/macros/latex/contrib/l3kernel/l3file.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1420,6 +1420,30 @@
% \end{macrocode}
% \end{variable}
%
+% \subsubsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Stream management}
%
% \begin{macro}{\iow_new:N, \iow_new:c}
@@ -1912,15 +1936,15 @@
\tl_set:Nx \l_@@_wrap_tl
{
\exp_after:wN \@@_wrap_fix_newline:w \l_@@_wrap_tl
- ^^J \q_nil ^^J \q_stop
+ ^^J \q_@@_nil ^^J \s_@@_stop
}
\exp_after:wN \@@_wrap_start:w \l_@@_wrap_tl
}
\cs_new:Npn \@@_wrap_fix_newline:w #1 ^^J #2 ^^J
{
#1
- \if_meaning:w \q_nil #2
- \use_i_delimit_by_q_stop:nw
+ \if_meaning:w \q_@@_nil #2
+ \@@_use_i_delimit_by_s_stop:nw
\fi:
\c_@@_wrap_newline_marker_tl
\@@_wrap_fix_newline:w #2 ^^J
@@ -1970,7 +1994,7 @@
}
{ \@@_wrap_line:nw { } ##1 ; }
##2 #1
- \@@_wrap_end_chunk:w 7 6 5 4 3 2 1 0 \q_stop
+ \@@_wrap_end_chunk:w 7 6 5 4 3 2 1 0 \s_@@_stop
}
}
\cs_new_protected:Npn \@@_wrap_next:nw ##1##2 #1
@@ -2066,7 +2090,7 @@
\@@_wrap_next_line:w
}
\cs_new:Npn \@@_wrap_end_chunk:w
- #1 \int_eval:w #2 - #3 ; #4#5 \q_stop
+ #1 \int_eval:w #2 - #3 ; #4#5 \s_@@_stop
{
\if_false: { \fi: }
\exp_args:Nf \@@_wrap_next:nw { \int_eval:n { #2 - #4 } }
@@ -2111,14 +2135,14 @@
\l_@@_line_part_tl
#1
{ ? \@@_wrap_break_end:w }
- \q_mark
+ \s_@@_mark
}
\cs_new:Npn \@@_wrap_break_first:w ##1 #1 ##2
{
\use_none:nn ##2 \@@_wrap_break_none:w
\@@_wrap_break_loop:w ##1 #1 ##2
}
- \cs_new:Npn \@@_wrap_break_none:w ##1##2 #1 ##3 \q_mark ##4 #1
+ \cs_new:Npn \@@_wrap_break_none:w ##1##2 #1 ##3 \s_@@_mark ##4 #1
{
\tl_if_empty:NTF \l_@@_line_tl
{ ##2 ##4 \@@_wrap_line_end:nw { } }
@@ -2130,7 +2154,7 @@
##1 #1
\@@_wrap_break_loop:w ##2 #1 ##3
}
- \cs_new:Npn \@@_wrap_break_end:w ##1 #1 ##2 ##3 #1 ##4 \q_mark
+ \cs_new:Npn \@@_wrap_break_end:w ##1 #1 ##2 ##3 #1 ##4 \s_@@_mark
{ ##1 \@@_wrap_line_end:nw { } ##3 }
}
\exp_args:NV \@@_tmp:w \c_catcode_other_space_tl
@@ -2144,7 +2168,7 @@
% call \cs{@@_wrap_line:nw} to find characters for the next line
% (remembering to account for the indentation).
% \begin{macrocode}
-\cs_new_protected:Npn \@@_wrap_next_line:w #1#2 \q_stop
+\cs_new_protected:Npn \@@_wrap_next_line:w #1#2 \s_@@_stop
{
\tl_clear:N \l_@@_line_tl
\token_if_eq_meaning:NNTF #1 \@@_wrap_end_chunk:w
@@ -2157,7 +2181,7 @@
\@@_wrap_line:nw
{ \l_@@_indent_tl }
\l_@@_line_target_int - \l_@@_indent_int ;
- #1 #2 \q_stop
+ #1 #2 \s_@@_stop
}
}
% \end{macrocode}
@@ -2262,10 +2286,10 @@
\cs_set_protected:Npn \@@_tmp:w #1
{
\cs_new:Npn \@@_wrap_trim:N ##1
- { \exp_after:wN \@@_wrap_trim:w ##1 \q_mark #1 \q_mark \q_stop }
- \cs_new:Npn \@@_wrap_trim:w ##1 #1 \q_mark
- { \@@_wrap_trim_aux:w ##1 \q_mark }
- \cs_new:Npn \@@_wrap_trim_aux:w ##1 \q_mark ##2 \q_stop {##1}
+ { \exp_after:wN \@@_wrap_trim:w ##1 \s_@@_mark #1 \s_@@_mark \s_@@_stop }
+ \cs_new:Npn \@@_wrap_trim:w ##1 #1 \s_@@_mark
+ { \@@_wrap_trim_aux:w ##1 \s_@@_mark }
+ \cs_new:Npn \@@_wrap_trim_aux:w ##1 \s_@@_mark ##2 \s_@@_stop {##1}
}
\exp_args:NV \@@_tmp:w \c_catcode_other_space_tl
% \end{macrocode}
@@ -2314,12 +2338,12 @@
{
\tl_if_blank:nTF {#1}
{
- \cs_set:Npn \@@_tmp:w ##1 " ##2 " ##3 \q_stop
+ \cs_set:Npn \@@_tmp:w ##1 " ##2 " ##3 \s_@@_stop
{ { } {##2} { } }
\seq_gput_right:Nx \g_@@_stack_seq
{
\exp_after:wN \@@_tmp:w \tex_jobname:D
- " \tex_jobname:D " \q_stop
+ " \tex_jobname:D " \s_@@_stop
}
}
{
@@ -2389,6 +2413,48 @@
% \end{macrocode}
% \end{variable}
%
+% \subsubsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_quark_if_nil:n}
+% Branching quark conditional.
+% \begin{macrocode}
+\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:n { TF }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_if_recursion_tail_break:NN,
+% \@@_if_recursion_tail_stop_do:Nn
+% }
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:nn
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[EXP]{\__kernel_file_name_sanitize:n}
% \begin{macro}[EXP]{\__kernel_file_name_expand_loop:w}
% \begin{macro}[EXP]{\__kernel_file_name_expand_N_type:Nw}
@@ -2413,11 +2479,11 @@
\exp_args:Ne \__kernel_file_name_strip_quotes:n
{
\__kernel_file_name_expand_loop:w #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
}
}
-\cs_new:Npn \__kernel_file_name_expand_loop:w #1 \q_recursion_stop
+\cs_new:Npn \__kernel_file_name_expand_loop:w #1 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#1}
{ \__kernel_file_name_expand_N_type:Nw }
@@ -2426,11 +2492,11 @@
{ \__kernel_file_name_expand_group:nw }
{ \__kernel_file_name_expand_space:w }
}
- #1 \q_recursion_stop
+ #1 \q_@@_recursion_stop
}
\cs_new:Npn \__kernel_file_name_expand_N_type:Nw #1
{
- \quark_if_recursion_tail_stop:N #1
+ \@@_if_recursion_tail_stop:N #1
\bool_lazy_and:nnTF
{ \token_if_expandable_p:N #1 }
{
@@ -2470,11 +2536,11 @@
\cs_new:Npn \__kernel_file_name_strip_quotes:n #1
{
\__kernel_file_name_strip_quotes:nnnw {#1} { 0 } { }
- #1 " \q_recursion_tail " \q_recursion_stop
+ #1 " \q_@@_recursion_tail " \q_@@_recursion_stop
}
\cs_new:Npn \__kernel_file_name_strip_quotes:nnnw #1#2#3#4 "
{
- \quark_if_recursion_tail_stop_do:nn {#4}
+ \@@_if_recursion_tail_stop_do:nn {#4}
{ \__kernel_file_name_strip_quotes:nnn {#1} {#2} {#3} }
\__kernel_file_name_strip_quotes:nnnw {#1} { #2 + 1 } { #3#4 }
}
@@ -2495,19 +2561,19 @@
% removed at the end.
% \begin{macrocode}
\cs_new:Npn \__kernel_file_name_trim_spaces:n #1
- { \__kernel_file_name_trim_spaces:nw {#1} #1 . \q_nil . \q_stop }
-\cs_new:Npn \__kernel_file_name_trim_spaces:nw #1#2 . #3 . #4 \q_stop
+ { \__kernel_file_name_trim_spaces:nw {#1} #1 . \q_@@_nil . \s_@@_stop }
+\cs_new:Npn \__kernel_file_name_trim_spaces:nw #1#2 . #3 . #4 \s_@@_stop
{
- \quark_if_nil:nTF {#3}
+ \@@_quark_if_nil:nTF {#3}
{
\exp_args:Ne \__kernel_file_name_trim_spaces_aux:n
- { \tl_trim_spaces:n { #1 \s_stop } }
+ { \tl_trim_spaces:n { #1 \s_@@_stop } }
}
{ \tl_trim_spaces:n {#1} }
}
\cs_new:Npn \__kernel_file_name_trim_spaces_aux:n #1
{ \__kernel_file_name_trim_spaces_aux:w #1 }
-\cs_new:Npn \__kernel_file_name_trim_spaces_aux:w #1 \s_stop {#1}
+\cs_new:Npn \__kernel_file_name_trim_spaces_aux:w #1 \s_@@_stop {#1}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2526,10 +2592,10 @@
% \begin{macro}[EXP]{\__kernel_file_name_quote:nw}
% \begin{macrocode}
\cs_new:Npn \__kernel_file_name_quote:n #1
- { \__kernel_file_name_quote:nw {#1} #1 ~ \q_nil \q_stop }
-\cs_new:Npn \__kernel_file_name_quote:nw #1 #2 ~ #3 \q_stop
+ { \__kernel_file_name_quote:nw {#1} #1 ~ \q_@@_nil \s_@@_stop }
+\cs_new:Npn \__kernel_file_name_quote:nw #1 #2 ~ #3 \s_@@_stop
{
- \quark_if_nil:nTF {#3}
+ \@@_quark_if_nil:nTF {#3}
{ #1 }
{ "#1" }
}
@@ -2686,19 +2752,19 @@
% directory part, saving that. Then check for an extension.
% \begin{macrocode}
\cs_new:Npn \@@_ext_check:n #1
- { \@@_ext_check:nw { / } #1 / \q_nil / \q_stop }
-\cs_new:Npn \@@_ext_check:nw #1 #2 / #3 / #4 \q_stop
+ { \@@_ext_check:nw { / } #1 / \q_@@_nil / \s_@@_stop }
+\cs_new:Npn \@@_ext_check:nw #1 #2 / #3 / #4 \s_@@_stop
{
- \quark_if_nil:nTF {#3}
+ \@@_quark_if_nil:nTF {#3}
{
\exp_args:No \@@_ext_check:nnw
- { \use_none:n #1 } {#2} #2 . \q_nil . \q_stop
+ { \use_none:n #1 } {#2} #2 . \q_@@_nil . \s_@@_stop
}
- { \@@_ext_check:nw { #1 #2 / } #3 / #4 \q_stop }
+ { \@@_ext_check:nw { #1 #2 / } #3 / #4 \s_@@_stop }
}
-\cs_new:Npx \@@_ext_check:nnw #1#2#3 . #4 . #5 \q_stop
+\cs_new:Npx \@@_ext_check:nnw #1#2#3 . #4 . #5 \s_@@_stop
{
- \exp_not:N \quark_if_nil:nTF {#4}
+ \exp_not:N \@@_quark_if_nil:nTF {#4}
{
\exp_not:N \@@_ext_check:nn
{ #1 #2 } { #1 #2 \tl_to_str:n { .tex } }
@@ -3309,11 +3375,11 @@
\cs_new_protected:Npn \file_parse_full_name:nNNN #1#2#3#4
{
\exp_after:wN \@@_parse_full_name_auxi:w
- \tl_to_str:n { #1 " #1 " } \q_stop #2#3#4
+ \tl_to_str:n { #1 " #1 " } \s_@@_stop #2#3#4
}
\cs_generate_variant:Nn \file_parse_full_name:nNNN { V }
\cs_new_protected:Npn \@@_parse_full_name_auxi:w
- #1 " #2 " #3 \q_stop #4#5#6
+ #1 " #2 " #3 \s_@@_stop #4#5#6
{
\@@_parse_full_name_split:nNNNTF {#2} / #4 #5
{ \str_if_empty:NT #4 { \str_set:Nn #4 { / } } }
@@ -3327,7 +3393,7 @@
}
\cs_new_protected:Npn \@@_parse_full_name_split:nNNNTF #1#2#3#4
{
- \cs_set_protected:Npn \@@_tmp:w ##1 ##2 #2 ##3 \q_stop
+ \cs_set_protected:Npn \@@_tmp:w ##1 ##2 #2 ##3 \s_@@_stop
{
\tl_if_empty:nTF {##3}
{
@@ -3342,9 +3408,9 @@
\use_i:nn
}
}
- { \@@_tmp:w { ##1 #2 ##2 } ##3 \q_stop }
+ { \@@_tmp:w { ##1 #2 ##2 } ##3 \s_@@_stop }
}
- \@@_tmp:w { } #1 #2 \q_stop
+ \@@_tmp:w { } #1 #2 \s_@@_stop
}
% \end{macrocode}
% \end{macro}
@@ -3449,7 +3515,7 @@
\tl_set:Nn \ExplFileExtension { [unknown~extension] }
\tl_set:Nn \ExplFileVersion {-1}
}
- { \@@_id_info_auxii:w #1 ~ \q_stop }
+ { \@@_id_info_auxii:w #1 ~ \s_@@_stop }
}
% \end{macrocode}
% Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension,
@@ -3458,19 +3524,19 @@
% |-1| value then |#5| and |#6| are empty.
% \begin{macrocode}
\cs_new_protected:Npn \@@_id_info_auxii:w
- #1 ~ #2.#3 ~ #4 ~ #5 ~ #6 \q_stop
+ #1 ~ #2.#3 ~ #4 ~ #5 ~ #6 \s_@@_stop
{
\tl_set:Nn \ExplFileName {#2}
\tl_set:Nn \ExplFileExtension {#3}
\tl_set:Nn \ExplFileVersion {#4}
\str_if_eq:nnTF {#4} {-1}
{ \tl_set:Nn \ExplFileDate { 0000/00/00 } }
- { \@@_id_info_auxiii:w #5 - 0 - 0 - \q_stop }
+ { \@@_id_info_auxiii:w #5 - 0 - 0 - \s_@@_stop }
}
% \end{macrocode}
% Convert an \textsc{svn}-style date into a \LaTeX{}-style one.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_id_info_auxiii:w #1 - #2 - #3 - #4 \q_stop
+\cs_new_protected:Npn \@@_id_info_auxiii:w #1 - #2 - #3 - #4 \s_@@_stop
{ \tl_set:Nn \ExplFileDate { #1/#2/#3 } }
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3kernel/l3final.dtx b/macros/latex/contrib/l3kernel/l3final.dtx
index 4cd9eead10..d48aac03f5 100644
--- a/macros/latex/contrib/l3kernel/l3final.dtx
+++ b/macros/latex/contrib/l3kernel/l3final.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx
index 8309ffad51..7a76d29386 100644
--- a/macros/latex/contrib/l3kernel/l3flag.dtx
+++ b/macros/latex/contrib/l3kernel/l3flag.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3format.ins b/macros/latex/contrib/l3kernel/l3format.ins
index a4f728a0d0..99e9389728 100644
--- a/macros/latex/contrib/l3kernel/l3format.ins
+++ b/macros/latex/contrib/l3kernel/l3format.ins
@@ -62,9 +62,9 @@ and all files in that bundle must be distributed together.
\from{l3names.dtx} {initex}
\from{l3basics.dtx} {initex}
\from{l3expan.dtx} {initex}
+ \from{l3quark.dtx} {initex}
\from{l3tl.dtx} {initex}
\from{l3str.dtx} {initex}
- \from{l3quark.dtx} {initex}
\from{l3seq.dtx} {initex}
% ======== FORMAT ONLY =========
\from{l3alloc.dtx} {initex}
diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
index ce09c02627..725abc23b9 100644
--- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
index 44b55728cd..0281772275 100644
--- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -245,12 +245,27 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\s_@@_mark, \s_@@_stop}
+% \begin{variable}{\s_@@_expr_mark, \s_@@_expr_stop}
% Aliases of \cs{tex_relax:D}, used to terminate expressions.
% \begin{macrocode}
+\scan_new:N \s_@@_expr_mark
+\scan_new:N \s_@@_expr_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\s_@@_mark, \s_@@_stop}
+% Generic scan marks used throughout the module.
+% \begin{macrocode}
\scan_new:N \s_@@_mark
\scan_new:N \s_@@_stop
% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_s_stop:nw}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}
@@ -378,7 +393,7 @@
\@@_if_type_fp:NTwFw
#1 \@@_use_ii_until_s:nnw
\s_@@ { \@@_use_i_until_s:nw 4 }
- \q_stop
+ \s_@@_stop
}
% \end{macrocode}
% \end{macro}
@@ -540,12 +555,12 @@
%
% \begin{macro}[EXP]{\@@_if_type_fp:NTwFw}
% Used as \cs{@@_if_type_fp:NTwFw} \meta{marker} \Arg{true code}
-% \cs{s_@@} \Arg{false code} \cs{q_stop}, this test whether the
+% \cs{s_@@} \Arg{false code} \cs{s_@@_stop}, this test whether the
% \meta{marker} is \cs{s_@@} or not and runs the appropriate
% \meta{code}. The very unusual syntax is for optimization purposes
% as that function is used for all floating point operations.
% \begin{macrocode}
-\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \q_stop {#2}
+\cs_new:Npn \@@_if_type_fp:NTwFw #1 \s_@@ #2 #3 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
%
@@ -562,7 +577,7 @@
\@@_if_type_fp:NTwFw
#1 \@@_array_if_all_fp_loop:w
\s_@@ { \prg_break:n \use_iii:nnn }
- \q_stop
+ \s_@@_stop
}
% \end{macrocode}
% \end{macro}
@@ -579,17 +594,17 @@
\@@_if_type_fp:NTwFw
#1 { }
\s_@@ { \@@_type_from_scan_other:N #1 }
- \q_stop
+ \s_@@_stop
}
\cs_new:Npx \@@_type_from_scan_other:N #1
{
\exp_not:N \exp_after:wN \exp_not:N \@@_type_from_scan:w
- \exp_not:N \token_to_str:N #1 \exp_not:N \q_mark
- \tl_to_str:n { s_@@ _? } \exp_not:N \q_mark \exp_not:N \q_stop
+ \exp_not:N \token_to_str:N #1 \s_@@_mark
+ \tl_to_str:n { s_@@ _? } \s_@@_mark \s_@@_stop
}
\exp_last_unbraced:NNNNo
\cs_new:Npn \@@_type_from_scan:w #1
- { \tl_to_str:n { s_@@ } } #2 \q_mark #3 \q_stop {#2}
+ { \tl_to_str:n { s_@@ } } #2 \s_@@_mark #3 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
%
@@ -614,7 +629,7 @@
\cs_end:
#2 #3
}
- \q_stop
+ \s_@@_stop
}
\exp_last_unbraced:NNNNo
\cs_new:Npn \@@_change_func_type_aux:w #1 { \tl_to_str:n { @@ } } { }
@@ -631,7 +646,7 @@
% \end{macro}
%
% \begin{macro}[EXP]{\@@_exp_after_any_f:Nnw, \@@_exp_after_any_f:nw}
-% \begin{macro}[EXP]{\@@_exp_after_stop_f:nw}
+% \begin{macro}[EXP]{\@@_exp_after_expr_stop_f:nw}
% The |Nnw| function simply dispatches to the appropriate
% \cs[no-index]{@@_exp_after\ldots{}_f:nw} with \enquote{\ldots{}}
% (either empty or |_|\meta{type}) extracted from |#1|, which should
@@ -649,10 +664,10 @@
\@@_if_type_fp:NTwFw
#2 \@@_exp_after_f:nw
\s_@@ { \@@_exp_after_any_f:Nnw #2 }
- \q_stop
+ \s_@@_stop
{#1} #2
}
-\cs_new_eq:NN \@@_exp_after_stop_f:nw \use_none:nn
+\cs_new_eq:NN \@@_exp_after_expr_stop_f:nw \use_none:nn
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -667,7 +682,7 @@
% \meta{fp_1} |;|\\
% \ldots{}\\
% \meta{fp_n} |;|\\
-% \cs{s_@@_stop}
+% \cs{s_@@_expr_stop}
% \end{quote}
% \begin{macrocode}
\cs_new:Npn \@@_exp_after_tuple_o:w
@@ -679,7 +694,7 @@
\exp_after:wN \@@_tuple_chk:w
\exp_after:wN {
\exp:w \exp_end_continue_f:w
- \@@_exp_after_array_f:w #2 \s_@@_stop
+ \@@_exp_after_array_f:w #2 \s_@@_expr_stop
\exp_after:wN }
\exp_after:wN ;
\exp:w \exp_end_continue_f:w #1
diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
index 65165842fc..55823ba7fb 100644
--- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
index e070533c59..fc629937c4 100644
--- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -111,11 +111,11 @@
\cs_new:Npn \@@_trim_zeros:w #1 ;
{
\@@_trim_zeros_loop:w #1
- ; \@@_trim_zeros_loop:w 0; \@@_trim_zeros_dot:w .; \s_stop
+ ; \@@_trim_zeros_loop:w 0; \@@_trim_zeros_dot:w .; \s_@@_stop
}
\cs_new:Npn \@@_trim_zeros_loop:w #1 0; #2 { #2 #1 ; #2 }
\cs_new:Npn \@@_trim_zeros_dot:w #1 .; { \@@_trim_zeros_end:w #1 ; }
-\cs_new:Npn \@@_trim_zeros_end:w #1 ; #2 \s_stop { #1 }
+\cs_new:Npn \@@_trim_zeros_end:w #1 ; #2 \s_@@_stop { #1 }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
index 00ff667502..a1defe9889 100644
--- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -704,7 +704,7 @@
; #2#3#4 0000 0000 ;
}
\cs_new:Npn \@@_exp_Taylor_ii:ww #1; #2;
- { \@@_exp_Taylor_loop:www 10 ; #1 ; #1 ; \s_stop }
+ { \@@_exp_Taylor_loop:www 10 ; #1 ; #1 ; \s_@@_stop }
\cs_new:Npn \@@_exp_Taylor_loop:www #1; #2; #3;
{
\if_int_compare:w #1 = 1 \exp_stop_f:
@@ -719,7 +719,7 @@
#2 ;
}
}
-\cs_new:Npn \@@_exp_Taylor_break:Nww #1 #2; #3 \s_stop
+\cs_new:Npn \@@_exp_Taylor_break:Nww #1 #2; #3 \s_@@_stop
{ \@@_fixed_add_one:wN #2 ; }
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
index 2c906bf480..8904c44200 100644
--- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
index 632346bc4a..a503e3a3d4 100644
--- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -125,8 +125,8 @@
{
\if_charcode:w 0
\@@_if_type_fp:NTwFw
- #1 { \use_i_delimit_by_q_stop:nw #3 \q_stop }
- \s_@@ 1 \q_stop
+ #1 { \@@_use_i_delimit_by_s_stop:nw #3 \s_@@_stop }
+ \s_@@ 1 \s_@@_stop
\prg_return_false:
\else:
\prg_return_true:
@@ -181,8 +181,8 @@
\cs_new:Npn \@@_compare_back_any:ww #1#2; #3
{
\@@_if_type_fp:NTwFw
- #1 { \@@_if_type_fp:NTwFw #3 \use_i:nn \s_@@ \use_ii:nn \q_stop }
- \s_@@ \use_ii:nn \q_stop
+ #1 { \@@_if_type_fp:NTwFw #3 \use_i:nn \s_@@ \use_ii:nn \s_@@_stop }
+ \s_@@ \use_ii:nn \s_@@_stop
\@@_compare_back:ww
{
\cs:w
@@ -416,9 +416,9 @@
% \begin{macrocode}
\cs_new:Npn \@@_step:wwwN #1#2; #3#4; #5#6; #7
{
- \@@_if_type_fp:NTwFw #1 { } \s_@@ \prg_break: \q_stop
- \@@_if_type_fp:NTwFw #3 { } \s_@@ \prg_break: \q_stop
- \@@_if_type_fp:NTwFw #5 { } \s_@@ \prg_break: \q_stop
+ \@@_if_type_fp:NTwFw #1 { } \s_@@ \prg_break: \s_@@_stop
+ \@@_if_type_fp:NTwFw #3 { } \s_@@ \prg_break: \s_@@_stop
+ \@@_if_type_fp:NTwFw #5 { } \s_@@ \prg_break: \s_@@_stop
\use_i:nnnn { \@@_step_fp:wwwN #1#2; #3#4; #5#6; #7 }
\prg_break_point:
\use:n
@@ -683,15 +683,15 @@
\if_meaning:w \@@_parse_infix_::N #5
\if_charcode:w 0
\@@_if_type_fp:NTwFw
- #2 { \use_i:nn \use_i_delimit_by_q_stop:nw #3 \q_stop }
- \s_@@ 1 \q_stop
+ #2 { \use_i:nn \@@_use_i_delimit_by_s_stop:nw #3 \s_@@_stop }
+ \s_@@ 1 \s_@@_stop
\exp_after:wN \exp_after:wN \exp_after:wN \@@_ternary_auxii:NwwN
\else:
\exp_after:wN \exp_after:wN \exp_after:wN \@@_ternary_auxi:NwwN
\fi:
\exp_after:wN #1
\exp:w \exp_end_continue_f:w
- \@@_exp_after_array_f:w #4 \s_@@_stop
+ \@@_exp_after_array_f:w #4 \s_@@_expr_stop
\exp_after:wN @
\exp:w
\@@_parse_operand:Nw \c_@@_prec_colon_int
@@ -702,7 +702,7 @@
\exp_after:wN \@@_parse_continue:NwN
\exp_after:wN #1
\exp:w \exp_end_continue_f:w
- \@@_exp_after_array_f:w #4 \s_@@_stop
+ \@@_exp_after_array_f:w #4 \s_@@_expr_stop
\exp_after:wN #5
\exp_after:wN #1
\fi:
@@ -712,7 +712,7 @@
\exp_after:wN \@@_parse_continue:NwN
\exp_after:wN #1
\exp:w \exp_end_continue_f:w
- \@@_exp_after_array_f:w #2 \s_@@_stop
+ \@@_exp_after_array_f:w #2 \s_@@_expr_stop
#4 #1
}
\cs_new:Npn \@@_ternary_auxii:NwwN #1#2@#3@#4
@@ -720,7 +720,7 @@
\exp_after:wN \@@_parse_continue:NwN
\exp_after:wN #1
\exp:w \exp_end_continue_f:w
- \@@_exp_after_array_f:w #3 \s_@@_stop
+ \@@_exp_after_array_f:w #3 \s_@@_expr_stop
#4 #1
}
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
index 8c5a03bd24..978d4dfe7f 100644
--- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -468,7 +468,7 @@
% \item If the next token is a control sequence with the meaning of
% \cs{scan_stop:}, it can be: \cs{s_@@}, in which case our job is
% done, as what follows is an internal floating point number, or
-% \cs{s_@@_mark}, in which case the expression has come to an early
+% \cs{s_@@_expr_mark}, in which case the expression has come to an early
% end, as we are still looking for a number here, or something else,
% in which case we consider the control sequence to be a bad
% variable resulting from \texttt{c}-expansion.
@@ -499,7 +499,7 @@
% operator. This goes as follows.
% \begin{itemize}
% \item If the next token is a control sequence, it could be the
-% special marker \cs{s_@@_mark}, and
+% special marker \cs{s_@@_expr_mark}, and
% otherwise it is a case of juxtaposing numbers, such as
% |2\c_zero_int|, with an implied multiplication.
% \item If the next token is a letter, it is also a case of
@@ -741,7 +741,7 @@
% \begin{macro}[EXP]
% {
% \@@_parse_one_fp:NN,
-% \@@_exp_after_mark_f:nw,
+% \@@_exp_after_expr_mark_f:nw,
% \@@_exp_after_?_f:nw
% }
% This function receives a \meta{precedence} and a control sequence
@@ -750,8 +750,8 @@
% \item \cs{s_@@} starts a floating point number, and we call
% \cs{@@_exp_after_f:nw}, which |f|-expands after the floating
% point.
-% \item \cs{s_@@_mark} is a premature end, we call
-% \cs{@@_exp_after_mark_f:nw}, which triggers an |fp-early-end|
+% \item \cs{s_@@_expr_mark} is a premature end, we call
+% \cs{@@_exp_after_expr_mark_f:nw}, which triggers an |fp-early-end|
% error.
% \item For a control sequence not containing \cs[no-index]{s_@@}, we call
% \cs{@@_exp_after_?_f:nw}, causing a |bad-variable| error.
@@ -776,7 +776,7 @@
\exp_after:wN #1 \exp:w \@@_parse_expand:w
}
}
-\cs_new:Npn \@@_exp_after_mark_f:nw #1
+\cs_new:Npn \@@_exp_after_expr_mark_f:nw #1
{
\int_case:nnF { \exp_after:wN \use_i:nnn \use_none:nnn #1 }
{
@@ -877,11 +877,11 @@
; \exp_not:N \@@_parse_one_register_dim:ww
\tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_mu:www
. \tl_to_str:n { pt } ; \exp_not:N \@@_parse_one_register_int:www
- \exp_not:N \q_stop
+ \s_@@_stop
}
\exp_args:Nno \use:nn
{ \cs_new:Npn \@@_parse_one_register_auxii:wwwNw #1 . #2 }
- { \tl_to_str:n { pt } #3 ; #4#5 \q_stop }
+ { \tl_to_str:n { pt } #3 ; #4#5 \s_@@_stop }
{ #4 #1.#2; }
\exp_args:Nno \use:nn
{ \cs_new:Npn \@@_parse_one_register_mu:www #1 }
@@ -1837,12 +1837,12 @@
% \begin{macrocode}
\cs_new:Npn \@@_parse_apply_unary:NNNwN #1#2#3#4@#5
{
- \@@_parse_apply_unary_chk:NwNw #4 @ ; . \q_stop
+ \@@_parse_apply_unary_chk:NwNw #4 @ ; . \s_@@_stop
\@@_parse_apply_unary_type:NNN
#3 #2 #4 @
\exp:w \exp_end_continue_f:w #5 #1
}
-\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \q_stop
+\cs_new:Npn \@@_parse_apply_unary_chk:NwNw #1#2 ; #3#4 \s_@@_stop
{
\if_meaning:w @ #3 \else:
\token_if_eq_meaning:NNTF . #3
@@ -1947,7 +1947,7 @@
\exp_not:N \token_if_eq_meaning:NNTF #3
\exp_not:c { @@_parse_infix_):N }
{
- \exp_not:N \@@_exp_after_array_f:w #2 \s_@@_stop
+ \exp_not:N \@@_exp_after_array_f:w #2 \s_@@_expr_stop
\exp_not:N \exp_after:wN
\exp_not:N \@@_parse_infix_after_paren:NN
\exp_not:N \exp_after:wN #1
@@ -2116,7 +2116,7 @@
% in two steps. The \cs{@@_parse_operand:Nw} function performs
% computations until reaching an operation with precedence
% \cs{c_@@_prec_end_int} or less, namely, the end of the expression. The
-% marker \cs{s_@@_mark} indicates that the next token is an already
+% marker \cs{s_@@_expr_mark} indicates that the next token is an already
% parsed version of an infix operator, and \cs{@@_parse_infix_end:N}
% has infinitely negative precedence. Finally, clean up a
% (well-defined) set of extra tokens and stop the initial expansion
@@ -2129,12 +2129,12 @@
\exp:w
\@@_parse_operand:Nw \c_@@_prec_end_int
\@@_parse_expand:w #1
- \s_@@_mark \@@_parse_infix_end:N
- \s_@@_stop
+ \s_@@_expr_mark \@@_parse_infix_end:N
+ \s_@@_expr_stop
\exp_end:
}
\cs_new:Npn \@@_parse_after:ww
- #1@ \@@_parse_infix_end:N \s_@@_stop #2 { #2 #1 }
+ #1@ \@@_parse_infix_end:N \s_@@_expr_stop #2 { #2 #1 }
\cs_new:Npn \@@_parse_o:n #1
{
\exp:w
@@ -2142,8 +2142,8 @@
\exp:w
\@@_parse_operand:Nw \c_@@_prec_end_int
\@@_parse_expand:w #1
- \s_@@_mark \@@_parse_infix_end:N
- \s_@@_stop
+ \s_@@_expr_mark \@@_parse_infix_end:N
+ \s_@@_expr_stop
{
\exp_end_continue_f:w
\@@_exp_after_any_f:nw { \exp_after:wN \exp_stop_f: }
@@ -2265,7 +2265,7 @@
{
\if_catcode:w \scan_stop: \exp_not:N #2
\if_int_compare:w
- \@@_str_if_eq:nn { \s_@@_mark } { \exp_not:N #2 }
+ \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 }
= 0 \exp_stop_f:
\exp_after:wN \exp_after:wN
\exp_after:wN \@@_parse_infix_mark:NNN
@@ -2317,7 +2317,7 @@
{
\if_catcode:w \scan_stop: \exp_not:N #2
\if_int_compare:w
- \@@_str_if_eq:nn { \s_@@_mark } { \exp_not:N #2 }
+ \@@_str_if_eq:nn { \s_@@_expr_mark } { \exp_not:N #2 }
= 0 \exp_stop_f:
\exp_after:wN \exp_after:wN
\exp_after:wN \@@_parse_infix_mark:NNN
@@ -2349,7 +2349,7 @@
% \subsubsection{Closing parentheses and commas}
%
% \begin{macro}[EXP]{\@@_parse_infix_mark:NNN}
-% As an infix operator, \cs{s_@@_mark} means that the next
+% As an infix operator, \cs{s_@@_expr_mark} means that the next
% token~(|#3|) has already gone through \cs{@@_parse_infix:NN} and
% should be provided the precedence~|#1|. The scan mark~|#2| is
% discarded.
@@ -2764,7 +2764,7 @@
\cs_new:Npn \@@_parse_function_one_two:nnw #1#2#3
{
\@@_if_type_fp:NTwFw
- #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \q_stop
+ #3 { } \s_@@ \@@_parse_function_one_two_error_o:w \s_@@_stop
\@@_parse_function_one_two_aux:nnw {#1} {#2} #3
}
\cs_new:Npn \@@_parse_function_one_two_error_o:w #1#2#3#4 @
@@ -2786,7 +2786,7 @@
\fi:
\@@_parse_function_one_two_error_o:w
}
- \q_stop
+ \s_@@_stop
\@@_parse_function_one_two_auxii:nnw {#1} {#2} #3; #4
}
\cs_new:Npn \@@_parse_function_one_two_auxii:nnw #1#2#3; #4; #5
diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx
index 8ff26feedd..11bf7d311d 100644
--- a/macros/latex/contrib/l3kernel/l3fp-random.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx
index 89453a55ca..a5b0bc6485 100644
--- a/macros/latex/contrib/l3kernel/l3fp-round.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
index 441a2e9436..51d25a090e 100644
--- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
% \maketitle
%
% \begin{documentation}
diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
index 1a34892a4b..156485e628 100644
--- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx
@@ -40,7 +40,7 @@
% {latex-team@latex-project.org}^^A
% }^^A
% }
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx
index b781dda55d..f9bcbee467 100644
--- a/macros/latex/contrib/l3kernel/l3fp.dtx
+++ b/macros/latex/contrib/l3kernel/l3fp.dtx
@@ -49,7 +49,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx
index 74c09b293c..d41c366b73 100644
--- a/macros/latex/contrib/l3kernel/l3fparray.dtx
+++ b/macros/latex/contrib/l3kernel/l3fparray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx
index 6ec7cd6528..faab276e44 100644
--- a/macros/latex/contrib/l3kernel/l3int.dtx
+++ b/macros/latex/contrib/l3kernel/l3int.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1053,6 +1053,37 @@
% \end{macro}
% \end{macro}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Scan marks used throughout the module.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_none_delimit_by_s_stop:w}
+% Function to gobble until a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Quarks for recursion.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:Nn,\@@_if_recursion_tail_stop:N}
+% Functions to query quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:Nn
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Integer expressions}
%
% \begin{macro}{\int_eval:n}
@@ -1469,7 +1500,7 @@
\@@_compare_error:
}
\cs_new:Npn \@@_compare_error:Nw
- #1#2 \q_stop
+ #1#2 \s_@@_stop
{
{ }
\c_zero_int \fi:
@@ -1525,7 +1556,7 @@
% \cs{@@_compare:w} receives as its argument an integer, a relation
% symbol, and some more tokens. We then setup the loop, which is
% ended by the two odd-looking items |e| and |{=nd_}|, with a trailing
-% \cs{q_stop} used to grab the entire argument when necessary.
+% \cs{s_@@_stop} used to grab the entire argument when necessary.
% \begin{macrocode}
\prg_new_conditional:Npnn \int_compare:n #1 { p , T , F , TF }
{
@@ -1535,7 +1566,7 @@
\cs_new:Npn \@@_compare:w #1 \@@_compare_error:
{
\exp_after:wN \if_false: \int_value:w
- \@@_compare:Nw #1 e { = nd_ } \q_stop
+ \@@_compare:Nw #1 e { = nd_ } \s_@@_stop
}
% \end{macrocode}
% The goal here is to find an \meta{operand} and a \meta{comparison}.
@@ -1552,13 +1583,13 @@
% \cs{scan_stop:}, ignored thanks to \tn{unexpanded}, and
% \cs{@@_compare_error:Nw} raises an error.
% \begin{macrocode}
-\cs_new:Npn \@@_compare:Nw #1#2 \q_stop
+\cs_new:Npn \@@_compare:Nw #1#2 \s_@@_stop
{
\exp_after:wN \@@_compare:NNw
- \@@_to_roman:w - 0 #2 \q_mark
- #1#2 \q_stop
+ \@@_to_roman:w - 0 #2 \s_@@_mark
+ #1#2 \s_@@_stop
}
-\cs_new:Npn \@@_compare:NNw #1#2#3 \q_mark
+\cs_new:Npn \@@_compare:NNw #1#2#3 \s_@@_mark
{
\__kernel_exp_not:w
\use:c
@@ -1585,7 +1616,7 @@
% and call \cs{@@_compare:Nw} to look for additional operands, after
% evaluating the following expression.
% \begin{macrocode}
-\cs_new:cpn { @@_compare_end_=:NNw } #1#2#3 e #4 \q_stop
+\cs_new:cpn { @@_compare_end_=:NNw } #1#2#3 e #4 \s_@@_stop
{
{#3} \exp_stop_f:
\prg_return_false: \else: \prg_return_true: \fi:
@@ -1593,7 +1624,7 @@
\cs_new:Npn \@@_compare:nnN #1#2#3
{
{#2} \exp_stop_f:
- \prg_return_false: \exp_after:wN \use_none_delimit_by_q_stop:w
+ \prg_return_false: \exp_after:wN \@@_use_none_delimit_by_s_stop:w
\fi:
#1 #2 #3 \exp_after:wN \@@_compare:Nw \int_value:w \@@_eval:w
}
@@ -1665,14 +1696,14 @@
\exp_args:Nf \@@_case:nnTF { \int_eval:n {#1} } {#2} { } { }
}
\cs_new:Npn \@@_case:nnTF #1#2#3#4
- { \@@_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+ { \@@_case:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
\cs_new:Npn \@@_case:nw #1#2#3
{
\int_compare:nNnTF {#1} = {#2}
{ \@@_case_end:nw {#3} }
{ \@@_case:nw {#1} }
}
-\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop
{ \exp_end: #1 #4 }
% \end{macrocode}
% \end{macro}
@@ -2261,10 +2292,10 @@
% \subsection{Converting from other formats to integers}
%
% \begin{macro}[rEXP]{\@@_pass_signs:wn, \@@_pass_signs_end:wn}
-% Called as \cs{@@_pass_signs:wn} \meta{signs and digits} \cs{q_stop}
+% Called as \cs{@@_pass_signs:wn} \meta{signs and digits} \cs{s_@@_stop}
% \Arg{code}, this function leaves in the input stream any sign it
% finds, then inserts the \meta{code} before the first non-sign token
-% (and removes \cs{q_stop}). More precisely, it deletes any~|+| and
+% (and removes \cs{s_@@_stop}). More precisely, it deletes any~|+| and
% passes any~|-| to the input stream, hence should be called in an
% integer expression.
% \begin{macrocode}
@@ -2277,7 +2308,7 @@
\exp_after:wN #1
\fi:
}
-\cs_new:Npn \@@_pass_signs_end:wn #1 \q_stop #2 { #2 #1 }
+\cs_new:Npn \@@_pass_signs_end:wn #1 \s_@@_stop #2 { #2 #1 }
% \end{macrocode}
% \end{macro}
%
@@ -2295,13 +2326,13 @@
\int_eval:n
{
\exp_after:wN \@@_pass_signs:wn \tl_to_str:n {#1}
- \q_stop { \@@_from_alph:nN { 0 } }
- \q_recursion_tail \q_recursion_stop
+ \s_@@_stop { \@@_from_alph:nN { 0 } }
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
}
\cs_new:Npn \@@_from_alph:nN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2 {#1}
+ \@@_if_recursion_tail_stop_do:Nn #2 {#1}
\exp_args:Nf \@@_from_alph:nN
{ \int_eval:n { #1 * 26 + \@@_from_alph:N #2 } }
}
@@ -2327,13 +2358,13 @@
\int_eval:n
{
\exp_after:wN \@@_pass_signs:wn \tl_to_str:n {#1}
- \q_stop { \@@_from_base:nnN { 0 } {#2} }
- \q_recursion_tail \q_recursion_stop
+ \s_@@_stop { \@@_from_base:nnN { 0 } {#2} }
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
}
\cs_new:Npn \@@_from_base:nnN #1#2#3
{
- \quark_if_recursion_tail_stop_do:Nn #3 {#1}
+ \@@_if_recursion_tail_stop_do:Nn #3 {#1}
\exp_args:Nf \@@_from_base:nnN
{ \int_eval:n { #1 * #2 + \@@_from_base:N #3 } }
{#2}
@@ -2409,16 +2440,16 @@
(
0
\exp_after:wN \@@_from_roman:NN \tl_to_str:n {#1}
- \q_recursion_tail \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_tail \q_@@_recursion_stop
)
}
}
\cs_new:Npn \@@_from_roman:NN #1#2
{
- \quark_if_recursion_tail_stop:N #1
+ \@@_if_recursion_tail_stop:N #1
\int_if_exist:cF { c_@@_from_roman_ #1 _int }
{ \@@_from_roman_error:w }
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ + \use:c { c_@@_from_roman_ #1 _int } }
\int_if_exist:cF { c_@@_from_roman_ #2 _int }
{ \@@_from_roman_error:w }
@@ -2436,7 +2467,7 @@
\@@_from_roman:NN #2
}
}
-\cs_new:Npn \@@_from_roman_error:w #1 \q_recursion_stop #2
+\cs_new:Npn \@@_from_roman_error:w #1 \q_@@_recursion_stop #2
{ #2 * 0 - 1 }
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx
index 900151aa0c..1c68482f55 100644
--- a/macros/latex/contrib/l3kernel/l3intarray.dtx
+++ b/macros/latex/contrib/l3kernel/l3intarray.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
index fa09742458..d5cc6170ad 100644
--- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
+++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -329,6 +329,104 @@
% and variable mappings.
% \end{variable}
%
+% \begin{function}{\__kernel_quark_new_test:N}
+% \begin{syntax}
+% \cs{__kernel_quark_new_test:N} \cs[no-index]{\meta{name}:\meta{arg spec}}
+% \end{syntax}
+% Defines a quark-test function \cs[no-index]{\meta{name}:\meta{arg spec}}
+% which tests if its argument is \cs[no-index]{q__\meta{namespace}_recursion_tail},
+% then acts accordingly, as described below for each possible
+% \meta{arg spec}.
+%
+% The \meta{namespace} is determined as the first (nonempty)
+% |_|-delimited word in \meta{name} and is used internally
+% in the definition of auxiliaries. The function
+% \cs{__kernel_quark_new_test:N} does \emph{not} define
+% the \cs[no-index]{q__\meta{namespace}_recursion_tail} and
+% \cs[no-index]{q__\meta{namespace}_recursion_stop} quarks.
+% They should be manually defined with \cs{quark_new:N}.
+%
+% There are $6$ different types of quark-test functions. Which one is
+% defined depends on the \meta{arg spec}, which \emph{must} be one of
+% the options listed now. Four of them are modeled after
+% \cs[no-index]{quark_if_recursion_tail:(N|n)} and
+% \cs[no-index]{quark_if_recursion_tail_do:(N|n)n}.
+% \begin{description}
+% \def\makelabel#1{\texttt{#1}}
+% \item[n] defines \cs[no-index]{\meta{name}:n} such that it
+% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_recursion_tail}, and
+% if so consumes all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop}
+% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop:n}).
+% \item[nn] defines \cs[no-index]{\meta{name}:nn} such that it
+% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_recursion_tail}, and
+% if so consumes all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop},
+% then executes the code |#2| after that
+% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop_do:nn}).
+% \item[N] defines \cs[no-index]{\meta{name}:N} such that it
+% checks if |#1| is \cs[no-index]{q__\meta{namespace}_recursion_tail}, and if so consumes
+% all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop}
+% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop:N}).
+% \item[Nn] defines \cs[no-index]{\meta{name}:Nn} such that it
+% checks if |#1| is \cs[no-index]{q__\meta{namespace}_recursion_tail}, and if so consumes
+% all tokens up to \cs[no-index]{q__\meta{namespace}_recursion_stop}, then executes
+% the code |#2| after that
+% (\emph{c.f.}~\cs{quark_if_recursion_tail_stop_do:Nn}).
+% \end{description}
+% The last two are modeled after
+% \cs[no-index]{quark_if_recursion_tail_break:(n|N)N}, and in those
+% cases the quark \cs[no-index]{q__\meta{namespace}_recursion_stop} is
+% not used (and thus needs not be defined).
+% \begin{description}
+% \def\makelabel#1{\texttt{#1}}
+% \item[nN] defines \cs[no-index]{\meta{name}:nN} such that it
+% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_recursion_tail}, and
+% if so uses the \cs[no-index]{\meta{type}_map_break:} function |#2|.
+% \item[NN] defines \cs[no-index]{\meta{name}:NN} such that it
+% checks if |#1| is \cs[no-index]{q__\meta{namespace}_recursion_tail}, and if so uses
+% the \cs[no-index]{\meta{type}_map_break:} function |#2|.
+% \end{description}
+% Any other signature, as well as a function without signature
+% are errors, and in such case the definition is aborted.
+% \end{function}
+%
+% \begin{function}{\__kernel_quark_new_conditional:Nn}
+% \begin{syntax}
+% \cs{__kernel_quark_new_conditional:Nn} \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:\meta{arg spec}} \Arg{conditions}
+% \end{syntax}
+% Defines a collection of quark conditionals that test if their
+% argument is the quark \cs[no-index]{q__\meta{namespace}_\meta{name}}
+% and perform suitable actions. The \meta{conditions} are a
+% comma-separated list of one or more of |p|, |T|, |F|, and |TF|, and
+% one conditional is defined for each \meta{condition} in the list, as
+% described for \cs{prg_new_conditional:Npnn}. The conditionals are
+% defined using \cs{prg_new_conditional:Npnn}, so that their name is
+% obtained by adding |p|, |T|, |F|, or |TF| to the base name
+% \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:\meta{arg spec}}.
+%
+% The first argument of \cs{__kernel_quark_new_conditional:Nn} must
+% contain |_quark_if_| and |:|, as these markers are used to determine
+% the \meta{name} of the quark
+% \cs[no-index]{q__\meta{namespace}_\meta{name}} to be tested. This
+% quark should be manually defined with \cs{quark_new:N}, as
+% \cs{__kernel_quark_new_conditional:Nn} does \emph{not} define it.
+%
+% The function \cs{__kernel_quark_new_conditional:Nn} can define $2$
+% different types of quark conditionals. Which one is defined depends
+% on the \meta{arg spec}, which \emph{must} be one of the following
+% options, modeled after \cs[no-index]{quark_if_nil:(N|n)(TF)}.
+% \begin{description}
+% \def\makelabel#1{\texttt{#1}}
+% \item[n] defines \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:n(TF)} such that it
+% checks if |#1| contains only \cs[no-index]{q__\meta{namespace}_\meta{name}}, and
+% executes the proper conditional branch.
+% \item[N] defines \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:N(TF)} such that it
+% checks if |#1| is \cs[no-index]{q__\meta{namespace}_\meta{name}}, and
+% executes the proper conditional branch.
+% \end{description}
+% Any other signature, as well as a function without signature
+% are errors, and in such case the definition is aborted.
+% \end{function}
+%
% \begin{variable}{\c__kernel_randint_max_int}
% Maximal allowed argument to \cs{__kernel_randint:n}. Equal to
% $2^{17}-1$.
diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx
index f00f95309c..b3630af0b1 100644
--- a/macros/latex/contrib/l3kernel/l3keys.dtx
+++ b/macros/latex/contrib/l3kernel/l3keys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -976,9 +976,7 @@
% argument.
% \begin{macrocode}
\cs_new:Npn \keyval_parse:NNn ##1 ##2 ##3
- {
- \@@_loop_active:NNw ##1 ##2 \s_@@_mark ##3 #1 \s_@@_tail #1
- }
+ { \@@_loop_active:NNw ##1 ##2 \s_@@_mark ##3 #1 \s_@@_tail #1 }
% \end{macrocode}
% \end{macro}
%
@@ -1043,16 +1041,14 @@
% control to \cs[no-index]{@@_key_val:nnN}.
% \begin{macrocode}
\cs_new:Npn \@@_split_active:w ##1 #2
+ { \@@_trim:nN { ##1 } \@@_split_active:nw \s_@@_mark }
+ \cs_new:Npn \@@_split_active:nw ##1 ##2 #2 ##3 \s_@@_stop
{
- \@@_trim:nN { ##1 } \@@_split_active:nw \s_@@_mark
+ \@@_if_empty:w \s_@@_mark ##3 \s_@@_stop
+ \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
+ { \@@_misplaced_equal_error: \use_none:n }
+ { \@@_trim:nN { ##2 } \@@_key_val:nnN { ##1 } }
}
- \cs_new:Npn \@@_split_active:nw ##1 ##2 #2 ##3 \s_@@_stop
- {
- \@@_if_empty:w \s_@@_mark ##3 \s_@@_stop
- \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
- { \@@_misplaced_equal_error: \use_none:n }
- { \@@_trim:nN { ##2 } \@@_key_val:nnN { ##1 } }
- }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1062,9 +1058,7 @@
% active equals sign and then runs the test for an empty argument.
% \begin{macrocode}
\cs_new:Npn \@@_if_has_equal_active:w ##1 #2
- {
- \@@_if_empty:w \s_@@_mark
- }
+ { \@@_if_empty:w \s_@@_mark }
% \end{macrocode}
% \end{macro}
%
@@ -1089,14 +1083,14 @@
\s_@@_mark \s_@@_tail
\@@_loop_other:NNw #1 , \s_@@_tail ,
\@@_loop_active:NNw #2 \s_@@_mark
- {}
+ { }
\cs_new:Npn \@@_end_loop_other:w
\s_@@_mark \s_@@_tail
\@@_if_has_equal_other:w #1 = \s_@@_stop
\@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
#2
\@@_loop_other:NNw #3 \s_@@_mark
- {}
+ { }
% \end{macrocode}
% \end{macro}
%
@@ -1106,16 +1100,14 @@
% equals signs of category other.
% \begin{macrocode}
\cs_new:Npn \@@_split_other:w #1 =
+ { \@@_trim:nN { #1 } \@@_split_other:nw \s_@@_mark }
+\cs_new:Npn \@@_split_other:nw #1 #2 = #3 \s_@@_stop
{
- \@@_trim:nN { #1 } \@@_split_other:nw \s_@@_mark
+ \@@_if_empty:w \s_@@_mark #3 \s_@@_stop
+ \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
+ { \@@_misplaced_equal_error: \use_none:n }
+ { \@@_trim:nN { #2 } \@@_key_val:nnN { #1 } }
}
- \cs_new:Npn \@@_split_other:nw #1 #2 = #3 \s_@@_stop
- {
- \@@_if_empty:w \s_@@_mark #3 \s_@@_stop
- \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn
- { \@@_misplaced_equal_error: \use_none:n }
- { \@@_trim:nN { #2 } \@@_key_val:nnN { #1 } }
- }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1126,9 +1118,7 @@
% them.
% \begin{macrocode}
\cs_new:Npn \@@_key:nN #1 #2
- {
- \exp_not:n { #2 { #1 } }
- }
+ { \exp_not:n { #2 { #1 } } }
% \end{macrocode}
% \end{macro}
%
@@ -1166,9 +1156,7 @@
\cs_new:Npn \@@_has_false:w \s_@@_mark \s_@@_stop \use_i:nn #1 #2 { #2 }
\cs_new:Npn \@@_blank_true:w \s_@@_mark \s_@@_stop \use:n #1 {}
\cs_new:Npn \@@_empty_key:w \s_@@_mark \s_@@_stop \exp_not:n #1
- {
- \@@_misplaced_equal_error:
- }
+ { \@@_misplaced_equal_error: }
% \end{macrocode}
% \end{macro}
%
@@ -1176,9 +1164,7 @@
% Another test that works by gobbling tokens until a specific one is hit.
% \begin{macrocode}
\cs_new:Npn \@@_if_has_equal_other:w #1 =
- {
- \@@_if_empty:w \s_@@_mark
- }
+ { \@@_if_empty:w \s_@@_mark }
% \end{macrocode}
% \end{macro}
%
@@ -1189,9 +1175,7 @@
% doesn't have to be fast anyway.
% \begin{macrocode}
\cs_new:Npn \@@_misplaced_equal_error:
- {
- \__kernel_msg_expandable_error:nn { kernel } { misplaced-equals-sign }
- }
+ { \__kernel_msg_expandable_error:nn { kernel } { misplaced-equals-sign } }
% \end{macrocode}
% \end{macro}
%
@@ -1360,7 +1344,7 @@
% be explicitly no-value, it must be a token list.
% \begin{macrocode}
\tl_new:N \l_@@_relative_tl
-\tl_set:Nn \l_@@_relative_tl { \q_no_value }
+\tl_set:Nn \l_@@_relative_tl { \q_@@_no_value }
% \end{macrocode}
% \end{variable}
%
@@ -1412,6 +1396,46 @@
% \end{macrocode}
% \end{variable}
%
+% \subsubsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_nil,\q_@@_no_value}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+\quark_new:N \q_@@_no_value
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_quark_if_nil:n}
+% Branching quark conditional.
+% \begin{macrocode}
+\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:n { TF }
+\__kernel_quark_new_conditional:Nn \@@_quark_if_no_value:N { TF }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:n}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:n
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{The key defining mechanism}
%
% \begin{macro}{\keys_define:nn}
@@ -1461,7 +1485,7 @@
\str_if_empty:NF \l_@@_property_str
{
\__kernel_msg_error:nnxx { kernel } { key-property-unknown }
- { \l_@@_property_str } { \l_keys_path_str }
+ { \l_@@_property_str } { \l_keys_path_str }
}
}
}
@@ -1480,9 +1504,9 @@
{
\str_set:Nx \l_@@_property_str { \@@_trim_spaces:n {#1} }
\exp_after:wN \@@_property_find:w \l_@@_property_str . .
- \q_stop {#1}
+ \s_@@_stop {#1}
}
-\cs_new_protected:Npn \@@_property_find:w #1 . #2 . #3 \q_stop #4
+\cs_new_protected:Npn \@@_property_find:w #1 . #2 . #3 \s_@@_stop #4
{
\tl_if_blank:nTF {#3}
{
@@ -1496,18 +1520,18 @@
{
\str_if_empty:NF \l_@@_module_str
{ \l_@@_module_str / }
- \tl_trim_spaces:n {#1}
+ \tl_trim_spaces:n {#1}
}
\str_set:Nn \l_@@_property_str { . #2 }
}
{
\str_set:Nx \l_keys_path_str { \l_@@_module_str / #1 . #2 }
- \@@_property_search:w #3 \q_stop
+ \@@_property_search:w #3 \s_@@_stop
}
\tl_set_eq:NN \l_keys_path_tl \l_keys_path_str
}
}
-\cs_new_protected:Npn \@@_property_search:w #1 . #2 \q_stop
+\cs_new_protected:Npn \@@_property_search:w #1 . #2 \s_@@_stop
{
\str_if_eq:nnTF {#2} { . }
{
@@ -1516,7 +1540,7 @@
}
{
\str_set:Nx \l_keys_path_str { \l_keys_path_str . #1 }
- \@@_property_search:w #2 \q_stop
+ \@@_property_search:w #2 \s_@@_stop
}
}
% \end{macrocode}
@@ -1536,18 +1560,18 @@
\bool_if:NTF \l_@@_no_value_bool
{
\exp_after:wN \@@_define_code:w
- \l_@@_property_str \q_stop
+ \l_@@_property_str \s_@@_stop
{ \use:c { \c_@@_props_root_str \l_@@_property_str } }
{
\__kernel_msg_error:nnxx { kernel }
{ key-property-requires-value } { \l_@@_property_str }
{ \l_keys_path_str }
- }
+ }
}
{ \use:c { \c_@@_props_root_str \l_@@_property_str } {#1} }
}
\exp_last_unbraced:NNNNo
- \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \q_stop
+ \cs_new:Npn \@@_define_code:w #1 \c_colon_str #2 \s_@@_stop
{ \tl_if_empty:nTF {#2} }
% \end{macrocode}
% \end{macro}
@@ -1800,7 +1824,7 @@
\exp_after:wN \@@_find_key_module:NNw
\exp_after:wN \l_@@_tmpa_tl
\exp_after:wN \l_@@_tmpb_tl
- \l_keys_path_str / \q_stop
+ \l_keys_path_str / \s_@@_stop
\@@_cmd_set:nx { \l_keys_path_str }
{
\exp_not:c { prop_ #2 put:Nnn }
@@ -2277,7 +2301,7 @@
\bool_set_false:N \exp_not:N \l_@@_filtered_bool
\bool_set_false:N \exp_not:N \l_@@_selective_bool
\tl_set:Nn \exp_not:N \l_@@_relative_tl
- { \exp_not:N \q_no_value }
+ { \exp_not:N \q_@@_no_value }
\@@_set:nn \exp_not:n { {#1} {#2} }
\bool_if:NT \l_@@_only_known_bool
{ \bool_set_true:N \exp_not:N \l_@@_only_known_bool }
@@ -2328,7 +2352,7 @@
\cs_new_protected:Npn \keys_set_known:nnN #1#2#3
{
\exp_args:No \@@_set_known:nnnnN
- \l_@@_unused_clist { \q_no_value } {#1} {#2} #3
+ \l_@@_unused_clist { \q_@@_no_value } {#1} {#2} #3
}
\cs_generate_variant:Nn \keys_set_known:nnN { nV , nv , no }
\cs_new_protected:Npn \keys_set_known:nnnN #1#2#3#4
@@ -2345,7 +2369,7 @@
\tl_set:Nn \l_@@_unused_clist {#1}
}
\cs_new_protected:Npn \keys_set_known:nn #1#2
- { \@@_set_known:nnn { \q_no_value } {#1} {#2} }
+ { \@@_set_known:nnn { \q_@@_no_value } {#1} {#2} }
\cs_generate_variant:Nn \keys_set_known:nn { nV , nv , no }
\cs_new_protected:Npn \@@_set_known:nnn #1#2#3
{
@@ -2406,7 +2430,7 @@
{
\exp_args:No \@@_set_filter:nnnnnN
\l_@@_unused_clist
- { \q_no_value } {#1} {#2} {#3} #4
+ { \q_@@_no_value } {#1} {#2} {#3} #4
}
\cs_generate_variant:Nn \keys_set_filter:nnnN { nnV , nnv , nno }
\cs_new_protected:Npn \keys_set_filter:nnnnN #1#2#3#4#5
@@ -2423,7 +2447,7 @@
\tl_set:Nn \l_@@_unused_clist {#1}
}
\cs_new_protected:Npn \keys_set_filter:nnn #1#2#3
- {\@@_set_filter:nnnn { \q_no_value } {#1} {#2} {#3} }
+ {\@@_set_filter:nnnn { \q_@@_no_value } {#1} {#2} {#3} }
\cs_generate_variant:Nn \keys_set_filter:nnn { nnV , nnv , nno }
\cs_new_protected:Npn \@@_set_filter:nnnn #1#2#3#4
{
@@ -2452,7 +2476,7 @@
\bool_set_false:N \exp_not:N \l_@@_filtered_bool
\bool_set_true:N \exp_not:N \l_@@_selective_bool
\tl_set:Nn \exp_not:N \l_@@_relative_tl
- { \exp_not:N \q_no_value }
+ { \exp_not:N \q_@@_no_value }
\@@_set_selective:nnn \exp_not:n { {#1} {#2} {#3} }
\bool_if:NT \l_@@_only_known_bool
{ \bool_set_true:N \exp_not:N \l_@@_only_known_bool }
@@ -2522,7 +2546,7 @@
\exp_after:wN \@@_find_key_module:NNw
\exp_after:wN \l_@@_module_str
\exp_after:wN \l_keys_key_str
- \l_keys_path_str / \q_stop
+ \l_keys_path_str / \s_@@_stop
\tl_set_eq:NN \l_keys_key_tl \l_keys_key_str
\@@_value_or_default:n {#3}
\bool_if:NTF \l_@@_selective_bool
@@ -2531,7 +2555,7 @@
\str_set:Nn \l_@@_module_str {#1}
}
\cs_generate_variant:Nn \@@_set_keyval:nnn { o }
-\cs_new_protected:Npn \@@_find_key_module:NNw #1#2#3 / #4 \q_stop
+\cs_new_protected:Npn \@@_find_key_module:NNw #1#2#3 / #4 \s_@@_stop
{
\tl_if_blank:nTF {#4}
{ \str_set:Nn #2 {#3} }
@@ -2541,7 +2565,7 @@
\str_if_empty:NF #1 { / }
#3
}
- \@@_find_key_module:NNw #1#2 #4 \q_stop
+ \@@_find_key_module:NNw #1#2 #4 \s_@@_stop
}
}
% \end{macrocode}
@@ -2722,12 +2746,12 @@
% When there is no relative path, things here are easy: just save the key
% name and value. When we are working with a relative path, first we
% need to turn it into a string: that can't happen earlier as we need
-% to store \cs{q_no_value}. Then, use a standard delimited approach to fish
+% to store \cs{q_@@_no_value}. Then, use a standard delimited approach to fish
% out the partial path.
% \begin{macrocode}
\cs_new_protected:Npn \@@_store_unused:
{
- \quark_if_no_value:NTF \l_@@_relative_tl
+ \@@_quark_if_no_value:NTF \l_@@_relative_tl
{
\clist_put_right:Nx \l_@@_unused_clist
{
@@ -2758,7 +2782,7 @@
\cs_set_protected:Npn \@@_store_unused:w
####1 \l_@@_relative_tl /
####2 \l_@@_relative_tl /
- ####3 \exp_not:N \q_stop
+ ####3 \s_@@_stop
}
{
\tl_if_blank:nF {##1}
@@ -2778,7 +2802,7 @@
{
\@@_store_unused:w \l_keys_path_str
\l_@@_relative_tl / \l_@@_relative_tl /
- \exp_not:N \q_stop
+ \s_@@_stop
}
}
\cs_new_protected:Npn \@@_store_unused:w { }
@@ -2824,9 +2848,9 @@
% Used to strip off the ending part of the key path after the last~|/|.
% \begin{macrocode}
\cs_new:Npn \@@_parent:n #1
- { \@@_parent:w #1 / / \q_stop { } }
+ { \@@_parent:w #1 / / \s_@@_stop { } }
\cs_generate_variant:Nn \@@_parent:n { o }
-\cs_new:Npn \@@_parent:w #1 / #2 / #3 \q_stop #4
+\cs_new:Npn \@@_parent:w #1 / #2 / #3 \s_@@_stop #4
{
\tl_if_blank:nTF {#2}
{
@@ -2834,7 +2858,7 @@
{ \use_none:n #4 }
}
{
- \@@_parent:w #2 / #3 \q_stop { #4 / #1 }
+ \@@_parent:w #2 / #3 \s_@@_stop { #4 / #1 }
}
}
% \end{macrocode}
@@ -2854,22 +2878,22 @@
\cs_new:Npn \@@_trim_spaces:n #1
{
\exp_after:wN \@@_trim_spaces_auxi:w \tl_to_str:n {#1}
- / \q_nil \q_stop
+ / \q_@@_nil \s_@@_stop
}
-\cs_new:Npn \@@_trim_spaces_auxi:w #1 / #2 \q_stop
+\cs_new:Npn \@@_trim_spaces_auxi:w #1 / #2 \s_@@_stop
{
- \quark_if_nil:nTF {#2}
+ \@@_quark_if_nil:nTF {#2}
{ \tl_trim_spaces:n {#1} }
{ \@@_trim_spaces_auxii:w #1 / #2 }
}
-\cs_new:Npn \@@_trim_spaces_auxii:w #1 / #2 / \q_nil
+\cs_new:Npn \@@_trim_spaces_auxii:w #1 / #2 / \q_@@_nil
{
\tl_trim_spaces:n {#1}
- \@@_trim_spaces_auxiii:w #2 / \q_recursion_tail / \q_recursion_stop
+ \@@_trim_spaces_auxiii:w #2 / \q_@@_recursion_tail / \q_@@_recursion_stop
}
\cs_set:Npn \@@_trim_spaces_auxiii:w #1 /
{
- \quark_if_recursion_tail_stop:n {#1}
+ \@@_if_recursion_tail_stop:n {#1}
/ \tl_trim_spaces:n { #1 }
\@@_trim_spaces_auxiii:w
}
diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx
index f1505be1b1..1c017035de 100644
--- a/macros/latex/contrib/l3kernel/l3legacy.dtx
+++ b/macros/latex/contrib/l3kernel/l3legacy.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx
index c3a5ec4985..5b3c8243fe 100644
--- a/macros/latex/contrib/l3kernel/l3luatex.dtx
+++ b/macros/latex/contrib/l3kernel/l3luatex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx
index 8dd4c2df83..feb233bf54 100644
--- a/macros/latex/contrib/l3kernel/l3msg.dtx
+++ b/macros/latex/contrib/l3kernel/l3msg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -525,6 +525,23 @@
% \end{macrocode}
% \end{variable}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_none_delimit_by_s_stop:w}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Creating messages}
%
% Messages are created and used separately, so there two parts to
@@ -1207,15 +1224,15 @@
{
\tl_if_in:nnTF { ^^J #1 } { ^^J > ~ }
{
- \tl_if_in:nnTF { #1 \q_mark } { . \q_mark }
+ \tl_if_in:nnTF { #1 \s_@@_mark } { . \s_@@_mark }
{ \@@_show_dot:w } { \@@_show:w }
- ^^J #1 \q_stop
+ ^^J #1 \s_@@_stop
}
{ \@@_show:nn { ? #1 } { } }
}
- \cs_new:Npn \@@_show_dot:w #1 ^^J > ~ #2 . \q_stop
+ \cs_new:Npn \@@_show_dot:w #1 ^^J > ~ #2 . \s_@@_stop
{ \@@_show:nn {#1} {#2} }
- \cs_new:Npn \@@_show:w #1 ^^J > ~ #2 \q_stop
+ \cs_new:Npn \@@_show:w #1 ^^J > ~ #2 \s_@@_stop
{ \@@_show:nn {#1} {#2} }
\cs_new_protected:Npn \@@_show:nn #1#2
{
@@ -1338,16 +1355,16 @@
{
\seq_clear:N \l_@@_hierarchy_seq
\@@_use_hierarchy:nwwN { }
- #1 \q_mark \@@_use_hierarchy:nwwN
- / \q_mark \use_none_delimit_by_q_stop:w
- \q_stop
+ #1 \s_@@_mark \@@_use_hierarchy:nwwN
+ / \s_@@_mark \@@_use_none_delimit_by_s_stop:w
+ \s_@@_stop
\@@_use_redirect_module:n { }
}
}
-\cs_new_protected:Npn \@@_use_hierarchy:nwwN #1#2 / #3 \q_mark #4
+\cs_new_protected:Npn \@@_use_hierarchy:nwwN #1#2 / #3 \s_@@_mark #4
{
\seq_put_left:Nn \l_@@_hierarchy_seq {#1}
- #4 { #1 / #2 } #3 \q_mark #4
+ #4 { #1 / #2 } #3 \s_@@_mark #4
}
% \end{macrocode}
% At this point, the items of \cs{l_@@_hierarchy_seq} are the
@@ -1798,6 +1815,18 @@
\__kernel_msg_new:nnnn { kernel } { quote-in-shell }
{ Quotes~in~shell~command~'#1'. }
{ Shell~commands~cannot~contain~quotes~("). }
+\__kernel_msg_new:nnnn { kernel } { invalid-quark-function }
+ { Quark~test~function~'#1'~is~invalid. }
+ {
+ \c__msg_coding_error_text_tl
+ LaTeX~has~been~asked~to~create~quark~test~function~'#1'~
+ \tl_if_empty:nTF {#2}
+ { but~that~name~ }
+ { with~signature~'#2',~but~that~signature~ }
+ is~not~valid.
+ }
+\__kernel_msg_new:nnn { kernel } { invalid-quark }
+ { Invalid~quark~variable~'#1'. }
\__kernel_msg_new:nnnn { kernel } { scanmark-already-defined }
{ Scan~mark~#1~already~defined. }
{
@@ -1984,7 +2013,7 @@
% is an extra subtlety: if the user inserts tokens for error recovery,
% they should be kept. Thus we also use an odd space character
% (with category code $7$) and keep tokens until that space character,
-% dropping everything else until \cs{q_stop}. The \cs{exp_end:} prevents
+% dropping everything else until \cs{s_@@_stop}. The \cs{exp_end:} prevents
% losing braces around the user-inserted text if any, and stops the
% expansion of \cs{exp:w}. The group is used to prevent
% |\LaTeX3~error:| from being globally equal to \cs{scan_stop:}.
diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx
index 1ff80abdbf..2878654f58 100644
--- a/macros/latex/contrib/l3kernel/l3names.dtx
+++ b/macros/latex/contrib/l3kernel/l3names.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3news.pdf b/macros/latex/contrib/l3kernel/l3news.pdf
index 1f47cf6159..d3d8cd3d8a 100644
--- a/macros/latex/contrib/l3kernel/l3news.pdf
+++ b/macros/latex/contrib/l3kernel/l3news.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news01.pdf b/macros/latex/contrib/l3kernel/l3news01.pdf
index 5a6cf44044..e7e64883a3 100644
--- a/macros/latex/contrib/l3kernel/l3news01.pdf
+++ b/macros/latex/contrib/l3kernel/l3news01.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news02.pdf b/macros/latex/contrib/l3kernel/l3news02.pdf
index 242ad64340..54d75387b2 100644
--- a/macros/latex/contrib/l3kernel/l3news02.pdf
+++ b/macros/latex/contrib/l3kernel/l3news02.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news03.pdf b/macros/latex/contrib/l3kernel/l3news03.pdf
index 10e4d27c06..60aa4d7d5d 100644
--- a/macros/latex/contrib/l3kernel/l3news03.pdf
+++ b/macros/latex/contrib/l3kernel/l3news03.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news04.pdf b/macros/latex/contrib/l3kernel/l3news04.pdf
index 9d236ae6ec..2165c12d76 100644
--- a/macros/latex/contrib/l3kernel/l3news04.pdf
+++ b/macros/latex/contrib/l3kernel/l3news04.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news05.pdf b/macros/latex/contrib/l3kernel/l3news05.pdf
index 5285b6494a..56d2d5f600 100644
--- a/macros/latex/contrib/l3kernel/l3news05.pdf
+++ b/macros/latex/contrib/l3kernel/l3news05.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news06.pdf b/macros/latex/contrib/l3kernel/l3news06.pdf
index 18cf35ef6c..4c0f81e8cb 100644
--- a/macros/latex/contrib/l3kernel/l3news06.pdf
+++ b/macros/latex/contrib/l3kernel/l3news06.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news07.pdf b/macros/latex/contrib/l3kernel/l3news07.pdf
index 558df172bd..f90ddaf6b1 100644
--- a/macros/latex/contrib/l3kernel/l3news07.pdf
+++ b/macros/latex/contrib/l3kernel/l3news07.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news08.pdf b/macros/latex/contrib/l3kernel/l3news08.pdf
index 9003cc10ad..0061ae2c85 100644
--- a/macros/latex/contrib/l3kernel/l3news08.pdf
+++ b/macros/latex/contrib/l3kernel/l3news08.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news09.pdf b/macros/latex/contrib/l3kernel/l3news09.pdf
index aa6826ec5c..149274576f 100644
--- a/macros/latex/contrib/l3kernel/l3news09.pdf
+++ b/macros/latex/contrib/l3kernel/l3news09.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news10.pdf b/macros/latex/contrib/l3kernel/l3news10.pdf
index ed057b204c..c6b222cbb4 100644
--- a/macros/latex/contrib/l3kernel/l3news10.pdf
+++ b/macros/latex/contrib/l3kernel/l3news10.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news11.pdf b/macros/latex/contrib/l3kernel/l3news11.pdf
index 2b42dd8612..ea68c02321 100644
--- a/macros/latex/contrib/l3kernel/l3news11.pdf
+++ b/macros/latex/contrib/l3kernel/l3news11.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3news12.pdf b/macros/latex/contrib/l3kernel/l3news12.pdf
index 56b04c76ac..d8e0127011 100644
--- a/macros/latex/contrib/l3kernel/l3news12.pdf
+++ b/macros/latex/contrib/l3kernel/l3news12.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf
index 0fe83d65c8..fbf3f14164 100644
--- a/macros/latex/contrib/l3kernel/l3prefixes.pdf
+++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx
index 1ea045aa74..d14576f08c 100644
--- a/macros/latex/contrib/l3kernel/l3prg.dtx
+++ b/macros/latex/contrib/l3kernel/l3prg.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -778,8 +778,9 @@
% \begin{macro}{\if_bool:N}
% \begin{macro}{\if_predicate:w}
% Those two primitive \TeX{} conditionals are synonyms.
+% \cs{if_bool:N} is defined in \pkg{l3basics}, as it's needed
+% earlier to define quark test functions.
% \begin{macrocode}
-\cs_new_eq:NN \if_bool:N \tex_ifodd:D
\cs_new_eq:NN \if_predicate:w \tex_ifodd:D
% \end{macrocode}
% \end{macro}
@@ -916,6 +917,31 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_q_recursion_stop:nw}
+% Functions to gobble up to a quark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_q_recursion_stop:nw
+ #1 #2 \q_@@_recursion_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:nn}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:nn
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[pTF]{\bool_if:N, \bool_if:c}
% \UnitTested
% Straight forward here. We could optimize here if we wanted to as
@@ -1213,7 +1239,7 @@
% \texttt{false} expression, then the result is \texttt{true}.
% \begin{macrocode}
\cs_new:Npn \bool_lazy_all_p:n #1
- { \@@_lazy_all:n #1 \q_recursion_tail \q_recursion_stop }
+ { \@@_lazy_all:n #1 \q_@@_recursion_tail \q_@@_recursion_stop }
\prg_new_conditional:Npnn \bool_lazy_all:n #1 { T , F , TF }
{
\if_predicate:w \bool_lazy_all_p:n {#1}
@@ -1224,9 +1250,9 @@
}
\cs_new:Npn \@@_lazy_all:n #1
{
- \quark_if_recursion_tail_stop_do:nn {#1} { \c_true_bool }
+ \@@_if_recursion_tail_stop_do:nn {#1} { \c_true_bool }
\bool_if:nF {#1}
- { \use_i_delimit_by_q_recursion_stop:nw { \c_false_bool } }
+ { \@@_use_i_delimit_by_q_recursion_stop:nw { \c_false_bool } }
\@@_lazy_all:n
}
% \end{macrocode}
@@ -1260,7 +1286,7 @@
% \texttt{true} expression, then the result is \texttt{false}.
% \begin{macrocode}
\cs_new:Npn \bool_lazy_any_p:n #1
- { \@@_lazy_any:n #1 \q_recursion_tail \q_recursion_stop }
+ { \@@_lazy_any:n #1 \q_@@_recursion_tail \q_@@_recursion_stop }
\prg_new_conditional:Npnn \bool_lazy_any:n #1 { T , F , TF }
{
\if_predicate:w \bool_lazy_any_p:n {#1}
@@ -1271,9 +1297,9 @@
}
\cs_new:Npn \@@_lazy_any:n #1
{
- \quark_if_recursion_tail_stop_do:nn {#1} { \c_false_bool }
+ \@@_if_recursion_tail_stop_do:nn {#1} { \c_false_bool }
\bool_if:nT {#1}
- { \use_i_delimit_by_q_recursion_stop:nw { \c_true_bool } }
+ { \@@_use_i_delimit_by_q_recursion_stop:nw { \c_true_bool } }
\@@_lazy_any:n
}
% \end{macrocode}
@@ -1606,10 +1632,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macrocode}
-%<@@=prg>
-% \end{macrocode}
-%
% \begin{variable}{\g__kernel_prg_map_int}
% A nesting counter for mapping.
% \begin{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx
index 9cc9111f34..c586164260 100644
--- a/macros/latex/contrib/l3kernel/l3prop.dtx
+++ b/macros/latex/contrib/l3kernel/l3prop.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -617,6 +617,34 @@
% \end{macrocode}
% \end{variable}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:n}
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:o}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:n
+\cs_generate_variant:Nn \@@_if_recursion_tail_stop:n { o }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Allocation and initialisation}
%
% \begin{macro}[tested = m3prop001]{\prop_new:N, \prop_new:c}
@@ -718,9 +746,9 @@
% trailing~|=| that we added). For both splits trim spaces and call a
% function (first \cs{@@_from_keyval_key:w} then
% \cs{@@_from_keyval_value:w}), followed by the trimmed material,
-% \cs{q_nil}, the subsequent part of the item, and the trailing |=|'s
-% and \cs{q_stop}. After finding the \meta{key} just store it after
-% \cs{q_stop}. After finding the \meta{value} ignore completely empty
+% \cs{s_@@_mark}, the subsequent part of the item, and the trailing |=|'s
+% and \cs{s_@@_stop}. After finding the \meta{key} just store it after
+% \cs{s_@@_stop}. After finding the \meta{value} ignore completely empty
% items (both trailing~|=| were used as delimiters and all parts are
% empty); if the remaining part~|#2| consists exactly of the second
% trailing~|=| (namely there was exactly one |=|~in the item) then
@@ -754,27 +782,27 @@
\cs_new_protected:Npn \@@_from_keyval:n #1
{
\@@_from_keyval_loop:w \prg_do_nothing: #1 ,
- \q_recursion_tail , \q_recursion_stop
+ \q_@@_recursion_tail , \q_@@_recursion_stop
}
\cs_new_protected:Npn \@@_from_keyval_loop:w #1 ,
{
- \quark_if_recursion_tail_stop:o {#1}
+ \@@_if_recursion_tail_stop:o {#1}
\@@_from_keyval_split:Nw \@@_from_keyval_key:n
- #1 = = \q_stop {#1}
+ #1 = = \s_@@_stop {#1}
\@@_from_keyval_loop:w \prg_do_nothing:
}
\cs_new_protected:Npn \@@_from_keyval_split:Nw #1#2 =
{ \tl_trim_spaces_apply:oN {#2} #1 }
\cs_new_protected:Npn \@@_from_keyval_key:n #1
- { \@@_from_keyval_key:w #1 \q_nil }
-\cs_new_protected:Npn \@@_from_keyval_key:w #1 \q_nil #2 \q_stop
+ { \@@_from_keyval_key:w #1 \s_@@_mark }
+\cs_new_protected:Npn \@@_from_keyval_key:w #1 \s_@@_mark #2 \s_@@_stop
{
\@@_from_keyval_split:Nw \@@_from_keyval_value:n
- \prg_do_nothing: #2 \q_stop {#1}
+ \prg_do_nothing: #2 \s_@@_stop {#1}
}
\cs_new_protected:Npn \@@_from_keyval_value:n #1
- { \@@_from_keyval_value:w #1 \q_nil }
-\cs_new_protected:Npn \@@_from_keyval_value:w #1 \q_nil #2 \q_stop #3#4
+ { \@@_from_keyval_value:w #1 \s_@@_mark }
+\cs_new_protected:Npn \@@_from_keyval_value:w #1 \s_@@_mark #2 \s_@@_stop #3#4
{
\tl_if_empty:nF { #3 #1 #2 }
{
@@ -808,7 +836,7 @@
% \begin{quote}
% \cs{cs_set:Npn} \cs{@@_split_aux:w} |#1| \\
% \quad \cs{@@_pair:wn} \meta{key} \cs{s_@@} |#2| \\
-% \quad |#3| \cs{q_mark} |#4| |#5| \cs{q_stop} \\
+% \quad |#3| \cs{s_@@_mark} |#4| |#5| \cs{s_@@_stop} \\
% \quad |{| |#4| \Arg{true code} \Arg{false code} |}|
% \end{quote}
%
@@ -829,10 +857,10 @@
\cs_new_protected:Npn \@@_split_aux:NnTF #1#2#3#4
{
\cs_set:Npn \@@_split_aux:w ##1
- \@@_pair:wn #2 \s_@@ ##2 ##3 \q_mark ##4 ##5 \q_stop
+ \@@_pair:wn #2 \s_@@ ##2 ##3 \s_@@_mark ##4 ##5 \s_@@_stop
{ ##4 {#3} {#4} }
- \exp_after:wN \@@_split_aux:w #1 \q_mark \use_i:nn
- \@@_pair:wn #2 \s_@@ { } \q_mark \use_ii:nn \q_stop
+ \exp_after:wN \@@_split_aux:w #1 \s_@@_mark \use_i:nn
+ \@@_pair:wn #2 \s_@@ { } \s_@@_mark \use_ii:nn \s_@@_stop
}
\cs_new:Npn \@@_split_aux:w { }
% \end{macrocode}
@@ -1147,7 +1175,7 @@
% most often empty. When the \meta{key} is found in the list,
% \cs{@@_if_in:N} receives \cs{@@_pair:wn}, and if it is
% found as the extra item, the function receives
-% \cs{q_recursion_tail}, easily recognizable.
+% \cs{q_@@_recursion_tail}, easily recognizable.
%
% Here, \cs{prop_map_function:NN} is not sufficient for the mapping,
% since it can only map a single token, and cannot carry the key that
@@ -1157,7 +1185,7 @@
{
\exp_last_unbraced:Noo \@@_if_in:nwwn { \tl_to_str:n {#2} } #1
\@@_pair:wn \tl_to_str:n {#2} \s_@@ { }
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:
}
\cs_new:Npn \@@_if_in:nwwn #1#2 \@@_pair:wn #3 \s_@@ #4
@@ -1168,7 +1196,7 @@
}
\cs_new:Npn \@@_if_in:N #1
{
- \if_meaning:w \q_recursion_tail #1
+ \if_meaning:w \q_@@_recursion_tail #1
\prg_return_false:
\else:
\prg_return_true:
diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx
index a6c66f1561..f513fcb026 100644
--- a/macros/latex/contrib/l3kernel/l3quark.dtx
+++ b/macros/latex/contrib/l3kernel/l3quark.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -399,9 +399,25 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\quark_if_recursion_tail_stop:N}
+% \begin{variable}{\s_@@}
+% Private scan mark used in \pkg{l3quark}. We don't have \pkg{l3scan}
+% yet, so we declare the scan mark here and add it to the scan mark pool
+% later.
+% \begin{macrocode}
+\cs_new_eq:NN \s_@@ \scan_stop:
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_nil}
+% Private quark use for some tests.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\quark_if_recursion_tail_stop:N}
% \UnitTested
-% \begin{macro}{\quark_if_recursion_tail_stop_do:Nn}
+% \begin{macro}[EXP]{\quark_if_recursion_tail_stop_do:Nn}
% \UnitTested
% When doing recursions, it is easy to spend a lot of time testing if the
% end marker has been found. To avoid this, a dedicated end marker is used
@@ -429,13 +445,13 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}
+% \begin{macro}[EXP]
% {\quark_if_recursion_tail_stop:n, \quark_if_recursion_tail_stop:o}
% \UnitTested
-% \begin{macro}
+% \begin{macro}[EXP]
% {\quark_if_recursion_tail_stop_do:nn, \quark_if_recursion_tail_stop_do:on}
% \UnitTested
-% \begin{macro}{\@@_if_recursion_tail:w}
+% \begin{macro}[EXP]{\@@_if_recursion_tail:w}
% See \cs{quark_if_nil:nTF} for the details. Expanding
% \cs{@@_if_recursion_tail:w} once in front of the tokens chosen here
% gives an empty result if and only if |#1|~is exactly
@@ -464,8 +480,8 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\quark_if_recursion_tail_break:NN}
-% \begin{macro}{\quark_if_recursion_tail_break:nN}
+% \begin{macro}[EXP]{\quark_if_recursion_tail_break:NN}
+% \begin{macro}[EXP]{\quark_if_recursion_tail_break:nN}
% Analogues of the \cs[index=quark_if_recursion_tail_stop:n]
% {quark_if_recursion_tail_stop\ldots{}} functions.
% Break the mapping using |#2|.
@@ -574,6 +590,353 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\__kernel_quark_new_test:N}
+% The function \cs{__kernel_quark_new_test:N} defines |#1| in a
+% similar way as \cs[no-index]{quark_if_recursion_tail_...} functions
+% (as described below), using
+% \cs[no-index]{q__\meta{namespace}_recursion_tail} as the test quark
+% and \cs[no-index]{q__\meta{namespace}_recursion_stop} as the
+% delimiter quark, where the \meta{namespace} is determined as the
+% first |_|-delimited part in~|#1|.
+%
+% There are six possible function types which this function can define,
+% and which is defined depends on the signature of the function being
+% defined:
+% \begin{description}
+% \def\makelabel#1{\texttt{:#1}~}
+% \item[n] gives an analogue of \cs{quark_if_recursion_tail_stop:n}
+% \item[nn] gives an analogue of \cs{quark_if_recursion_tail_stop_do:nn}
+% \item[nN] gives an analogue of \cs{quark_if_recursion_tail_break:nN}
+% \item[N] gives an analogue of \cs{quark_if_recursion_tail_stop:N}
+% \item[Nn] gives an analogue of \cs{quark_if_recursion_tail_stop_do:Nn}
+% \item[NN] gives an analogue of \cs{quark_if_recursion_tail_break:NN}
+% \end{description}
+% Any other signature causes an error, as does a function without signature.
+%
+% \begin{macro}{\__kernel_quark_new_conditional:Nn}
+% Similar to \cs{__kernel_quark_new_test:N}, but defines quark
+% branching conditionals like \cs{quark_if_nil:nTF} that test for the
+% quark \cs[no-index]{q__\meta{namespace}_\meta{name}}.
+% The \meta{namespace} and \meta{name} are determined from the
+% conditional~|#1|, which must take the rather rigid form
+% \cs[no-index]{__\meta{namespace}_quark_if_\meta{name}:\meta{arg spec}}.
+% There are only two cases for the \meta{arg spec} here:
+% \begin{description}
+% \def\makelabel#1{\texttt{:#1}~}
+% \item[n] gives an analogue of \cs[no-index]{quark_if_nil:n(TF)}
+% \item[N] gives an analogue of \cs[no-index]{quark_if_nil:N(TF)}
+% \end{description}
+% Any other signature causes an error, as does a function without signature.
+% We use low-level emptiness tests as \pkg{l3tl} is not available yet when these
+% functions are used; thankfully we only care about whether strings
+% are empty so a simple \cs{if_meaning:w} \cs{q_nil} \meta{string}
+% \cs{q_nil} suffices.
+%
+% \begin{macro}{\@@_new_test:NNNn, \@@_new_test:Nccn,
+% \@@_new_test_aux:nnNNnnnn}
+% \begin{macro}{\@@_new_conditional:Nnnn, \@@_new_conditional:Nxxn}
+% \begin{macrocode}
+\cs_new_protected:Npn \__kernel_quark_new_test:N #1
+ { \@@_new_test_aux:Nx #1 { \@@_module_name:N #1 } }
+\cs_new_protected:Npn \@@_new_test_aux:Nn #1 #2
+ {
+ \if_meaning:w \q_nil #2 \q_nil
+ \__kernel_msg_error:nnx { kernel } { invalid-quark-function }
+ { \token_to_str:N #1 }
+ \else:
+ \@@_new_test:Nccn #1
+ { q__#2_recursion_tail } { q__#2_recursion_stop } { __#2 }
+ \fi:
+ }
+\cs_generate_variant:Nn \@@_new_test_aux:Nn { Nx }
+\cs_new_protected:Npn \@@_new_test:NNNn #1
+ {
+ \exp_last_unbraced:Nf \@@_new_test_aux:nnNNnnnn
+ { \cs_split_function:N #1 }
+ #1 { test }
+ }
+\cs_generate_variant:Nn \@@_new_test:NNNn { Ncc }
+\cs_new_protected:Npn \__kernel_quark_new_conditional:Nn #1
+ {
+ \@@_new_conditional:Nxxn #1
+ { \@@_quark_conditional_name:N #1 }
+ { \@@_module_name:N #1 }
+ }
+\cs_new_protected:Npn \@@_new_conditional:Nnnn #1#2#3#4
+ {
+ \if_meaning:w \q_nil #2 \q_nil
+ \__kernel_msg_error:nnx { kernel } { invalid-quark-function }
+ { \token_to_str:N #1 }
+ \else:
+ \if_meaning:w \q_nil #3 \q_nil
+ \__kernel_msg_error:nnx { kernel } { invalid-quark-function }
+ { \token_to_str:N #1 }
+ \else:
+ \exp_last_unbraced:Nf \@@_new_test_aux:nnNNnnnn
+ { \cs_split_function:N #1 }
+ #1 { conditional }
+ {#2} {#3} {#4}
+ \fi:
+ \fi:
+ }
+\cs_generate_variant:Nn \@@_new_conditional:Nnnn { Nxx }
+\cs_new_protected:Npn \@@_new_test_aux:nnNNnnnn #1 #2 #3 #4 #5
+ {
+ \cs_if_exist_use:cTF { @@_new_#5_#2:Nnnn } { #4 }
+ {
+ \__kernel_msg_error:nnxx { kernel } { invalid-quark-function }
+ { \token_to_str:N #4 } {#2}
+ \use_none:nnn
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{
+% \@@_new_test_n:Nnnn, \@@_new_test_nn:Nnnn,
+% \@@_new_test_N:Nnnn, \@@_new_test_Nn:Nnnn,
+% \@@_new_test_NN:Nnnn, \@@_new_test_NN:Nnnn,
+% }
+% These macros implement the six possibilities mentioned above, passing
+% the right arguments to \cs{@@_new_test_aux_do:nNNnnnnNNn},
+% which defines some auxiliaries, and then to
+% \cs{@@_new_test_define_tl:nNnNNn} (|:n(n)| variants) or to
+% \cs{@@_new_test_define_ifx:nNnNNn} (|:N(n)|) which define the
+% main conditionals.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_new_test_n:Nnnn #1 #2 #3 #4
+ {
+ \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { none } { } { } { }
+ \@@_new_test_define_tl:nNnNNn #1 { }
+ }
+\cs_new_protected:Npn \@@_new_test_nn:Nnnn #1 #2 #3 #4
+ {
+ \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2}
+ \@@_new_test_define_tl:nNnNNn #1 { \use_none:n }
+ }
+\cs_new_protected:Npn \@@_new_test_nN:Nnnn #1 #2 #3 #4
+ {
+ \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2}
+ \@@_new_test_define_break_tl:nNNNNn #1 { }
+ }
+\cs_new_protected:Npn \@@_new_test_N:Nnnn #1 #2 #3 #4
+ {
+ \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { none } { } { } { }
+ \@@_new_test_define_ifx:nNnNNn #1 { }
+ }
+\cs_new_protected:Npn \@@_new_test_Nn:Nnnn #1 #2 #3 #4
+ {
+ \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2}
+ \@@_new_test_define_ifx:nNnNNn #1
+ { \else: \exp_after:wN \use_none:n }
+ }
+\cs_new_protected:Npn \@@_new_test_NN:Nnnn #1 #2 #3 #4
+ {
+ \@@_new_test_aux_do:nNNnnnnNNn {#4} #2 #3 { i } { n } {##1} {##2}
+ \@@_new_test_define_break_ifx:nNNNNn #1 { }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% \@@_new_test_aux_do:nNNnnnnNNn,
+% \@@_test_define_aux:NNNNnnNNn
+% }
+% \cs{@@_new_test_aux_do:nNNnnnnNNn} makes the control sequence names
+% which will be used by \cs{@@_test_define_aux:NNNNnnNNn}, and then later
+% by \cs{@@_new_test_define_tl:nNnNNn} or
+% \cs{@@_new_test_define_ifx:nNnNNn}. The control sequences defined
+% here are analogous to \cs{@@_if_recursion_tail:w} and to
+% \cs[no-index]{use_(none|i)_delimit_by_q_recursion_stop:(|n)w}.
+%
+% The name is composed by the name-space and the name of the quarks.
+% Suppose \cs{__kernel_quark_new_test:N} was used with:
+% \begin{verbatim}
+% \__kernel_quark_new_test:N \__test_quark_tail:n
+% \end{verbatim}
+% then the first auxiliary will be \cs[no-index]{__test_quark_recursion_tail:w},
+% and the second one will be
+% \cs[no-index]{__test_use_none_delimit_by_q_recursion_stop:w}.
+%
+% Note that the actual quarks are \emph{not} defined here. They should
+% be defined separately using \cs{quark_new:N}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_new_test_aux_do:nNNnnnnNNn #1 #2 #3 #4 #5
+ {
+ \exp_args:Ncc \@@_test_define_aux:NNNNnnNNn
+ { #1 _quark_recursion_tail:w }
+ { #1 _use_ #4 _delimit_by_q_recursion_stop: #5 w }
+ #2 #3
+ }
+\cs_new_protected:Npn \@@_test_define_aux:NNNNnnNNn #1 #2 #3 #4 #5 #6 #7
+ {
+ \cs_gset:Npn #1 ##1 #3 ##2 ? ##3 ?! { ##1 ##2 }
+ \cs_gset:Npn #2 ##1 #6 #4 {#5}
+ #7 {##1} #1 #2 #3
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% \@@_new_test_define_tl:nNnNNn,
+% \@@_new_test_define_ifx:nNnNNn
+% }
+% \begin{macro}{
+% \@@_new_test_define_break_tl:nNNNNn,
+% \@@_new_test_define_break_ifx:nNNNNn
+% }
+% Finally, these two macros define the main conditional function using
+% what's been set up before.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_new_test_define_tl:nNnNNn #1 #2 #3 #4 #5 #6
+ {
+ \cs_new:Npn #5 #1
+ {
+ \tl_if_empty:oTF
+ { #2 {} ##1 {} ?! #4 ??! }
+ {#3} {#6}
+ }
+ }
+\cs_new_protected:Npn \@@_new_test_define_ifx:nNnNNn #1 #2 #3 #4 #5 #6
+ {
+ \cs_new:Npn #5 #1
+ {
+ \if_meaning:w #4 ##1
+ \exp_after:wN #3
+ #6
+ \fi:
+ }
+ }
+\cs_new_protected:Npn \@@_new_test_define_break_tl:nNNNNn #1 #2 #3
+ { \@@_new_test_define_tl:nNnNNn {##1##2} #2 {##2} }
+\cs_new_protected:Npn \@@_new_test_define_break_ifx:nNNNNn #1 #2 #3
+ { \@@_new_test_define_ifx:nNnNNn {##1##2} #2 {##2} }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{
+% \@@_new_conditional_n:Nnnn,
+% \@@_new_conditional_N:Nnnn,
+% }
+% These macros implement the two possibilities for branching quark
+% conditionals, passing
+% the right arguments to \cs{@@_new_conditional_aux_do:NNnnn},
+% which defines some auxiliaries and defines the
+% main conditionals.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_new_conditional_n:Nnnn
+ { \@@_new_conditional_aux_do:NNnnn \use_i:nn }
+\cs_new_protected:Npn \@@_new_conditional_N:Nnnn
+ { \@@_new_conditional_aux_do:NNnnn \use_ii:nn }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{
+% \@@_new_conditional_aux_do:NNnnn,
+% \@@_new_conditional_define:NNNNn,
+% }
+% Similar to the previous macros, but branching conditionals only
+% require one auxiliary, so we take a shortcut. In
+% \cs{@@_new_conditional_define:NNNNn}, |#4| is \cs{use_i:nn} to
+% define the \texttt{n}-type function (which needs an auxiliary) and
+% is \cs{use_ii:nn} to define the \texttt{N}-type function.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_new_conditional_aux_do:NNnnn #1 #2 #3 #4
+ {
+ \exp_args:Ncc \@@_new_conditional_define:NNNNn
+ { __ #4 _if_quark_ #3 :w } { q__ #4 _ #3 } #2 #1
+ }
+\cs_new_protected:Npn \@@_new_conditional_define:NNNNn #1 #2 #3 #4 #5
+ {
+ #4 { \cs_gset:Npn #1 ##1 #2 ##2 ? ##3 ?! { ##1 ##2 } } { }
+ \exp_args:Nno \use:n { \prg_new_conditional:Npnn #3 ##1 {#5} }
+ {
+ #4 { \@@_if_empty_if:o { #1 {} ##1 {} ?! #2 ??! } }
+ { \if_meaning:w #2 ##1 }
+ \prg_return_true: \else: \prg_return_false: \fi:
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_module_name:N}
+% \begin{macro}[EXP]{
+% \@@_module_name:w,
+% \@@_module_name_loop:w,
+% \@@_module_name_end:w
+% }
+% \cs{@@_module_name:N} takes a control sequence and returns its
+% \meta{module} name, determined as the first non-empty
+% non-single-character word, separated by |_| or~|:|. These rules
+% give the correct result for public functions
+% \cs[no-index]{\meta{module}_\ldots{}}, private functions
+% \cs[no-index]{__\meta{module}_\ldots{}}, and variables such as
+% \cs[no-index]{l_\meta{module}_\ldots{}}. If no valid module is
+% found the result is an empty string. The approach is to first cut
+% off everything after the (first) |:| if any is present, then
+% repeatedly grab |_|-delimited words until finding one of length at
+% least~$2$ (we use low-level tests as \pkg{l3tl} is not fully
+% available when \cs{__kernel_quark_new_test:N} is first used.
+% If no \meta{module} is found (such as in \cs{::n}) we
+% get the trailing marker \cs{use_none:n} |{}|, which expands to
+% nothing.
+% \begin{macrocode}
+\cs_set:Npn \@@_tmp:w #1#2
+ {
+ \cs_new:Npn \@@_module_name:N ##1
+ {
+ \exp_last_unbraced:Nf \@@_module_name:w
+ { \cs_to_str:N ##1 } #1 \s_@@
+ }
+ \cs_new:Npn \@@_module_name:w ##1 #1 ##2 \s_@@
+ { \@@_module_name_loop:w ##1 #2 \use_none:n { } #2 \s_@@ }
+ \cs_new:Npn \@@_module_name_loop:w ##1 #2
+ {
+ \use_i_ii:nnn \if_meaning:w \prg_do_nothing:
+ ##1 \prg_do_nothing: \prg_do_nothing:
+ \exp_after:wN \@@_module_name_loop:w
+ \else:
+ \@@_module_name_end:w ##1
+ \fi:
+ }
+ \cs_new:Npn \@@_module_name_end:w
+ ##1 \fi: ##2 \s_@@ { \fi: ##1 }
+ }
+\exp_after:wN \@@_tmp:w \tl_to_str:n { : _ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_quark_conditional_name:N, \@@_quark_conditional_name:w}
+% \cs{@@_quark_conditional_name:N} determines the quark name that the quark
+% conditional function~|##1| queries, as the part of the function name
+% between |_quark_if_| and the trailing~|:|. Again we define it
+% through \cs{@@_tmp:w}, which receives |:| as |#1| and |_quark_if_|
+% as |#2|. The auxiliary \cs{@@_quark_conditional_name:w} returns the part
+% between the first |_quark_if_| and the next~|:|, and we apply this
+% auxiliary to the function name followed by |:| (in case the function
+% name is lacking a signature), and |_quark_if_:| so that
+% \cs{@@_quark_conditional_name:N} returns an empty string if |_quark_if_| is
+% not present.
+% \begin{macrocode}
+\cs_set:Npn \@@_tmp:w #1 #2 \s_@@
+ {
+ \cs_new:Npn \@@_quark_conditional_name:N ##1
+ {
+ \exp_last_unbraced:Nf \@@_quark_conditional_name:w
+ { \cs_to_str:N ##1 } #1 #2 #1 \s_@@
+ }
+ \cs_new:Npn \@@_quark_conditional_name:w
+ ##1 #2 ##2 #1 ##3 \s_@@ {##2}
+ }
+\exp_after:wN \@@_tmp:w \tl_to_str:n { : _quark_if_ } \s_@@
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Scan marks}
%
% \begin{macrocode}
@@ -583,8 +946,9 @@
% \begin{variable}{\g_@@_marks_tl}
% \UnitTested
% The list of all scan marks currently declared.
+% No \pkg{l3tl} yet, so define this by hand.
% \begin{macrocode}
-\tl_new:N \g_@@_marks_tl
+\cs_gset:Npn \g_@@_marks_tl { }
% \end{macrocode}
% \end{variable}
%
@@ -612,12 +976,25 @@
% \UnitTested
% We only declare one scan mark here, more can be defined
% by specific modules.
+% Can't use \cs{scan_new:N} yet because \pkg{l3tl} isn't loaded,
+% so define \cs{s_stop} by hand and add it to \cs{g_@@_marks_tl}.
+% We also add \cs{s__quark} (declared earlier) to the pool here.
+% Since it lives in a different namespace, a little \pkg{l3docstrip}
+% cheating is necessary.
% \begin{macrocode}
-\scan_new:N \s_stop
+\cs_new_eq:NN \s_stop \scan_stop:
+\cs_gset_nopar:Npx \g_@@_marks_tl
+ {
+ \exp_not:o \g_@@_marks_tl
+ \s_stop
+%<@@=quark>
+ \s_@@
+%<@@=scan>
+ }
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}{\use_none_delimit_by_s_stop:w}
+% \begin{macro}[EXP]{\use_none_delimit_by_s_stop:w}
% \UnitTested
% Similar to \cs{use_none_delimit_by_q_stop:w}.
% \begin{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx
index 3b4fc4fbc8..7c2d8e7504 100644
--- a/macros/latex/contrib/l3kernel/l3regex.dtx
+++ b/macros/latex/contrib/l3kernel/l3regex.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1105,6 +1105,42 @@
% \end{macrocode}
% \end{variable}
%
+% \subsubsection{Internal auxiliaries}
+%
+% \begin{variable}{\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_use_none_delimit_by_q_recursion_stop:w,
+% \@@_use_i_delimit_by_q_recursion_stop:nw
+% }
+% Functions to gobble up to a quark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_q_recursion_stop:w
+ #1 \q_@@_recursion_stop { }
+\cs_new:Npn \@@_use_i_delimit_by_q_recursion_stop:nw
+ #1 #2 \q_@@_recursion_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_quark_if_nil:n}
+% Branching quark conditional.
+% \begin{macrocode}
+\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:N { F }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_break_point:TF}
% \begin{macro}{\@@_break_true:w}
% When testing whether a character of the query token list matches
@@ -3242,7 +3278,7 @@
\tl_set:Nx \l_@@_internal_a_tl
{
\exp_after:wN \@@_compile_cs_aux:Nn \l_@@_internal_regex
- \q_nil \q_nil \q_recursion_stop
+ \q_@@_nil \q_@@_nil \q_@@_recursion_stop
}
\exp_args:Nx \@@_compile_one:n
{
@@ -3260,12 +3296,13 @@
{
\scan_stop:
\@@_compile_cs_aux:NNnnnN #2
- \q_nil \q_nil \q_nil \q_nil \q_nil \q_nil \q_recursion_stop
+ \q_@@_nil \q_@@_nil \q_@@_nil
+ \q_@@_nil \q_@@_nil \q_@@_nil \q_@@_recursion_stop
\@@_compile_cs_aux:Nn
}
{
- \quark_if_nil:NF #1 { \flag_raise_if_clear:n { @@_cs } }
- \use_none_delimit_by_q_recursion_stop:w
+ \@@_quark_if_nil:NF #1 { \flag_raise_if_clear:n { @@_cs } }
+ \@@_use_none_delimit_by_q_recursion_stop:w
}
}
\cs_new:Npn \@@_compile_cs_aux:NNnnnN #1#2#3#4#5#6
@@ -3284,12 +3321,12 @@
\@@_compile_cs_aux:NNnnnN
}
{
- \quark_if_nil:NF #1
+ \@@_quark_if_nil:NF #1
{
\flag_raise_if_clear:n { @@_cs }
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
}
- \use_none_delimit_by_q_recursion_stop:w
+ \@@_use_none_delimit_by_q_recursion_stop:w
}
}
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx
index 071f202e81..56c4bc1fda 100644
--- a/macros/latex/contrib/l3kernel/l3seq.dtx
+++ b/macros/latex/contrib/l3kernel/l3seq.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -985,6 +985,14 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Private scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\@@_item:n}
% The delimiter is always defined, but when used incorrectly simply
% removes its argument and hits an undefined control sequence to
@@ -1645,10 +1653,10 @@
\tl_set:Nx #2
{
\exp_after:wN \@@_get_left:wnw
- #1 \@@_item:n { \q_no_value } \q_stop
+ #1 \@@_item:n { \q_no_value } \s_@@_stop
}
}
-\cs_new:Npn \@@_get_left:wnw #1 \@@_item:n #2#3 \q_stop
+\cs_new:Npn \@@_get_left:wnw #1 \@@_item:n #2#3 \s_@@_stop
{ \exp_not:n {#2} }
\cs_generate_variant:Nn \seq_get_left:NN { c }
% \end{macrocode}
@@ -1670,9 +1678,9 @@
\cs_new_protected:Npn \seq_gpop_left:NN
{ \@@_pop:NNNN \@@_pop_left:NNN \tl_gset:Nn }
\cs_new_protected:Npn \@@_pop_left:NNN #1#2#3
- { \exp_after:wN \@@_pop_left:wnwNNN #2 \q_stop #1#2#3 }
+ { \exp_after:wN \@@_pop_left:wnwNNN #2 \s_@@_stop #1#2#3 }
\cs_new_protected:Npn \@@_pop_left:wnwNNN
- #1 \@@_item:n #2#3 \q_stop #4#5#6
+ #1 \@@_item:n #2#3 \s_@@_stop #4#5#6
{
#4 #5 { #1 #3 }
\tl_set:Nn #6 {#2}
@@ -1823,8 +1831,8 @@
% of being empty, terminating the loop and returning nothing at all.
% \begin{macrocode}
\cs_new:Npn \seq_item:Nn #1
- { \exp_after:wN \@@_item:wNn #1 \q_stop #1 }
-\cs_new:Npn \@@_item:wNn \s_@@ #1 \q_stop #2#3
+ { \exp_after:wN \@@_item:wNn #1 \s_@@_stop #1 }
+\cs_new:Npn \@@_item:wNn \s_@@ #1 \s_@@_stop #2#3
{
\exp_args:Nf \@@_item:nwn
{ \exp_args:Nf \@@_item:nN { \int_eval:n {#3} } #2 }
@@ -2070,9 +2078,9 @@
}
{
\exp_after:wN \@@_use_setup:w #1 \@@_item:n
- \q_mark { \@@_use:nwwwwnwn {#3} }
- \q_mark { \@@_use:nwwn {#4} }
- \q_stop { }
+ \s_@@_mark { \@@_use:nwwwwnwn {#3} }
+ \s_@@_mark { \@@_use:nwwn {#4} }
+ \s_@@_stop { }
}
}
{
@@ -2085,12 +2093,12 @@
\cs_new:Npn \@@_use_setup:w \s_@@ { \@@_use:nwwwwnwn { } }
\cs_new:Npn \@@_use:nwwwwnwn
#1 \@@_item:n #2 \@@_item:n #3 \@@_item:n #4#5
- \q_mark #6#7 \q_stop #8
+ \s_@@_mark #6#7 \s_@@_stop #8
{
#6 \@@_item:n {#3} \@@_item:n {#4} #5
- \q_mark {#6} #7 \q_stop { #8 #1 #2 }
+ \s_@@_mark {#6} #7 \s_@@_stop { #8 #1 #2 }
}
-\cs_new:Npn \@@_use:nwwn #1 \@@_item:n #2 #3 \q_stop #4
+\cs_new:Npn \@@_use:nwwn #1 \@@_item:n #2 #3 \s_@@_stop #4
{ \exp_not:n { #4 #1 #2 } }
\cs_new:Npn \seq_use:Nn #1#2
{ \seq_use:Nnnn #1 {#2} {#2} {#2} }
diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx
index 152b90a3c0..8cfd78d6f1 100644
--- a/macros/latex/contrib/l3kernel/l3skip.dtx
+++ b/macros/latex/contrib/l3kernel/l3skip.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1087,6 +1087,23 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_none_delimit_by_s_stop:w}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Creating and initialising \texttt{dim} variables}
%
% \begin{macro}{\dim_new:N, \dim_new:c}
@@ -1337,7 +1354,7 @@
\cs_new:Npn \@@_compare:w #1 \@@_compare_error:
{
\exp_after:wN \if_false: \exp:w \exp_end_continue_f:w
- \@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \q_stop
+ \@@_compare:wNN #1 ? { = \@@_compare_end:w \else: } \s_@@_stop
}
\exp_args:Nno \use:nn
{ \cs_new:Npn \@@_compare:wNN #1 } { \tl_to_str:n {pt} #2#3 }
@@ -1347,7 +1364,7 @@
\fi:
#1 pt \exp_stop_f:
\prg_return_false:
- \exp_after:wN \use_none_delimit_by_q_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_s_stop:w
\fi:
\reverse_if:N \if_dim:w #1 pt #2
\exp_after:wN \@@_compare:wNN
@@ -1361,7 +1378,7 @@
#1 \reverse_if:N #2 < #3 = { #1 #2 > #3 }
\cs_new:cpn { @@_compare_ > :w }
#1 \reverse_if:N #2 > #3 = { #1 #2 < #3 }
-\cs_new:Npn \@@_compare_end:w #1 \prg_return_false: #2 \q_stop
+\cs_new:Npn \@@_compare_end:w #1 \prg_return_false: #2 \s_@@_stop
{ #1 \prg_return_false: \else: \prg_return_true: \fi: }
\cs_new_protected:Npn \@@_compare_error:
{
@@ -1403,14 +1420,14 @@
\exp_args:Nf \@@_case:nnTF { \dim_eval:n {#1} } {#2} { } { }
}
\cs_new:Npn \@@_case:nnTF #1#2#3#4
- { \@@_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+ { \@@_case:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
\cs_new:Npn \@@_case:nw #1#2#3
{
\dim_compare:nNnTF {#1} = {#2}
{ \@@_case_end:nw {#3} }
{ \@@_case:nw {#1} }
}
-\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop
{ \exp_end: #1 #4 }
% \end{macrocode}
% \end{macro}
@@ -1766,6 +1783,13 @@
%<@@=skip>
% \end{macrocode}
%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\skip_new:N, \skip_new:c}
% Allocation of a new internal registers.
% \begin{macrocode}
@@ -1914,9 +1938,9 @@
{
\exp_after:wN \@@_if_finite:wwNw
\skip_use:N \tex_glueexpr:D ##1 ; \prg_return_false:
- #1 ; \prg_return_true: \q_stop
+ #1 ; \prg_return_true: \s_@@_stop
}
- \cs_new:Npn \@@_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \q_stop {##3}
+ \cs_new:Npn \@@_if_finite:wwNw ##1 #1 ##2 ; ##3 ##4 \s_@@_stop {##3}
}
\exp_args:No \@@_tmp:w { \tl_to_str:n { fil } }
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx
index 2dbb5b6931..6b41acfe3e 100644
--- a/macros/latex/contrib/l3kernel/l3sort.dtx
+++ b/macros/latex/contrib/l3kernel/l3sort.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -199,6 +199,14 @@
% \end{variable}
% \end{variable}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Finding available \tn{toks} registers}
%
% \begin{macro}{\@@_shrink_range:}
@@ -555,7 +563,7 @@
\prg_do_nothing:
\@@_return_mark:w
\@@_return_mark:w
- \q_mark
+ \s_@@_mark
\@@_return_none_error:
}
% \end{macrocode}
@@ -567,7 +575,7 @@
% Each comparison should call \cs{sort_return_same:} or
% \cs{sort_return_swapped:} exactly once. If neither is called,
% \cs{@@_return_none_error:} is called, since the \texttt{return_mark}
-% removes tokens until \cs{q_mark}. If one is called, the
+% removes tokens until \cs{s_@@_mark}. If one is called, the
% \texttt{return_mark} auxiliary removes everything except
% \cs{@@_return_same:w} (or its \texttt{swapped} analogue) followed by
% \cs{@@_return_none_error:}. Finally if two or more are called,
@@ -575,26 +583,26 @@
% so that it produces an error.
% \begin{macrocode}
\cs_new_protected:Npn \sort_return_same:
- #1 \@@_return_mark:w #2 \q_mark
+ #1 \@@_return_mark:w #2 \s_@@_mark
{
#1
#2
\@@_return_two_error:
\@@_return_mark:w
- \q_mark
+ \s_@@_mark
\@@_return_same:w
}
\cs_new_protected:Npn \sort_return_swapped:
- #1 \@@_return_mark:w #2 \q_mark
+ #1 \@@_return_mark:w #2 \s_@@_mark
{
#1
#2
\@@_return_two_error:
\@@_return_mark:w
- \q_mark
+ \s_@@_mark
\@@_return_swapped:w
}
-\cs_new_protected:Npn \@@_return_mark:w #1 \q_mark { }
+\cs_new_protected:Npn \@@_return_mark:w #1 \s_@@_mark { }
\cs_new_protected:Npn \@@_return_none_error:
{
\__kernel_msg_error:nnxx { kernel } { return-none }
@@ -707,7 +715,7 @@
% \tl_if_blank:nF {#1}
% {
% \__sort:nnNnn { } { } #2
-% #1 \q_recursion_tail \q_recursion_stop
+% #1 \q__sort_recursion_tail \q__sort_recursion_stop
% }
% }
% \cs_new:Npn \__sort:nnNnn #1#2#3#4#5
@@ -742,7 +750,7 @@
% ~~~~~~\meta{extra arguments}\\
% ~~|}|\\
% \cs{@@_loop:wNn}~\ldots{}~\meta{prepared tokens}\\
-% ~~\meta{end-loop}~|{}|~\cs{q_stop}
+% ~~\meta{end-loop}~|{}|~\cs{s_@@_stop}
% \end{quote}
% In this example, which matches the structure of
% \cs{@@_quick_split_i:NnnnnNn} and a few other functions below, the
@@ -782,13 +790,13 @@
%
% The third speed up is to avoid |\use:ff| using a continuation-passing
% style: \cs{@@_quick_split:NnNn} expects a list followed by
-% \cs{q_mark} \Arg{code}, and expands to \meta{code} \meta{sorted list}.
+% \cs{s_@@_mark} \Arg{code}, and expands to \meta{code} \meta{sorted list}.
% Sorting the two parts of the list around the pivot is done with
% \begin{quote}
% \ttfamily
-% \cs{@@_quick_split:NnNn} |#2| \ldots{} \cs{q_mark}\\
+% \cs{@@_quick_split:NnNn} |#2| \ldots{} \cs{s_@@_mark}\\
% ~~|{|\\
-% ~~~~\cs{@@_quick_split:NnNn} |#1| \ldots{} \cs{q_mark} \Arg{code}\\
+% ~~~~\cs{@@_quick_split:NnNn} |#1| \ldots{} \cs{s_@@_mark} \Arg{code}\\
% ~~~~\Arg{pivot}\\
% ~~|}|
% \end{quote}
@@ -823,7 +831,7 @@
% argument of the third \cs{use:n}, hence must remain in memory, and so
% on. The memory consumption grows quadratically with the number of
% nested \cs{use:n}. In practice, this means that we must read
-% everything until a trailing \cs{q_stop} once in a while, otherwise
+% everything until a trailing \cs{s_@@_stop} once in a while, otherwise
% sorting lists of more than a few thousand items would exhaust a
% typical \TeX{}'s memory.
%
@@ -846,8 +854,8 @@
% \texttt{prepare_end} auxiliary finds the prepared token list
% as~|#4|. The scene is then set up for \cs{@@_quick_split:NnNn},
% which sorts the prepared list and perform the post action placed
-% after \cs{q_mark}, namely removing the trailing \cs{s_stop} and
-% \cs{q_stop} and leaving \cs{exp_stop_f:} to stop
+% after \cs{s_@@_mark}, namely removing the trailing \cs{s_@@_stop} and
+% \cs{s_@@_stop} and leaving \cs{exp_stop_f:} to stop
% \texttt{f}-expansion.
% \begin{macrocode}
\cs_new:Npn \tl_sort:nN #1#2
@@ -859,7 +867,7 @@
\@@_quick_prepare:Nnnn #2 { } { }
#1
{ \prg_break_point: \@@_quick_prepare_end:NNNnw }
- \q_stop
+ \s_@@_stop
}
}
}
@@ -868,13 +876,13 @@
\prg_break: #4 \prg_break_point:
\@@_quick_prepare:Nnnn #1 { #2 #3 } { #1 {#4} }
}
-\cs_new:Npn \@@_quick_prepare_end:NNNnw #1#2#3#4#5 \q_stop
+\cs_new:Npn \@@_quick_prepare_end:NNNnw #1#2#3#4#5 \s_@@_stop
{
\@@_quick_split:NnNn #4 \@@_quick_end:nnTFNn { }
- \q_mark { \@@_quick_cleanup:w \exp_stop_f: }
- \s_stop \q_stop
+ \s_@@_mark { \@@_quick_cleanup:w \exp_stop_f: }
+ \s_@@_mark \s_@@_stop
}
-\cs_new:Npn \@@_quick_cleanup:w #1 \s_stop \q_stop {#1}
+\cs_new:Npn \@@_quick_cleanup:w #1 \s_@@_mark \s_@@_stop {#1}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -961,9 +969,9 @@
% auxiliaries here) and another copy~|#6| of the fake item. All those
% are discarded except the function~|#5|. This function receives
% lists~|#1| and~|#2| of items less than or greater than the
-% pivot~|#3|, then a continuation code~|#5| just after \cs{q_mark}.
+% pivot~|#3|, then a continuation code~|#5| just after \cs{s_@@_mark}.
% To avoid a memory problem described earlier, all of the ending
-% functions read~|#6| until \cs{q_stop} and place~|#6| back into the
+% functions read~|#6| until \cs{s_@@_stop} and place~|#6| back into the
% input stream. When the lists |#1| and~|#2| are empty, the
% \texttt{single} auxiliary simply places the continuation~|#5| before
% the pivot~|{#3}|. When |#2|~is empty, |#1|~is sorted and placed
@@ -976,30 +984,30 @@
% continuations are done in such a way to place the pivot in between.
% \begin{macrocode}
\cs_new:Npn \@@_quick_end:nnTFNn #1#2#3#4#5#6 {#5}
-\cs_new:Npn \@@_quick_single_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
- { #5 {#3} #6 \q_stop }
-\cs_new:Npn \@@_quick_only_i_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_single_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop
+ { #5 {#3} #6 \s_@@_stop }
+\cs_new:Npn \@@_quick_only_i_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop
{
\@@_quick_split:NnNn #1
- \@@_quick_end:nnTFNn { } \q_mark {#5}
+ \@@_quick_end:nnTFNn { } \s_@@_mark {#5}
{#3}
- #6 \q_stop
+ #6 \s_@@_stop
}
-\cs_new:Npn \@@_quick_only_ii_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_only_ii_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop
{
\@@_quick_split:NnNn #2
- \@@_quick_end:nnTFNn { } \q_mark { #5 {#3} }
- #6 \q_stop
+ \@@_quick_end:nnTFNn { } \s_@@_mark { #5 {#3} }
+ #6 \s_@@_stop
}
-\cs_new:Npn \@@_quick_split_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_split_end:nnnwnw #1#2#3#4 \s_@@_mark #5#6 \s_@@_stop
{
- \@@_quick_split:NnNn #2 \@@_quick_end:nnTFNn { } \q_mark
+ \@@_quick_split:NnNn #2 \@@_quick_end:nnTFNn { } \s_@@_mark
{
\@@_quick_split:NnNn #1
- \@@_quick_end:nnTFNn { } \q_mark {#5}
+ \@@_quick_end:nnTFNn { } \s_@@_mark {#5}
{#3}
}
- #6 \q_stop
+ #6 \s_@@_stop
}
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx
index 9092f8fdbc..4620342091 100644
--- a/macros/latex/contrib/l3kernel/l3str-convert.dtx
+++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -286,6 +286,20 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\s_@@}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\g_@@_alias_prop}
% To avoid needing one file per encoding/escaping alias, we keep track
% of those in a property list.
@@ -557,13 +571,13 @@
{
\exp_after:wN \@@_convert_gmap_internal_loop:Nww
\exp_after:wN #1
- \g_@@_result_tl \s__tl \q_stop \prg_break: \s__tl
+ \g_@@_result_tl \s_@@ \s_@@_stop \prg_break: \s_@@
\prg_break_point:
}
}
-\cs_new:Npn \@@_convert_gmap_internal_loop:Nww #1 #2 \s__tl #3 \s__tl
+\cs_new:Npn \@@_convert_gmap_internal_loop:Nww #1 #2 \s_@@ #3 \s_@@
{
- \use_none_delimit_by_q_stop:w #3 \q_stop
+ \@@_use_none_delimit_by_s_stop:w #3 \s_@@_stop
#1 {#3}
\@@_convert_gmap_internal_loop:Nww #1
}
@@ -626,7 +640,7 @@
% to a list of Unicode characters in an internal representation,
% with items of the form
% \begin{quote}
-% \meta{bytes} \cs{s__tl} \meta{Unicode code point} \cs{s__tl}
+% \meta{bytes} \cs{s_@@} \meta{Unicode code point} \cs{s_@@}
% \end{quote}
% where we have collected the \meta{bytes} which combined to form
% this particular Unicode character, and the \meta{Unicode code
@@ -679,12 +693,12 @@
#1
\tl_gset:Nx \g_@@_result_tl { \__kernel_str_to_other_fast:n {#4} }
\exp_after:wN \@@_convert:wwwnn
- \tl_to_str:n {#5} /// \q_stop
+ \tl_to_str:n {#5} /// \s_@@_stop
{ decode } { unescape }
\prg_do_nothing:
\@@_convert_decode_:
\exp_after:wN \@@_convert:wwwnn
- \tl_to_str:n {#6} /// \q_stop
+ \tl_to_str:n {#6} /// \s_@@_stop
{ encode } { escape }
\use_ii_i:nn
\@@_convert_encode_:
@@ -721,7 +735,7 @@
% was given, and only the encoding, |#1|, should be performed.
% \begin{macrocode}
\cs_new_protected:Npn \@@_convert:wwwnn
- #1 / #2 // #3 \q_stop #4#5
+ #1 / #2 // #3 \s_@@_stop #4#5
{
\@@_convert:nnn {enc} {#4} {#1}
\@@_convert:nnn {esc} {#5} {#2}
@@ -967,7 +981,7 @@
\cs_new_protected:Npn \@@_convert_decode_:
{ \@@_convert_gmap:N \@@_decode_native_char:N }
\cs_new:Npn \@@_decode_native_char:N #1
- { #1 \s__tl \int_value:w `#1 \s__tl }
+ { #1 \s_@@ \int_value:w `#1 \s_@@ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1039,7 +1053,7 @@
}
}
\cs_new:Npn \@@_decode_clist_char:n #1
- { #1 \s__tl \int_eval:n {#1} \s__tl }
+ { #1 \s_@@ \int_eval:n {#1} \s_@@ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1115,11 +1129,11 @@
\int_zero:N \l_@@_internal_int
\exp_last_unbraced:Nx \@@_decode_eight_bit_load:nn
{ \tl_use:c { c_@@_encoding_#1_tl } }
- { \q_stop \prg_break: } { }
+ { \s_@@_stop \prg_break: } { }
\prg_break_point:
\exp_last_unbraced:Nx \@@_decode_eight_bit_load_missing:n
{ \tl_use:c { c_@@_encoding_#1_missing_tl } }
- { \q_stop \prg_break: }
+ { \s_@@_stop \prg_break: }
\prg_break_point:
\flag_clear:n { str_error }
\@@_convert_gmap:N \@@_decode_eight_bit_char:N
@@ -1128,7 +1142,7 @@
}
\cs_new_protected:Npn \@@_decode_eight_bit_load:nn #1#2
{
- \use_none_delimit_by_q_stop:w #1 \q_stop
+ \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop
\tex_dimen:D "#1 = \l_@@_internal_int sp \scan_stop:
\tex_skip:D \l_@@_internal_int = "#1 sp \scan_stop:
\tex_toks:D \l_@@_internal_int \exp_after:wN { \int_value:w "#2 }
@@ -1137,7 +1151,7 @@
}
\cs_new_protected:Npn \@@_decode_eight_bit_load_missing:n #1
{
- \use_none_delimit_by_q_stop:w #1 \q_stop
+ \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop
\tex_dimen:D "#1 = \l_@@_internal_int sp \scan_stop:
\tex_skip:D \l_@@_internal_int = "#1 sp \scan_stop:
\tex_toks:D \l_@@_internal_int \exp_after:wN
@@ -1147,13 +1161,13 @@
}
\cs_new:Npn \@@_decode_eight_bit_char:N #1
{
- #1 \s__tl
+ #1 \s_@@
\if_int_compare:w \tex_dimen:D `#1 < \l_@@_internal_int
\if_int_compare:w \tex_skip:D \tex_dimen:D `#1 = `#1 \exp_stop_f:
\tex_the:D \tex_toks:D \tex_dimen:D
\fi:
\fi:
- \int_value:w `#1 \s__tl
+ \int_value:w `#1 \s_@@
}
% \end{macrocode}
% \end{macro}
@@ -1173,7 +1187,7 @@
\int_zero:N \l_@@_internal_int
\exp_last_unbraced:Nx \@@_encode_eight_bit_load:nn
{ \tl_use:c { c_@@_encoding_#1_tl } }
- { \q_stop \prg_break: } { }
+ { \s_@@_stop \prg_break: } { }
\prg_break_point:
\flag_clear:n { str_error }
\@@_convert_gmap_internal:N \@@_encode_eight_bit_char:n
@@ -1182,7 +1196,7 @@
}
\cs_new_protected:Npn \@@_encode_eight_bit_load:nn #1#2
{
- \use_none_delimit_by_q_stop:w #1 \q_stop
+ \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop
\tex_dimen:D "#2 = \l_@@_internal_int sp \scan_stop:
\tex_skip:D \l_@@_internal_int = "#2 sp \scan_stop:
\exp_args:NNf \tex_toks:D \l_@@_internal_int
@@ -1762,17 +1776,17 @@
{ 32 } { 192 }
{ 16 } { 224 }
{ 8 } { 240 }
- \q_stop
+ \s_@@_stop
}
-\cs_new:Npn \@@_encode_utf_viii_loop:wwnnw #1; #2; #3#4 #5 \q_stop
+\cs_new:Npn \@@_encode_utf_viii_loop:wwnnw #1; #2; #3#4 #5 \s_@@_stop
{
\if_int_compare:w #1 < #3 \exp_stop_f:
\@@_output_byte:n { #1 + #4 }
- \exp_after:wN \use_none_delimit_by_q_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_s_stop:w
\fi:
\exp_after:wN \@@_encode_utf_viii_loop:wwnnw
\int_value:w \int_div_truncate:nn {#1} {64} ; #1 ;
- #5 \q_stop
+ #5 \s_@@_stop
\@@_output_byte:n { #2 - 64 * ( #1 - 2 ) }
}
% \end{macrocode}
@@ -1949,7 +1963,7 @@
{
#1
\if_int_compare:w `#1 < "C0 \exp_stop_f:
- \s__tl
+ \s_@@
\if_int_compare:w `#1 < "80 \exp_stop_f:
\int_value:w `#1
\else:
@@ -1961,12 +1975,12 @@
\exp_after:wN \@@_decode_utf_viii_continuation:wwN
\int_value:w \int_eval:n { `#1 - "C0 } \exp_after:wN
\fi:
- \s__tl
- \use_none_delimit_by_q_stop:w {"80} {"800} {"10000} {"110000} \q_stop
+ \s_@@
+ \@@_use_none_delimit_by_s_stop:w {"80} {"800} {"10000} {"110000} \s_@@_stop
\@@_decode_utf_viii_start:N
}
\cs_new:Npn \@@_decode_utf_viii_continuation:wwN
- #1 \s__tl #2 \@@_decode_utf_viii_start:N #3
+ #1 \s_@@ #2 \@@_decode_utf_viii_start:N #3
{
\use_none:n #3
\if_int_compare:w `#3 <
@@ -1976,20 +1990,20 @@
\exp_after:wN \@@_decode_utf_viii_aux:wNnnwN
\int_value:w \int_eval:n { #1 * "40 + `#3 - "80 } \exp_after:wN
\else:
- \s__tl
+ \s_@@
\flag_raise:n { str_missing }
\flag_raise:n { str_error }
\int_use:N \c_@@_replacement_char_int
\fi:
- \s__tl
+ \s_@@
#2
\@@_decode_utf_viii_start:N #3
}
\cs_new:Npn \@@_decode_utf_viii_aux:wNnnwN
- #1 \s__tl #2#3#4 #5 \@@_decode_utf_viii_start:N #6
+ #1 \s_@@ #2#3#4 #5 \@@_decode_utf_viii_start:N #6
{
\if_int_compare:w #1 < #4 \exp_stop_f:
- \s__tl
+ \s_@@
\if_int_compare:w #1 < #3 \exp_stop_f:
\flag_raise:n { str_overlong }
\flag_raise:n { str_error }
@@ -1998,13 +2012,13 @@
#1
\fi:
\else:
- \if_meaning:w \q_stop #5
+ \if_meaning:w \s_@@_stop #5
\@@_decode_utf_viii_overflow:w #1
\fi:
\exp_after:wN \@@_decode_utf_viii_continuation:wwN
\int_value:w \int_eval:n { #1 - #4 } \exp_after:wN
\fi:
- \s__tl
+ \s_@@
#2 {#4} #5
\@@_decode_utf_viii_start:N
}
@@ -2017,10 +2031,10 @@
}
\cs_new:Npn \@@_decode_utf_viii_end:
{
- \s__tl
+ \s_@@
\flag_raise:n { str_missing }
\flag_raise:n { str_error }
- \int_use:N \c_@@_replacement_char_int \s__tl
+ \int_use:N \c_@@_replacement_char_int \s_@@
\prg_break:
}
% \end{macrocode}
@@ -2192,7 +2206,7 @@
% big-endianness. The three endianness cases are based on a common
% auxiliary whose first argument is $1$ for big-endian and $2$ for
% little-endian, and whose second argument, delimited by the scan mark
-% \cs{s_stop}, is expanded once (the string may be long; passing
+% \cs{s_@@_stop}, is expanded once (the string may be long; passing
% \cs{g_@@_result_tl} as an argument before expansion is cheaper).
%
% The \cs{@@_decode_utf_xvi:Nw} function defines \cs{@@_tmp:w} to
@@ -2202,13 +2216,13 @@
% \cs{@@_decode_utf_xvi_pair:NN} described below.
% \begin{macrocode}
\cs_new_protected:cpn { @@_convert_decode_utf16be: }
- { \@@_decode_utf_xvi:Nw 1 \g_@@_result_tl \s_stop }
+ { \@@_decode_utf_xvi:Nw 1 \g_@@_result_tl \s_@@_stop }
\cs_new_protected:cpn { @@_convert_decode_utf16le: }
- { \@@_decode_utf_xvi:Nw 2 \g_@@_result_tl \s_stop }
+ { \@@_decode_utf_xvi:Nw 2 \g_@@_result_tl \s_@@_stop }
\cs_new_protected:cpn { @@_convert_decode_utf16: }
{
\exp_after:wN \@@_decode_utf_xvi_bom:NN
- \g_@@_result_tl \s_stop \s_stop \s_stop
+ \g_@@_result_tl \s_@@_stop \s_@@_stop \s_@@_stop
}
\cs_new_protected:Npn \@@_decode_utf_xvi_bom:NN #1#2
{
@@ -2220,7 +2234,7 @@
{ \@@_decode_utf_xvi:Nw 1 #1#2 }
}
}
- \cs_new_protected:Npn \@@_decode_utf_xvi:Nw #1#2 \s_stop
+ \cs_new_protected:Npn \@@_decode_utf_xvi:Nw #1#2 \s_@@_stop
{
\flag_clear:n { str_error }
\flag_clear:n { str_missing }
@@ -2230,7 +2244,7 @@
\tl_gset:Nx \g_@@_result_tl
{
\exp_after:wN \@@_decode_utf_xvi_pair:NN
- #2 \q_nil \q_nil
+ #2 \q_@@_nil \q_@@_nil
\prg_break_point:
}
\@@_if_flag_error:nnx { str_error } { utf16-decode } { }
@@ -2271,8 +2285,8 @@
% range $[\hexnum{DC}, \hexnum{DF}]$ (trail surrogate). The test is
% similar to the test used for continuation bytes in the
% \textsc{utf-8} decoding functions. In the case where |#4#5| is
-% indeed a trail surrogate, leave |#1#2#4#5| \cs{s__tl}
-% \meta{code~point} \cs{s__tl}, and remove the pair |#4#5| before
+% indeed a trail surrogate, leave |#1#2#4#5| \cs{s_@@}
+% \meta{code~point} \cs{s_@@}, and remove the pair |#4#5| before
% looping with \cs{@@_decode_utf_xvi_pair:NN}. Otherwise, of course,
% complain about the missing surrogate.
%
@@ -2281,13 +2295,13 @@
% \hexnum{DC00} - \hexnum{10000}$.
%
% Every time we read a pair of bytes, we test for the end-marker
-% \cs{q_nil}. When reaching the end, we additionally check that the
+% \cs{q_@@_nil}. When reaching the end, we additionally check that the
% string had an even length. Also, if the end is reached when
% expecting a trail surrogate, we treat that as a missing surrogate.
% \begin{macrocode}
\cs_new:Npn \@@_decode_utf_xvi_pair:NN #1#2
{
- \if_meaning:w \q_nil #2
+ \if_meaning:w \q_@@_nil #2
\@@_decode_utf_xvi_pair_end:Nw #1
\fi:
\if_case:w
@@ -2295,14 +2309,14 @@
\or: \exp_after:wN \@@_decode_utf_xvi_quad:NNwNN
\or: \exp_after:wN \@@_decode_utf_xvi_extra:NNw
\fi:
- #1#2 \s__tl
- \int_eval:n { "100 * \@@_tmp:w #1#2 + \@@_tmp:w #2#1 } \s__tl
+ #1#2 \s_@@
+ \int_eval:n { "100 * \@@_tmp:w #1#2 + \@@_tmp:w #2#1 } \s_@@
\@@_decode_utf_xvi_pair:NN
}
\cs_new:Npn \@@_decode_utf_xvi_quad:NNwNN
#1#2 #3 \@@_decode_utf_xvi_pair:NN #4#5
{
- \if_meaning:w \q_nil #5
+ \if_meaning:w \q_@@_nil #5
\@@_decode_utf_xvi_error:nNN { missing } #1#2
\@@_decode_utf_xvi_pair_end:Nw #4
\fi:
@@ -2313,13 +2327,13 @@
\@@_tmp:w #4#5 < "E0
\fi:
\exp_stop_f:
- #1 #2 #4 #5 \s__tl
+ #1 #2 #4 #5 \s_@@
\int_eval:n
{
( "100 * \@@_tmp:w #1#2 + \@@_tmp:w #2#1 - "D7F7 ) * "400
+ "100 * \@@_tmp:w #4#5 + \@@_tmp:w #5#4
}
- \s__tl
+ \s_@@
\exp_after:wN \use_i:nnn
\else:
\@@_decode_utf_xvi_error:nNN { missing } #1#2
@@ -2329,20 +2343,20 @@
\cs_new:Npn \@@_decode_utf_xvi_pair_end:Nw #1 \fi:
{
\fi:
- \if_meaning:w \q_nil #1
+ \if_meaning:w \q_@@_nil #1
\else:
\@@_decode_utf_xvi_error:nNN { end } #1 \prg_do_nothing:
\fi:
\prg_break:
}
- \cs_new:Npn \@@_decode_utf_xvi_extra:NNw #1#2 \s__tl #3 \s__tl
+ \cs_new:Npn \@@_decode_utf_xvi_extra:NNw #1#2 \s_@@ #3 \s_@@
{ \@@_decode_utf_xvi_error:nNN { extra } #1#2 }
\cs_new:Npn \@@_decode_utf_xvi_error:nNN #1#2#3
{
\flag_raise:n { str_error }
\flag_raise:n { str_#1 }
- #2 #3 \s__tl
- \int_use:N \c_@@_replacement_char_int \s__tl
+ #2 #3 \s_@@
+ \int_use:N \c_@@_replacement_char_int \s_@@
}
% \end{macrocode}
% \end{macro}
@@ -2470,7 +2484,7 @@
%
% The structure is similar to \textsc{utf-16} decoding functions. If
% the endianness is not given, test the first $4$ bytes of the string
-% (possibly \cs{s_stop} if the string is too short) for the presence
+% (possibly \cs{s_@@_stop} if the string is too short) for the presence
% of a byte-order mark. If there is a byte-order mark, use that
% endianness, and remove the $4$ bytes, otherwise default to
% big-endian, and leave the $4$ bytes in place. The
@@ -2482,22 +2496,22 @@
% inside an \texttt{x}-expanding assignment to \cs{g_@@_result_tl}.
%
% The \texttt{_loop} auxiliary first checks for the end-of-string
-% marker \cs{s_stop}, calling the \texttt{_end} auxiliary if
-% appropriate. Otherwise, leave the \meta{4~bytes} \cs{s__tl} behind,
+% marker \cs{s_@@_stop}, calling the \texttt{_end} auxiliary if
+% appropriate. Otherwise, leave the \meta{4~bytes} \cs{s_@@} behind,
% then check that the code point is not overflowing: the leading byte
% must be $0$, and the following byte at most $16$.
%
% In the ending code, we check that there remains no byte: there
-% should be nothing left until the first \cs{s_stop}. Break the map.
+% should be nothing left until the first \cs{s_@@_stop}. Break the map.
% \begin{macrocode}
\cs_new_protected:cpn { @@_convert_decode_utf32be: }
- { \@@_decode_utf_xxxii:Nw 1 \g_@@_result_tl \s_stop }
+ { \@@_decode_utf_xxxii:Nw 1 \g_@@_result_tl \s_@@_stop }
\cs_new_protected:cpn { @@_convert_decode_utf32le: }
- { \@@_decode_utf_xxxii:Nw 2 \g_@@_result_tl \s_stop }
+ { \@@_decode_utf_xxxii:Nw 2 \g_@@_result_tl \s_@@_stop }
\cs_new_protected:cpn { @@_convert_decode_utf32: }
{
\exp_after:wN \@@_decode_utf_xxxii_bom:NNNN \g_@@_result_tl
- \s_stop \s_stop \s_stop \s_stop \s_stop
+ \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop
}
\cs_new_protected:Npn \@@_decode_utf_xxxii_bom:NNNN #1#2#3#4
{
@@ -2509,7 +2523,7 @@
{ \@@_decode_utf_xxxii:Nw 1 #1#2#3#4 }
}
}
- \cs_new_protected:Npn \@@_decode_utf_xxxii:Nw #1#2 \s_stop
+ \cs_new_protected:Npn \@@_decode_utf_xxxii:Nw #1#2 \s_@@_stop
{
\flag_clear:n { str_overflow }
\flag_clear:n { str_end }
@@ -2518,17 +2532,17 @@
\tl_gset:Nx \g_@@_result_tl
{
\exp_after:wN \@@_decode_utf_xxxii_loop:NNNN
- #2 \s_stop \s_stop \s_stop \s_stop
+ #2 \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop
\prg_break_point:
}
\@@_if_flag_error:nnx { str_error } { utf32-decode } { }
}
\cs_new:Npn \@@_decode_utf_xxxii_loop:NNNN #1#2#3#4
{
- \if_meaning:w \s_stop #4
+ \if_meaning:w \s_@@_stop #4
\exp_after:wN \@@_decode_utf_xxxii_end:w
\fi:
- #1#2#3#4 \s__tl
+ #1#2#3#4 \s_@@
\if_int_compare:w \@@_tmp:w #1#4 > 0 \exp_stop_f:
\flag_raise:n { str_overflow }
\flag_raise:n { str_error }
@@ -2543,17 +2557,17 @@
{ \@@_tmp:w #2#3*"10000 + \@@_tmp:w #3#2*"100 + \@@_tmp:w #4#1 }
\fi:
\fi:
- \s__tl
+ \s_@@
\@@_decode_utf_xxxii_loop:NNNN
}
- \cs_new:Npn \@@_decode_utf_xxxii_end:w #1 \s_stop
+ \cs_new:Npn \@@_decode_utf_xxxii_end:w #1 \s_@@_stop
{
\tl_if_empty:nF {#1}
{
\flag_raise:n { str_end }
\flag_raise:n { str_error }
- #1 \s__tl
- \int_use:N \c_@@_replacement_char_int \s__tl
+ #1 \s_@@
+ \int_use:N \c_@@_replacement_char_int \s_@@
}
\prg_break:
}
diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx
index 66909707c0..d4cbc2bb49 100644
--- a/macros/latex/contrib/l3kernel/l3str.dtx
+++ b/macros/latex/contrib/l3kernel/l3str.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -862,6 +862,46 @@
%<@@=str>
% \end{macrocode}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_use_none_delimit_by_s_stop:w,
+% \@@_use_i_delimit_by_s_stop:nw
+% }
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+\cs_new:Npn \@@_use_i_delimit_by_s_stop:nw #1 #2 \s_@@_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{
+% \@@_if_recursion_tail_break:NN,
+% \@@_if_recursion_tail_stop_do:Nn
+% }
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_break:NN
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:Nn
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Creating and setting string variables}
%
% \begin{macro}
@@ -978,7 +1018,7 @@
% issues if we are fed a token list variable. Then the code is a much
% simplified version of the token list code because neither the
% delimiter nor the replacement can contain macro parameters or
-% braces. The delimiter \cs{q_mark} cannot appear in the string to
+% braces. The delimiter \cs{s_@@_mark} cannot appear in the string to
% edit so it is used in all cases. Some |x|-expansion is unnecessary.
% There is no need to avoid losing braces nor to protect against
% expansion. The ending code is much simplified and does not need to
@@ -1018,9 +1058,9 @@
{
\@@_replace_next:w
#4
- \use_none_delimit_by_q_stop:w
+ \@@_use_none_delimit_by_s_stop:w
#5
- \q_stop
+ \s_@@_stop
}
}
\cs_new_eq:NN \@@_replace_next:w ?
@@ -1214,7 +1254,7 @@
\@@_case:nnTF {#1} {#2}
}
\cs_new:Npn \@@_case:nnTF #1#2#3#4
- { \@@_case:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+ { \@@_case:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
\cs_generate_variant:Nn \str_case:nn { V , o , nV , nv }
\prg_generate_conditional_variant:Nnn \str_case:nn
{ V , o , nV , nv } { T , F , TF }
@@ -1245,14 +1285,14 @@
\@@_case_e:nnTF {#1} {#2}
}
\cs_new:Npn \@@_case_e:nnTF #1#2#3#4
- { \@@_case_e:nw {#1} #2 {#1} { } \q_mark {#3} \q_mark {#4} \q_stop }
+ { \@@_case_e:nw {#1} #2 {#1} { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
\cs_new:Npn \@@_case_e:nw #1#2#3
{
\str_if_eq:eeTF {#1} {#2}
{ \@@_case_end:nw {#3} }
{ \@@_case_e:nw {#1} }
}
-\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop
{ \exp_end: #1 #4 }
% \end{macrocode}
% \end{macro}
@@ -1280,12 +1320,12 @@
% These are received by \cs{@@_map_function:Nn}, which passes
% the space to |#1| and calls \cs{@@_map_function:w} to deal with the
% next space. The space before the braced space allows to optimize
-% the \cs{q_recursion_tail} test. Of course we need to include a
+% the \cs{q_@@_recursion_tail} test. Of course we need to include a
% trailing space (the question mark is needed to avoid losing the
% space when \TeX{} tokenizes the line).
% At the cost of about three more auxiliaries this code could get a $9$
% times speed up by testing only every $9$-th character for whether it
-% is \cs{q_recursion_tail} (also by converting $9$ spaces at a time in
+% is \cs{q_@@_recursion_tail} (also by converting $9$ spaces at a time in
% the \cs{str_map_function:nN} case).
%
% For the \texttt{map_variable} functions we use a string assignment
@@ -1297,7 +1337,7 @@
\exp_after:wN \@@_map_function:w
\exp_after:wN \@@_map_function:Nn \exp_after:wN #2
\__kernel_tl_to_str:w {#1}
- \q_recursion_tail ? ~
+ \q_@@_recursion_tail ? ~
\prg_break_point:Nn \str_map_break: { }
}
\cs_new:Npn \str_map_function:NN
@@ -1306,7 +1346,7 @@
{ #1 { ~ { ~ } \@@_map_function:w } }
\cs_new:Npn \@@_map_function:Nn #1#2
{
- \if_meaning:w \q_recursion_tail #2
+ \if_meaning:w \q_@@_recursion_tail #2
\exp_after:wN \str_map_break:
\fi:
#1 #2 \@@_map_function:Nn #1
@@ -1323,7 +1363,7 @@
\exp_not:c { @@_map_ \int_use:N \g__kernel_prg_map_int :w }
\__kernel_str_to_other_fast:n {#1}
}
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:Nn \str_map_break:
{ \int_gdecr:N \g__kernel_prg_map_int }
}
@@ -1332,7 +1372,7 @@
\cs_generate_variant:Nn \str_map_inline:Nn { c }
\cs_new:Npn \@@_map_inline:NN #1#2
{
- \quark_if_recursion_tail_break:NN #2 \str_map_break:
+ \@@_if_recursion_tail_break:NN #2 \str_map_break:
\exp_args:No #1 { \token_to_str:N #2 }
\@@_map_inline:NN #1
}
@@ -1343,14 +1383,14 @@
\exp_not:n { \@@_map_variable:NnN #2 {#3} }
\__kernel_str_to_other_fast:n {#1}
}
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:Nn \str_map_break: { }
}
\cs_new_protected:Npn \str_map_variable:NNn
{ \exp_args:No \str_map_variable:nNn }
\cs_new_protected:Npn \@@_map_variable:NnN #1#2#3
{
- \quark_if_recursion_tail_break:NN #3 \str_map_break:
+ \@@_if_recursion_tail_break:NN #3 \str_map_break:
\str_set:Nn #1 {#3}
\use:n {#2}
\@@_map_variable:NnN #1 {#2}
@@ -1378,17 +1418,17 @@
% \begin{macro}[EXP]{\@@_to_other_loop:w, \@@_to_other_end:w}
% First apply \cs{tl_to_str:n}, then replace all spaces by
% \enquote{other} spaces, $8$ at a time, storing the converted part of
-% the string between the \cs{q_mark} and \cs{q_stop} markers. The end
+% the string between the \cs{s_@@_mark} and \cs{s_@@_stop} markers. The end
% is detected when \cs{@@_to_other_loop:w} finds one of the trailing
% |A|, distinguished from any contents of the initial token list by
% their category. Then \cs{@@_to_other_end:w} is called, and finds
-% the result between \cs{q_mark} and the first |A| (well, there is
+% the result between \cs{s_@@_mark} and the first |A| (well, there is
% also the need to remove a space).
% \begin{macrocode}
\cs_new:Npn \__kernel_str_to_other:n #1
{
\exp_after:wN \@@_to_other_loop:w
- \tl_to_str:n {#1} ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \q_mark \q_stop
+ \tl_to_str:n {#1} ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \s_@@_mark \s_@@_stop
}
\group_begin:
\tex_lccode:D `\* = `\ %
@@ -1397,15 +1437,15 @@
{
\group_end:
\cs_new:Npn \@@_to_other_loop:w
- #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 ~ #7 ~ #8 ~ #9 \q_stop
+ #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 ~ #7 ~ #8 ~ #9 \s_@@_stop
{
\if_meaning:w A #8
\@@_to_other_end:w
\fi:
\@@_to_other_loop:w
- #9 #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * \q_stop
+ #9 #1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * \s_@@_stop
}
- \cs_new:Npn \@@_to_other_end:w \fi: #1 \q_mark #2 * A #3 \q_stop
+ \cs_new:Npn \@@_to_other_end:w \fi: #1 \s_@@_mark #2 * A #3 \s_@@_stop
{ \fi: #2 }
}
% \end{macrocode}
@@ -1421,7 +1461,7 @@
\cs_new:Npn \__kernel_str_to_other_fast:n #1
{
\exp_after:wN \@@_to_other_fast_loop:w \tl_to_str:n {#1} ~
- A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \q_stop
+ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ A ~ \s_@@_stop
}
\group_begin:
\tex_lccode:D `\* = `\ %
@@ -1438,7 +1478,7 @@
#1 * #2 * #3 * #4 * #5 * #6 * #7 * #8 * #9
\@@_to_other_fast_loop:w *
}
- \cs_new:Npn \@@_to_other_fast_end:w #1 * A #2 \q_stop {#1}
+ \cs_new:Npn \@@_to_other_fast_end:w #1 * A #2 \s_@@_stop {#1}
}
% \end{macrocode}
% \end{macro}
@@ -1481,25 +1521,25 @@
\exp_after:wN \@@_item:w
\int_value:w \int_eval:n {#2} \exp_after:wN ;
\int_value:w \@@_count:n {#1} ;
- #1 \q_stop
+ #1 \s_@@_stop
}
\cs_new:Npn \@@_item:w #1; #2;
{
\int_compare:nNnTF {#1} < 0
{
\int_compare:nNnTF {#1} < {-#2}
- { \use_none_delimit_by_q_stop:w }
+ { \@@_use_none_delimit_by_s_stop:w }
{
- \exp_after:wN \use_i_delimit_by_q_stop:nw
+ \exp_after:wN \@@_use_i_delimit_by_s_stop:nw
\exp:w \exp_after:wN \@@_skip_exp_end:w
\int_value:w \int_eval:n { #1 + #2 } ;
}
}
{
\int_compare:nNnTF {#1} > {#2}
- { \use_none_delimit_by_q_stop:w }
+ { \@@_use_none_delimit_by_s_stop:w }
{
- \exp_after:wN \use_i_delimit_by_q_stop:nw
+ \exp_after:wN \@@_use_i_delimit_by_s_stop:nw
\exp:w \@@_skip_exp_end:w #1 ; { }
}
}
@@ -1581,7 +1621,7 @@
\int_value:w \@@_count:n {#1} \exp_after:wN ;
\int_value:w \int_eval:n { (#2) - 1 } \exp_after:wN ;
\int_value:w \int_eval:n {#3} ;
- #1 \q_stop
+ #1 \s_@@_stop
}
\cs_new:Npn \@@_range:w #1; #2; #3;
{
@@ -1635,7 +1675,7 @@
% \@@_collect_end:wn, \@@_collect_end:nnnnnnnnw
% }
% Collects |max(#1,0)| characters, and removes everything else until
-% \cs{q_stop}. This is somewhat similar to \cs{@@_skip_exp_end:w}, but
+% \cs{s_@@_stop}. This is somewhat similar to \cs{@@_skip_exp_end:w}, but
% accepts integer expression arguments. This time we can only grab
% $7$ characters at a time. At the end, we use an \cs{if_case:w}
% trick again, so that the $8$ first arguments of
@@ -1668,7 +1708,7 @@
#1 \else: 0 \fi: \exp_stop_f:
\or: \or: \or: \or: \or: \or: \fi:
}
-\cs_new:Npn \@@_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \q_stop
+\cs_new:Npn \@@_collect_end:nnnnnnnnw #1#2#3#4#5#6#7#8 #9 \s_@@_stop
{ #1#2#3#4#5#6#7#8 }
% \end{macrocode}
% \end{macro}
@@ -1695,13 +1735,13 @@
\exp_after:wN \@@_count_spaces_loop:w
\tl_to_str:n {#1} ~
X 7 ~ X 6 ~ X 5 ~ X 4 ~ X 3 ~ X 2 ~ X 1 ~ X 0 ~ X -1 ~
- \q_stop
+ \s_@@_stop
}
}
\cs_new:Npn \@@_count_spaces_loop:w #1~#2~#3~#4~#5~#6~#7~#8~#9~
{
\if_meaning:w X #9
- \use_i_delimit_by_q_stop:nw
+ \@@_use_i_delimit_by_s_stop:nw
\fi:
9 + \@@_count_spaces_loop:w
}
@@ -1755,13 +1795,13 @@
{ X 8 } { X 7 } { X 6 }
{ X 5 } { X 4 } { X 3 }
{ X 2 } { X 1 } { X 0 }
- \q_stop
+ \s_@@_stop
}
}
\cs_new:Npn \@@_count_loop:NNNNNNNNN #1#2#3#4#5#6#7#8#9
{
\if_meaning:w X #9
- \exp_after:wN \use_none_delimit_by_q_stop:w
+ \exp_after:wN \@@_use_none_delimit_by_s_stop:w
\fi:
9 + \@@_count_loop:NNNNNNNNN
}
@@ -1781,14 +1821,14 @@
% hands it to \cs{str_head:n}. To circumvent the fact that \TeX{}
% skips spaces when grabbing undelimited macro parameters,
% \cs{@@_head:w} takes an argument delimited by a space. If |#1|
-% starts with a non-space character, \cs{use_i_delimit_by_q_stop:nw}
+% starts with a non-space character, \cs{@@_use_i_delimit_by_s_stop:nw}
% leaves that in the input stream. On the other hand, if |#1| starts
% with a space, the \cs{@@_head:w} takes an empty argument, and the
% single (initially braced) space in the definition of \cs{@@_head:w}
% makes its way to the output. Finally, for an empty argument, the
% (braced) empty brace group in the definition of \cs{str_head:n}
% gives an empty result after passing through
-% \cs{use_i_delimit_by_q_stop:nw}.
+% \cs{@@_use_i_delimit_by_s_stop:nw}.
% \begin{macrocode}
\cs_new:Npn \str_head:N { \exp_args:No \str_head:n }
\cs_generate_variant:Nn \str_head:N { c }
@@ -1796,14 +1836,14 @@
{
\exp_after:wN \@@_head:w
\tl_to_str:n {#1}
- { { } } ~ \q_stop
+ { { } } ~ \s_@@_stop
}
\cs_new:Npn \@@_head:w #1 ~ %
- { \use_i_delimit_by_q_stop:nw #1 { ~ } }
+ { \@@_use_i_delimit_by_s_stop:nw #1 { ~ } }
\cs_new:Npn \str_head_ignore_spaces:n #1
{
- \exp_after:wN \use_i_delimit_by_q_stop:nw
- \tl_to_str:n {#1} { } \q_stop
+ \exp_after:wN \@@_use_i_delimit_by_s_stop:nw
+ \tl_to_str:n {#1} { } \s_@@_stop
}
% \end{macrocode}
% \end{macro}
@@ -1823,7 +1863,7 @@
% end-marker |X| be unexpandable and not a control sequence). The
% \texttt{_ignore_spaces} is rather simpler: after converting the
% input to a string, \cs{@@_tail_auxii:w} removes one undelimited
-% argument and leaves everything else until an end-marker \cs{q_mark}.
+% argument and leaves everything else until an end-marker \cs{s_@@_mark}.
% One can check that an empty (or blank) string yields an empty
% tail.
% \begin{macrocode}
@@ -1833,15 +1873,15 @@
{
\exp_after:wN \@@_tail_auxi:w
\reverse_if:N \if_charcode:w
- \scan_stop: \tl_to_str:n {#1} X X \q_stop
+ \scan_stop: \tl_to_str:n {#1} X X \s_@@_stop
}
-\cs_new:Npn \@@_tail_auxi:w #1 X #2 \q_stop { \fi: #1 }
+\cs_new:Npn \@@_tail_auxi:w #1 X #2 \s_@@_stop { \fi: #1 }
\cs_new:Npn \str_tail_ignore_spaces:n #1
{
\exp_after:wN \@@_tail_auxii:w
- \tl_to_str:n {#1} \q_mark \q_mark \q_stop
+ \tl_to_str:n {#1} \s_@@_mark \s_@@_mark \s_@@_stop
}
-\cs_new:Npn \@@_tail_auxii:w #1 #2 \q_mark #3 \q_stop { #2 }
+\cs_new:Npn \@@_tail_auxii:w #1 #2 \s_@@_mark #3 \s_@@_stop { #2 }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1880,7 +1920,7 @@
}
\cs_new:Npn \@@_change_case_aux:nn #1#2
{
- \@@_change_case_loop:nw {#2} #1 \q_recursion_tail \q_recursion_stop
+ \@@_change_case_loop:nw {#2} #1 \q_@@_recursion_tail \q_@@_recursion_stop
\@@_change_case_result:n { }
}
\cs_new:Npn \@@_change_case_output:nw #1#2 \@@_change_case_result:n #3
@@ -1888,12 +1928,12 @@
\cs_generate_variant:Nn \@@_change_case_output:nw { f }
\cs_new:Npn \@@_change_case_end:wn #1 \@@_change_case_result:n #2
{ \tl_to_str:n {#2} }
-\cs_new:Npn \@@_change_case_loop:nw #1#2 \q_recursion_stop
+\cs_new:Npn \@@_change_case_loop:nw #1#2 \q_@@_recursion_stop
{
\tl_if_head_is_space:nTF {#2}
{ \@@_change_case_space:n }
{ \@@_change_case_char:nN }
- {#1} #2 \q_recursion_stop
+ {#1} #2 \q_@@_recursion_stop
}
\exp_last_unbraced:NNNNo
\cs_new:Npn \@@_change_case_space:n #1 \c_space_tl
@@ -1903,7 +1943,7 @@
}
\cs_new:Npn \@@_change_case_char:nN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_change_case_end:wn }
\@@_change_case_output:fw
{ \use:c { char_str_ #1 case:N } #2 }
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf
index ecd36e76ee..eb0878701d 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.pdf
+++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex
index 1896458840..16d5983a04 100644
--- a/macros/latex/contrib/l3kernel/l3styleguide.tex
+++ b/macros/latex/contrib/l3kernel/l3styleguide.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2020-05-05}
+\date{Released 2020-05-11}
\begin{document}
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
index 37dd80b173..44c75ca2e3 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
index e1aa7562c0..0bc6adc9ac 100644
--- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex
+++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2020-05-05}
+\date{Released 2020-05-11}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx
index 4b36af5e14..feef711735 100644
--- a/macros/latex/contrib/l3kernel/l3sys.dtx
+++ b/macros/latex/contrib/l3kernel/l3sys.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
index 7955976684..974430a84b 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex
index 4d96050ff0..eab4b9053c 100644
--- a/macros/latex/contrib/l3kernel/l3term-glossary.tex
+++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex
@@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2020-05-05}
+\date{Released 2020-05-11}
\newcommand{\TF}{\textit{(TF)}}
diff --git a/macros/latex/contrib/l3kernel/l3text-case.dtx b/macros/latex/contrib/l3kernel/l3text-case.dtx
index 950635ec93..ad71e49319 100644
--- a/macros/latex/contrib/l3kernel/l3text-case.dtx
+++ b/macros/latex/contrib/l3kernel/l3text-case.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -207,7 +207,7 @@
{
\group_align_safe_begin:
\@@_change_case_loop:nnw {#2} {#3} #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
\@@_change_case_result:n { }
}
% \end{macrocode}
@@ -227,7 +227,7 @@
% \end{macrocode}
% The main loop is the standard \texttt{tl action} type.
% \begin{macrocode}
-\cs_new:Npn \@@_change_case_loop:nnw #1#2#3 \q_recursion_stop
+\cs_new:Npn \@@_change_case_loop:nnw #1#2#3 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#3}
{ \@@_change_case_N_type:nnN }
@@ -236,9 +236,9 @@
{ \use:c { @@_change_case_group_ #1 :nnn } }
{ \@@_change_case_space:nnw }
}
- {#1} {#2} #3 \q_recursion_stop
+ {#1} {#2} #3 \q_@@_recursion_stop
}
-\cs_new:Npn \@@_change_case_break:w #1 \q_recursion_tail \q_recursion_stop
+\cs_new:Npn \@@_change_case_break:w #1 \q_@@_recursion_tail \q_@@_recursion_stop
{
\@@_change_case_store:n {#1}
\@@_change_case_end:w
@@ -309,7 +309,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_change_case_N_type:nnN #1#2#3
{
- \quark_if_recursion_tail_stop_do:Nn #3
+ \@@_if_recursion_tail_stop_do:Nn #3
{ \@@_change_case_end:w }
\@@_change_case_N_type_aux:nnN {#1} {#2} #3
}
@@ -321,16 +321,16 @@
\cs_new:Npn \@@_change_case_N_type:nnnN #1#2#3#4
{
\@@_change_case_math_search:nnNNN {#2} {#3} #4 #1
- \q_recursion_tail \q_recursion_tail
- \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_tail
+ \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_math_search:nnNNN #1#2#3#4#5
{
- \quark_if_recursion_tail_stop_do:Nn #4
+ \@@_if_recursion_tail_stop_do:Nn #4
{ \@@_change_case_cs_check:nnN {#1} {#2} #3 }
\token_if_eq_meaning:NNTF #3 #4
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{
\@@_change_case_store:n {#3}
\@@_change_case_math_loop:nnNw {#1} {#2} #5
@@ -338,7 +338,7 @@
}
{ \@@_change_case_math_search:nnNNN {#1} {#2} #3 }
}
-\cs_new:Npn \@@_change_case_math_loop:nnNw #1#2#3#4 \q_recursion_stop
+\cs_new:Npn \@@_change_case_math_loop:nnNw #1#2#3#4 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#4}
{ \@@_change_case_math_N_type:nnNN }
@@ -347,11 +347,11 @@
{ \@@_change_case_math_group:nnNn }
{ \@@_change_case_math_space:nnNw }
}
- {#1} {#2} #3 #4 \q_recursion_stop
+ {#1} {#2} #3 #4 \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_math_N_type:nnNN #1#2#3#4
{
- \quark_if_recursion_tail_stop_do:Nn #4
+ \@@_if_recursion_tail_stop_do:Nn #4
{ \@@_change_case_end:w }
\@@_change_case_store:n {#4}
\token_if_eq_meaning:NNTF #4 #3
@@ -402,15 +402,15 @@
\cs_new:Npn \@@_change_case_exclude:nnnN #1#2#3#4
{
\@@_change_case_exclude:nnNN {#2} {#3} #4 #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_exclude:nnNN #1#2#3#4
{
- \quark_if_recursion_tail_stop_do:Nn #4
+ \@@_if_recursion_tail_stop_do:Nn #4
{ \use:c { @@_change_case_letterlike_ #1 :nnN } {#1} {#2} #3 }
\cs_if_eq:NNTF #3 #4
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{ \@@_change_case_exclude:nnNn {#1} {#2} #3 }
}
{ \@@_change_case_exclude:nnNN {#1} {#2} #3 }
@@ -495,7 +495,7 @@
{ \@@_change_case_lower_sigma:nnNw {#2} {#3} #4 }
{ \@@_change_case_char:nnnN {#1} {#2} {#3} #4 }
}
- \cs_new:Npn \@@_change_case_lower_sigma:nnNw #1#2#3#4 \q_recursion_stop
+ \cs_new:Npn \@@_change_case_lower_sigma:nnNw #1#2#3#4 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#4}
{ \@@_change_case_lower_sigma:NnnN #3 }
@@ -504,7 +504,7 @@
{ \char_generate:nn { "03C2 } { \@@_char_catcode:N #3 } }
\@@_change_case_loop:nnw
}
- {#1} {#2} #4 \q_recursion_stop
+ {#1} {#2} #4 \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_lower_sigma:NnnN #1#2#3#4
{
@@ -742,12 +742,12 @@
\@@_change_case_upper_el_loop:nnw {#2} {#3}
}
\cs_new:Npn \@@_change_case_upper_el_loop:nnw
- #1#2#3 \q_recursion_stop
+ #1#2#3 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#3}
{ \@@_change_case_upper_el:nnN }
{ \@@_change_case_loop:nnw }
- {#1} {#2} #3 \q_recursion_stop
+ {#1} {#2} #3 \q_@@_recursion_stop
}
% \end{macrocode}
% In addition to the Greek accents, we list three cases here where an
@@ -916,12 +916,12 @@
\@@_change_case_lower_lt:nnw {#2} {#3}
}
}
- \cs_new:Npn \@@_change_case_lower_lt:nnw #1#2#3 \q_recursion_stop
+ \cs_new:Npn \@@_change_case_lower_lt:nnw #1#2#3 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#3}
{ \@@_change_case_lower_lt:nnN }
{ \@@_change_case_loop:nnw }
- {#1} {#2} #3 \q_recursion_stop
+ {#1} {#2} #3 \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_lower_lt:nnN #1#2#3
{
@@ -983,12 +983,12 @@
\@@_change_case_upper_lt:nnw {#2} {#3}
}
}
- \cs_new:Npn \@@_change_case_upper_lt:nnw #1#2#3 \q_recursion_stop
+ \cs_new:Npn \@@_change_case_upper_lt:nnw #1#2#3 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#3}
{ \@@_change_case_upper_lt:nnN }
{ \use:c { @@_change_case_char_next_ #1 :nn } }
- {#1} {#2} #3 \q_recursion_stop
+ {#1} {#2} #3 \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_upper_lt:nnN #1#2#3
{
@@ -1023,12 +1023,12 @@
}
{ \@@_change_case_char:nnnN {#1} {#2} {#3} #4 }
}
-\cs_new:Npn \@@_change_case_title_nl:nnw #1#2#3 \q_recursion_stop
+\cs_new:Npn \@@_change_case_title_nl:nnw #1#2#3 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#3}
{ \@@_change_case_title_nl:nnN }
{ \use:c { @@_change_case_char_next_ #1 :nn } }
- {#1} {#2} #3 \q_recursion_stop
+ {#1} {#2} #3 \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_title_nl:nnN #1#2#3
{
@@ -1084,7 +1084,7 @@
% combination is found both the dotless-I and the dot-above char have to
% be removed from the input.
% \begin{macrocode}
- \cs_new:Npn \@@_change_case_lower_tr:nnNw #1#2#3#4 \q_recursion_stop
+ \cs_new:Npn \@@_change_case_lower_tr:nnNw #1#2#3#4 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#4}
{ \@@_change_case_lower_tr:NnnN #3 }
@@ -1093,7 +1093,7 @@
{ \char_generate:nn { "0131 } { \@@_char_catcode:N #3 } }
\@@_change_case_loop:nnw
}
- {#1} {#2} #4 \q_recursion_stop
+ {#1} {#2} #4 \q_@@_recursion_stop
}
\cs_new:Npn \@@_change_case_lower_tr:NnnN #1#2#3#4
{
diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx
index 0de4896617..070e41956f 100644
--- a/macros/latex/contrib/l3kernel/l3text-purify.dtx
+++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -53,7 +53,7 @@
%
% \begin{implementation}
%
-% \section{\pkg{l3text} implementation}
+% \section{\pkg{l3text-purify} implementation}
%
% \begin{macrocode}
%<*initex|package>
@@ -65,6 +65,13 @@
%
% \subsection{Purifying text}
%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop:N}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop:N
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[rEXP]{\text_purify:n, \@@_purify:n}
% \begin{macro}[rEXP]{\@@_purify_loop:w}
% \begin{macro}[rEXP]{\@@_purify_group:n}
@@ -98,13 +105,13 @@
\group_align_safe_end:
}
\cs_new:Npn \@@_purify:n #1
- { \@@_purify_loop:w #1 \q_recursion_tail \q_recursion_stop }
+ { \@@_purify_loop:w #1 \q_@@_recursion_tail \q_@@_recursion_stop }
% \end{macrocode}
% The main loop is a standard \enquote{tl action}. Unlike the expansion
% or case changing, here any groups have to be run inline. Most of the
% business end is as before in the \texttt{N}-type token processing.
% \begin{macrocode}
-\cs_new:Npn \@@_purify_loop:w #1 \q_recursion_stop
+\cs_new:Npn \@@_purify_loop:w #1 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#1}
{ \@@_purify_N_type:N }
@@ -113,7 +120,7 @@
{ \@@_purify_group:n }
{ \@@_purify_space:w }
}
- #1 \q_recursion_stop
+ #1 \q_@@_recursion_stop
}
\cs_new:Npn \@@_purify_group:n #1 { \@@_purify_loop:w #1 }
\exp_last_unbraced:NNo \cs_new:Npn \@@_purify_space:w \c_space_tl
@@ -128,30 +135,30 @@
% \begin{macrocode}
\cs_new:Npn \@@_purify_N_type:N #1
{
- \quark_if_recursion_tail_stop:N #1
+ \@@_if_recursion_tail_stop:N #1
\@@_purify_N_type_aux:N #1
}
\cs_new:Npn \@@_purify_N_type_aux:N #1
{
\exp_after:wN \@@_purify_math_search:NNN
\exp_after:wN #1 \l_text_math_delims_tl
- \q_recursion_tail ?
- \q_recursion_stop
+ \q_@@_recursion_tail ?
+ \q_@@_recursion_stop
}
\cs_new:Npn \@@_purify_math_search:NNN #1#2#3
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_purify_math_cmd:N #1 }
\token_if_eq_meaning:NNTF #1 #2
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{ \@@_purify_math_start:NNw #2 #3 }
}
{ \@@_purify_math_search:NNN #1 }
}
-\cs_new:Npn \@@_purify_math_start:NNw #1#2#3 \q_recursion_stop
+\cs_new:Npn \@@_purify_math_start:NNw #1#2#3 \q_@@_recursion_stop
{
- \@@_purify_math_loop:NNw #1#2#3 \q_recursion_stop
+ \@@_purify_math_loop:NNw #1#2#3 \q_@@_recursion_stop
\@@_purify_math_result:n { }
}
\cs_new:Npn \@@_purify_math_store:n #1
@@ -165,7 +172,7 @@
}
\cs_new:Npn \@@_purify_math_stop:Nw #1 \@@_purify_math_result:n #2
{ \exp_not:n {#1#2} }
-\cs_new:Npn \@@_purify_math_loop:NNw #1#2#3 \q_recursion_stop
+\cs_new:Npn \@@_purify_math_loop:NNw #1#2#3 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#3}
{ \@@_purify_math_N_type:NNN }
@@ -174,11 +181,11 @@
{ \@@_purify_math_group:NNn }
{ \@@_purify_math_space:NNw }
}
- #1#2#3 \q_recursion_stop
+ #1#2#3 \q_@@_recursion_stop
}
\cs_new:Npn \@@_purify_math_N_type:NNN #1#2#3
{
- \quark_if_recursion_tail_stop_do:Nn #3
+ \@@_if_recursion_tail_stop_do:Nn #3
{ \@@_purify_math_stop:Nw #1 }
\token_if_eq_meaning:NNTF #3 #2
{ \@@_purify_math_end:w }
@@ -206,15 +213,15 @@
\cs_new:Npn \@@_purify_math_cmd:N #1
{
\exp_after:wN \@@_purify_math_cmd:NN \exp_after:wN #1
- \l_text_math_arg_tl \q_recursion_tail \q_recursion_stop
+ \l_text_math_arg_tl \q_@@_recursion_tail \q_@@_recursion_stop
}
\cs_new:Npn \@@_purify_math_cmd:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_purify_replace:N #1 }
\cs_if_eq:NNTF #2 #1
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{ \@@_purify_math_cmd:n }
}
{ \@@_purify_math_cmd:NN #1 }
@@ -264,7 +271,7 @@
}
\cs_new:Npn \@@_purify_protect:N #1
{
- \quark_if_recursion_tail_stop:N #1
+ \@@_if_recursion_tail_stop:N #1
\@@_purify_loop:w
}
% \end{macrocode}
diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx
index 73f2064561..5113e03cc9 100644
--- a/macros/latex/contrib/l3kernel/l3text.dtx
+++ b/macros/latex/contrib/l3kernel/l3text.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -277,6 +277,52 @@
%<@@=text>
% \end{macrocode}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_nil}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_quark_if_nil:n}
+% Branching quark conditional.
+% \begin{macrocode}
+\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:n { TF }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_i_delimit_by_q_recursion_stop:nw}
+% Functions to gobble up to a quark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_i_delimit_by_q_recursion_stop:nw
+ #1 #2 \q_@@_recursion_stop {#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_stop_do:Nn}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_stop_do:Nn
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Utilities}
%
% \begin{macro}[EXP]
@@ -379,9 +425,9 @@
\if_catcode:w + #1 12 \else:
4 \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi:
\exp_after:wN ;
- \token_to_meaning:N #1 \q_stop
+ \token_to_meaning:N #1 \s_@@_stop
}
-\cs_new:Npn \@@_token_to_explicit_auxi:w #1 ; #2 \q_stop
+\cs_new:Npn \@@_token_to_explicit_auxi:w #1 ; #2 \s_@@_stop
{
\char_generate:nn
{
@@ -453,7 +499,7 @@
{
{ \token_if_protected_macro_p:N #1 }
{ \token_if_protected_long_macro_p:N #1 }
- { \token_if_eq_meaning_p:NN \q_recursion_tail #1 }
+ { \token_if_eq_meaning_p:NN \q_@@_recursion_tail #1 }
}
{ \prg_return_false: }
{ \prg_return_true: }
@@ -615,7 +661,7 @@
{
\group_align_safe_begin:
\@@_expand_loop:w #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
\@@_expand_result:n { }
}
% \end{macrocode}
@@ -638,7 +684,7 @@
% recursively, while spaces are just passed through. Thus all of the
% action is in handling \texttt{N}-type tokens.
% \begin{macrocode}
-\cs_new:Npn \@@_expand_loop:w #1 \q_recursion_stop
+\cs_new:Npn \@@_expand_loop:w #1 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#1}
{ \@@_expand_N_type:N }
@@ -647,7 +693,7 @@
{ \@@_expand_group:n }
{ \@@_expand_space:w }
}
- #1 \q_recursion_stop
+ #1 \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_group:n #1
{
@@ -675,7 +721,7 @@
% \begin{macrocode}
\cs_new:Npx \@@_expand_N_type:N #1
{
- \exp_not:N \quark_if_recursion_tail_stop_do:Nn #1
+ \exp_not:N \@@_if_recursion_tail_stop_do:Nn #1
{ \exp_not:N \@@_expand_end:w }
\exp_not:N \bool_lazy_any:nTF
{
@@ -749,16 +795,16 @@
{
\exp_after:wN \@@_expand_math_search:NNN
\exp_after:wN #1 \l_text_math_delims_tl
- \q_recursion_tail \q_recursion_tail
- \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_tail
+ \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_math_search:NNN #1#2#3
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_expand_explicit:N #1 }
\token_if_eq_meaning:NNTF #1 #2
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{
\@@_expand_store:n {#1}
\@@_expand_math_loop:Nw #3
@@ -766,7 +812,7 @@
}
{ \@@_expand_math_search:NNN #1 }
}
-\cs_new:Npn \@@_expand_math_loop:Nw #1#2 \q_recursion_stop
+\cs_new:Npn \@@_expand_math_loop:Nw #1#2 \q_@@_recursion_stop
{
\tl_if_head_is_N_type:nTF {#2}
{ \@@_expand_math_N_type:NN }
@@ -775,11 +821,11 @@
{ \@@_expand_math_group:Nn }
{ \@@_expand_math_space:Nw }
}
- #1#2 \q_recursion_stop
+ #1#2 \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_math_N_type:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_expand_end:w }
\@@_expand_store:n {#2}
\token_if_eq_meaning:NNTF #2 #1
@@ -820,7 +866,7 @@
\exp_after:wN \@@_expand_exclude:NN
\l_text_math_arg_tl
#1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
%</initex>
%<*package>
\exp_args:Ne \@@_expand_exclude:nN
@@ -836,12 +882,12 @@
\cs_new:Npn \@@_expand_exclude:nN #1#2
{
\@@_expand_exclude:NN #2 #1
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
%</package>
\cs_new:Npn \@@_expand_exclude:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
%<*initex>
{ \@@_expand_cs:N #1 }
%</initex>
@@ -850,7 +896,7 @@
%</package>
\cs_if_eq:NNTF #2 #1
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{ \@@_expand_exclude:Nn #1 }
}
{ \@@_expand_exclude:NN #1 }
@@ -869,15 +915,15 @@
{
\exp_after:wN \@@_expand_letterlike:NN \exp_after:wN
#1 \l_text_letterlike_tl
- \q_recursion_tail \q_recursion_stop
+ \q_@@_recursion_tail \q_@@_recursion_stop
}
\cs_new:Npn \@@_expand_letterlike:NN #1#2
{
- \quark_if_recursion_tail_stop_do:Nn #2
+ \@@_if_recursion_tail_stop_do:Nn #2
{ \@@_expand_cs:N #1 }
\cs_if_eq:NNTF #2 #1
{
- \use_i_delimit_by_q_recursion_stop:nw
+ \@@_use_i_delimit_by_q_recursion_stop:nw
{
\@@_expand_store:n {#1}
\@@_expand_loop:w
@@ -908,10 +954,10 @@
{ \cs_to_str:N #1 } #1
}
\cs_new:Npn \@@_expand_protect:nN #1#2
- { \@@_expand_protect:Nw #2 #1 \q_nil #1 ~ \q_nil \q_nil \q_stop }
-\cs_new:Npn \@@_expand_protect:Nw #1 #2 ~ \q_nil #3 \q_nil #4 \q_stop
+ { \@@_expand_protect:Nw #2 #1 \q_@@_nil #1 ~ \q_@@_nil \q_@@_nil \s_@@_stop }
+\cs_new:Npn \@@_expand_protect:Nw #1 #2 ~ \q_@@_nil #3 \q_@@_nil #4 \s_@@_stop
{
- \quark_if_nil:nTF {#4}
+ \@@_quark_if_nil:nTF {#4}
{
\cs_if_exist:cTF {#2}
{ \exp_args:Ne \@@_expand_store:n { \exp_not:c {#2} } }
diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
index 969e15a485..6fbe2f1bbb 100644
--- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx
@@ -44,7 +44,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx
index 7c5217cb1d..53f61e9750 100644
--- a/macros/latex/contrib/l3kernel/l3tl.dtx
+++ b/macros/latex/contrib/l3kernel/l3tl.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1505,6 +1505,35 @@
% \end{macro}
% \end{macro}
%
+% \subsection{Internal quarks and quark-query functions}
+%
+% \begin{variable}{\q_@@_nil,\q_@@_mark,\q_@@_stop}
+% Internal quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_nil
+\quark_new:N \q_@@_mark
+\quark_new:N \q_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_recursion_tail,\q_@@_recursion_stop}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_recursion_tail
+\quark_new:N \q_@@_recursion_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_if_recursion_tail_break:nN}
+% \begin{macro}[pTF]{\@@_if_recursion_tail_stop:n}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_test:N \@@_if_recursion_tail_break:nN
+\__kernel_quark_new_conditional:Nn \@@_quark_if_nil:n { TF }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Reassigning token list category codes}
%
% \begin{variable}{\c_@@_rescan_marker_tl}
@@ -1670,7 +1699,7 @@
% token list may contain a comment character, in which case the |'| we
% expected is not there. We fix this as follows: rather than just
% |::| we set \tn{everyeof} to |::|\Arg{code1} |'::|\Arg{code2}
-% \cs{q_stop}. The auxiliary \cs{@@_set_rescan_single:NNww} runs the
+% \cs{s_@@_stop}. The auxiliary \cs{@@_set_rescan_single:NNww} runs the
% \texttt{o}-expanding assignment, expanding either \meta{code1} or
% \meta{code2} before its the main argument~|#3|. In the typical case
% without comment character, \meta{code1} is expanded, removing the
@@ -1717,9 +1746,9 @@
{
#1 \use_none:n
#2 #1 { \exp:w \@@_set_rescan_single_aux:w }
- \q_stop
+ \s_@@_stop
}
- \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \q_stop
+ \cs_set:Npn \@@_rescan:NNw ##1##2##3 #2 #1 ##4 ##5 \s_@@_stop
{
\group_end:
##1 ##2 { ##4 ##3 }
@@ -1756,13 +1785,13 @@
% the \meta{tl~var} by \meta{token list}.
% \begin{macrocode}
\cs_new_protected:Npn \tl_replace_once:Nnn
- { \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_set:Nx }
+ { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_wrap:w \tl_set:Nx }
\cs_new_protected:Npn \tl_greplace_once:Nnn
- { \@@_replace:NnNNNnn \q_mark ? \@@_replace_wrap:w \tl_gset:Nx }
+ { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_wrap:w \tl_gset:Nx }
\cs_new_protected:Npn \tl_replace_all:Nnn
- { \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_set:Nx }
+ { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_next:w \tl_set:Nx }
\cs_new_protected:Npn \tl_greplace_all:Nnn
- { \@@_replace:NnNNNnn \q_mark ? \@@_replace_next:w \tl_gset:Nx }
+ { \@@_replace:NnNNNnn \q_@@_mark ? \@@_replace_next:w \tl_gset:Nx }
\cs_generate_variant:Nn \tl_replace_once:Nnn { c }
\cs_generate_variant:Nn \tl_greplace_once:Nnn { c }
\cs_generate_variant:Nn \tl_replace_all:Nnn { c }
@@ -1816,9 +1845,9 @@
% at most $O(n^{3/2})$. Bear in mind that these upper bounds are
% reached only in very contrived scenarios: we include the case
% \enquote{\meta{A}} in the list of delimiters to try, so that the
-% \meta{delimiter} is simply \cs{q_mark} in the most common
+% \meta{delimiter} is simply \cs{q_@@_mark} in the most common
% situation where neither the \meta{token list} nor the \meta{pattern}
-% contains \cs{q_mark}.
+% contains \cs{q_@@_mark}.
%
% Let us now ahead, optimizing for this most common case. First, two
% special cases: an empty \meta{pattern}~|#6| is an error, and if
@@ -1826,14 +1855,14 @@
% \meta{pattern}~|#6| then we can use it as the \meta{delimiter}
% through \cs{@@_replace_auxii:nNNNnn} |{#1}|. Otherwise, we end up
% calling \cs{@@_replace:NnNNNnn} repeatedly with the first two
-% arguments \cs{q_mark} |{?}|, |\?| |{??}|, |\??| |{???}|, and so on,
+% arguments \cs{q_@@_mark} |{?}|, |\?| |{??}|, |\??| |{???}|, and so on,
% until |#6|~does not contain the control sequence~|#1|, which we take
% as our~\meta{A}. The argument~|#2| only serves to collect~|?|
% characters for~|#1|. Note that the order of the tests means that
% the first two are done every time, which is wasteful (for instance,
% we repeatedly test for the emptyness of~|#6|). However, this is
% rare enough not to matter. Finally, choose~\meta{B} to be
-% \cs{q_nil} or~\cs{q_stop} such that it is not equal to~|#6|.
+% \cs{q_@@_nil} or~\cs{q_@@_stop} such that it is not equal to~|#6|.
%
% The \cs{@@_replace_auxi:NnnNNNnn} auxiliary receives \Arg{A} and
% |{|\meta{A}$^n$\meta{B}|}| as its arguments, initially with $n=1$.
@@ -1855,9 +1884,9 @@
\tl_if_in:nnTF {#6} {#1}
{ \exp_args:Nc \@@_replace:NnNNNnn {#2} {#2?} }
{
- \quark_if_nil:nTF {#6}
- { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_stop } }
- { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_nil } }
+ \@@_quark_if_nil:nTF {#6}
+ { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_@@_stop } }
+ { \@@_replace_auxi:NnnNNNnn #5 {#1} { #1 \q_@@_nil } }
}
}
{ \@@_replace_auxii:nNNNnn {#1} }
@@ -1988,7 +2017,7 @@
% \meta{token list} |?| is empty after one expansion. The auxiliary
% \cs{@@_if_empty_if:o} is a fast emptyness test, converting its
% argument to a string (after one expansion) and using the test
-% \cs{if_meaning:w} \cs{q_nil} |...| \cs{q_nil}.
+% \cs{if_meaning:w} \cs{q_@@_nil} |...| \cs{q_@@_nil}.
% \begin{macrocode}
\prg_new_conditional:Npnn \tl_if_blank:n #1 { p , T , F , TF }
{
@@ -2023,22 +2052,22 @@
%
% \begin{macro}[pTF]{\tl_if_empty:n, \tl_if_empty:V}
% Convert the argument to a string: this is empty if and only if
-% the argument is. Then |\if_meaning:w \q_nil ... \q_nil| is
+% the argument is. Then |\if_meaning:w \q_@@_nil ... \q_@@_nil| is
% \texttt{true} if and only if the string |...| is empty.
-% It could be tempting to use |\if_meaning:w \q_nil #1 \q_nil| directly.
+% It could be tempting to use |\if_meaning:w \q_@@_nil #1 \q_@@_nil| directly.
% This fails on a token
-% list starting with \cs{q_nil} of course but more troubling is the
+% list starting with \cs{q_@@_nil} of course but more troubling is the
% case where argument is a complete conditional such as \cs{if_true:}
% a \cs{else:} b \cs{fi:} because then \cs{if_true:} is used by
% \cs{if_meaning:w}, the test turns out \texttt{false}, the \cs{else:}
% executes the \texttt{false} branch, the \cs{fi:} ends it and the
-% \cs{q_nil} at the end
+% \cs{q_@@_nil} at the end
% starts executing\dots{}
% \begin{macrocode}
\prg_new_conditional:Npnn \tl_if_empty:n #1 { p , TF , T , F }
{
- \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
- \tl_to_str:n {#1} \q_nil
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil
+ \tl_to_str:n {#1} \q_@@_nil
\prg_return_true:
\else:
\prg_return_false:
@@ -2064,8 +2093,8 @@
% \begin{macrocode}
\cs_new:Npn \@@_if_empty_if:o #1
{
- \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
- \__kernel_tl_to_str:w \exp_after:wN {#1} \q_nil
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil
+ \__kernel_tl_to_str:w \exp_after:wN {#1} \q_@@_nil
}
\prg_new_conditional:Npnn \tl_if_empty:o #1 { p , TF , T , F }
{
@@ -2221,13 +2250,13 @@
{
\if_catcode:w ^ \exp_after:wN \@@_if_single:nnw
\__kernel_tl_to_str:w
- \exp_after:wN { \use_none:nn #1 ?? } ^ ? \q_stop
+ \exp_after:wN { \use_none:nn #1 ?? } ^ ? \s_@@_stop
\prg_return_true:
\else:
\prg_return_false:
\fi:
}
-\cs_new:Npn \@@_if_single:nnw #1#2#3 \q_stop {#2}
+\cs_new:Npn \@@_if_single:nnw #1#2#3 \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2291,7 +2320,7 @@
\@@_case:NnTF #1 {#2}
}
\cs_new:Npn \@@_case:NnTF #1#2#3#4
- { \@@_case:Nw #1 #2 #1 { } \q_mark {#3} \q_mark {#4} \q_stop }
+ { \@@_case:Nw #1 #2 #1 { } \s_@@_mark {#3} \s_@@_mark {#4} \s_@@_stop }
\cs_new:Npn \@@_case:Nw #1#2#3
{
\tl_if_eq:NNTF #1 #2
@@ -2306,14 +2335,14 @@
% one of the cases searched for, then |#1| is the code to insert,
% |#2| is the \emph{next} case to check on and |#3| is all of
% the rest of the cases code. That means that |#4| is the \texttt{true}
-% branch code, and |#5| tidies up the spare \cs{q_mark} and the
+% branch code, and |#5| tidies up the spare \cs{s_@@_mark} and the
% \texttt{false} branch. On the other hand, if none of the cases matched
% then we arrive here using the \enquote{termination} case of comparing
% the search with itself. That means that |#1| is empty, |#2| is
-% the first \cs{q_mark} and so |#4| is the \texttt{false} code (the
+% the first \cs{s_@@_mark} and so |#4| is the \texttt{false} code (the
% \texttt{true} code is mopped up by |#3|).
% \begin{macrocode}
-\cs_new:Npn \@@_case_end:nw #1#2#3 \q_mark #4#5 \q_stop
+\cs_new:Npn \@@_case_end:nw #1#2#3 \s_@@_mark #4#5 \s_@@_stop
{ \exp_end: #1 #4 }
% \end{macrocode}
% \end{macro}
@@ -2333,14 +2362,14 @@
\cs_new:Npn \tl_map_function:nN #1#2
{
\@@_map_function:Nn #2 #1
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:Nn \tl_map_break: { }
}
\cs_new:Npn \tl_map_function:NN
{ \exp_args:No \tl_map_function:nN }
\cs_new:Npn \@@_map_function:Nn #1#2
{
- \quark_if_recursion_tail_break:nN {#2} \tl_map_break:
+ \@@_if_recursion_tail_break:nN {#2} \tl_map_break:
#1 {#2} \@@_map_function:Nn #1
}
\cs_generate_variant:Nn \tl_map_function:NN { c }
@@ -2363,7 +2392,7 @@
{ @@_map_ \int_use:N \g__kernel_prg_map_int :w } ##1 {#2}
\exp_args:Nc \@@_map_function:Nn
{ @@_map_ \int_use:N \g__kernel_prg_map_int :w }
- #1 \q_recursion_tail
+ #1 \q_@@_recursion_tail
\prg_break_point:Nn \tl_map_break:
{ \int_gdecr:N \g__kernel_prg_map_int }
}
@@ -2382,7 +2411,7 @@
\cs_new:Npn \tl_map_tokens:nn #1#2
{
\@@_map_tokens:nn {#2} #1
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:Nn \tl_map_break: { }
}
\cs_new:Npn \tl_map_tokens:Nn
@@ -2390,7 +2419,7 @@
\cs_generate_variant:Nn \tl_map_tokens:Nn { c }
\cs_new:Npn \@@_map_tokens:nn #1#2
{
- \quark_if_recursion_tail_break:nN {#2} \tl_map_break:
+ \@@_if_recursion_tail_break:nN {#2} \tl_map_break:
\use:n {#1} {#2}
\@@_map_tokens:nn {#1}
}
@@ -2410,14 +2439,14 @@
\cs_new_protected:Npn \tl_map_variable:nNn #1#2#3
{
\@@_map_variable:Nnn #2 {#3} #1
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:Nn \tl_map_break: { }
}
\cs_new_protected:Npn \tl_map_variable:NNn
{ \exp_args:No \tl_map_variable:nNn }
\cs_new_protected:Npn \@@_map_variable:Nnn #1#2#3
{
- \quark_if_recursion_tail_break:nN {#3} \tl_map_break:
+ \@@_if_recursion_tail_break:nN {#3} \tl_map_break:
\tl_set:Nn #1 {#3}
\use:n {#2}
\@@_map_variable:Nnn #1 {#2}
@@ -2538,23 +2567,23 @@
% \begin{macro}{\@@_reverse_items:nwNwn}
% \begin{macro}{\@@_reverse_items:wn}
% Reversal of a token list is done by taking one item at a time
-% and putting it after \cs{q_stop}.
+% and putting it after \cs{s_@@_stop}.
% \begin{macrocode}
\cs_new:Npn \tl_reverse_items:n #1
{
\@@_reverse_items:nwNwn #1 ?
- \q_mark \@@_reverse_items:nwNwn
- \q_mark \@@_reverse_items:wn
- \q_stop { }
+ \s_@@_mark \@@_reverse_items:nwNwn
+ \s_@@_mark \@@_reverse_items:wn
+ \s_@@_stop { }
}
-\cs_new:Npn \@@_reverse_items:nwNwn #1 #2 \q_mark #3 #4 \q_stop #5
+\cs_new:Npn \@@_reverse_items:nwNwn #1 #2 \s_@@_mark #3 #4 \s_@@_stop #5
{
#3 #2
- \q_mark \@@_reverse_items:nwNwn
- \q_mark \@@_reverse_items:wn
- \q_stop { {#1} #5 }
+ \s_@@_mark \@@_reverse_items:nwNwn
+ \s_@@_mark \@@_reverse_items:wn
+ \s_@@_stop { {#1} #5 }
}
-\cs_new:Npn \@@_reverse_items:wn #1 \q_stop #2
+\cs_new:Npn \@@_reverse_items:wn #1 \s_@@_stop #2
{ \exp_not:o { \use_none:nn #2 } }
% \end{macrocode}
% \end{macro}
@@ -2570,17 +2599,17 @@
% }
% Trimming spaces from around the input is deferred to an internal
% function whose first argument is the token list to trim, augmented
-% by an initial \cs{q_mark}, and whose second argument is a
+% by an initial \cs{s_@@_mark}, and whose second argument is a
% \meta{continuation}, which receives as a braced argument
-% \cs{use_none:n} \cs{q_mark} \meta{trimmed token list}. In the case
+% \cs{use_none:n} \cs{s_@@_mark} \meta{trimmed token list}. In the case
% at hand, we take \cs{exp_not:o} as our continuation, so that space
% trimming behaves correctly within an \texttt{x}-type expansion.
% \begin{macrocode}
\cs_new:Npn \tl_trim_spaces:n #1
- { \@@_trim_spaces:nn { \q_mark #1 } \exp_not:o }
+ { \@@_trim_spaces:nn { \s_@@_mark #1 } \exp_not:o }
\cs_generate_variant:Nn \tl_trim_spaces:n { o }
\cs_new:Npn \tl_trim_spaces_apply:nN #1#2
- { \@@_trim_spaces:nn { \q_mark #1 } { \exp_args:No #2 } }
+ { \@@_trim_spaces:nn { \s_@@_mark #1 } { \exp_args:No #2 } }
\cs_generate_variant:Nn \tl_trim_spaces_apply:nN { o }
\cs_new_protected:Npn \tl_trim_spaces:N #1
{ \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
@@ -2603,14 +2632,14 @@
% definitions, we nest those in \cs{@@_tmp:w}, which then receives
% a single space as its argument: |#1| is \verb*+ +.
% Removing leading spaces is done with \cs{@@_trim_spaces_auxi:w},
-% which loops until \cs{q_mark}\verb*+ + matches the end of the token
+% which loops until \cs{s_@@_mark}\verb*+ + matches the end of the token
% list: then |##1| is the token list and |##3| is
% \cs{@@_trim_spaces_auxii:w}. This hands the relevant tokens to the
% loop \cs{@@_trim_spaces_auxiii:w}, responsible for trimming
-% trailing spaces. The end is reached when \verb*+ + \cs{q_nil}
+% trailing spaces. The end is reached when \verb*+ + \cs{s_@@_nil}
% matches the one present in the definition of \cs{tl_trim_spacs:n}.
% Then \cs{@@_trim_spaces_auxiv:w} puts the token list into a group,
-% with \cs{use_none:n} placed there to gobble a lingering \cs{q_mark},
+% with \cs{use_none:n} placed there to gobble a lingering \cs{s_@@_mark},
% and feeds this to the \meta{continuation}.
% \begin{macrocode}
\cs_set:Npn \@@_tmp:w #1
@@ -2619,35 +2648,35 @@
{
\@@_trim_spaces_auxi:w
##1
- \q_nil
- \q_mark #1 { }
- \q_mark \@@_trim_spaces_auxii:w
+ \s_@@_nil
+ \s_@@_mark #1 { }
+ \s_@@_mark \@@_trim_spaces_auxii:w
\@@_trim_spaces_auxiii:w
- #1 \q_nil
+ #1 \s_@@_nil
\@@_trim_spaces_auxiv:w
- \q_stop
+ \s_@@_stop
}
- \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \q_mark #1 ##2 \q_mark ##3
+ \cs_new:Npn \@@_trim_spaces_auxi:w ##1 \s_@@_mark #1 ##2 \s_@@_mark ##3
{
##3
\@@_trim_spaces_auxi:w
- \q_mark
+ \s_@@_mark
##2
- \q_mark #1 {##1}
+ \s_@@_mark #1 {##1}
}
\cs_new:Npn \@@_trim_spaces_auxii:w
- \@@_trim_spaces_auxi:w \q_mark \q_mark ##1
+ \@@_trim_spaces_auxi:w \s_@@_mark \s_@@_mark ##1
{
\@@_trim_spaces_auxiii:w
##1
}
- \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \q_nil ##2
+ \cs_new:Npn \@@_trim_spaces_auxiii:w ##1 #1 \s_@@_nil ##2
{
##2
- ##1 \q_nil
+ ##1 \s_@@_nil
\@@_trim_spaces_auxiii:w
}
- \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \q_nil ##2 \q_stop ##3
+ \cs_new:Npn \@@_trim_spaces_auxiv:w ##1 \s_@@_nil ##2 \s_@@_stop ##3
{ ##3 { \use_none:n ##1 } }
}
\@@_tmp:w { ~ }
@@ -2669,10 +2698,9 @@
% in the token list.
% Only \cs{q_@@_act_mark} and \cs{q_@@_act_stop} may not appear
% in the token lists manipulated by \cs{@@_act:NNNnn} functions.
-% No quark module yet, so do things by hand.
% \begin{macrocode}
-\cs_new_nopar:Npn \q_@@_act_mark { \q_@@_act_mark }
-\cs_new_nopar:Npn \q_@@_act_stop { \q_@@_act_stop }
+\quark_new:N \q_@@_act_mark
+\quark_new:N \q_@@_act_stop
% \end{macrocode}
% \end{variable}
%
@@ -2819,7 +2847,7 @@
%
% \begin{macro}{\tl_head:N, \tl_head:n, \tl_head:V, \tl_head:v, \tl_head:f}
% \begin{macro}{\@@_head_auxi:nw, \@@_head_auxii:n}
-% \begin{macro}{\tl_head:w}
+% \begin{macro}{\tl_head:w,\@@_tl_head:w}
% \begin{macro}{\tl_tail:N, \tl_tail:n, \tl_tail:V, \tl_tail:v, \tl_tail:f}
% Finding the head of a token list expandably always strips braces, which
% is fine as this is consistent with for example mapping to a list. The
@@ -2836,17 +2864,17 @@
\cs_new:Npn \tl_head:n #1
{
\__kernel_exp_not:w
- \if_false: { \fi: \@@_head_auxi:nw #1 { } \q_stop }
+ \if_false: { \fi: \@@_head_auxi:nw #1 { } \s_@@_stop }
}
-\cs_new:Npn \@@_head_auxi:nw #1#2 \q_stop
+\cs_new:Npn \@@_head_auxi:nw #1#2 \s_@@_stop
{
\exp_after:wN \@@_head_auxii:n \exp_after:wN {
\if_false: } \fi: {#1}
}
\cs_new:Npn \@@_head_auxii:n #1
{
- \exp_after:wN \if_meaning:w \exp_after:wN \q_nil
- \__kernel_tl_to_str:w \exp_after:wN { \use_none:n #1 } \q_nil
+ \exp_after:wN \if_meaning:w \exp_after:wN \q_@@_nil
+ \__kernel_tl_to_str:w \exp_after:wN { \use_none:n #1 } \q_@@_nil
\exp_after:wN \use_i:nn
\else:
\exp_after:wN \use_ii:nn
@@ -2856,6 +2884,7 @@
}
\cs_generate_variant:Nn \tl_head:n { V , v , f }
\cs_new:Npn \tl_head:w #1#2 \q_stop {#1}
+\cs_new:Npn \@@_tl_head:w #1#2 \s_@@_stop {#1}
\cs_new:Npn \tl_head:N { \exp_args:No \tl_head:n }
% \end{macrocode}
% To correctly leave the tail of a token list, it's important \emph{not} to
@@ -2923,7 +2952,7 @@
\tl_if_head_is_N_type:nTF { #1 ? }
{
\exp_after:wN \exp_not:N
- \tl_head:w #1 { ? \use_none:nn } \q_stop
+ \@@_tl_head:w #1 { ? \use_none:nn } \s_@@_stop
}
{ \str_head:n {#1} }
\prg_return_true:
@@ -2950,7 +2979,7 @@
\tl_if_head_is_N_type:nTF { #1 ? }
{
\exp_after:wN \exp_not:N
- \tl_head:w #1 { ? \use_none:nn } \q_stop
+ \@@_tl_head:w #1 { ? \use_none:nn } \s_@@_stop
}
{
\tl_if_head_is_group:nTF {#1}
@@ -2986,7 +3015,7 @@
\cs_new:Npn \@@_if_head_eq_meaning_normal:nN #1 #2
{
\exp_after:wN \if_meaning:w
- \tl_head:w #1 { ?? \use_none:nnn } \q_stop #2
+ \@@_tl_head:w #1 { ?? \use_none:nnn } \s_@@_stop #2
\prg_return_true:
\else:
\prg_return_false:
@@ -3109,7 +3138,7 @@
% \begin{macro}{\@@_item_aux:nn, \@@_item:nn}
% The idea here is to find the offset of the item from the left, then use
% a loop to grab the correct item. If the resulting offset is too large,
-% then \cs{quark_if_recursion_tail_stop:n} terminates the loop, and returns
+% then \cs{@@_if_recursion_tail_break:nN} terminates the loop, and returns
% nothing at all.
% \begin{macrocode}
\cs_new:Npn \tl_item:nn #1#2
@@ -3117,7 +3146,7 @@
\exp_args:Nf \@@_item:nn
{ \exp_args:Nf \@@_item_aux:nn { \int_eval:n {#2} } {#1} }
#1
- \q_recursion_tail
+ \q_@@_recursion_tail
\prg_break_point:
}
\cs_new:Npn \@@_item_aux:nn #1#2
@@ -3128,7 +3157,7 @@
}
\cs_new:Npn \@@_item:nn #1#2
{
- \quark_if_recursion_tail_break:nN {#2} \prg_break:
+ \@@_if_recursion_tail_break:nN {#2} \prg_break:
\int_compare:nNnTF {#1} = 1
{ \prg_break:n { \exp_not:n {#2} } }
{ \exp_args:Nf \@@_item:nn { \int_eval:n { #1 - 1 } } }
@@ -3331,7 +3360,7 @@
{ \iow_wrap:nnnN { >~ \tl_to_str:n {#1} . } { } { } \@@_show:n }
\cs_new_protected:Npn \@@_show:n #1
{
- \tl_set:Nf \l_@@_internal_a_tl { \@@_show:w #1 \q_stop }
+ \tl_set:Nf \l_@@_internal_a_tl { \@@_show:w #1 \s_@@_stop }
\__kernel_iow_with:Nnn \tex_newlinechar:D { 10 }
{
\__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 }
@@ -3341,7 +3370,7 @@
}
}
}
-\cs_new:Npn \@@_show:w #1 > #2 . \q_stop {#2}
+\cs_new:Npn \@@_show:w #1 > #2 . \s_@@_stop {#2}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3355,6 +3384,18 @@
% \end{macrocode}
% \end{macro}
%
+% \subsection{Internal scan marks}
+%
+% \begin{variable}{\s_@@_nil,\s_@@_mark,\s_@@_stop}
+% Internal scan marks. These are defined here at the end because the
+% code for \cs{scan_new:N} depends on some \pkg{l3tl} functions.
+% \begin{macrocode}
+\scan_new:N \s_@@_nil
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Scratch token lists}
%
% \begin{variable}{\g_tmpa_tl, \g_tmpb_tl}
diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx
index 61565b47c0..0608820bba 100644
--- a/macros/latex/contrib/l3kernel/l3token.dtx
+++ b/macros/latex/contrib/l3kernel/l3token.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
@@ -1101,6 +1101,29 @@
%<@@=char>
% \end{macrocode}
%
+% \subsection{Internal auxiliaries}
+%
+% \begin{variable}{\s_@@_stop}
+% Internal scan mark.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\q_@@_no_value}
+% Internal recursion quarks.
+% \begin{macrocode}
+\quark_new:N \q_@@_no_value
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[pTF]{\@@_quark_if_no_value:N}
+% Functions to query recursion quarks.
+% \begin{macrocode}
+\__kernel_quark_new_conditional:Nn \@@_quark_if_no_value:N { TF }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Manipulating and interrogating character tokens}
%
% \begin{macro}{\char_set_catcode:nn}
@@ -1667,12 +1690,12 @@
\exp_after:wN \exp_after:wN \exp_after:wN \@@_to_nfd:Nw
\exp_after:wN \exp_after:wN \exp_after:wN #1
\cs:w c_@@_nfd_ \token_to_str:N #1 _ tl \cs_end:
- \q_stop
+ \s_@@_stop
}
{ \exp_not:n {#1} }
}
\cs_set_eq:NN \@@_to_nfd:n \char_to_nfd:N
-\cs_new:Npn \@@_to_nfd:Nw #1#2#3 \q_stop
+\cs_new:Npn \@@_to_nfd:Nw #1#2#3 \s_@@_stop
{
\exp_args:Ne \@@_to_nfd:n
{ \char_generate:nn { `#2 } { \@@_change_case_catcode:N #1 } }
@@ -1744,13 +1767,13 @@
{ \char_generate:nn {#1} { \@@_change_case_catcode:N #2 } }
}
\cs_new:Npn \@@_change_case_multi:nN #1#2
- { \@@_change_case_multi:NNNNw #2 #1 \q_no_value \q_no_value \q_stop }
+ { \@@_change_case_multi:NNNNw #2 #1 \q_@@_no_value \q_@@_no_value \s_@@_stop }
\cs_generate_variant:Nn \@@_change_case_multi:nN { v }
-\cs_new:Npn \@@_change_case_multi:NNNNw #1#2#3#4#5 \q_stop
+\cs_new:Npn \@@_change_case_multi:NNNNw #1#2#3#4#5 \s_@@_stop
{
- \quark_if_no_value:NTF #4
+ \@@_quark_if_no_value:NTF #4
{
- \quark_if_no_value:NTF #3
+ \@@_quark_if_no_value:NTF #3
{ \@@_change_case:NN #1 #2 }
{ \@@_change_case:NNN #1 #2#3 }
}
@@ -1865,6 +1888,13 @@
%<@@=token>
% \end{macrocode}
%
+% \begin{variable}{\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
% \begin{macro}{\token_to_meaning:N, \token_to_meaning:c}
% \begin{macro}{\token_to_str:N, \token_to_str:c}
% These are all defined in \pkg{l3basics}, as they are needed
@@ -2136,10 +2166,10 @@
{
\exp_not:N \exp_after:wN \exp_not:N \@@_if_macro_p:w
\exp_not:N \token_to_meaning:N ##1 \tl_to_str:n { ma : }
- \exp_not:N \q_stop
+ \s_@@_stop
}
\cs_new:Npn \exp_not:N \@@_if_macro_p:w
- ##1 \tl_to_str:n { ma } ##2 \c_colon_str ##3 \exp_not:N \q_stop
+ ##1 \tl_to_str:n { ma } ##2 \c_colon_str ##3 \s_@@_stop
}
{
\str_if_eq:nnTF { #2 } { cro }
@@ -2200,7 +2230,7 @@
% conditionals which detect whether the \tn{meaning} of their
% argument begins with a particular string. Each auxiliary takes an
% argument delimited by a string, a second one delimited by
-% \cs{q_stop}, and returns the first one and its delimiter.
+% \cs{s_@@_stop}, and returns the first one and its delimiter.
% This result is eventually compared to another string.
% \begin{macrocode}
\group_begin:
@@ -2209,7 +2239,7 @@
\use:x
{
\cs_new:Npn \exp_not:c { @@_delimit_by_ #1 :w }
- ####1 \tl_to_str:n {#1} ####2 \exp_not:N \q_stop
+ ####1 \tl_to_str:n {#1} ####2 \s_@@_stop
{ ####1 \tl_to_str:n {#1} }
}
}
@@ -2297,7 +2327,7 @@
\exp_not:N \exp_after:wN
\exp_not:c { @@_delimit_by_ #2 :w }
\exp_not:N \token_to_meaning:N ####1
- ? \tl_to_str:n {#2} \exp_not:N \q_stop
+ ? \tl_to_str:n {#2} \s_@@_stop
}
{ \exp_not:n {#3} }
{ \exp_not:N \prg_return_true: }
@@ -2356,7 +2386,7 @@
% nonexistent depending on \tn{endlinechar}), and takes care
% of three of the exceptions: \tn{space}, \tn{italiccorr}
% and \tn{hyphen}, whose meaning is at most two characters.
-% This leaves a string terminated by some |:|, and \cs{q_stop}.
+% This leaves a string terminated by some |:|, and \cs{s_@@_stop}.
%
% The meaning of each one of the five \tn[no-index]{...mark} primitives
% has the form \meta{letters}|:|\meta{user material}. In other words,
@@ -2389,17 +2419,17 @@
{
\exp_not:N \exp_after:wN \exp_not:N \@@_if_primitive:NNw
\exp_not:N \token_to_meaning:N ##1
- \tl_to_str:n { : : : } \exp_not:N \q_stop ##1
+ \tl_to_str:n { : : : } \s_@@_stop ##1
}
}
\cs_new:Npn \exp_not:N \@@_if_primitive:NNw
- ##1##2 ##3 \c_colon_str ##4 \exp_not:N \q_stop
+ ##1##2 ##3 \c_colon_str ##4 \s_@@_stop
{
\exp_not:N \tl_if_empty:oTF
{ \exp_not:N \@@_if_primitive_space:w ##3 ~ }
{
\exp_not:N \@@_if_primitive_loop:N ##3
- \c_colon_str \exp_not:N \q_stop
+ \c_colon_str \s_@@_stop
}
{ \exp_not:N \@@_if_primitive_nullfont:N }
}
@@ -2422,7 +2452,7 @@
\exp_after:wN \@@_if_primitive_loop:N
\fi:
}
-\cs_new:Npn \@@_if_primitive:Nw #1 #2 \q_stop
+\cs_new:Npn \@@_if_primitive:Nw #1 #2 \s_@@_stop
{
\if:w : #1
\exp_after:wN \@@_if_primitive_undefined:N
@@ -2497,6 +2527,21 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\s_@@_mark,\s_@@_stop}
+% Internal scan marks.
+% \begin{macrocode}
+\scan_new:N \s_@@_mark
+\scan_new:N \s_@@_stop
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_use_none_delimit_by_s_stop:w}
+% Functions to gobble up to a scan mark.
+% \begin{macrocode}
+\cs_new:Npn \@@_use_none_delimit_by_s_stop:w #1 \s_@@_stop { }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\peek_after:Nw}
% \begin{macro}{\peek_gafter:Nw}
% Simple wrappers for \tn{futurelet}: no arguments absorbed
@@ -2759,7 +2804,7 @@
% \texttt{true} branch, we must detect outer tokens, without impacting
% performance too much for non-outer tokens. The first filter is to
% search for \texttt{outer} in the \tn{meaning} of \cs{l_peek_token}.
-% If that is absent, \cs{use_none_delimit_by_q_stop:w} cleans up, and
+% If that is absent, \cs{@@_use_none_delimit_by_s_stop:w} cleans up, and
% we call \cs{@@_true:w}. Otherwise, the token can be a non-outer
% macro or a primitive mark whose parameter or replacement text
% contains \texttt{outer}, it can be the primitive \tn{outer}, or it
@@ -2772,7 +2817,7 @@
% \cs{@@_token_generic:NNTF} function.
% \begin{macrocode}
\group_begin:
- \cs_set_protected:Npn \@@_tmp:w #1 \q_stop
+ \cs_set_protected:Npn \@@_tmp:w #1 \s_@@_stop
{
\cs_new_protected:Npn \@@_execute_branches_N_type:
{
@@ -2783,18 +2828,18 @@
1 \exp_stop_f:
\exp_after:wN \@@_N_type:w
\token_to_meaning:N \l_peek_token
- \q_mark \@@_N_type_aux:nnw
- #1 \q_mark \use_none_delimit_by_q_stop:w
- \q_stop
+ \s_@@_mark \@@_N_type_aux:nnw
+ #1 \s_@@_mark \@@_use_none_delimit_by_s_stop:w
+ \s_@@_stop
\exp_after:wN \@@_true:w
\else:
\exp_after:wN \@@_false:w
\fi:
}
- \cs_new_protected:Npn \@@_N_type:w ##1 #1 ##2 \q_mark ##3
+ \cs_new_protected:Npn \@@_N_type:w ##1 #1 ##2 \s_@@_mark ##3
{ ##3 {##1} {##2} }
}
- \exp_after:wN \@@_tmp:w \tl_to_str:n { outer } \q_stop
+ \exp_after:wN \@@_tmp:w \tl_to_str:n { outer } \s_@@_stop
\group_end:
\cs_new_protected:Npn \@@_N_type_aux:nnw #1 #2 #3 \fi:
{
diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx
index 346f310a93..bc0466eeca 100644
--- a/macros/latex/contrib/l3kernel/l3unicode.dtx
+++ b/macros/latex/contrib/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-05-05}
+% \date{Released 2020-05-11}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf
index efdf8a34ec..21358a14f7 100644
--- a/macros/latex/contrib/l3kernel/source3.pdf
+++ b/macros/latex/contrib/l3kernel/source3.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex
index 27cfc97124..91b33318e5 100644
--- a/macros/latex/contrib/l3kernel/source3.tex
+++ b/macros/latex/contrib/l3kernel/source3.tex
@@ -53,7 +53,7 @@ for those people who are interested.
{latex-team@latex-project.org}%
}%
}
-\date{Released 2020-05-05}
+\date{Released 2020-05-11}
\pagenumbering{roman}
\maketitle
diff --git a/macros/latex/contrib/l3kernel/source3body.tex b/macros/latex/contrib/l3kernel/source3body.tex
index 4edd3d5b6c..83203e6427 100644
--- a/macros/latex/contrib/l3kernel/source3body.tex
+++ b/macros/latex/contrib/l3kernel/source3body.tex
@@ -436,10 +436,10 @@ used on top of \LaTeXe{} if \cs{outer} tokens are used in the arguments.
\ExplSyntaxOff
\DocInput{l3basics.dtx}
\DocInput{l3expan.dtx}
+\DocInput{l3quark.dtx}
\DocInput{l3tl.dtx}
\DocInput{l3str.dtx}
\DocInput{l3str-convert.dtx}
-\DocInput{l3quark.dtx}
\DocInput{l3seq.dtx}
\DocInput{l3int.dtx}
\DocInput{l3flag.dtx}
diff --git a/macros/latex/contrib/longdivision/README.md b/macros/latex/contrib/longdivision/README.md
index e459c12ca8..db6a6469aa 100644
--- a/macros/latex/contrib/longdivision/README.md
+++ b/macros/latex/contrib/longdivision/README.md
@@ -1,8 +1,8 @@
-longdivision v1.1.0
+longdivision v1.2.0
========================
Author: Hood Chatham
Email: hood@mit.edu
-Date: 2019-03-24
+Date: 2020-05-09
Description:
License: All files have the Latex Project Public License.
Files:
@@ -29,7 +29,11 @@ longdiv.tex, though I think \intlongdivision looks better, and it can handle
much larger dividends and divisors (the dividend is only constrained by the
size of the page, and the divisor can be up to 8 digits long).
-See the package manual for more information.
+See the package manual for more information. To compile the manual, you need
+the file pgfmanual-en-macros.tex from the tikz manual. I am not allowed to
+include this file on the CTAN repositiory due to rules against file duplication,
+but you can find it on github:
+https://github.com/hoodmane/longdivision/blob/master/pgfmanual-en-macros.tex
Email me at hood@mit.edu to submit bug reports, request new features, etc.
The current development copy is hosted at https://github.com/hoodmane/longdivision.
@@ -38,16 +42,31 @@ The current development copy is hosted at https://github.com/hoodmane/longdivisi
Changelog:
==========
-## [1.1.0] (2018-10-08)
+## [1.2.0] (2020-05-09)
+### Added:
+- An option to control the decimal separator
+- Options to specify "digit separator" and "digit group length"
+- A "separators in work" option to put spaces rather than punctuation in the work
+- Change the division sign in "german style" long division
+
### Fixed:
-- If the "\longdivision" command is in math mode, the numbers are typeset in math mode too (reported by Yu-Tsiang Tai).
-- The "\longdivision" command now can handle macros as arguments (as suggested by Mike Jenck).
+- Math mode usage used to be inconsistent. Now if not used in math mode,
+ typesetting is consistently not in math mode, if used in math mode it is
+ consistently in math mode.
+- Major improvements to typesetting engine should allow changes in the future to be less painful.
+- A few deprecated expl3 commands have been replaced (thanks to a pull request from Phelype Oleinik).
+
+## [1.1.0] (2018-10-08)
### Added:
- Multiple typesetting styles
- Multiple styles for indicating a repeating decimal
- Typesetting partial long division (as suggested by Cameron McLeman).
+### Fixed:
+- If the "\longdivision" command is in math mode, the numbers are typeset in math mode too (reported by Yu-Tsiang Tai).
+- The "\longdivision" command now can handle macros as arguments (as suggested by Mike Jenck).
+
## [1.0.0] (2017-02-05)
diff --git a/macros/latex/contrib/longdivision/longdivision.sty b/macros/latex/contrib/longdivision/longdivision.sty
index 98349704fe..d749bab70e 100644
--- a/macros/latex/contrib/longdivision/longdivision.sty
+++ b/macros/latex/contrib/longdivision/longdivision.sty
@@ -1,7 +1,7 @@
-%% Package: longdivision.sty version 1.0
+%% Package: longdivision.sty version 1.2.0
%% Author: Hood Chatham
%% Email: hood@mit.edu
-%% Date: 2/5/2017
+%% Date: 2020-05-09
%% License: Latex Project Public License
@@ -10,18 +10,23 @@
\ExplSyntaxOn
-
+%
% Core registers
+%
\bool_new:N \l__longdiv_mathmode_bool
-\bool_new:N \l_longdiv_repeating_decimal_bool
\bool_new:N \l__longdiv_added_point_bool
\bool_new:N \l__longdiv_seen_point_bool
\bool_new:N \l__longdiv_seen_digit_bool
\bool_new:N \l__longdiv_stopped_early_stage_bool
\int_new:N \l__longdiv_quotient_int
\int_new:N \l__longdiv_position_int
-\int_new:N \l__longdiv_point_digit_int
-\int_new:N \l__longdiv_repeat_digit_int
+\int_new:N \l__longdiv_point_digit_dividend_int
+\int_new:N \l__longdiv_point_digit_quotient_int
+\int_new:N \l__longdiv_repeat_digit_int % How many digits after the decimal point does repitition start (so in 1/9 will be 0)
+\int_set:Nn \l__longdiv_repeat_digit_int { 100 }
+\int_new:N \l__longdiv_digit_group_length
+
+\int_set:Nn \l__longdiv_digit_group_length 3
\dim_new:N \g__longdiv_temp_dim % For measuring the distance to the right side of digits
@@ -36,29 +41,100 @@
\int_const:Nn \c__longdiv_max_display_divisions_int { 20 }
\int_new:N \l__longdiv_display_divisions_int
+\tl_new:N \l__longdiv_remainder_tl
+\tl_new:N \l__longdiv_divisor_tl
+\tl_new:N \l__longdiv_dividend_tl
+\tl_new:N \l__longdiv_quotient_tl
+
+%
% Key-value arguments
+%
\cs_new:Npn \longdivisionkeys #1 { \keys_set:nn { longdivision } { #1 } }
\keys_define:nn { longdivision }
{
stage .int_set:N = \l__longdiv_digits_requested_int,
- max~extra~digits .int_set:N = \l__longdiv_max_extra_digits_int,
+ max ~ extra ~ digits .int_set:N = \l__longdiv_max_extra_digits_int,
unknown .code:n = {
- %\def\temp{#1}\show\temp
- \int_set:Nn \l__longdiv_max_extra_digits_int { \l_keys_key_tl }
- }
+ \longdiv_if_int:nTF {\tl_use:N \l_keys_key_tl}{
+ \int_set:Nn \l__longdiv_max_extra_digits_int { \l_keys_key_tl }
+ }{
+ \msg_error:nnx { longdivision } { unknown_key } { \tl_use:N \l_keys_key_tl }
+ }
+ },
+ german ~ division ~ sign .code:n = {
+ \cs_set:Nn \longdiv_german_division_sign: { #1 }
+ },
+ decimal ~ separator .code:n = {
+ \tl_if_single:nTF { #1 } {
+ \longdiv_if_digit:nTF { #1 } {
+ \msg_error:nnn { longdivision } { decimal_separator_is_digit } { #1 }
+ } {
+ \cs_set:Nn \longdiv_decimal_separator: { #1 }
+ }
+ }{
+ \msg_error:nnn { longdivision } { decimal_separator_not_single } { #1 }
+ }
+ },
+ digit ~ separator .code:n = {
+ \cs_if_exist_use:cF { longdiv_digit_separator ~ \detokenize{#1} }{
+ \cs_set_protected:Nn \longdiv_digit_separator: { #1 }
+ }
+ },
+ digit ~ group ~ length .int_set:N = \l__longdiv_digit_group_length,
+ separators ~ in ~ work .bool_set:N = \l__longdiv_separators_in_work_bool
+}
+
+\cs_set:cpn { longdiv_digit_separator ~ _ }{
+ \cs_set_protected:Nn \longdiv_digit_separator: { \texttt{\detokenize{_}} }
+}
+
+% We want to test for decimal separator later with \ifx / \token_if_eq_meaning:NN so we use \let to define the decimal separator.
+% The digit separator is only important currently in the output, so we can use \def for that.
+% TODO: ignore digit separator in input.
+\cs_new:Nn \longdiv_decimal_separator: { . }
+\cs_new:Nn \longdiv_digit_separator: { }
+\bool_set_true:N \l__longdiv_separators_in_work_bool
+
+
+\newcount\longdiv@tempcount
+\cs_new:Npn \longdiv_if_int:nTF #1 {
+ \afterassignment \longdiv_checkint_aux:w
+ % Why would I use $$ as a delimiter? Needs to be unexpandable and unlikely to show up in #1.
+ % I think \relax / \scan_stop: doesn't work because \int_eval:w will absorb a relax.
+ \longdiv@tempcount = \int_eval:w 0 #1 $$
+}
+
+\cs_new:Npn \longdiv_checkint_aux:w #1 $$ { % Picked up down here
+ \tl_if_empty:nTF { #1 }
}
\cs_new:Nn \longdiv_register_repeating_decimal_style_choices:n {
\keys_define:nn { longdivision } {
- repeating~decimal~style .choices:nn =
+ repeating ~ decimal ~ style .choices:nn =
{ #1 }
{
- \cs_set_eq:Nc \longdiv_linkedlist_indicate_repeating_decimal:n { longdiv_linkedlist_indicate_repeating_decimal_##1:n }
+ \cs_set_eq:Nc \longdiv_indicate_repeating_decimal:n { longdiv_indicate_repeating_decimal_##1:n }
+ \cs_if_exist:cT { longdiv_indicate_repeating_decimal_ ##1 _skip_begin: } {
+ \cs_set_eq:Nc \longdiv_indicate_repeating_decimal_skip_begin: { longdiv_indicate_repeating_decimal_ ##1 _skip_begin: }
+ }
+ \cs_if_exist:cT { longdiv_indicate_repeating_decimal_ ##1 _skip_end: } {
+ \cs_set_eq:Nc \longdiv_indicate_repeating_decimal_skip_end: { longdiv_indicate_repeating_decimal_ ##1 _skip_end: }
+ }
}
}
}
+% In the annoying and ugly "parentheses" repeating decimal setting, the repeating indicators take up space.
+% \longdiv_indicate_repeating_decimal_skip_begin: and \longdiv_indicate_repeating_decimal_skip_end: are supposed to measure the amount
+% of space taken up. For all the other settings, they are just empty.
+\cs_new:Nn \longdiv_indicate_repeating_decimal_skip_begin: { }
+\cs_new:Nn \longdiv_indicate_repeating_decimal_skip_end: { }
+% This is a no-op except in the parentheses setting.
+\cs_new:Nn \longdiv_indicate_repeating_decimal_phantom:n { \longdiv_indicate_repeating_decimal_skip_begin: #1 \longdiv_indicate_repeating_decimal_skip_end: }
+\cs_new:Nn \longdiv_indicate_repeating_decimal_dividend:n { \longdiv_indicate_repeating_decimal_phantom:n { #1 } }
+\cs_new:Nn \longdiv_indicate_repeating_decimal_quotient:n { \longdiv_indicate_repeating_decimal:n { #1 } }
+
\cs_new:Nn \longdiv_register_style_choices:n {
\keys_define:nn { longdivision } {
style .choices:nn =
@@ -76,80 +152,108 @@
\cs_new:cpn { longdiv_typeset_main_ #1 :} { #2 }
\longdiv_register_style_choices:n { #1 }
}
-\let \longdivdefinestyle \longdiv_define_style:nn
+\let \longdivisiondefinestyle \longdiv_define_style:nn
-%%
-%% The linked list
-%%
-% This token list just stores a reference to the first entry in the linked list
-\tl_new:N \l__longdiv_linkedlist_tl
-\tl_set:Nn\l__longdiv_linkedlist_tl { \longdiv_linkedlist_next:n { 0 } }
-\int_new:N \l__longdiv_linkedlist_length_int
+% Errors:
+\group_begin:
+\char_set_catcode_space:N\ % Using ~ in the messages is annoying, so let's restore the catcode of space for the meantime
+\msg_new:nnn {longdivision} {dividend_invalid} {Dividend '#1' is invalid (\msg_line_context:).}
+\msg_new:nnn {longdivision} {divisor_too_large}
+ {Divisor '#2' is too large (\msg_line_context:). It has \tl_count:n {#2} digits, but divisors can be at most 9 digits long.}
+\msg_new:nnn {longdivision} {divisor_not_int} {Divisor '#2' is not an integer (\msg_line_context:).}
+\msg_new:nnn {longdivision} {divisor_invalid} {Divisor '#2' is invalid (\msg_line_context:).}
+\msg_new:nnn {longdivision} {unknown_key} {Unknown key '#1'. (\msg_line_context:).}
+\msg_new:nnn {longdivision} {decimal_separator_not_single} {Decimal separator '#1' should be a single token. (\msg_line_context:).}
+\msg_new:nnn {longdivision} {decimal_separator_is_digit} {Decimal separator '#1' is a digit which is not allowed. (\msg_line_context:).}
-% Set the next entry to be a no-op so that when expanded the last "null pointer" just disappears
-\cs_new:Nn \longdiv_linkedlist_set_next_do_nothing: {
- \cs_set_eq:cN { longdiv_linkedlist ~ \int_use:N \l__longdiv_linkedlist_length_int } \prg_do_nothing:
-}
-\longdiv_linkedlist_set_next_do_nothing:
+% Warnings:
+\msg_new:nnn {longdivision} {work_stopped_early} {The work display stopped early to avoid running off the page (\msg_line_context:).}
+\msg_new:nnn {longdivision} {division_stopped_early} {The division stopped early to avoid running off the page (\msg_line_context:).}
+\msg_new:nnn {longdivision} {no_division_occurred}
+ {Either the dividend was zero or you used \token_to_str:N \intlongdiv \space and the dividend was ~less than the divisor. ~
+ This isn't a big deal, but the result probably looks silly.}
+\msg_new:nnn {longdivision} {no_tikz} {You requested "style~=~tikz" but tikz has not been loaded. Falling back to "style~=~standard".}
+\group_end:
-% "pointer" to next element (argument is the element's id)
-\cs_new:Nn \longdiv_linkedlist_next:n { \use:c { longdiv_linkedlist ~ #1 } }
-\cs_new:Nn \longdiv_linkedlist_add:n {
- \cs_set:cpx { longdiv_linkedlist ~ \int_use:N \l__longdiv_linkedlist_length_int}{
- \exp_not:n{ \longdiv_linkedlist_element:n { #1 } } \exp_not:N \longdiv_linkedlist_next:n { \int_eval:n { \l__longdiv_linkedlist_length_int + 1} }
- }
- \int_incr:N \l__longdiv_linkedlist_length_int
- \longdiv_linkedlist_set_next_do_nothing:
-}
-\cs_new_eq:NN \longdiv_linkedlist_element:n \use:n
-\cs_generate_variant:Nn \longdiv_linkedlist_add:n { f }
-% The easy implementation of remove_tail and the \longdiv_linkedlist_indicate_repeating_decimal commands is why I chose the "linked list" format.
-% Delete last element of list.
-\cs_new:Nn \longdiv_linkedlist_remove_tail: {
- \int_decr:N \l__longdiv_linkedlist_length_int
- \longdiv_linkedlist_set_next_do_nothing:
-}
%%
%% Entry points
%%
-% \tl_rescan to ignore spaces in input.
\NewDocumentCommand \longdivision { omm } {
\group_begin:
\IfNoValueF { #1 } {
\keys_set:nn { longdivision } { #1 }
}
- \tl_rescan:nn { \ExplSyntaxOn } { \longdiv_start:xx { #2 } { #3 } }
+ \longdiv_start:xx { #2 } { #3 }
\group_end:
}
-% Same as \longdiv[0]{#1}{#2}.
+% Same as \longdiv[options, 0]{#1}{#2}.
\NewDocumentCommand \intlongdivision { omm } {
\group_begin:
\IfNoValueF { #1 } {
\keys_set:nn { longdivision } { #1 }
}
\int_set:Nn \l__longdiv_max_extra_digits_int { 0 }
- \tl_rescan:nn { \ExplSyntaxOn } { \longdiv_start:xx { #2 } { #3 } }
+ \longdiv_start:xx { #2 } { #3 }
\group_end:
}
+\cs_generate_variant:Nn \tl_remove_all:Nn { No }
+
+% We need \longdiv_decimal_separator: to be \def'd so that we can expand it for use with tl_remove_all (in prepare_dividend)
+% but we also want to test for the decimal separator with \token_if_eq_meaning:NN (in \longdiv_if_token_is_decimal_separator:N)
+\cs_new:Nn \longdiv_store_decimal_separator_token: {
+ \exp_last_unbraced:NNo \cs_set_eq:NN \longdiv_decimal_separator_token: \longdiv_decimal_separator:
+}
+
+\cs_new:Nn \longdiv_start:nn {
+ \longdiv_store_decimal_separator_token:
+ \tl_set:Nn \l_tmpa_tl {#1}
+ \tl_set:Nn \l_tmpb_tl {#2}
+ % Remove spaces from arguments (we used to do this by setting space to ignore and using \tl_rescan but that is a bit gauche).
+ \tl_remove_all:Nn \l_tmpa_tl { ~ }
+ \tl_remove_all:Nn \l_tmpb_tl { ~ }
+ % TODO: Remove digit separators from inputs (dummied out because I didn't feel like handling _ case)
+ % \tl_if_empty:oF \longdiv_digit_separator: {
+ % \tl_remove_all:No \l_tmpa_tl { \longdiv_digit_separator: }
+ % \tl_remove_all:No \l_tmpb_tl { \longdiv_digit_separator: }
+ % }
+ \longdiv_add_leading_zero_if_necessary:N \l_tmpa_tl
+
+ \longdiv_start_i:xx
+ { \tl_use:N \l_tmpa_tl }
+ { \tl_use:N \l_tmpb_tl }
+}
+\cs_generate_variant:Nn \longdiv_start:nn { xx }
+
+
+\cs_generate_variant:Nn \tl_if_eq:nnT { xnT }
+\cs_new:Nn \longdiv_add_leading_zero_if_necessary:N {
+ \tl_if_eq:xnT { \tl_head:N { #1 } } { . } {
+ \tl_put_left:Nn \l_tmpa_tl { 0 }
+ }
+}
+
% Check input is valid then enter main loop.
% We use \int_eval:w to ensure that the dividend has no unnecessary leading zeroes and doesn't begin with a decimal point.
% Note that \int_eval:n wouldn't work here because it inserts a "\relax" token that would not get eaten by \numexpr if
% #1 contains a decimal point. This "\relax" causes trouble for the division main loop.
-\cs_new:Nn \longdiv_start:nn {
- \longdiv_check_dividend:n { #1 }
+\cs_new:Nn \longdiv_start_i:nn {
+ \longdiv_if_decimal_number:nF { #1 } {
+ \longdiv_error:nwnn { dividend_invalid }
+ }
\longdiv_check_divisor:n { #2 }
- % Second copy of #1 is eaten by \longdiv_typeset:nnn to print the dividend
- \exp_args:Nnnff \longdiv_get_new_digit:nnn { } { #2 } { \int_eval:w 0#1 } { \int_eval:w 0#1 }
+ \tl_set:Nn \l__longdiv_dividend_tl { #1 }
+ \tl_set:Nn \l__longdiv_divisor_tl { #2 }
+ \longdiv_get_new_digit:nnn { } { #2 } { #1 }
\longdiv_break_point: { #1 } { #2 }
}
-\cs_generate_variant:Nn \longdiv_start:nn { xx }
+\cs_generate_variant:Nn \longdiv_start_i:nn { xx }
\cs_new_eq:NN \longdiv_break_point: \use_none:nn
@@ -157,42 +261,70 @@
%% Input checkers
%%
+\prg_new_conditional:Nnn \longdiv_if_token_is_decimal_separator:N { TF } {
+ \token_if_eq_meaning:NNTF #1 \longdiv_decimal_separator_token: {
+ \prg_return_true:
+ }{
+ \prg_return_false:
+ }
+}
+
+
% Parse through the dividend token by token
% Check that every token is a digit with the exception of at most one .
-\cs_new:Nn \longdiv_check_dividend:n {
- \longdiv_check_dividend_before_point:N #1 \q_stop
+\prg_new_conditional:Nnn \longdiv_if_decimal_number:n { F } {
+ \longdiv_if_decimal_number_before_point:N #1 \q_stop
}
-\cs_new:Nn \longdiv_check_dividend_before_point:N {
- \token_if_eq_meaning:NNF #1 \q_stop {
- \token_if_eq_meaning:NNTF #1 . {
- \longdiv_check_dividend_seen_point:N
+\cs_new:Nn \longdiv_if_decimal_number_before_point:N {
+ \token_if_eq_meaning:NNTF #1 \q_stop {
+ \prg_return_true:
+ }{
+ \longdiv_if_token_is_decimal_separator:NTF #1 {
+ \longdiv_if_decimal_number_seen_point:N
}{
- \longdiv_check_dividend_isdigit:N #1
- \longdiv_check_dividend_before_point:N
+ \longdiv_if_digit:nF { #1 }{
+ \prg_return_false:
+ \use_none_delimit_by_q_stop:w
+ }
+ \longdiv_if_decimal_number_before_point:N
}
}
}
-\cs_new:Nn \longdiv_check_dividend_seen_point:N {
- \token_if_eq_meaning:NNF #1 \q_stop {
- \longdiv_check_dividend_isdigit:N #1
- \longdiv_check_dividend_seen_point:N
+\cs_new:Nn \longdiv_if_decimal_number_seen_point:N {
+ \token_if_eq_meaning:NNTF #1 \q_stop {
+ \prg_return_true:
+ }{
+ \longdiv_if_digit:nF { #1 }{
+ \prg_return_false:
+ \use_none_delimit_by_q_stop:w
+ }
+ \longdiv_if_decimal_number_seen_point:N
}
}
-\cs_new:Nn \longdiv_check_dividend_isdigit:N {
- \bool_if:nF { \token_if_eq_meaning_p:NN #1 0
- || \token_if_eq_meaning_p:NN #1 1 || \token_if_eq_meaning_p:NN #1 2 || \token_if_eq_meaning_p:NN #1 3
- || \token_if_eq_meaning_p:NN #1 4 || \token_if_eq_meaning_p:NN #1 5 || \token_if_eq_meaning_p:NN #1 6
- || \token_if_eq_meaning_p:NN #1 7 || \token_if_eq_meaning_p:NN #1 8 || \token_if_eq_meaning_p:NN #1 9
- }{
- \longdiv_error:nwnn { dividend_invalid }
- }
+\prg_new_conditional:Nnn \longdiv_if_digit:n { T, F, TF, p } {
+ \bool_lazy_and:nnTF
+ { \tl_if_single_p:n { #1 } }
+ {\bool_lazy_any_p:n{
+ { \token_if_eq_meaning_p:NN #1 0 }
+ { \token_if_eq_meaning_p:NN #1 1 }
+ { \token_if_eq_meaning_p:NN #1 2 }
+ { \token_if_eq_meaning_p:NN #1 3 }
+ { \token_if_eq_meaning_p:NN #1 4 }
+ { \token_if_eq_meaning_p:NN #1 5 }
+ { \token_if_eq_meaning_p:NN #1 6 }
+ { \token_if_eq_meaning_p:NN #1 7 }
+ { \token_if_eq_meaning_p:NN #1 8 }
+ { \token_if_eq_meaning_p:NN #1 9 }
+ }}
+ { \prg_return_true: }
+ { \prg_return_false: }
}
% Check that there is no ., that it is at most 8 digits, and that the entire argument can get assigned to a count variable
-% There's no way to do this last check in expl3, so I use plaintex \newcount, \afterassignment, and \l__longdiv_temp_int =.
+% There's no slick way to do this last check in expl3, so I use plaintex \newcount, \afterassignment, and \l__longdiv_temp_int =.
\newcount \l__longdiv_temp_int
\cs_new:Nn \longdiv_check_divisor:n {
\tl_if_in:nnT { #1 } { . } {
@@ -200,7 +332,7 @@
}
% We have to do the length check before the "validity" check because the "validity" check makes an assignment
% which throws a low level error if the number to be assigned is too large.
- \int_compare:nNnF { \tl_count:n { #1 } } < \c_nine {
+ \int_compare:nNnF { \tl_count:n { #1 } } < 9 {
\longdiv_error:nwnn { divisor_too_large }
}
% Idea here: if #1 is a valid number, \l__longdiv_temp_int = 0#1 will absorb all of it.
@@ -215,7 +347,7 @@
\tl_if_empty:nF { #1 } {
\longdiv_error:nwnn { divisor_invalid }
}
- \int_compare:nNnT \l__longdiv_temp_int = \c_zero {
+ \int_compare:nNnT \l__longdiv_temp_int = \c_zero_int {
\longdiv_error:nwnn { divisor_zero }
}
}
@@ -225,22 +357,6 @@
\msg_error:nnnn { longdivision } { #1 }
}
-% Errors:
-\msg_new:nnn { longdivision } { dividend_invalid } { Dividend ~ '#1' ~ is ~ invalid ~ (\msg_line_context:).}
-\msg_new:nnn { longdivision } { divisor_too_large }
- { Divisor ~ '#2' ~ is ~ too ~ large ~ (\msg_line_context:). ~ It ~ has ~ \tl_count:n { #2 } ~ digits, ~ but ~ divisors ~ can ~ be ~ at ~ most ~ 9 ~ digits ~ long. }
-\msg_new:nnn { longdivision } { divisor_not_int } { Divisor ~ '#2' ~ is ~ not ~ an ~ integer ~ (\msg_line_context:). }
-\msg_new:nnn { longdivision } { divisor_invalid } { Divisor ~ '#2' ~ is ~ invalid ~ (\msg_line_context:). }
-
-% Warnings:
-\msg_new:nnn { longdivision } { work_stopped_early } { The ~ work ~ display ~ stopped ~ early ~ to ~ avoid ~ running ~ off ~ the ~ page ~ (\msg_line_context:). }
-\msg_new:nnn { longdivision } { division_stopped_early } { The ~ division ~ stopped ~ early ~ to ~ avoid ~ running ~ off ~ the ~ page ~ (\msg_line_context:).}
-\msg_new:nnn { longdivision } { no_division_occurred }
- { Either ~ the ~ dividend ~ was ~ zero ~ or ~ you ~ used ~ \token_to_str:N \intlongdiv \space and ~ the ~ dividend ~ was ~less ~ than ~ the ~ divisor. ~
- This ~ isn't ~ a ~ big ~ deal, ~ but ~ the ~ result ~ probably ~ looks ~ silly. }
-\msg_new:nnn { longdivision } { no_tikz } { You ~ requested ~ "style~=~tikz" ~ but ~ tikz ~ has ~ not ~ been ~ loaded. ~ Falling ~ back ~ to ~ "style~=~standard". }
-
-
%%
%% Division
%%
@@ -253,7 +369,7 @@
% If we haven't hit the decimal point add it to the quotient and dividend
% Set seen_digit false so that we can remove the decimal point later if it divided evenly or we used \intlongdiv
\bool_if:NF \l__longdiv_seen_point_bool {
- \longdiv_add_point: %
+ \longdiv_record_point: %
\bool_set_false:N \l__longdiv_seen_digit_bool
\bool_set_true:N \l__longdiv_added_point_bool
}
@@ -265,8 +381,8 @@
\cs_generate_variant:Nn \longdiv_get_new_digit:nnn {xnn}
\cs_new:Npn \longdiv_get_new_digit_aux:nnw #1 #2 #3 #4;{
- \token_if_eq_meaning:NNTF #3 . {
- \longdiv_add_point:
+ \longdiv_if_token_is_decimal_separator:NTF #3 {
+ \longdiv_record_point:
\bool_set_true:N \l__longdiv_seen_digit_bool % Prevent this decimal point from being removed later
\bool_set_false:N \l__longdiv_added_point_bool
\longdiv_get_new_digit:nnn { #1 } { #2 } { #4 }
@@ -276,15 +392,13 @@
}
% Adds a decimal point, with a leading 0 if necessary, and records the current position in \l__longdiv_point_digit_int
-\cs_new:Nn \longdiv_add_point: {
- \bool_set_true:N \l__longdiv_seen_point_bool
- \bool_if:NTF \l__longdiv_seen_digit_bool {
- \longdiv_linkedlist_add:n { . }
- }{
- \longdiv_linkedlist_add:n { 0. } % Add a leading zero
-
+\cs_new:Nn \longdiv_record_point: {
+ \bool_if:NF \l__longdiv_seen_digit_bool {
+ \tl_put_right:Nn \l__longdiv_quotient_tl { 0 } % Add a leading zero
}
- \int_set_eq:NN \l__longdiv_point_digit_int \l__longdiv_position_int % Record the position of the point
+ \int_set_eq:NN \l__longdiv_point_digit_dividend_int { \l__longdiv_position_int } % Record the position of the point
+ \bool_set_true:N \l__longdiv_seen_point_bool
+ \int_set:Nn \l__longdiv_point_digit_quotient_int { \tl_count:N \l__longdiv_quotient_tl }
}
% Divide when we still have more digits.
@@ -297,17 +411,17 @@
}{
\int_set:Nn \l__longdiv_quotient_int { \int_div_truncate:nn { #1 } { #2 } }
\bool_if:nTF {
- \int_compare_p:nNn \l__longdiv_quotient_int = \c_zero % If the quotient was zero, we might not have to print it
+ \int_compare_p:nNn \l__longdiv_quotient_int = \c_zero_int % If the quotient was zero, we might not have to print it
&& !\l__longdiv_seen_digit_bool % If no other digits have been printed
&& !\l__longdiv_seen_point_bool % And we are before the decimal point
}{
\int_incr:N \l__longdiv_digits_requested_int % Get an extra digit, this one doesn't count.
}{ % Otherwise print it and record that we've seen a digit (all further 0's must be printed)
\bool_set_true:N \l__longdiv_seen_digit_bool
- \longdiv_linkedlist_add:f { \int_use:N \l__longdiv_quotient_int }
+ \tl_put_right:Nf \l__longdiv_quotient_tl { \int_use:N \l__longdiv_quotient_int }
}
\int_incr:N \l__longdiv_position_int
- \longdiv_divide_record:nn{ #1 }{ #2 }
+ \longdiv_divide_record:nn { #1 }{ #2 }
\longdiv_get_new_digit:xnn { \longdiv_remainder:nn { #1 } { #2 } } { #2 }
}
}
@@ -326,13 +440,14 @@
% For some reason we need to shift the typeset work over by half a digit if we quit early due to "stage" option
% so we need to set a flag so that the work typesetter can know to do this.
\bool_set_true:N \l__longdiv_stopped_early_stage_bool
- % \int_set:Nn \l_tmpa_int { \use:c { longdiv_linkedlist ~ \int_eval:n { \l__longdiv_linkedlist_length_int - 1 } } }
- \longdiv_linkedlist_add:n { \phantom { #3 0 } }
- \exp_args:Nx \longdiv_typeset:nnn { \longdiv_delete_last:n { #1 } } { #2 }
+ \tl_put_right:Nn \l__longdiv_quotient_tl { {\longdiv_hphantom:n { #3 0 }} }
+ \tl_set:Nf \l__longdiv_remainer { \tl_range:nnn { #1 } { 1 } { -2 } }
+ \longdiv_typeset:
}
-% Deletes the last digit of number.
-\cs_new:Nn \longdiv_delete_last:n { \tl_reverse:f { \tl_tail:f { \tl_reverse:f { #1 } } } }
+% \relax to protect also against f expansion
+\cs_new:Nn \longdiv_hphantom:n { \relax \longdiv_hphantom_aux: { #1 } }
+\cs_new_protected:Nn \longdiv_hphantom_aux: { \hphantom }
% Divide when we are out of digits.
% #1 -- remainder from last time (we will add a zero to the end)
@@ -343,28 +458,33 @@
% If we've seen this remainder before, we're done. Use the appropriate command
% to insert the overline, and then typeset everything
\cs_if_exist_use:cTF { longdiv_remainders ~ \int_eval:n { #1 } }{ % \int_eval:n to remove leading zero
- \longdiv_typeset:nnn { #1 } { #2 }
+ \tl_set:Nn \l__longdiv_remainder_tl { #1 }
+ \longdiv_typeset:
}{
- \bool_if:nTF {
+ \bool_if:nTF { % Check if we should stop early
\int_compare_p:nNn \l__longdiv_extra_digits_int = \l__longdiv_max_extra_digits_int
||\int_compare_p:nNn \l__longdiv_position_int = \c__longdiv_max_total_digits_int
- ||\int_compare_p:nNn \l__longdiv_position_int = \l__longdiv_digits_requested_int
+ ||\int_compare_p:nNn \l__longdiv_position_int = \l__longdiv_digits_requested_int % This is from the "stage" option
}{
\int_compare:nNnT \l__longdiv_position_int = \c__longdiv_max_total_digits_int {
\msg_warning:nn { longdivision } { division_stopped_early }
}
- \longdiv_typeset:nnn { #1 } { #2 }
+ \tl_set:Nn \l__longdiv_remainder_tl { #1 }
+ \longdiv_typeset:
}{
% Otherwise, record that we've seen this remainder and the position we're in
% In case this is the first digit of the repeated part
+ % \l__longdiv_repeat_digit_int counts digits after the decimal point, so in 1/9 it will be 0.
+ % See also the comment above \longdiv_insert_separators:Nn
\cs_set:cpx { longdiv_remainders ~ \int_eval:n { #1 } }{ % \int_eval:n to remove leading zero
- \int_set:Nn \l__longdiv_repeat_digit_int { \int_use:N \l__longdiv_linkedlist_length_int }
- \exp_not:N \longdiv_linkedlist_indicate_repeating_decimal:n { \int_use:N \l__longdiv_linkedlist_length_int }
+ \exp_not:N \int_set:Nn \exp_not:N \l__longdiv_repeat_digit_int {
+ \tl_count:N \l__longdiv_quotient_tl - \int_use:N \l__longdiv_point_digit_quotient_int
+ }
}
% Now we have to use #1 0 everywhere
\int_set:Nn \l__longdiv_quotient_int { \int_div_truncate:nn { #1 0 } { #2 } }
- \longdiv_linkedlist_add:f { \int_use:N \l__longdiv_quotient_int }
- \bool_set_true:N \l__longdiv_seen_digit_bool % We've seen a digit after the decimal point, don't need to remove it
+ \tl_put_right:Nf \l__longdiv_quotient_tl { \int_use:N \l__longdiv_quotient_int }
+ \bool_set_true:N \l__longdiv_seen_digit_bool % We've seen a digit after the decimal point
\int_incr:N \l__longdiv_position_int
\int_incr:N \l__longdiv_extra_digits_int
\longdiv_divide_record:nn { #1 0 } { #2 }
@@ -380,7 +500,7 @@
% This command checks if the quotient was zero, and if so preserves the leading zero by avoiding \int_eval:n
% This is so that e.g, \longdiv{14.1}{7} doesn't screw up
\cs_new:Nn \longdiv_remainder:nn {
- \int_compare:nNnTF \l__longdiv_quotient_int = \c_zero
+ \int_compare:nNnTF \l__longdiv_quotient_int = \c_zero_int
{ #1 }
{ \int_eval:n { #1 - \l__longdiv_quotient_int * #2 } }
}
@@ -393,7 +513,7 @@
\tl_new:N \l__longdiv_work_tl
\cs_new:Nn \longdiv_divide_record:nn {
\int_compare:nNnTF \l__longdiv_display_divisions_int < \c__longdiv_max_display_divisions_int {
- \int_compare:nNnF \l__longdiv_quotient_int = \c_zero { % If the quotient was zero, nothing needs to be typeset
+ \int_compare:nNnF \l__longdiv_quotient_int = \c_zero_int { % If the quotient was zero, nothing needs to be typeset
\tl_set:Nx \l__longdiv_work_tl {
\l__longdiv_work_tl
{ \int_use:N \l__longdiv_position_int } { #1 } { \int_eval:n { \l__longdiv_quotient_int * #2 } }
@@ -402,7 +522,8 @@
}
}{
\int_compare:nNnT \l__longdiv_display_divisions_int = \c__longdiv_max_display_divisions_int {
- \int_compare:nNnF \l__longdiv_quotient_int = \c_zero {
+ % If we hit max_display_divisions, we need to use typeset_work_last and emit a stopped-early warning. Otherwise this is the same as the display_divisions < max_display_divisions case.
+ \int_compare:nNnF \l__longdiv_quotient_int = \c_zero_int {
\tl_set:Nx \l__longdiv_work_tl {
\l__longdiv_work_tl
{ \int_use:N \l__longdiv_position_int } { #1 } { \int_eval:n { \l__longdiv_quotient_int * #2 } }
@@ -419,212 +540,272 @@
%% Typesetting
%%
+% This is the bulk of the code, division is quite easy but arranging stuff on the page is much harder.
+
+\cs_new_protected:Nn \longdiv_return_to_original_mode:n { \bool_if:NF \l__longdiv_mathmode_bool \hbox { #1 } }
%% Indicate repeating decimals
-% These are all different implementations of \longdiv_linkedlist_indicate_repeating_decimal:n
+% These are all different implementations of \longdiv_indicate_repeating_decimal:n
% They take one input which is the index of the start of the repeating decimal in the linked list
-% Chosen using "repeating decimal style", default is "dots all"
+% Chosen using "repeating decimal style", default is "overline"
% possible values: "overline", "dots", "dots all", "parentheses"
-% Put an \overline over the repeated digits. \overline only works in math mode, so we have to use \ensuremath. Then we put an \hbox
-% to take ourselves
-\cs_new:Nn \longdiv_linkedlist_indicate_repeating_decimal_overline:n {
- \cs_set:cpx { longdiv_linkedlist ~ #1 }{
- \ensuremath{ \overline { \bool_if:NF \l__longdiv_mathmode_bool \hbox { \exp_not:f { \use:c { longdiv_linkedlist ~ #1 } } } } }
- }
+% Put an \overline over the repeated digits. \overline only works in math mode, so we have to use \ensuremath.
+% \longdiv_return_to_original_mode:n restores text mode by wrapping in an hbox if necessary.
+% We stored the top level mode at the beginning of \longdiv_typeset:
+\cs_new:Nn \longdiv_indicate_repeating_decimal_overline:n {
+ \longdiv_ensuremath:n { \overline { \longdiv_return_to_original_mode:n {
+ #1
+ } } }
}
-\cs_new:cn { longdiv_linkedlist_indicate_repeating_decimal_dots~all:n } {
- \cs_set:cpx { longdiv_linkedlist ~ #1 }{
- \exp_not:n {
- \cs_set:Npn \longdiv_linkedlist_element:n ##1 { \dot ##1 }
- }
- \ensuremath { \noexpand \dot \exp_not:f { \use:c { longdiv_linkedlist ~ #1 } } }
+\cs_new_protected:Nn \longdiv_dot:n {
+ % In the dotsall case, we use this on every digit in range, but we don't want to put dots over the
+ % punctuation so we test for it.
+ \longdiv_if_digit:nTF { #1 } {
+ \longdiv_ensuremath:n { \dot { \longdiv_return_to_original_mode:n { #1 } } }
+ }{
+ #1
}
}
-\cs_new:Nn \longdiv_linkedlist_indicate_repeating_decimal_dots:n {
- \cs_set:cpx { longdiv_linkedlist ~ \int_eval:n { \l__longdiv_linkedlist_length_int - 1 } }{
- \noexpand\dot \use:c { longdiv_linkedlist ~ \int_eval:n { \l__longdiv_linkedlist_length_int - 1 } }
- }
- \cs_set:cpx { longdiv_linkedlist ~ #1 }{
- \ensuremath { \noexpand \dot \exp_not:f { \use:c { longdiv_linkedlist ~ #1 } } }
- }
+% #1 -- put a dot over every digit in #1. This needs to be expandable like all the indicate_repeating_decimal variants.
+\cs_new:cn { longdiv_indicate_repeating_decimal_dots~all:n } {
+ \tl_map_function:nN { #1 } \longdiv_dot:n % \tl_map_function is expandable whereas \tl_map_inline is not.
}
-\bool_new:N \l__longdiv_repeating_decimal_parentheses_bool
-\cs_new:Nn \longdiv_linkedlist_indicate_repeating_decimal_parentheses:n {
- \cs_set:cpx { longdiv_linkedlist ~ #1 }{
- ( \exp_not:f { \use:c { longdiv_linkedlist ~ #1 } } )
- }
- % Don't insert extra space for parenthesis in german typesetting because the quotient isn't directly above dividend and work.
- \cs_if_eq:NNF \longdiv_typeset_main: \longdiv_typeset_main_german:{
- \bool_set_true:N \l__longdiv_repeating_decimal_parentheses_bool
- \cs_set:Nn \longdiv_typeset_extra_zeroes: {
- \bool_if:NT \l__longdiv_added_point_bool { . }
- \prg_replicate:nn { #1 - \l__longdiv_linkedlist_length_int + \l__longdiv_extra_digits_int } { 0 } \hphantom (
- \prg_replicate:nn { \l__longdiv_position_int - #1 } { 0 } \hphantom{ ) }
- }
- }
+% Put a dot over the first and last entry of the token list leaving the rest alone
+\cs_new:Nn \longdiv_indicate_repeating_decimal_dots:n {
+ \longdiv_dot:n { \tl_head:n { #1 } }
+ % tl_range wraps it's output in an \exp_not:n which we cancel out with this \expanded
+ % (I guess in expl3 this is \use:e)
+ \expanded { \tl_range:nnn { #1 } { 2 } { -2 } }
+ \longdiv_dot:n { \tl_item:nn { #1 } { -1 } }
}
-% Do nothing, don't indicate repeating digits at all.
-\cs_new:Nn \longdiv_linkedlist_indicate_repeating_decimal_none:n {
+\bool_new:N \l__longdiv_repeating_decimal_parentheses_bool
+
+\cs_new:Nn \longdiv_indicate_repeating_decimal_parentheses:n {
+ (#1)
+}
+% In the parentheses case, the parentheses take up space so we record that here
+\cs_new:Nn \longdiv_indicate_repeating_decimal_parentheses_skip_begin: {
+ { \longdiv_hphantom:n { ( } }
}
-\cs_new_eq:NN \longdiv_linkedlist_indicate_repeating_decimal:n \longdiv_linkedlist_indicate_repeating_decimal_overline:n
+\cs_new:Nn \longdiv_indicate_repeating_decimal_parentheses_skip_end: {
+ { \longdiv_hphantom:n { ) } }
+}
-% \l__longdiv_linkedlist_tl -- quotient
-% #1 -- remainder
-% #2 -- divisor
-% #3 -- dividend
-\cs_new:Nn \longdiv_typeset:nnn {
- \mode_if_math:TF { \bool_set_true:N \l__longdiv_mathmode_bool } { \bool_set_false:N \l__longdiv_mathmode_bool }
- \cs_set:Npn \longdiv_typeset_dividend: {
- \longdiv_typeset_number:n {
- #3
- \bool_if:NT \l__longdiv_seen_digit_bool { % we don't want to add a trailing decimal point to the dividend if it divided evenly
- \longdiv_typeset_extra_zeroes:
- }
- }
+% Do nothing, don't indicate repeating digits at all.
+\cs_new:Nn \longdiv_indicate_repeating_decimal_none:n { #1 }
+
+% Default is overline
+\cs_new_eq:NN \longdiv_indicate_repeating_decimal:n \longdiv_indicate_repeating_decimal_overline:n
+
+% The three markers are inserted by \longdiv_insert_separators:Nn into quotient, dividend, and work.
+% We give them various definitions in the three contexts depending on how we do the formatting.
+% typeset_work is typically happening inside of a tabular where each row is in a separate local context,
+% so we need to make definitions global for that case. For sanitation purposes, we get rid of the defintions
+% as soon as we are done with them.
+\cs_new:Nn \longdiv_undefine_markers: {
+ \cs_undefine:N \longdiv_decimal_separator_marker:
+ \cs_undefine:N \longdiv_digit_separator_marker:
+ \cs_undefine:N \longdiv_repeat_marker:
+}
+
+\cs_new:Nn \longdiv_typeset_work: {
+ \bool_if:NTF \l__longdiv_separators_in_work_bool { % This is the "separators in work" option.
+ \cs_gset:Nn \longdiv_decimal_separator_marker: { \longdiv_decimal_separator: } % If true print the separators
+ \cs_gset:Nn \longdiv_digit_separator_marker: { \longdiv_digit_separator: }
+ }{
+ \cs_gset:Nn \longdiv_decimal_separator_marker: {{ \longdiv_hphantom:n { \longdiv_decimal_separator: } }} % Else use \phantom
+ \cs_gset:Nn \longdiv_digit_separator_marker: {{ \longdiv_hphantom:n { \longdiv_digit_separator: } }}
}
- \cs_set:Npn \longdiv_typeset_work: { \longdiv_typeset_work:n { #1 } }
- \cs_set:Npn \longdiv_typeset_divisor: { \longdiv_typeset_number:n { #2 } }
- \cs_set:Npn \longdiv_typeset_remainder: { \longdiv_typeset_number:n { #1 } } % This isn't used in current typesetting code, just could be nice to have
- \bool_set:Nn \l_longdiv_repeating_decimal_bool { \int_compare_p:nNn \l__longdiv_repeat_digit_int > 0 } % This isn't used in current typesetting code, just could be nice to have
- \let\longdivdividend\longdiv_typeset_dividend:
- \let\longdivdivisor\longdiv_typeset_divisor:
- \let\longdivquotient\longdiv_typeset_quotient:
- \let\longdivwork\longdiv_typeset_work:
- \bool_if:NF \l__longdiv_seen_digit_bool { \longdiv_linkedlist_remove_tail: } % If we haven't seen any new digits since adding a terminal decimal point, delete it.
- \longdiv_typeset_main:
+ \cs_gset:Nn \longdiv_repeat_marker: { \longdiv_indicate_repeating_decimal_skip_begin: } % Leave a space (if we are in parentheses case) if we see the repeat_marker.
+ \longdiv_typeset_work:n { \tl_use:N \l__longdiv_remainder_tl }
+ \longdiv_undefine_markers:
}
-
-\cs_new:Nn \longdiv_typeset_extra_zeroes: {
- \bool_if:NT \l__longdiv_added_point_bool { . }
- \prg_replicate:nn { \l__longdiv_extra_digits_int } { 0 }
+\cs_new_protected:Nn \longdiv_ensuremath:n { \ensuremath{#1} }
+% Choose mathmode or not mathmode as appropriate. \l__longdiv_mathmode_bool is set in \longdiv_typeset:
+\cs_new_protected:Nn \longdiv_typeset_number:n {
+ \bool_if:NTF \l__longdiv_mathmode_bool { \longdiv_ensuremath:n { #1 } } { \hbox { #1 } }
}
-\cs_new:Nn \longdiv_typeset_main_default: {
- \bool_if:NTF \l__longdiv_is_tikz_loaded_bool {
- \longdiv_typeset_main_tikz:
- } {
- \longdiv_typeset_main_standard:
- }
+\cs_new:Nn \longdiv_typeset_divisor: {
+ \longdiv_typeset_number:n { \tl_use:N \l__longdiv_divisor_tl }
}
-\cs_new_eq:NN \longdiv_typeset_main: \longdiv_typeset_main_default:
-
-\longdiv_define_style:nn { standard } {
- \hskip4pt
- \rule{0pt}{22pt} \longdiv_typeset_divisor: \, \begin{tabular}[b]{@{}r@{}}
- \longdiv_typeset_quotient:\,
- \\\hline
-
- \smash{\big)}\begin{tabular}[t]{@{}l@{}}
- \longdiv_typeset_dividend: \\
- \longdiv_typeset_work:\\[3pt]
- \end{tabular}\,
- \end{tabular}
- \hskip5.3pt
+\cs_new:Nn \longdiv_typeset_dividend: {
+ \longdiv_typeset_number:n { \tl_use:N \l__longdiv_dividend_tl }
}
-\bool_new:N \l__longdiv_is_tikz_loaded_bool
-\AtBeginDocument{ \@ifpackageloaded { tikz }{ \bool_gset_true:N \l__longdiv_is_tikz_loaded_bool } { } }
-
-\longdiv_define_style:nn { german } {
- \begin{tabular}[t]{@{}l@{}}
- \longdiv_typeset_dividend: \hskip1pt : \hskip1pt \longdiv_typeset_divisor: \hskip4pt = \hskip4pt \longdiv_typeset_quotient: \\
- \longdiv_typeset_work:
- \end{tabular}
+\cs_set:Npn \longdiv_typeset_quotient: {
+ \longdiv_typeset_number:n { \tl_use:N \l__longdiv_quotient_tl }
}
-
-\newlength{\longdiv@dividendlength}
-\newlength{\longdiv@dividendheight}
-\newlength{\longdiv@divisorheight}
-\newlength{\longdiv@maxheight}
-
-\let\longdiv@ifl@aded\@ifl@aded
-\let\longdiv@pkgextension\@pkgextension
-\def\longdiv@ifpackageloaded{\@ifl@aded\@pkgextension}
-
-\longdiv_define_style:nn { tikz }{
- \let\@ifl@aded\longdiv@ifl@aded
- \let\@pkgextension \longdiv@pkgextension
- \bool_if:NTF \l__longdiv_is_tikz_loaded_bool {
- \longdiv@typeset@tikz@rest
- } {
- \msg_warning:nn { longdivision } { no_tikz }
- \longdiv_typeset_main_standard:
- }
+% This isn't used in current typesetting code, but could be nice to have for integer division for instance
+\cs_set:Npn \longdiv_typeset_remainder: {
+ \longdiv_typeset_number:n { \tl_use:N \l__longdiv_remainder_tl }
}
+% At this point, the divisor, dividend, quotient, and remainder should all be stored in their appropriate token lists:
+% \l__longdiv_divisor_tl
+% \l__longdiv_dividend_tl
+% \l__longdiv_quotient_tl
+% \l__longdiv_remainder_tl
+% Of course we also care about all sorts of other state...
+\cs_new:Nn \longdiv_typeset: {
+ % Record whether we are in mathmode or not on the top level so we can make sure to typeset everything consistently
+ \mode_if_math:TF { \bool_set_true:N \l__longdiv_mathmode_bool } { \bool_set_false:N \l__longdiv_mathmode_bool }
-\def\longdiv@typeset@tikz@rest{
- \let\longdiv@typeset@dividend\longdiv_typeset_dividend:
- \let\longdiv@typeset@divisor\longdiv_typeset_divisor:
- \let\longdiv@typeset@quotient\longdiv_typeset_quotient:
- \let\longdiv@typeset@work\longdiv_typeset_work:
- \settowidth{\longdiv@dividendlength}{1.\longdiv_typeset_dividend:}
- \settoheight{\longdiv@dividendheight}{\longdiv_typeset_dividend:}
- \settoheight{\longdiv@maxheight}{\longdiv_typeset_dividend:\longdiv_typeset_divisor:}
- \settoheight{\longdiv@divisorheight}{\longdiv_typeset_divisor:}
- \l__longdiv_rulethickness_dim = 0.2mm
- \longdiv@typeset@main@tikz@helper
-}
+ \longdiv_prepare_divisor:
+ \longdiv_prepare_dividend:
+ \longdiv_prepare_quotient:
+ \longdiv_prepare_remainder:
-\ExplSyntaxOff
-\def\longdiv@typeset@main@tikz@helper{
- \begin{tikzpicture} [baseline=.5pt]
- \draw (1pt,.5*\longdiv@divisorheight) node [left] {\longdiv@typeset@divisor};
- \draw (\longdiv@dividendlength,.5*\longdiv@dividendheight) node [left] {\longdiv@typeset@dividend};
- \draw [line width=0.2mm] (0pt,-.22*\longdiv@dividendheight) arc (-70:60:\longdiv@maxheight*.41 and \longdiv@maxheight*.88) -- ++(\longdiv@dividendlength-2pt,0pt);
- \draw (\longdiv@dividendlength,\longdiv@divisorheight+\longdiv@maxheight*.3) node[above left] {
- \longdiv@typeset@quotient
- };
- \draw (0,0) node[below right] {
- \begin{tabular}[t]{@{}l@{}}
- \longdiv@typeset@work
- \end{tabular}
- };
- \end{tikzpicture}
-}
-\ExplSyntaxOn
+ % Copy components into "public" commands for custom typeset_main code
+ \let\longdivwork\longdiv_typeset_work:
+ \let\longdivdivisor\longdiv_typeset_divisor:
+ \let\longdivdividend\longdiv_typeset_dividend:
+ \let\longdivquotient\longdiv_typeset_quotient:
+ \let\longdivremainder\longdiv_typeset_remainder:
+ \longdiv_typeset_main:
+}
-\cs_new:Nn \longdiv_typeset_quotient: {
- \int_compare:nNnTF \l__longdiv_linkedlist_length_int = \c_zero
- {
- \bool_if:NTF \l__longdiv_stopped_early_stage_bool
- { }
- { \longdiv_typeset_number:n { 0 } }
+\cs_new:Nn \longdiv_prepare_divisor: {
+ \longdiv_insert_separators:Nn \l__longdiv_divisor_tl { \tl_count:N \l__longdiv_divisor_tl }
+ \cs_gset:Nn \longdiv_digit_separator_marker: { \longdiv_digit_separator: }
+ \tl_set:Nx \l__longdiv_divisor_tl { \tl_use:N \l__longdiv_divisor_tl }
+ \longdiv_undefine_markers:
+}
+
+\cs_new:Nn \longdiv_prepare_dividend: {
+ \tl_set:Nx \l__longdiv_dividend_tl {
+ \tl_use:N \l__longdiv_dividend_tl
+ % Pad dividend with extra zeroes as needed
+ \prg_replicate:nn { \l__longdiv_extra_digits_int } { 0 }
+ }
+ % Get rid of decimal separator if present (it gets added back in by insert_separators)
+ \tl_remove_all:No \l__longdiv_dividend_tl { \longdiv_decimal_separator: }
+ \longdiv_insert_separators:Nn \l__longdiv_dividend_tl { \l__longdiv_point_digit_dividend_int }
+ \cs_set:Nn \longdiv_decimal_separator_marker: { \longdiv_decimal_separator: }
+ \cs_set:Nn \longdiv_digit_separator_marker: { \longdiv_digit_separator: }
+ \cs_set:Npn \longdiv_repeat_marker: ##1 \s_stop {
+ \longdiv_indicate_repeating_decimal_dividend:n { ##1 }
+ }
+ \tl_set:Nx \l__longdiv_dividend_tl { \tl_use:N \l__longdiv_dividend_tl \s_stop }
+ \longdiv_undefine_markers:
+
+ % The rest of this function groups punctuation with the digit to its right
+ % 123,456.789 ==> 123{,4}56{.7}89
+ % This is for typesetting the work, we need to measure how far to the right
+ % to typeset a block that contains the first four digits that should be the width of
+ % 123{,4}. This format is needed for \longdiv_typeset_setwidth:n to work correctly.
+ \tl_build_clear:N \l_tmpa_tl
+ \tl_build_clear:N \l_tmpb_tl
+ \tl_map_inline:Nn \l__longdiv_dividend_tl {
+ \tl_build_put_right:Nn \l_tmpb_tl { ##1 }
+ \longdiv_if_digit:nT { ##1 } {
+ \tl_build_end:N \l_tmpb_tl
+ \tl_build_put_right:No \l_tmpa_tl {
+ \exp_after:wN { \exp:w \exp_end_continue_f:w \tl_use:N \l_tmpb_tl }
+ }
+ \tl_build_clear:N \l_tmpb_tl
}
- { \longdiv_typeset_number:n { \l__longdiv_linkedlist_tl } }
+ }
+ % Catch any trailing punctuation
+ \tl_build_end:N \l_tmpb_tl
+ \tl_build_put_right:No \l_tmpa_tl {
+ \exp_after:wN { \exp:w \exp_end_continue_f:w \tl_use:N \l_tmpb_tl }
+ }
+ \tl_build_end:N \l_tmpa_tl
+ % Store retokenized result into \l__longdiv_dividend_tl
+ \tl_set_eq:NN \l__longdiv_dividend_tl \l_tmpa_tl
+}
+
+\cs_new:Nn \longdiv_prepare_quotient: {
+ \longdiv_insert_separators:Nn \l__longdiv_quotient_tl { \l__longdiv_point_digit_quotient_int }
+ \cs_set:Nn \longdiv_decimal_separator_marker: { \longdiv_decimal_separator: }
+ \cs_set:Nn \longdiv_digit_separator_marker: { \longdiv_digit_separator: }
+ \cs_set:Npn \longdiv_repeat_marker: ##1 \s_stop {
+ \longdiv_indicate_repeating_decimal_quotient:n { ##1 }
+ }
+ \tl_set:Nx \l__longdiv_quotient_tl { \tl_use:N \l__longdiv_quotient_tl \s_stop }
+ \longdiv_undefine_markers:
+}
+
+% In the very outside chance that someone defines a format that uses "\longdivremainder", has a 4+ digit remainder,
+% AND uses the digit separator option, I have them covered... In the other 99.99% of the time this does nothing.
+% Really just here for uniformity.
+\cs_new:Nn \longdiv_prepare_remainder: {
+ \longdiv_insert_separators:Nn \l__longdiv_remainder_tl { \tl_count:N \l__longdiv_remainder_tl }
+ \cs_gset:Nn \longdiv_digit_separator_marker: { \longdiv_digit_separator: }
+ \tl_set:Nx \l__longdiv_remainder_tl { \tl_use:N \l__longdiv_remainder_tl }
+ \longdiv_undefine_markers:
+}
+
+\int_new:N \l__longdiv_temp_length_int
+
+\cs_generate_variant:Nn \tl_map_inline:nn { fn }
+\cs_generate_variant:Nn \tl_put_right:Nn { Nf }
+\cs_generate_variant:Nn \tl_build_put_right:Nn { No, Nf }
+
+% This is the key workhorse for our typesetting engine.
+% #1 -- a token list
+% #2 -- how many digits of the current number come before the decimal point
+% We iterate over the current token list, making a new one with punctuation inserted.
+% We use a coordinate system where the digit directly AFTER the decimal point is digit 0,
+% the digit directly before the decimal point is digit -1, etc.
+% This coordinate system is obviously useful for digit separators which occur based on their position
+% relative to the decimal point.
+% We set up \l__longdiv_repeat_digit_int so that it is already in these coordinates.
+% Any additional decorations that need to be added in the future should use coordiantes relative to the decimal point too.
+\cs_new:Nn \longdiv_insert_separators:Nn {
+ \int_set:Nn \l_tmpa_int { - \int_eval:n { #2 } }
+ \tl_build_clear:N \l_tmpa_tl
+ \tl_build_put_right:Nf \l_tmpa_tl { \tl_head:N #1 }
+ \tl_map_inline:fn { \tl_tail:N #1 } {
+ \int_incr:N \l_tmpa_int
+ \int_compare:nNnTF \l_tmpa_int = 0 {
+ \tl_build_put_right:Nn \l_tmpa_tl { \longdiv_decimal_separator_marker: }
+ }{
+ % Check if \l_tmpa_int is divisible by \l__longdiv_digit_group_length.
+ \int_compare:nNnT \l_tmpa_int = { \l_tmpa_int / \l__longdiv_digit_group_length * \l__longdiv_digit_group_length } {
+ \tl_build_put_right:Nn \l_tmpa_tl { \longdiv_digit_separator_marker: }
+ }
+ }
+ \int_compare:nNnT \l_tmpa_int = \l__longdiv_repeat_digit_int {
+ \tl_build_put_right:Nn \l_tmpa_tl { \longdiv_repeat_marker: }
+ }
+ \tl_build_put_right:Nn \l_tmpa_tl { ##1 }
+ }
+ \tl_build_get:NN \l_tmpa_tl #1
}
-\cs_new:Nn \longdiv_typeset_number:n {
- \bool_if:NTF \l__longdiv_mathmode_bool { \ensuremath{#1} } { #1 }
-}
-
% Iterate through the division "work" and typeset it
+% Argument is remainder after the final division iteration
\cs_new:Nn \longdiv_typeset_work:n {
\tl_if_empty:NTF \l__longdiv_work_tl {
\msg_warning:nn { longdivision } { no_division_occurred }
}{
\exp_after:wN \longdiv_typeset_work_first:nnn \l__longdiv_work_tl
+ % If we quit early, \longdiv_typeset_work_last:nn occurs already in \l__longdiv_work_tl so don't need it again
\int_compare:nNnT \l__longdiv_display_divisions_int < \c__longdiv_max_display_divisions_int {
\exp_args:No \longdiv_typeset_work_last:nn { \int_use:N \l__longdiv_position_int } { #1 }
}
}
}
+\tl_new:N \g__longdiv_work_line_tl
+
% #1 -- digits in to the right side of the numbers we are writing
% #2 -- remainder from last time with new digits added to the right
% #3 -- quotient * divisor
@@ -632,10 +813,16 @@
% _rest typesets result from last time, quotient * divisor and the line
% _last only typesets the remainder from last time
\cs_new:Nn \longdiv_typeset_work_first:nnn {
- \longdiv_typeset_setwidth:n { #1 }
+ \longdiv_typeset_setwidth:n { #1 }
\hspace{\g__longdiv_temp_dim}
- \llap { \longdiv_insert_point_ifneeded:nn { #1 } { #3 } }
- \\\longdiv_rule:nn{#1}{#3}
+ \tl_gset:Nf \g__longdiv_work_line_tl { #3 }
+ \longdiv_work_insert_separators:Nn { \g__longdiv_work_line_tl } { #1 }
+ % We need the definition to be global to make it past the \\.
+ % Best practice would be to feed in a local variable to insert_separators, but insert_separators
+ % already uses \l_tmpa_tl and \l_tmb_tl for its own purposes. It would anyways be more error prone to do it that way.
+ \tl_gset_eq:NN \g__longdiv_work_line_tl \g__longdiv_work_line_tl % Globalize definition from insert_separators
+ \longdiv_llap_preserve_math_mode:n { \longdiv_typeset_number:n { \g__longdiv_work_line_tl } }
+ \\\longdiv_rule:N { \g__longdiv_work_line_tl }
\peek_meaning:NT \bgroup {
\longdiv_typeset_work_rest:nnn
}
@@ -644,11 +831,17 @@
\cs_new:Nn \longdiv_typeset_work_rest:nnn {
\longdiv_typeset_setwidth:n { #1 }
\hspace{\g__longdiv_temp_dim}
- \llap { \longdiv_insert_point_ifneeded:nn { #1 } { #2 } }
+ \tl_gset:Nf \g__longdiv_work_line_tl { #2 }
+ \longdiv_work_insert_separators:Nn { \g__longdiv_work_line_tl } { #1 }
+ \tl_gset_eq:NN \g__longdiv_work_line_tl \g__longdiv_work_line_tl
+ \longdiv_llap_preserve_math_mode:n { \longdiv_typeset_number:n { \g__longdiv_work_line_tl } }
\\
\hspace{\g__longdiv_temp_dim}
- \llap { \longdiv_insert_point_ifneeded:nn { #1 } { #3 } }
- \\\longdiv_rule:nn{#1}{#3}
+ \tl_gset:Nf \g__longdiv_work_line_tl { #3 }
+ \longdiv_work_insert_separators:Nn { \g__longdiv_work_line_tl } { #1 }
+ \tl_gset_eq:NN \g__longdiv_work_line_tl \g__longdiv_work_line_tl
+ \longdiv_llap_preserve_math_mode:n { \longdiv_typeset_number:n { \g__longdiv_work_line_tl } }
+ \\\longdiv_rule:N { \g__longdiv_work_line_tl }
\peek_meaning:NT \bgroup {
\longdiv_typeset_work_rest:nnn
}
@@ -659,107 +852,148 @@
\cs_new:Nn \longdiv_typeset_work_last:nn {
\longdiv_typeset_setwidth:n { #1 }
\hspace{\g__longdiv_temp_dim}
- \llap { \longdiv_insert_point_ifneeded:nn { #1 } { #2 } }
-}
-
-% #1 -- the start position of the substring
-% #2 -- the substring
-% #3 -- the position we are checking for
-\prg_new_conditional:Nnn \longdiv_if_contains_position:nnn { TF,T,F } {
- \bool_if:nTF {
- \int_compare_p:nNn { #1 } > #3
- && \int_compare_p:nNn { #1 - \tl_count:n { #2 } } < #3
- }{
- \prg_return_true:
- }{
- \prg_return_false:
- }
+ \tl_gset:Nf \g__longdiv_work_line_tl { #2 }
+ \longdiv_work_insert_separators:Nn { \g__longdiv_work_line_tl } { #1 }
+ \tl_gset_eq:NN \g__longdiv_work_line_tl \g__longdiv_work_line_tl
+ \longdiv_llap_preserve_math_mode:n { \longdiv_typeset_number:n { \g__longdiv_work_line_tl } }
}
-% Set \g__longdiv_temp_dim equal to digitwidth * number of digits
-% If we are past the decimal point, add \c__longdiv_pointwidth_dim
+% Set \g__longdiv_temp_dim equal to the width of the first #1 digits of dividend (and any punctuation in that range).
+% In prepare_dividend we grouped the punctuation together with the following digit so that this works conveniently
\cs_new:Nn \longdiv_typeset_setwidth:n {
- \dim_gset:Nn \g__longdiv_temp_dim { #1\c__longdiv_digitwidth_dim }
+ \settowidth \l__longdiv_tempwidth_dim {\tl_range:Nnn \l__longdiv_dividend_tl { 1 } { #1 } \relax }
+ \dim_gset:Nn \g__longdiv_temp_dim { \l__longdiv_tempwidth_dim }
% For some reason we need to shift everything over by half a digit if we quit early due to "stage" option
- \bool_if:NT \l__longdiv_stopped_early_stage_bool { \dim_gadd:Nn \g__longdiv_temp_dim { -0.5\c__longdiv_digitwidth_dim } }
- \int_compare:nNnT \l__longdiv_point_digit_int < { #1 } {
- \dim_gadd:Nn \g__longdiv_temp_dim \c__longdiv_pointwidth_dim
- }
- \bool_if:NT \l__longdiv_repeating_decimal_parentheses_bool {
- \int_compare:nNnT \l__longdiv_repeat_digit_int < { #1 } {
- \dim_gadd:Nn \g__longdiv_temp_dim \c__longdiv_parenwidth_dim
- }
- }
+ \bool_if:NT \l__longdiv_stopped_early_stage_bool {\dim_gadd:Nn \g__longdiv_temp_dim { -0.5\c__longdiv_digitwidth_dim } }
}
-% If the number ends after the decimal point ( #1 > \l__longdiv_point_digit_int )
-% and start before it ( #1 - length(#2) < \l__longdiv_point_digit_int) insert a
-% decimal point in the appropriate position of #2. Otherwise just return #2
-\cs_new:Nn \longdiv_insert_point_ifneeded:nn {
- \tl_set:Nn \l_tmpa_tl { #2 }
- \bool_if:NT \l__longdiv_repeating_decimal_parentheses_bool {
- \longdiv_if_contains_position:nnnT { #1 } { #2 } { \l__longdiv_repeat_digit_int } {
- \tl_set:Nx \l_tmpa_tl {
- \exp_not:N \longdiv_insert:nff { \hskip \c__longdiv_parenwidth_dim } %)
- { \int_eval:n{\l__longdiv_repeat_digit_int - #1 + \tl_count:n { #2 }} }
- { \tl_use:N \l_tmpa_tl }
- }
- }
- }
- \longdiv_if_contains_position:nnnT { #1 } { #2 } { \l__longdiv_point_digit_int } {
- \tl_set:Nx \l_tmpa_tl { \longdiv_insert:nff . {\int_eval:n{\l__longdiv_point_digit_int - #1 + \tl_count:n { #2 }}} { \tl_use:N \l_tmpa_tl } }
- }
- \longdiv_typeset_number:n { \tl_use:N \l_tmpa_tl }
+% #2 is the distance to the right endpoint of the token list #1.
+% The distance to decimal point is (point_digit_divident - distance to left endpoint of #1)
+\cs_new:Nn \longdiv_work_insert_separators:Nn {
+ \longdiv_insert_separators:Nn #1 { \l__longdiv_point_digit_dividend_int + \tl_count:N #1 - #2 }
}
-% Walk #2 digits across #3 and then insert #1
-\cs_new:Nn \longdiv_insert:nnn {
- \longdiv_insert_aux:onN { #2 } { #1 } #3
+% I think this is the same as a command from mathtools, but I make my own here.
+\cs_new:Nn \longdiv_llap_preserve_math_mode:n {
+ \if_mode_math:
+ \llap{$#1$}
+ \else
+ \llap{#1}
+ \fi
}
-\cs_generate_variant:Nn \longdiv_insert:nnn { nff }
-\cs_new:Nn \longdiv_insert_aux:nnN {
- \int_compare:nNnTF { #1 } = \c_zero {
- #2#3
- }{
- #3 \longdiv_insert_aux:onN { \int_eval:n { #1 - 1 } } { #2 }
- }
-}
-\cs_generate_variant:Nn \longdiv_insert_aux:nnN {onN}
-
-
-% Okay, this is another section where we are adulterated with plaintex stuff.
-% It would be easy to reimplement \settowidth, but \hrule and \noalign have no
-% expl3 name anyways. Since I only use these dim variables with \settowidth, I declare
-% them with \newdimen rather than \dim_new:N
-\newdimen \c__longdiv_digitwidth_dim
-\settowidth \c__longdiv_digitwidth_dim { 0 }
-\newdimen \c__longdiv_pointwidth_dim
-\settowidth \c__longdiv_pointwidth_dim { . }
-\newdimen \c__longdiv_parenwidth_dim
-\settowidth \c__longdiv_parenwidth_dim { ( }
-\newdimen \l__longdiv_tempwidth_dim
+\newdimen \l__longdiv_tempwidth_dim
\newdimen \l__longdiv_rulethickness_dim
\l__longdiv_rulethickness_dim = 0.2mm
-\cs_new:Nn \longdiv_rule:nn {
+% Make a rule of length the width of token list #1 whose right endpoint is \g__longdiv_temp_dim from the left.
+\cs_new:Nn \longdiv_rule:N {
\noalign {
- \settowidth \l__longdiv_tempwidth_dim { #2 }
- % Check whether the decimal point occurred in the middle of the current number
- % because if so, it's longer by pointwidth.
- \longdiv_if_contains_position:nnnT { #1 } { #2 } { \l__longdiv_point_digit_int } {
- \dim_add:Nn \l__longdiv_tempwidth_dim \c__longdiv_pointwidth_dim
- }
- % If we use parens to denote the repeating part of the quotient, they take up space too. Test if a paren occurs.
- \bool_if:NT \l__longdiv_repeating_decimal_parentheses_bool {
- \longdiv_if_contains_position:nnnT { #1 } { #2 } { \l__longdiv_point_digit_int } {
- \dim_add:Nn \l__longdiv_tempwidth_dim \c__longdiv_parenwidth_dim
- }
- }
+ \settowidth \l__longdiv_tempwidth_dim { \tl_use:N #1 }
\box_move_right:nn { \g__longdiv_temp_dim - \l__longdiv_tempwidth_dim } {
\vbox:n { \hrule width \l__longdiv_tempwidth_dim height \l__longdiv_rulethickness_dim }
}
}
}
+
+
+%%
+%% Typesetting styles
+%%
+
+% The typesetting style is chosen with the "style" key.
+% These commands use the five commands which contain the relevant results of the division:
+% \longdivdivisor
+% \longdivdividend
+% \longdivquotient
+% \longdivremainder
+% \longdivwork
+
+\longdiv_define_style:nn { default } {
+ \bool_if:NTF \l__longdiv_is_tikz_loaded_bool {
+ \longdiv_typeset_main_tikz:
+ } {
+ \longdiv_typeset_main_standard:
+ }
+}
+\cs_new_eq:NN \longdiv_typeset_main: \longdiv_typeset_main_default:
+
+% In the normal fonts this looks vaguely okay I guess.
+% One nice thing about the standard / german styles is that \tracingall behaves better.
+% Tikz really wrecks the \tracingall output (hundreds of thousands of text lines of the tikz parser =( )
+% I believe this is stolen from the ancient plaintex longdiv.tex
+\longdiv_define_style:nn { standard } {
+ \hskip4pt
+ \rule{0pt}{22pt} \longdivdivisor \, \begin{tabular}[b]{@{}r@{}}
+ \longdivquotient \,
+ \\\hline
+ \smash{\big)}\begin{tabular}[t]{@{}l@{}}
+ \longdivdividend{\hskip 3pt}\relax \\
+ \longdivwork\\[3pt]
+ \end{tabular}\,
+ \end{tabular}
+ \hskip5.3pt
+}
+
+\cs_new:Nn \longdiv_german_division_sign: { : }
+
+% "German" style because it was first requested by a German. has also been suggested to call it "Latin American" style.
+\longdiv_define_style:nn { german } {
+ \begin{tabular}[t]{@{}l@{}}
+ \longdivdividend \hskip1pt \longdiv_german_division_sign: \hskip1pt \longdivdivisor \hskip4pt = \hskip4pt \longdivquotient \\
+ \longdivwork
+ \end{tabular}
+}
+
+
+% Certainly the pretiest of my three styles. I think I got it from a tex stack exchange post,
+% but I apparently didn't credit it when I copied it and I cannot find teh post now.
+\longdiv_define_style:nn { tikz }{
+ \bool_if:NTF \l__longdiv_is_tikz_loaded_bool {
+ \longdiv@typeset@main@tikz
+ } {
+ \msg_warning:nn { longdivision } { no_tikz }
+ \longdiv_typeset_main_standard:
+ }
+}
+
+\bool_new:N \l__longdiv_is_tikz_loaded_bool
+\AtBeginDocument{ \@ifpackageloaded { tikz }{ \bool_gset_true:N \l__longdiv_is_tikz_loaded_bool } { } }
+
+
+\ExplSyntaxOff
+
+\newlength{\longdiv@dividendlength}
+\newlength{\longdiv@dividendheight}
+\newlength{\longdiv@divisorheight}
+\newlength{\longdiv@maxheight}
+
+% text depth is needed to prevent descending commas from shifting components up weirdly.
+\def\longdiv@typeset@main@tikz{
+ \settowidth{\longdiv@dividendlength}{1.\longdivdividend}
+ \settoheight{\longdiv@dividendheight}{\longdivdividend}
+ \settoheight{\longdiv@maxheight}{\longdivdividend\longdivdivisor}
+ \settoheight{\longdiv@divisorheight}{\longdivdivisor}
+ \begin{tikzpicture} [baseline=.5pt, text height=\longdiv@maxheight]
+ \draw (1pt,.5*\longdiv@divisorheight)
+ node [left, text depth=0pt] { \longdivdivisor };
+ \draw (\longdiv@dividendlength,.5*\longdiv@dividendheight )
+ node [left, text depth=0pt] { \longdivdividend };
+ \draw [line width=0.2mm]
+ (0pt,-.22*\longdiv@dividendheight) arc (-70:60:\longdiv@maxheight*.41 and \longdiv@maxheight*.88)
+ -- ++(\longdiv@dividendlength-2pt, 0pt);
+ \draw (\longdiv@dividendlength,\longdiv@divisorheight+\longdiv@maxheight*.37)
+ node[above left, text depth=0pt] { \longdivquotient };
+ \draw (1pt,0) node[below right] {
+ \begin{tabular}[t]{@{}l@{}}
+ \longdivwork
+ \end{tabular}
+ };
+ \end{tikzpicture}
+}
+\ExplSyntaxOn
+
+
+
\ExplSyntaxOff
diff --git a/macros/latex/contrib/longdivision/longdivision_manual.pdf b/macros/latex/contrib/longdivision/longdivision_manual.pdf
index 64a9bee6c5..f64df8e2f9 100644
--- a/macros/latex/contrib/longdivision/longdivision_manual.pdf
+++ b/macros/latex/contrib/longdivision/longdivision_manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/longdivision/longdivision_manual.tex b/macros/latex/contrib/longdivision/longdivision_manual.tex
index c4f23a9fbc..24e3928248 100644
--- a/macros/latex/contrib/longdivision/longdivision_manual.tex
+++ b/macros/latex/contrib/longdivision/longdivision_manual.tex
@@ -1,8 +1,11 @@
\documentclass{ltxdoc}
-\def\version{Version 1.1.0}
+\def\version{Version 1.2.0}
+\let\ifluatex\relax
+\usepackage{ifluatex}
\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
\usepackage{longdivision}
+
\usepackage{tikz}
\usepackage[documentation]{tcolorbox}
\usepackage{etoolbox}
@@ -98,7 +101,7 @@
\date{\version\\\today}
\maketitle
-The \longdivname\ package defines two main commands: |\longdivision| and |\intlongdivision|. The usage for both is |\longdivision[|\meta{options}|]|\marg{dividend}\marg{divisor}. The difference is that |\longdivision| divides until the remainders repeat or the quotient has too many digits to fit the page, whereas |\intlongdivision| does integer division and leaves the remainder. The command |\longdivisionkeys|\marg{options} is also defined to set default options. At most 20 division steps worth of work will be displayed and at most 60 digits worth of division output will be produced. Thanks to Mike Jenck, Cameron McLeman, and Yu-Tsung Tai for emailing me with bug reports and feature requests.
+The \longdivname\ package defines two main commands: |\longdivision| and |\intlongdivision|. The usage for both is |\longdivision[|\meta{options}|]|\marg{dividend}\marg{divisor}. The difference is that |\longdivision| divides until the remainders repeat or the quotient has too many digits to fit the page, whereas |\intlongdivision| does integer division and leaves the remainder. The command |\longdivisionkeys|\marg{options} is also defined to set default options. At most 20 division steps worth of work will be displayed and at most 60 digits worth of division output will be produced. Thanks to Mike Jenck, Ben McKay, Cameron McLeman, Phelype Oleinik, Maximilian Schmidt, and Yu-Tsung Tai for bug reports and feature requests.
Here is an example usage:
@@ -114,8 +117,8 @@ These commands have several key-value options:
This key determines the maximum amount of ``extra'' zeroes to add to the end of the dividend in the process of division -- if the quotient has more digits before it repeats, the division will just stop. This is only an option for |\longdivision|, the command |\intlongdivision|\marg{dividend}\marg{divisor} is equivalent to |\longdivision[max extra digits=0]|\marg{dividend}\marg{divisor}. For brevity, this option has the short form where just the value is provided: |\longdivision[2]|\marg{dividend}\marg{divisor} is the same as |\longdivision[max extra digits=2]|\marg{dividend}\marg{divisor}.
\begin{tcblisting}{}
-\longdivision[max extra digits = 2]{10.0}{7} \quad
-\longdivision[1]{10.0}{7}
+\longdivision[max extra digits = 1]{14.1}{7} \quad
+\longdivision[2]{14.1}{7}
\end{tcblisting}
\end{key}
@@ -123,26 +126,28 @@ This key determines the maximum amount of ``extra'' zeroes to add to the end of
\begin{key}{stage = \meta{nonnegative integer}}
This controls how many steps worth of division to do. Thanks to Cam McLeman for suggesting this feature.
\begin{tcblisting}{}
-\longdivision[stage=0]{1}{7} \quad
-\longdivision[stage=1]{1}{7} \quad
-\longdivision[stage=2]{1}{7} \quad
-\longdivision[stage=3]{1}{7} \quad
-\longdivision[stage=4]{1}{7} \quad
-\longdivision[stage=5]{1}{7} \quad
-\longdivision[stage=6]{1}{7}
+\longdivision[stage=0]{5.3}{37} \quad
+\longdivision[stage=1]{5.3}{37} \quad
+\longdivision[stage=2]{5.3}{37} \quad
+\longdivision[stage=3]{5.3}{37} \quad
+\longdivision[stage=4]{5.3}{37}
\end{tcblisting}
\end{key}
-\begin{key}{style = \meta{style}}
+\begin{key}{style = \meta{style} (initially standard)}
Control the style for typesetting the result of long division. The options are |default|, |standard|, |tikz|, or |german|. The option |default| is the same as |tikz| if \tikzname\ is loaded and otherwise is the same as |standard|. You probably should load \tikzname\ because the \tikzname\ version looks significantly better. If you use this option, you'll probably want to set the style once and for all in your preamble with |\longdivisionkeys{style=|\meta{style}|}|.
\begin{tcblisting}{}
\intlongdivision[style = tikz ]{100.0}{13} \quad
\intlongdivision[style = standard]{100.0}{13} \quad
\intlongdivision[style = german ]{100.0}{13}
\end{tcblisting}
-You can define your own typesetting style by saying |\longdiv_define_style:nn|\marg{style name}\marg{code}. This can use the commands |\longdivdividend| which contains the dividend, |\longdivdivisor| which contains the divisor, |\longdivquotient| which contains the quotient, and |\longdivwork:| which contains the |division work|. For instance, a simplified version of the |german| style is:
+You can define your own style with |\longdivisiondefinestyle|\marg{style name}\marg{code}.
+In the |\marg{code}| you can use the commands |\longdivdivisor| which contains the divisor, |\longdivdividend| which contains the dividend,
+|\longdivquotient| which contains the quotient, |\longdivwork| which contains the division work
+and |\longdivremainder| which contains the remainder.
+For instance, a simplified version of the |german| style is:
\begin{tcblisting}{}
-\longdivdefinestyle{my style}{%
+\longdivisiondefinestyle{my style}{%
\begin{tabular}{@{}l@{}}
\longdivdividend : \, \longdivdivisor \, = \longdivquotient \\
\longdivwork
@@ -153,8 +158,8 @@ You can define your own typesetting style by saying |\longdiv_define_style:nn|\m
Send me an email if you cannot figure out how to make a style to your liking.
\end{key}
-\begin{key}{repeating decimal style = \meta{style}}
-Control the way that repeating decimals are typeset. The options are |overline|, |dots|, |dots all|, |parentheses|, or |none|. The default is |overline|. The |parentheses| style creates ugly spacing problems and the |dots| style is insufficiently visible, so the |overline| style is the best. If you use this option, you'll probably want to set the style once and for all in your preamble with |\longdivisionkeys{recurring decimal style=|\meta{style}|}| |\longdivisionkeys{style=|\meta{style}|}|. Like the |style| key, this is designed to be extensible. However, the process of creating new |repeating decimal style|s is a bit involved. Send me an email if you want a new |repeating decimal style|.
+\begin{key}{repeating decimal style = \meta{style} (initially overline)}
+Control the way that repeating decimals are typeset. The options are |overline|, |dots|, |dots all|, |parentheses|, or |none|. The default is |overline|. The |parentheses| style creates ugly spacing problems and the |dots| style is insufficiently visible, so the |overline| style is the best. If you use this option, you'll probably want to set the style once and for all in your preamble with |\longdivisionkeys{recurring decimal style=|\meta{style}|}|. Like the |style| key, this is designed to be extensible. However, the process of creating new |repeating decimal style|s is a bit involved. Send me an email if you want a new |repeating decimal style|.
\begin{tcblisting}{}
\longdivision[repeating decimal style = overline ]{5.3}{37} \quad
\longdivision[repeating decimal style = dots ]{5.3}{37} \quad
@@ -163,4 +168,55 @@ Control the way that repeating decimals are typeset. The options are |overline|,
\longdivision[repeating decimal style = none ]{5.3}{37}
\end{tcblisting}
\end{key}
+
+
+\begin{key}{decimal separator = \meta{separator character} (initially .)}
+Control the character used to indicated the decimal point. Most people want this to be a period or a comma. The default is a period. Note that this changes the decimal separator BOTH in the input and in the output. If you set the decimal separator to a comma and then use a period in the input, it will throw an error (though this could be inconvenient for people -- if this behavior causes you trouble, email me and I can fix it).
+If you want to use the comma decimal separator, I recommend saying |\longdivisionkeys{decimal separator = {,}}| in your preamble.
+\begin{tcblisting}{}
+\longdivision[decimal separator = {.}]{2.1}{3} \quad
+\longdivision[decimal separator = {,}]{2,1}{3}
+\end{tcblisting}
+\end{key}
+
+\begin{key}{digit separator = \meta{separator character} (initially none)}
+Control the character used to separate groups of digits in the output.
+By default digit groups have length 3, but that can be configured with the |digit group length| key.
+%The digit separator will also be deleted from input strings.
+If value is empty, then no separator is used.
+Most people want this to be a period or a comma.
+Note that this changes the decimal separator BOTH in the input and in the output. If you set the decimal separator to a comma and then use a period in the input, it will throw an error.
+\begin{tcblisting}{}
+\longdivisionkeys{digit group length = 2}
+\longdivision[digit separator = {,}]{5}{7} \quad
+\longdivision[digit separator = {.}, decimal separator = {,}]{5}{7}
+\longdivision[digit separator = { }]{5}{7}
+\longdivision[digit separator = {_}]{5}{7}
+\end{tcblisting}
+\end{key}
+
+\begin{key}{digit group length = \meta{integer} (initially 3)}
+Specify how often to include a digit separator. Does nothing without the |digit separator| key.
+\begin{tcblisting}{}
+\longdivision[digit group length = 2, digit separator = {,}]{5}{7} \quad
+\longdivision[digit group length = 3, digit separator = { }]{5}{7} \quad
+\longdivision[digit group length = 4, digit separator = {_}]{5}{7}
+\end{tcblisting}
+\end{key}
+
+\begin{key}{separators in work = \meta{bool} (initially true)}
+Specifies whether to include the decimal and digit separators in division work. When this is false, |\longdivision| will leave a space instead so that the digits are aligned correctly. \begin{tcblisting}{}
+\longdivision[separators in work = true ]{14.1}{3} \quad
+\longdivision[separators in work = false]{14.1}{3}
+\end{tcblisting}
+\end{key}
+
+\begin{key}{german division sign = \meta{division sign} (initially :)}
+\begin{tcblisting}{}
+\longdivisionkeys{style = german}
+\longdivision[german division sign = $\,\div\,$ ]{14.1}{3} \quad
+\longdivision[german division sign = : ]{14.1}{3}
+\end{tcblisting}
+\end{key}
+
\end{document}
diff --git a/macros/latex/contrib/tasks/README b/macros/latex/contrib/tasks/README
index 5b7fce5020..d597763e70 100644
--- a/macros/latex/contrib/tasks/README
+++ b/macros/latex/contrib/tasks/README
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------
-the TASKS package v1.2a 2020/04/19
+the TASKS package v1.2b 2020/05/11
lists with columns filled horizontally
@@ -11,19 +11,20 @@ E-Mail: contact@mychemistry.eu
Copyright 2013--2020 Clemens Niederberger
This work may be distributed and/or modified under the
-conditions of the LaTeX Project Public License, either version 1.3
+conditions of the LaTeX Project Public License, either version 1.3c
of this license or (at your option) any later version.
The latest version of this license is in
http://www.latex-project.org/lppl.txt
-and version 1.3 or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008/05/04 or later.
This work has the LPPL maintenance status `maintained'.
The Current Maintainer of this work is Clemens Niederberger.
--------------------------------------------------------------------------
The tasks package consists of the files
- - tasks.sty, tasks.cfg, tasks_en.tex, task_en.pdf
+ - tasks.sty, tasks.cfg
+ - tasks-manual.tex, task-manual.pdf, task-manual.cls
- README
--------------------------------------------------------------------------
If you have any ideas, questions, suggestions or bugs to report, please
diff --git a/macros/latex/contrib/tasks/tasks-manual.pdf b/macros/latex/contrib/tasks/tasks-manual.pdf
index 415cd6178b..708bc9b981 100644
--- a/macros/latex/contrib/tasks/tasks-manual.pdf
+++ b/macros/latex/contrib/tasks/tasks-manual.pdf
Binary files differ
diff --git a/macros/latex/contrib/tasks/tasks.sty b/macros/latex/contrib/tasks/tasks.sty
index 31db9fe1ea..22ac99035b 100644
--- a/macros/latex/contrib/tasks/tasks.sty
+++ b/macros/latex/contrib/tasks/tasks.sty
@@ -28,10 +28,10 @@
\RequirePackage {expl3,xparse,xtemplate}
\ExplSyntaxOn
-\tl_const:Nn \c_tasks_date_tl {2020/04/19}
+\tl_const:Nn \c_tasks_date_tl {2020/05/11}
\tl_const:Nn \c_tasks_version_major_number_tl {1}
\tl_const:Nn \c_tasks_version_minor_number_tl {2}
-\tl_const:Nn \c_tasks_version_subrelease_tl {a}
+\tl_const:Nn \c_tasks_version_subrelease_tl {b}
\tl_const:Nx \c_tasks_version_number_tl
{
\c_tasks_version_major_number_tl .
@@ -675,7 +675,10 @@
}
% --------------------------------------------------------------------------
-
+% #1: item separator
+% #2: options
+% #3: number of columns
+% #4: environment body
\cs_new_protected:Npn \tasks_body:nnnn #1#2#3#4
{
\int_gincr:N \g__tasks_env_int
@@ -687,11 +690,11 @@
\vskip-\baselineskip
\hrule\@height\z@
}
+ \keys_set:nn {tasks/list} {#2}
\dim_compare:nNnF { \l__tasks_before_list_skip } = {0pt}
{ \vspace {\l__tasks_before_list_skip} }
\list {}
{
- \keys_set:nn {tasks/list} {#2}
\dim_set:Nn \leftmargin {0pt}
\dim_set:Nn \rightmargin {0pt}
}
@@ -859,3 +862,5 @@
- \tasksifmeasuringTF
- new option `counter'
- rename manual files
+2020/04/19 v1.2a - only use arabic numbers for \theHtask
+2020/05/11 v1.2b - options are set to late for `before-skip' -- fixed