summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/README.md4
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdfbin714141 -> 719776 bytes
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex6
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex36
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex76
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex8
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex379
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex4
-rw-r--r--Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex2
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins4
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx63
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx125
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx4
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx49
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx2
-rw-r--r--Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx75
-rw-r--r--Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex2
-rw-r--r--Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex2
-rw-r--r--Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex2
-rw-r--r--Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex2
-rw-r--r--Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex45
-rw-r--r--Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex77
-rw-r--r--Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex2
-rw-r--r--Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex56
-rw-r--r--Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty2
-rw-r--r--Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty2
-rw-r--r--Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty2
-rw-r--r--Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty36
-rw-r--r--Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty2
-rw-r--r--Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty2
30 files changed, 565 insertions, 506 deletions
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/README.md b/Master/texmf-dist/doc/latex/expkv-bundle/README.md
index 8d484d62d4e..f36dd3203d0 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/README.md
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/README.md
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
# `expkv-bundle` -- an expandable key=value implementation and more
-Version 2023-01-23
+Version 2024-12-26
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
@@ -10,7 +10,7 @@ Hosted on the Island of TeX at https://gitlab.com/islandoftex/texmf/expkv-bundle
-------------------------------------------------------------------------------
-Copyright (C) 2020-2023 Jonathan P. Spratte
+Copyright (C) 2020-2024 Jonathan P. Spratte
This work may be distributed and/or modified under the conditions of the LaTeX
Project Public License (LPPL), either version 1.3c of this license or (at your
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdf b/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdf
index 1d7023208a8..808dab5b694 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdf
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex b/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex
index f8110ea36a1..2860be24ea0 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex
@@ -51,6 +51,10 @@
\let\metaORIG\meta
\protected\def\meta #1{\texttt{\metaORIG{#1}}}
+\let\margORIG\marg
+\protected\def\marg #1{\texttt{\margORIG{#1}}}
+\let\oargORIG\oarg
+\protected\def\oarg #1{\texttt{\oargORIG{#1}}}
\input{preamble-examples.tex}
\input{preamble-logos.tex}
@@ -286,7 +290,7 @@
suggestions and additions to this documentation.%
}%
}
-\date{2023-01-23}
+\date{2024-12-26}
\begingroup
\renewcommand*\thefootnote{\fnsymbol{footnote}}
\maketitle
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex b/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex
index 850b9af6205..d1806e625a8 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex
@@ -380,19 +380,21 @@ key is a primary or secondary key (unless explicitly stated otherwise).
\begin{function}[module=expkv-cs type]{enum}
\begin{syntax}
- enum \key\ = \marg{key_2}\kvarg \prefixes2
+ enum \key\ = \marg{key_2}\{\val, \ldots\} \prefixes2
\end{syntax}
This defines \key\ to only accept the values given in the list of the second
argument of its definition. It forwards the position of \val\ in that list to
- \meta{key_2} (zero-based). The \meta{key_2} has to already be defined by the
- time an |enum| key is set up. Each \val\ in the list (and at use time) is
- |\detokenize|d, so no expansion takes place here.
+ \meta{key_2} (zero-based) as a string of digits (so as |0|, |1|, \ldots). The
+ \meta{key_2} has to already be defined by the time an |enum| key is set up.
+ Each \val\ in the list (and at use time) is |\detokenize|d, so no expansion
+ takes place here.
If you use |enum| twice on the same \key\ the new values will again start at
zero (so it is possible to define multiple values with the same outcome),
however since you can't skip values you'll have to use the same as in the
- first call for values with just a single variant. There is no interface to
- delete existing values.
+ first call for values with just a single variant (or use the |choice| \type\
+ as an |enum| is just a specialised |choice| and the two use the same internal
+ structure). There is no interface to delete existing values.
\end{function}
\begin{example}{Enumerating choices with the \texttt{enum} \type}
First a small example that might give you an idea of what the description
@@ -431,9 +433,10 @@ key is a primary or secondary key (unless explicitly stated otherwise).
\end{syntax}
This is pretty similar to an |enum|, but unlike with |enum| the forwarded
\val\ will not be numeric, instead the \val\ as given during the definition
- time will be forwarded. This means that while the user input has to match in a
+ time will be forwarded (inside the \kv\ list argument if you omit \val\ the
+ same as the \key\ will be used). While the user input has to match in a
|\detokenize|d form, the \val\ might still expand further during your macro's
- expansion (if what you provided as a choice is expandable).
+ expansion.
\end{function}
\begin{example}{Filtering possible values with the \texttt{choice} \type}
We could use this to filter out the possible vertical placements of a \LaTeXe\
@@ -452,6 +455,23 @@ key is a primary or secondary key (unless explicitly stated otherwise).
\foo{} \foo{v=t} \foo{v=c} \foo{v=b}
\end{enverb}
\end{example}
+\begin{example}{Setting up a Boolean key with the \texttt{choice} \type}
+ We could also set up a Boolean key with a |choice| key by forwarding
+ |\@firstoftwo| or |\@secondoftwo|:
+ \begin{enverb}
+ \makeatletter
+ \ekvcSplit\foo{bool-internal=\@secondoftwo}
+ {bool was #1{true}{false}.\par}
+ \ekvcSecondaryKeys\foo
+ {
+ choice bool = {bool-internal}
+ {true=\@firstoftwo, false=\@secondoftwo}
+ ,nmeta bool = {bool-internal=\@firstoftwo}
+ }
+ \foo{}\foo{bool}\foo{bool=false}\foo{bool=true}
+ \makeatother
+ \end{enverb}
+\end{example}
\begin{function}[module=expkv-cs type]{aggregate,e-aggregate}
\begin{syntax}
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex b/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex
index fade98e8b8f..5a682b73bc4 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex
@@ -320,7 +320,7 @@ showing line.
expand to the second argument (so behave like |\@secondoftwo|). The idea is
that with this type you can define a key which should be typeset formatted.
The |edata| and |xdata| variants will fully expand \val, the |gdata| and
- |xdata| variants will store \val\ inside \meta{cs} globally. Juts like with
+ |xdata| variants will store \val\ inside \meta{cs} globally. Just like with
|store| you can use macro parameters without having to double them. The
\prefixes\ only affect the key-macro, \meta{cs} will always be expandable and
|\long|.
@@ -462,6 +462,18 @@ showing line.
the \kv\ list inside of \meta{set} and defines a \Nkey\ with a static list.
\end{function}
+\begin{function}[module=expkv-def type]{alias}
+ \begin{syntax}
+ alias \key\ = \meta{key_2} \prefixes2333
+ \end{syntax}
+ Copy the definition of \meta{key_2} to \key. \key\ will inherit being |long|
+ or |protected| from \meta{key_2} as well. If a \Vkey\ named \meta{key_2}
+ exists its definition is copied, and if an accordingly named \Nkey\ exists its
+ definition is copied to the new name as well. At least one of the two keys
+ must exist or else this throws an error. If \meta{key_2} is later redefined
+ the definition of \key\ will stay the same.
+\end{function}
+
\begin{function}[module=expkv-def type]{set}
\begin{syntax}
set \key\ = \marg{set} \prefixes2233
@@ -608,6 +620,37 @@ showing line.
\end{enverb}
\end{example}
+\begin{function}[module=expkv-def type]{choice-aliases}
+ \begin{syntax}
+ choice-aliases \key\ = \{\meta{new}=\meta{old}, \ldots\} \prefixes2333
+ \end{syntax}
+ Copy the definition of the choice \meta{old} of \key\ to a \meta{new} choice
+ for the same \key. The \key\ must be an existing |choice| key. Inside the
+ \meta{new}=\meta{old} list all elements must get a value. If used the
+ |new|-prefix will apply to each individual \meta{new} choice name (so if any
+ already exists it'll throw an error, and the current element will be ignored).
+ The \meta{new} choice will inherit being |protected| from the \meta{old} one.
+ The \meta{old} choice must be defined obviously.
+
+ This works for a |choice| or |bool| \type\ as well as all their variants. If
+ something redefines some of the choices later on the aliases will keep the
+ original definition.
+\end{function}
+\begin{example}
+ {Create shortcuts for choices using the \texttt{choice-aliases} \type}
+ With the following we create a key that accepts some choices, and since our
+ keyboard is only designed to handle a finite number of keystrokes we also
+ allow for shorter names of those choices. (This is not part of the ongoing
+ example using the |example| set above.)
+ \begin{enverb}[no-store,no-tcb]
+ \ekvdefinekeys{choice-alias-example}
+ {
+ choice-store key = { long-name, short-name }
+ ,choice-aliases key = { ln = long-name, sn = short-name }
+ }
+ \end{enverb}
+\end{example}
+
\begin{function}[module=expkv-def type]{unknown code}
\begin{syntax}
unknown code = \marg{definition} \prefixes2322
@@ -668,25 +711,28 @@ argument order without any performance hit if you compare this to
\end{function}
\bigskip
-Time to use all those keys defined in the different examples!
+Time to use all those keys defined in the different examples as part of the
+|example| set!
% undo the global no-tcb setting
\ekvset{enverb}{no-store,undo-no-tcb}%
\begin{enverb}[restore,below,inter=Which results in three paragraphs of text:]
\newcommand\defexample[1][]
{%
- \ekvset{example}{#1}%
- After walking \the\exampledistance\space we finally reached
- \examplebar{\emph}{no particular place}.
- There I ordered
- \iffoo
- a drink called \examplefoostore\space (that has
- \the\examplefoocount\space tokens in it)%
- \else
- nothing of particular interest%
- \fi
- \examplebaz{ and ate \emph}.
- Then a friend of mine also chose \exampledrink.
- \par
+ \begingroup % keep the values set local to this call
+ \ekvset{example}{#1}%
+ After walking \the\exampledistance\space we finally reached
+ \examplebar{\emph}{no particular place}.
+ There I ordered
+ \iffoo
+ a drink called \examplefoostore\space (that has
+ \the\examplefoocount\space tokens in it)%
+ \else
+ nothing of particular interest%
+ \fi
+ \examplebaz{ and ate \emph}.
+ Then a friend of mine also chose \exampledrink.
+ \par
+ \endgroup
}
\defexample[nofoo]
\defexample[all,choose=lemonade]
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex b/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex
index 0109eb70dae..b9b90eb6685 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex
@@ -928,10 +928,10 @@ breaks is not possible.
\cs{ekv@name@set}\marg{set}
\cs{ekv@name@key}\marg{key}
\end{syntax}
- The names of the macros storing the code of \Vkey{}s are stored in are built
- with these macros. The name is built from two blocks, one that is formatting
- the \set\ name, and on for formatting the \key\ name. To get the actual name
- the argument to \cs{ekv@name@key} must be |\detokenize|d. Both blocks are put
+ The names of the macros storing the code of \Vkey{}s are built with these
+ macros. The name is built from two blocks, one that is formatting the \set\
+ name, and on for formatting the \key\ name. To get the actual name the
+ argument to \cs{ekv@name@key} must be |\detokenize|d. Both blocks are put
together (with the necessary |\detokenize|) by \cs{ekv@name}. For \Nkey{}s an
additional |N| gets appended, so their name is
\cs{ekv@name}\marg{set}\marg{key}|N|.
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex b/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex
index 22f39cd31cc..b81d9b99788 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex
@@ -1,348 +1,97 @@
-\RequirePackage{expkv-def}
+\RequirePackage{expkv-def,enverb}
-\ExplSyntaxOn
-\cs_new_eq:NN \enverb@count \tl_count:n
-\cs_set:Npx \enverb@othercr { \char_generate:nn {13} {12} }
-\ExplSyntaxOff
%% key setup
-\ekvdefinekeys{enverb}
+\enverbsetup{key-set=expkv/enverb}
+\ekvdefinekeys{expkv/enverb}
{
- boolTF auto-ignore = \enverb@ifautoignore
- ,initial auto-ignore
- ,protected code ignore = \let\enverb@ifautoignore\@secondoftwo
- ,eint more-ignore = \enverb@moreignore
- ,initial more-ignore = 2
- ,also eint ignore = \enverb@ignore
- ,boolTF same-line = \enverb@ifsameline
+ ,boolTF same-line = \ekvdoc@enverb@ifsameline
,unknown-choice same-line =
- \let\enverb@ifsameline\@firstoftwo\edef\enverb@codeshare{\unexpanded{#1}}
+ \let\ekvdoc@enverb@ifsameline\@firstoftwo\edef\ekvdoc@enverb@codeshare{\unexpanded{#1}}
,initial same-line = 0.75
- ,invboolTF other-line = \enverb@ifsameline
+ ,invboolTF other-line = \ekvdoc@enverb@ifsameline
,nmeta below = {same-line=false, no-aboveskip, no-belowskip}
,nmeta undo-below = {same-line=true, aboveskip, belowskip}
- ,store same-line-lst = \enverb@options@lst@same
- ,store same-line-tcb = \enverb@options@tcb@same
+ ,store same-line-lst = \ekvdoc@enverb@options@lst@same
+ ,store same-line-tcb = \ekvdoc@enverb@options@tcb@same
,initial same-line-lst = {aboveskip=0pt,belowskip=0pt}
,initial same-line-tcb = {nobeforeafter,box align=center}
- ,store other-line-lst = \enverb@options@lst@other
- ,store other-line-tcb = \enverb@options@tcb@other
+ ,store other-line-lst = \ekvdoc@enverb@options@lst@other
+ ,store other-line-tcb = \ekvdoc@enverb@options@tcb@other
,meta slst = same-line-lst={#1}
,meta stcb = same-line-tcb={#1}
,meta olst = other-line-lst={#1}
,meta otcb = other-line-tcb={#1}
- ,store lst = \enverb@options@lst
- ,store tcb = \enverb@options@tcb
- ,long store bol = \enverb@bol@content
- ,long store eol = \enverb@eol@content
- ,einitial eol = \enverb@othercr
- ,boolTF no-lst = \enverb@ifno@lst
+ ,store lst = \ekvdoc@enverb@options@lst
+ ,store tcb = \ekvdoc@enverb@options@tcb
+ ,boolTF no-lst = \ekvdoc@enverb@ifno@lst
,also nmeta no-lst = below
- ,boolTF no-tcb = \enverb@ifno@tcb
+ ,boolTF no-tcb = \ekvdoc@enverb@ifno@tcb
,also nmeta no-tcb = below
,nmeta undo-no-tcb = {no-tcb=false, undo-below}
- ,store inter = \enverb@inter
- ,data gappend = \enverb@append
- ,dataT pre-tcb = \enverb@pretcb
- ,store after = \enverb@after
- ,nmeta store = gappend=\enverb@store
- ,noval no-store = \let\enverb@append\@secondoftwo
- ,nmeta restore = {pre-tcb=\enverb@store,after=\enverb@clear@store}
- ,code aboveskip = \edef\enverb@aboveskip{\vskip\unexpanded{#1}\relax}
- ,code belowskip = \edef\enverb@belowskip{\vskip\unexpanded{#1}\relax}
+ ,store inter = \ekvdoc@enverb@inter
+ ,data gappend = \ekvdoc@enverb@append
+ ,dataT pre-tcb = \ekvdoc@enverb@pretcb
+ ,store after = \ekvdoc@enverb@after
+ ,nmeta store = gappend=\ekvdoc@enverb@store
+ ,noval no-store = \let\ekvdoc@enverb@append\@secondoftwo
+ ,nmeta restore = {o: pre-tcb=\ekvdoc@enverb@store,after=\ekvdoc@enverb@clear@store}
+ ,code aboveskip = \edef\ekvdoc@enverb@aboveskip{\vskip\unexpanded{#1}\relax}
+ ,code belowskip = \edef\ekvdoc@enverb@belowskip{\vskip\unexpanded{#1}\relax}
,default aboveskip = \medskipamount
,default belowskip = \medskipamount
,initial aboveskip
,initial belowskip
- ,noval no-aboveskip = \let\enverb@aboveskip\@empty
- ,noval no-belowskip = \let\enverb@belowskip\@empty
+ ,noval no-aboveskip = \let\ekvdoc@enverb@aboveskip\@empty
+ ,noval no-belowskip = \let\ekvdoc@enverb@belowskip\@empty
}
-\protected\long\ekvsetdef\enverbsetup{enverb}
-\protected\def\enverb@clear@store{\global\let\enverb@store\@empty}
-\enverb@clear@store
+\protected\def\ekvdoc@enverb@clear@store{\global\let\ekvdoc@enverb@store\@empty}
+\ekvdoc@enverb@clear@store
-%% start of nested environments
-\newcommand\enverb@tcb
+\newcommand\ekvdoc@enverb@gaddo[2]
+ {\xdef#1{\unexpanded\expandafter{#1}\unexpanded\expandafter{#2}}}
+\newcommand\ekvdoc@enverb@pre[2]
+ {\edef#1{\unexpanded{#2}\unexpanded\expandafter{#1}}}
+\NewCommandCopy\Enverb\enverb
+\def\enverb{\Enverb{}}
+\def\endenverb
{%
- \expanded
+ \ekvdoc@enverb@append\ekvdoc@enverb@gaddo\@gobble\enverbBody
+ \par
+ \ekvdoc@enverb@aboveskip
+ \ekvdoc@enverb@ifno@lst{}%
{%
- \noexpand\begin{exresult}%
- [{%
- \enverb@options@tcb,%
- \enverb@ifsameline\enverb@options@tcb@same\enverb@options@tcb@other
- }]%
+ \ekvdoc@enverb@ifsameline
+ {\noindent\begin{minipage}[c]{\ekvdoc@enverb@codeshare\linewidth}}%
+ {}%
+ \ExpandArgs{ne}\enverbListing{lstlisting}
+ {[{%
+ \ekvdoc@enverb@options@lst,%
+ \ekvdoc@enverb@ifsameline
+ \ekvdoc@enverb@options@lst@same
+ \ekvdoc@enverb@options@lst@other
+ }]}%
+ \ekvdoc@enverb@ifsameline{\end{minipage}}{}%
}%
- {\linewidth\enverb@ifsameline{-\enverb@codeshare\linewidth}{}}%
- }
-\newcommand\enverb@lst
- {%
- \expanded
+ \ekvdoc@enverb@inter
+ \ekvdoc@enverb@ifno@tcb{}%
{%
- \noexpand\begin{lstlisting}%
+ \expanded{\noexpand\begin{exresult}
[{%
- \enverb@options@lst,%
- \enverb@ifsameline\enverb@options@lst@same\enverb@options@lst@other
- }]%
- }%
- }
-
-%% auxiliary error function
-\newcommand\enverb@error[1]
- {%
- \GenericError
- {(enverb)\@spaces\@spaces\@spaces\@spaces}%
- {Environment enverb error: #1}%
- {Just use it correctly!}%
- {Read the sources.}%
- }
-
-%% setup for weird category code regime
-\begingroup
-\lccode`\~=`\^^M
-\catcode`\:=13
-\lccode`\:=`\ % <- space
-\catcode`\;=13
-\lccode`\;=`\^^I % <- tab
-\lowercase{\endgroup
-%% code for spaces and CR
-\def\enverb@body@space{}%
-\def\enverb@body@tab{}%
-\def\enverb@body@newline#1~%
- {\enverb@ifnotend{#1}{\enverb@bol\unexpanded{#1}\enverb@eol~}}%
-%% activate the category code regime of the body
-\protected\def\enverb@body@setup
- {%
- \let\enverb@collected@body\@empty
- \let\do\@makeother\dospecials
- \catcode`\^^M=13 \let~\enverb@body@newline
- \catcode`\ =13 \let:\enverb@body@space
- \catcode`\^^I=13 \let;\enverb@body@tab
- \let\enverb@bol\relax
- \let\enverb@eol\relax
- }
-%% check for optional argument
-\newcommand\enverb@search@oarg@a
- {%
- \ifx:\next
- \ifenverb@firsteol
- \else
- \enverb@body@add{:}%
- \fi
- \let\next\enverb@search@oarg@b
- \else
- \ifx~\next
- \ifenverb@firsteol
- \enverb@firsteolfalse
- \else
- \enverb@body@add{~}%
- \fi
- \let\next\enverb@search@oarg@b
- \else
- \ifx[\next\@gobble]%
- \let\next\enverb@oarg
- \else
- \ifenverb@firsteol
- \let\next\enverb@body@after@begin
- \else
- \let\next\enverb@body
- \fi
- \fi
- \fi
- \fi
- \next
- }
-%% start body collection
-\newcommand\enverb@body
- {\edef\enverb@collected@body{\iffalse}\fi\expandafter~\enverb@collected@body}
-%% check the line after an oarg
-\def\enverb@body@after@oarg#1~%
- {\enverb@ensure@blank{#1}{closing bracket}\enverb@body}
-%% check the line after the \begin statement
-\def\enverb@body@after@begin#1~%
- {\enverb@ensure@blank{#1}{\string\begin}\enverb@body}
-}
-%% quick check for empty line
-\newcommand\enverb@ensure@blank[2]
- {%
- \expandafter\enverb@ifempty\expanded{{#1}}{}%
- {%
- \expanded{%
- \noexpand\enverb@error
+ \ekvdoc@enverb@options@tcb,%
+ \ekvdoc@enverb@ifsameline
+ \ekvdoc@enverb@options@tcb@same
+ \ekvdoc@enverb@options@tcb@other
+ }]}%
{%
- Line after #2 not empty.\noexpand\MessageBreak
- Contains: \detokenize\expandafter{\romannumeral`\^^@#1}%
+ \linewidth
+ \ekvdoc@enverb@ifsameline{-\ekvdoc@enverb@codeshare\linewidth}{}%
}%
- }%
- }%
- }
-%% quick check for empty argument
-\newcommand\enverb@ifempty[1]
- {%
- \enverb@ifempty@\enverb@ifempty@A#1\enverb@ifempty@B.\enverb@ifempty@true
- \enverb@ifempty@A\enverb@ifempty@B
- }
-\def\enverb@ifempty@#1\enverb@ifempty@A\enverb@ifempty@B#2#3{#3}
-\def\enverb@ifempty@true\enverb@ifempty@A\enverb@ifempty@B#1#2{#1}
-\newcommand\enverb@gadd[2]{\xdef#1{\unexpanded\expandafter{#1#2}}}
-\newcommand\enverb@body@add[1]
- {%
- \edef\enverb@collected@body
- {\unexpanded\expandafter{\enverb@collected@body#1}}%
- }
-% start of environment `enverb'
-\newcommand\enverb
- {%
- \begingroup
- \def\tmp{enverb}%
- \expandafter
- \endgroup
- \expandafter\enverb@ifnotend@setup@perhaps\expanded
- {{\string{\@currenvir\string}}}%
- \begingroup
- \enverb@body@setup
- \enverb@firsteoltrue
- \let\enverb@collected@oarg\@empty
- \enverb@search@oarg
- }
-\newif\ifenverb@firsteol
-\newcommand\enverb@search@oarg{\futurelet\next\enverb@search@oarg@a}
-\newcommand\enverb@search@oarg@b{\expandafter\enverb@search@oarg\@gobble}
-\newcommand\enverb@oarg{\endgroup\enverb@oarg@}
-\NewDocumentCommand\enverb@oarg@{O{}}
- {%
- \edef\enverb@collected@oarg{\unexpanded{#1}}%
- \begingroup
- \enverb@body@setup
- \enverb@body@after@oarg
- }
-\def\enverb@ifnotend#1%
- {%
- \def\enverb@ifnotend##1%
- {%
- \enverb@ifnotend@
- ##1\enverb@mark\enverb@ifnotend@maybe
- #1\enverb@mark\@thirdofthree
- \enverb@stop
- }%
- \def\enverb@ifnotend@##1#1##2\enverb@mark##3##4\enverb@stop{##3{##1}{##2}}%
- }
-\expandafter\enverb@ifnotend\expanded{{\expandafter\@gobble\string\\end}}
-\newcommand\enverb@ifnotend@maybe[2]
- {\expandafter\enverb@ifnotend@perhaps\expandafter{\romannumeral`\^^@#2}{#1}}
-\newcommand\enverb@ifnotend@setup@perhaps[1]
- {%
- \def\enverb@ifnotend@perhaps##1%
- {%
- \enverb@ifnotend@perhaps@\enverb@mark##1\enverb@mark\enverb@ifnotend@end
- \enverb@mark#1\enverb@mark\@thirdofthree
- \enverb@stop
- }%
- \def\enverb@ifnotend@perhaps@
- ##1\enverb@mark#1##2\enverb@mark##3##4\enverb@stop
- {##3{##2}}%
- }
-\providecommand\@thirdofthree[3]{#3}
-\outer\def\myabsolutestop{\stop}
-\newcommand\enverb@ifnotend@end[3]
- {%
- \iffalse{\fi}%
- \enverb@ensure@blank{#1}{\string\end}%
- \expanded
- {%
- \endgroup
- \enverbsetup
- {\unexpanded\expandafter{\enverb@collected@oarg}}%
- \noexpand\enverb@output
- {\unexpanded\expandafter{\enverb@collected@body}}%
- }%
- {#2}%
- \expandafter\end\expandafter{\@currenvir}%
- }
-\long\def\enverb@output#1#2%
- {%
- \enverb@ifautoignore
- {\enverb@setup@ignore{\enverb@count{#2}+\enverb@moreignore}}%
- {\enverb@setup@ignore\enverb@ignore}%
- \edef\enverb@line##1\enverb@eol
- {%
- \noexpand\detokenize{##1}%
- \noexpand\unexpanded{\unexpanded\expandafter{\enverb@eol@content}}%
- }%
- \edef\enverb@collected@body{#1}%
- \expanded
- {\unexpanded{\enverb@append\enverb@gadd\@gobble}\expandafter}%
- \expandafter{\enverb@collected@body}%
- \par
- \enverb@aboveskip
- \enverb@ifno@lst{}%
- {%
- \enverb@ifsameline
- {\noindent\begin{minipage}[c]{\enverb@codeshare\linewidth}}%
- {}%
- \begingroup
- \everyeof{\noexpand}%
- \expandafter
- \endgroup
- \scantokens\expanded
- {{%
- \noexpand\csname enverb@lst\endcsname
- \enverb@othercr
- \enverb@collected@body
- \string\end{lstlisting}\enverb@othercr
- }}%
- \enverb@ifsameline{\end{minipage}}{}%
- }%
- \enverb@inter
- \enverb@ifno@tcb{}%
- {%
- \begingroup
- \everyeof{\noexpand}%
- \newlinechar=\endlinechar
- \expandafter
- \endgroup
- \scantokens\expanded
- {{%
- \noexpand\csname enverb@tcb\endcsname
- \enverb@pretcb{\unexpanded\expandafter}%
- \enverb@collected@body
- \noexpand\end{exresult}%
- }}%
+ \ekvdoc@enverb@pretcb{\ekvdoc@enverb@pre\enverbBody}%
+ \enverbExecute
+ \end{exresult}%
}%
\par
- \enverb@belowskip
- \enverb@after
+ \ekvdoc@enverb@belowskip
+ \ekvdoc@enverb@after
\@endpetrue
}
-\providecommand\@firstofnine[9]{#1}
-\newcommand\enverb@setup@ignore[1]
- {\expandafter\enverb@setup@ignore@\the\numexpr#1\relax;\enverb@line}
-\def\enverb@setup@ignore@#1;#2%
- {%
- \ifnum#1>9
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
- {\expandafter\enverb@setup@ignore@\the\numexpr#1-8;{\@firstofnine{#2}}}%
- {%
- \let\enverb@bol@gobble\@empty % just so that renewcommand doesn't go nuts
- \expanded
- {%
- \unexpanded{\renewcommand\enverb@bol@gobble}\ifnum#1>\z@[#1]\fi
- {%
- \noexpand\unexpanded
- {\unexpanded\expandafter{\enverb@bol@content}}%
- \unexpanded{#2}%
- }%
- \unexpanded{\def\enverb@bol##1\enverb@eol}%
- {%
- \noexpand\unexpanded
- {\unexpanded\expandafter{\enverb@bol@content}}%
- \unexpanded{\expandafter\enverb@ifempty\expanded}{{##1}}%
- {\noexpand\enverb@line}%
- {\noexpand\enverb@bol@gobble}%
- ##1\unexpanded{\enverb@eol}%
- }%
- }%
- }%
- }
-\let\endenverb\@empty
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex b/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex
index 47d2c744a52..3ea08a042f1 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex
@@ -13,8 +13,8 @@
\cs_set_protected:Npn \__expkvdoc_tmp:nN #1#2
{
\__kernel_tl_set:Nx #2 { \tl_to_str:n {#1} }
- \tl_replace_all:Nxn #2 { \c_underscore_str } { / }
- \tl_remove_all:Nx #2 { \c_backslash_str }
+ \tl_replace_all:NVn #2 \c_underscore_str { / }
+ \tl_remove_all:NV #2 \c_backslash_str
\tl_put_left:Nn #2 { doc/function// }
}
\cs_if_eq:NNTF \__expkvdoc_tmp:nN \__codedoc_get_hyper_target:nN
diff --git a/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex b/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex
index a94920bfffa..e616a696909 100644
--- a/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex
+++ b/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex
@@ -29,7 +29,7 @@
textit,texttt,
usepackage,
usemodule,
- @gobble,@gobbletwo,@firstofone,@empty,
+ @gobble,@gobbletwo,@firstofone,@empty,@firstoftwo,@secondoftwo,
ExplSyntaxOn,ExplSyntaxOff,
}
,moretexcs=[4]% used packages
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins b/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins
index 648b1b2871a..6a4b85b0338 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-Project: expkv-bundle Copyright (C) 2020-2023 Jonathan P. Spratte
+Project: expkv-bundle Copyright (C) 2020-2024 Jonathan P. Spratte
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -39,7 +39,7 @@ Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
-Copyright (C) 2020-2023 Jonathan P. Spratte
+Copyright (C) 2020-2024 Jonathan P. Spratte
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx b/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx
index 4cf7946a87e..6e3c11ab8de 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv-cs.dtx Copyright (C) 2020-2023 Jonathan P. Spratte
+% File: expkv-cs.dtx Copyright (C) 2020-2024 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -90,8 +90,8 @@
% \begin{macro}{\ekvcVersion,\ekvcDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvcVersion{1.3}
-\def\ekvcDate{2023-01-23}
+\def\ekvcVersion{1.4}
+\def\ekvcDate{2024-12-16}
% \end{macrocode}
% \end{macro}
%
@@ -1090,36 +1090,47 @@
% \begin{macro}[internal]
% {
% \ekvc@type@enum,\ekvc@h@enum,\ekvc@h@enum@,\ekvc@enum@name,
-% \ekvc@type@choice@
+% \ekvc@type@choice,\ekvc@type@choice@k,\ekvc@type@choice@p
% }
% Enums don't need to apply special trickery to make the parts of the names
% retrievable, so unlike in \expkvd\ we don't need catcode juggling.
% The setup of an |enum| requires unpacking the value in two different
-% arguments so we need an auxiliary here.
+% arguments so we need an auxiliary here. A |choice| is basically the same,
+% but a bit more flexible (it allows to specify a value to be forwarded
+% instead of just a positional number), hence we need a slightly different
+% second step.
% \begin{macrocode}
\def\ekvc@enum@name#1#2#3{ekvc#1(#2)#3}
\ekvpDefType{ekvc@setup@secondary}{enum}
- {\ekvpAssertTwoValues{#3}\ekvc@type@enum\ekvc@type@enum@{#1}#3}
+ {\ekvpAssertTwoValues{#3}\ekvc@type@enum{#1}#3}
\ekvpDefType{ekvc@setup@secondary}{choice}
- {\ekvpAssertTwoValues{#3}\ekvc@type@enum\ekvc@type@choice@{#1}#3}
-\protected\long\def\ekvc@type@enum#1#2#3%
+ {\ekvpAssertTwoValues{#3}\ekvc@type@choice{#1}#3}
+\protected\long\def\ekvc@type@enum@or@choice#1#2%
{%
- \ekvc@assert@defined{#3}%
+ \ekvc@assert@defined{#2}%
% \end{macrocode}
% At run time we need another helper and we need to expand the current
-% |\ekvc@set| now. The helper will build a control sequence from each given
-% value, those will be set up in the |\ekvcsvloop|.
+% |\ekvc@set| now. The helper will check whether the given value is defined
+% and call the underlying macro (defined below).
% \begin{macrocode}
\ekvc@long\edef\ekvc@tmp##1%
{%
\ekv@unexpanded{\expandafter\ekvc@h@enum\detokenize}{##1}%
\ekv@unexpanded{\ekvc@stop}%
- {\ekvc@set}{#2}%
+ {\ekvc@set}{#1}%
}%
- \ekvlet\ekvc@set{#2}\ekvc@tmp
+ \ekvlet\ekvc@set{#1}\ekvc@tmp
+ }
+\protected\long\def\ekvc@type@enum#1#2%
+ {%
+ \ekvc@type@enum@or@choice{#1}{#2}%
+% \end{macrocode}
+% |\ekvc@type@enum@| will build a control sequence from each given value,
+% those will be set up in the |\ekvcsvloop|.
+% \begin{macrocode}
\def\ekvc@tmp{0}%
\expandafter\ekvcsvloop\expandafter
- {\expandafter#1\csname\ekv@name\ekvc@set{#3}\endcsname{#2}}%
+ {\expandafter\ekvc@type@enum@\csname\ekv@name\ekvc@set{#2}\endcsname{#1}}%
}
% \end{macrocode}
% Here |#1| will be the key-macro of the underlying primary or secondary key,
@@ -1133,12 +1144,32 @@
{\ekv@unexpanded{#1}{\ekvc@tmp}}%
\edef\ekvc@tmp{\the\numexpr\ekvc@tmp+1\relax}%
}
-\ekv@exparg{\protected\long\def\ekvc@type@choice@#1#2#3}%
+% \end{macrocode}
+% Similar code for the |choice| type.
+% \begin{macrocode}
+\protected\long\def\ekvc@type@choice#1#2%
+ {%
+ \ekvc@type@enum@or@choice{#1}{#2}%
+ \ekv@exparg
+ {%
+ \expandafter\ekvparse\expandafter
+ {%
+ \expandafter\ekvc@type@choice@k
+ \csname\ekv@name\ekvc@set{#2}\endcsname{#1}%
+ }%
+ }%
+ {%
+ \expandafter\ekvc@type@choice@p
+ \csname\ekv@name\ekvc@set{#2}\endcsname{#1}%
+ }%
+ }
+\ekv@exparg{\protected\long\def\ekvc@type@choice@p#1#2#3#4}%
{%
\expandafter\expandafter\expandafter\edef\expandafter
\csname\ekvc@enum@name\ekvc@set{#2}{\detokenize{#3}}\endcsname
- {\ekv@unexpanded{#1{#3}}}%
+ {\ekv@unexpanded{#1{#4}}}%
}
+\protected\long\def\ekvc@type@choice@k#1#2#3{\ekvc@type@choice@p#1{#2}{#3}{#3}}
% \end{macrocode}
% The use-time helper will check if the macro for the passed in choice exists,
% if it doesn't throws an error, else calls that macro which will set the
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx b/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx
index 33933425e6b..6fc3c54b149 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv-def.dtx Copyright (C) 2020-2023 Jonathan P. Spratte
+% File: expkv-def.dtx Copyright (C) 2020-2024 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -85,8 +85,8 @@
% \begin{macro}{\ekvdVersion,\ekvdDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvdVersion{1.0}
-\def\ekvdDate{2023-01-23}
+\def\ekvdVersion{1.1}
+\def\ekvdDate{2024-12-16}
% \end{macrocode}
% \end{macro}
%
@@ -696,6 +696,38 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{alias}
+% A few more or less standard tests and then copy over the definitions.
+% \begin{macrocode}
+\ekvd@def@type{alias}
+ {%
+ \ekvd@assert@arg
+ \ekvd@assert@not@protected
+ \ekvd@assert@not@long
+ \ekvd@assert@not@also
+% \end{macrocode}
+% In order to do nothing if |new| should be checked and the error condition
+% for either the |Val|- or |NoVal|-key is met we need to check for the defined
+% keys without actually copying here (the alternative would be using an
+% auxiliary variable which we would then need to check anyway).
+% \begin{macrocode}
+ \ekvifdefined\ekvd@set{#3}{\ekvd@do@new{}{#1}}{}%
+ \ekvifdefinedNoVal\ekvd@set{#3}{\ekvd@do@new{NoVal}{#1}}{}%
+% \end{macrocode}
+% Assert that at least one of |Val|- or |NoVal|-keys exist.
+% \begin{macrocode}
+ \ekvpAssertTF
+ {\ekvifdefined\ekvd@set{#3}\@firstoftwo{\ekvifdefinedNoVal\ekvd@set{#3}}}%
+ {undefined key `#3'}%
+% \end{macrocode}
+% Copy the definitions.
+% \begin{macrocode}
+ \ekvifdefined\ekvd@set{#3}{\ekvletkv\ekvd@set{#1}\ekvd@set{#3}}{}%
+ \ekvifdefinedNoVal\ekvd@set{#3}{\ekvletkvNoVal\ekvd@set{#1}\ekvd@set{#3}}{}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{choice}
% \begin{macro}[internal]{\ekvd@type@choice,\ekvd@populate@choice}
% The real key definition of a |choice| type is pretty simple, the heavy
@@ -838,6 +870,51 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{choice-aliases}
+% \begin{macro}[internal]{\ekvd@t@choicealias}
+% Choice alias shall copy over separate choices to new names for the same key.
+% The code is pretty straight forward, we just make sure no disallowed
+% prefixes were used, the key exists, is already a choice key, and then we
+% loop through the list of aliases.
+% \begin{macrocode}
+\ekvd@def@type{choice-aliases}
+ {%
+ \ekvd@assert@arg
+ \ekvd@assert@not@protected
+ \ekvd@assert@not@long
+ \ekvd@assert@not@also
+ \ekvd@assert@already@choice{#1}%
+ \ekvparse\ekvd@err@missing@value{\ekvd@t@choicealias{#1}}{#3}%
+ }
+% \end{macrocode}
+% The copying of the definitions is rather straight forward, check if choice
+% of that name exists, and if so copy it. The |new| prefix will apply for each
+% individual new choice, so we need to check this here.
+% \begin{macrocode}
+\protected\long\def\ekvd@t@choicealias#1#2#3%
+ {%
+ \ifx\ekvd@do@new\ekvd@assert@new
+ \ekv@fi@firstofone
+ \fi
+ \@gobble
+ {%
+ \ekv@ifdefined{\ekvd@choice@name\ekvd@set{#1}{#2}}%
+ {\ekvd@err@not@new@choice{#2}\ekv@gobbleto@stop}%
+ {}%
+ }%
+ \ekv@ifdefined{\ekvd@choice@name\ekvd@set{#1}{#3}}%
+ {%
+ \expandafter\let
+ \csname\ekvd@choice@name\ekvd@set{#1}{#2}\expandafter\endcsname
+ \csname\ekvd@choice@name\ekvd@set{#1}{#3}\endcsname
+ }%
+ {\ekvd@err@undefined@choice{#1}{#3}}%
+ \@gobble\ekv@stop
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{unknown-choice}
% \begin{macrocode}
\ekvd@def@type{unknown-choice}
@@ -1220,9 +1297,14 @@
% \begin{macrocode}
\protected\def\ekvd@if@not@already@choice#1%
{%
- \expandafter\ekvd@if@not@already@choice@a
- \csname\ekv@name\ekvd@set{#1}\endcsname
- {}\ekvd@h@choice\ekvd@stop
+ \ekvifdefined\ekvd@set{#1}%
+ {%
+ \expandafter
+ \ekvd@if@not@already@choice@a
+ \csname\ekv@name\ekvd@set{#1}\endcsname
+ {}\ekvd@h@choice\ekvd@stop
+ }%
+ {\@firstofone}%
}
\protected\def\ekvd@if@not@already@choice@a
{%
@@ -1235,6 +1317,15 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[internal]{\ekvd@assert@already@choice}
+% A small assertion that a key is defined as a choice key. With the test
+% |\ekvd@if@not@already@choice| this becomes pretty easy.
+% \begin{macrocode}
+\long\def\ekvd@assert@already@choice#1%
+ {\ekvd@if@not@already@choice{#1}{\ekvd@err@not@choice\ekvpGobbleT}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[internal]{\ekvd@ifspace,\ekvd@ifspace@}
% Yet another test which can be reduced to an if-empty, this time by gobbling
% everything up to the first space.
@@ -1259,10 +1350,13 @@
% \begin{macro}[internal]
% {
% \ekvd@errm,\ekvd@err@missing@definition,
-% \ekvd@err@missing@type,\ekvd@err@undefined@prefix,\ekvd@err@undefined@key,
+% \ekvd@err@missing@type,
+% \ekvd@err@undefined@prefix,\ekvd@err@undefined@key,
+% \ekvd@err@undefined@noval,\ekvd@err@undefined@choice,
% \ekvd@err@no@prefix,\ekvd@err@no@prefix@also,
% \ekvd@err@add@val@on@noval,\ekvd@err@add@noval@on@val,
-% \ekvd@err@unsupported@arg,\ekvd@err@not@new
+% \ekvd@err@unsupported@arg,\ekvd@err@not@new,\ekvd@err@not@new@choice,
+% \ekvd@err@not@choice,\ekvd@err@missing@value
% }
% The non-expandable error messages are boring, so here they are:
% \begin{macrocode}
@@ -1288,7 +1382,7 @@
{%
\ekvd@errm
{%
- Undefined noval key `\ekv@unexpanded{#1}' found while processing
+ Undefined NoVal key `\ekv@unexpanded{#1}' found while processing
`\ekvd@cur'%
}%
}
@@ -1310,8 +1404,19 @@
}
\protected\def\ekvd@err@not@new
{\ekvd@errm{The key for `\ekvd@cur' is already defined}}
-\protected\long\def\ekvd@err@misused@unknown
+\protected\def\ekvd@err@not@new@choice#1%
+ {\ekvd@errm{The choice `\detokenize{#1}' is already defined for `\ekvd@cur'}}
+\protected\def\ekvd@err@misused@unknown
{\ekvd@errm{Misuse of the unknown type found while processing `\ekvd@cur'}}
+\protected\long\def\ekvd@err@not@choice
+ {\ekvd@errm{The key for `\ekvd@cur' is not an existing choice key}}
+\protected\long\def\ekvd@err@missing@value#1%
+ {\ekvd@errm{Missing value for `#1' in `\ekvd@cur'}}
+\protected\long\def\ekvd@err@undefined@choice#1#2%
+ {%
+ \ekvd@errm
+ {Undefined choice `#2' for key `#1' found while processing `\ekvd@cur'}%
+ }
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx b/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx
index 2bc84dafaa2..0d292099857 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv-opt.dtx Copyright (C) 2020-2023 Jonathan P. Spratte
+% File: expkv-opt.dtx Copyright (C) 2020-2024 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -27,7 +27,7 @@ Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
--------------------------------------------------------------
-Copyright (C) 2020-2023 Jonathan P. Spratte
+Copyright (C) 2020-2024 Jonathan P. Spratte
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx b/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx
index d2b51d0cb06..74efcb8b626 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv-opt.dtx Copyright (C) 2020-2023 Jonathan P. Spratte
+% File: expkv-opt.dtx Copyright (C) 2020-2024 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -51,8 +51,8 @@
% \begin{macro}{\ekvoVersion,\ekvoDate}
% Store the package's version and date in two macros.
% \begin{macrocode}
-\newcommand*\ekvoVersion{1.0}
-\newcommand*\ekvoDate{2023-01-23}
+\newcommand*\ekvoVersion{1.1}
+\newcommand*\ekvoDate{2024-12-16}
% \end{macrocode}
% \end{macro}
% And we report who we are and what we need.
@@ -239,6 +239,27 @@
% \begin{macrocode}
\protected\def\ekvo@set@handlers@local
{%
+% \end{macrocode}
+% In case a class has the same option list as the global class, and there are
+% already options in the unused options list, it should remove known keys
+% from the unused options list.
+% \begin{macrocode}
+ \ifx\@currext\@clsextension
+ \unless\ifx\@classoptionslist\relax
+ \expandafter
+ \ifx
+ \csname @raw@opt@\@currname.\@currext\endcsname
+ \@raw@classoptionslist
+ \unless\ifx\@unusedoptionlist\@empty
+ \let\ekvo@handle@defined@k\ekvo@rmfrom@unused@one
+ \let\ekvo@handle@defined@kv\ekvo@rmfrom@unused@two
+ \fi
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
+% The normal unused handlers for a class:
+% \begin{macrocode}
\ekvo@if@need@handlers
{%
\ifx\@currext\@clsextension
@@ -252,10 +273,6 @@
\@raw@classoptionslist
\let\ekvo@handle@undefined@k\ekvo@addto@unused@one
\let\ekvo@handle@undefined@kv\ekvo@addto@unused@two
- \unless\ifx\@unusedoptionlist\@empty
- \let\ekvo@handle@defined@k\ekvo@rmfrom@unused@one
- \let\ekvo@handle@defined@kv\ekvo@rmfrom@unused@two
- \fi
\else
\let\ekvo@handle@undefined@k\@gobble
\let\ekvo@handle@undefined@kv\@gobbletwo
@@ -640,22 +657,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ekvoProcessUnusedGlobalOptions}
-% \begin{macrocode}
-\protected\def\ekvoProcessUnusedGlobalOptions#1%
- {%
- \PackageError{expkv-opt}%
- {%
- \noexpand
- \ekvoProcessUnusedGlobalOptions no longer works because of changes in%
- \MessageBreak
- the LaTeX2e kernel%
- }%
- {}%
- }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\ekvoProcessFutureOptions}
% Parsing future options (without patching kernel internals) is only possible
% with kernel versions after 2022-11-01.
@@ -761,7 +762,7 @@
\csname\ekvo@name{}uN\expandafter\endcsname\expandafter
{\detokenize{##1}}{##1}%
}%
- {\@gobble}%
+ {}%
}%
\long\def\ekvo@handle@undefined@kv##1##2%
{%
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx b/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx
index dc05d6bd0bb..d29e362ec12 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv-pop.dtx Copyright (C) 2020-2023 Jonathan P. Spratte
+% File: expkv-pop.dtx Copyright (C) 2020-2024 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx b/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx
index 1c883b43462..6618247b141 100644
--- a/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx
+++ b/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% File: expkv.dtx Copyright (C) 2020-2023 Jonathan P. Spratte
+% File: expkv.dtx Copyright (C) 2020-2024 Jonathan P. Spratte
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -115,8 +115,8 @@
% \begin{macro}{\ekvVersion,\ekvDate}
% We're on our first input, so lets store the version and date in a macro.
% \begin{macrocode}
-\def\ekvVersion{2.0}
-\def\ekvDate{2023-01-23}
+\def\ekvVersion{2.1}
+\def\ekvDate{2024-12-26}
% \end{macrocode}
% \end{macro}
%
@@ -255,6 +255,28 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[internal]{\ekv@ifatmostone}
+% Our check for at most one group or single non-space token is rather straight
+% forward. There are in essence three cases.
+%
+% If |#1| is blank the auxiliary |\ekv@ifatmostone@| will read
+% |\ekv@stop|\hspace{0pt}|\ekv@iflabk@false| as |#1#2| and |#3| will be empty.
+% Leading to the test being true.
+%
+% If |#1| has exactly one group or single non-space token the auxiliary will
+% read that argument plus |\ekv@stop| as |#1#2| and |\ekv@ifblank@false| as
+% |#3|. Leading to the test being true.
+%
+% If |#1| has two or more normal arguments the auxiliary will gobble the first
+% two as |#1#2| and the possibly empty remainder until the first |\ekv@stop|
+% as |#3|. Then |\ekv@ifblank@false| kicks in and the test is indeed false.
+% \begin{macrocode}
+\long\def\ekv@ifatmostone#1%
+ {\ekv@ifatmostone@#1\ekv@stop\ekv@ifblank@false\ekv@stop\@firstoftwo}
+\long\def\ekv@ifatmostone@#1#2#3\ekv@stop{}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[internal]{\ekv@ifdefined}
% We'll need to check whether something is defined quite frequently, so why not
% define a macro that does this. The following test is expandable and pretty
@@ -439,12 +461,11 @@
% \begin{macrocode}
\def\ekv@name@set#1{ekv#1(}
\long\def\ekv@name@key#1{#1)}
-\edef\ekv@name
+\long\ekv@expandedarg{\def\ekv@name#1#2}%
{%
\ekv@unexpanded\expandafter{\ekv@name@set{#1}}%
\ekv@unexpanded\expandafter{\ekv@name@key{\detokenize{#2}}}%
}
-\long\ekv@exparg{\def\ekv@name#1#2}{\ekv@name}
% \end{macrocode}
% \end{macro}
%
@@ -469,7 +490,7 @@
% package if an |\outer| has been gobbled this way. I consider that good,
% because keys shouldn't be defined |\outer| anyways.
% \begin{macrocode}
-\edef\ekv@checkvalid
+\protected\ekv@expandedarg{\def\ekv@checkvalid#1#2}%
{%
\ekv@unexpanded\expandafter{\ekv@ifempty{#1}}%
\ekv@unexpanded
@@ -490,7 +511,6 @@
}%
\ekv@unexpanded{\@gobble}%
}
-\ekv@exparg{\protected\def\ekv@checkvalid#1#2}{\ekv@checkvalid}%
% \end{macrocode}
% \end{macro}
%
@@ -2072,10 +2092,10 @@
% |\ekv@exparg| so that during runtime the macro storing the set name
% is already built and one |\expandafter| doesn't have to be used.
% \begin{macrocode}
-\ekv@expargtwice{\protected\def\ekvsetdef#1#2}%
+\ekv@exparg{\protected\def\ekvsetdef#1#2}%
{%
\romannumeral
- \ekv@exparg{\ekv@zero\ekv@exparg{\def#1##1}}%
+ \ekv@exparg{\expandafter\ekv@zero\ekv@exparg{\def#1##1}}%
{\ekvset{#2}{##1}}%
}
% \end{macrocode}
@@ -2085,16 +2105,16 @@
% And do the same for |\ekvsetSneaked| in the two possible ways, with a fixed
% sneaked argument and with a flexible one.
% \begin{macrocode}
-\ekv@expargtwice{\protected\def\ekvsetSneakeddef#1#2}%
+\ekv@exparg{\protected\def\ekvsetSneakeddef#1#2}%
{%
\romannumeral
- \ekv@exparg{\ekv@zero\ekv@exparg{\long\def#1##1##2}}%
+ \ekv@exparg{\expandafter\ekv@zero\ekv@exparg{\def#1##1##2}}%
{\ekvsetSneaked{#2}{##1}{##2}}%
}
-\ekv@expargtwice{\protected\def\ekvsetdefSneaked#1#2#3}%
+\ekv@exparg{\protected\long\def\ekvsetdefSneaked#1#2#3}%
{%
\romannumeral
- \ekv@exparg{\ekv@zero\ekv@exparg{\long\def#1##1}}%
+ \ekv@exparg{\expandafter\ekv@zero\ekv@exparg{\def#1##1}}%
{\ekvsetSneaked{#2}{#3}{##1}}%
}
% \end{macrocode}
@@ -2108,7 +2128,11 @@
\@firstofone{\endgroup
\def\ekv@alignsafe{\romannumeral\iffalse{\fi`^^@ }
}
-\def\ekv@endalignsafe{\ifnum`{=\ekv@zero}\fi}
+\begingroup
+\catcode`\^^@=1
+\@firstofone{\endgroup
+ \edef\ekv@endalignsafe{\ekv@unexpanded{\romannumeral`^^@\iffalse}\fi} }
+}
% \end{macrocode}
% \end{macro}
%
@@ -2156,10 +2180,11 @@
% The two macros to grab the optional argument have to remove the remainder of
% the test and the wrong next step as well as grabbing the argument.
% \begin{macrocode}
-\long\def\ekv@optarg@b\ekv@mark[\ekv@mark\ifnum`##1\fi\@firstofone##2##3##4##5]%
+\@firstofone{\long\def\ekv@optarg@b
+ \ekv@mark[\ekv@mark\romannumeral`##1\fi} \@firstofone##2##3##4##5]%
{#2##2{##5}}
-\long\def\ekv@optargTF@b
- ##1\ekv@mark[\ekv@mark\ifnum`##2\fi\@firstofone##3##4##5]%
+\@firstofone{\long\def\ekv@optargTF@b
+ ##1\ekv@mark[\ekv@mark\romannumeral`##2\fi} \@firstofone##3##4##5]%
{#2 ##1{##5}}
}
% \end{macrocode}
@@ -2167,11 +2192,7 @@
% trailing space from the definition of |\ekv@alignsafe|.
% \begin{macrocode}
\ekv@exparg
- {%
- \expandafter\ekv@strip\expandafter
- {\expandafter\ekv@mark\ekv@alignsafe}%
- \ekvoptarg
- }%
+ {\ekv@exparg\ekv@strip{\expandafter\ekv@mark\ekv@alignsafe}\ekvoptarg}%
\ekv@endalignsafe
\long\def\ekv@optarg@if#1\ekv@mark[\ekv@mark{}
% \end{macrocode}
@@ -2183,9 +2204,9 @@
% \begin{macrocode}
\long\def\ekv@ifstar#1#2#3%
{%
- \if*\string#3%
- \ekv@fi@firstoftwo
- \fi
+ \ekv@ifatmostone{#3}%
+ {\if*\string#3\ekv@fi@firstoftwo\fi}%
+ {}%
\@secondoftwo
{#1}%
{#2{#3}}%
@@ -2346,7 +2367,7 @@
\ekv@exparg{\long\def\ekv@err@common@#1`#2' #3.#4#5}%
{\ekv@err{#4 `#5' in set `#2'}}
\ekv@exparg{\long\def\ekv@err@unknown#1#2}{\ekv@err@common{unknown key}{#1}}
-\ekv@exparg{\long\def\ekv@err@noarg#1#2}
+\ekv@exparg{\long\def\ekv@err@noarg#1#2}%
{\ekv@err@common{unwanted value for}{#1}}
\ekv@exparg{\long\def\ekv@err@reqval#1#2}%
{\ekv@err@common{missing value for}{#1}}
@@ -2355,7 +2376,7 @@
\ekv@exparg{\def\ekv@err@redirect@k@notfound#1#2\ekv@stop}%
{\ekv@err{no NoVal key `#1' in sets #2}}
\ekv@exparg{\def\ekv@err@undefined@expansion#1\fi}%
- {\expandafter\fi\ekv@err{Undefined expansion rule `#1'}}%
+ {\expandafter\fi\ekv@err{Undefined expansion rule `#1'}}
\ekv@exparg{\def\ekv@err@erroneous@variable#1}%
{\ekv@err{Erroneous variable `#1' used}}
\ekv@exparg{\def\ekv@err@key@no@reinsert}%
diff --git a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex
index f4fcf8fdc0f..73aa33ef1c1 100644
--- a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex
+++ b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex
index 5752a499295..2dd8f672f67 100644
--- a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex
+++ b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex
index 4e66a908a9c..0309abd776b 100644
--- a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex
+++ b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex
index 489f2df0159..b6acaf2e7e7 100644
--- a/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex
+++ b/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex b/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex
index ef836dd7b57..e1a90e78dda 100644
--- a/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex
+++ b/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -52,8 +52,8 @@
\else
\expandafter\endinput
\fi
-\def\ekvcVersion{1.3}
-\def\ekvcDate{2023-01-23}
+\def\ekvcVersion{1.4}
+\def\ekvcDate{2024-12-16}
\csname ekvc@tmp\endcsname
\expandafter\chardef\csname ekvc@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -646,22 +646,26 @@
}
\def\ekvc@enum@name#1#2#3{ekvc#1(#2)#3}
\ekvpDefType{ekvc@setup@secondary}{enum}
- {\ekvpAssertTwoValues{#3}\ekvc@type@enum\ekvc@type@enum@{#1}#3}
+ {\ekvpAssertTwoValues{#3}\ekvc@type@enum{#1}#3}
\ekvpDefType{ekvc@setup@secondary}{choice}
- {\ekvpAssertTwoValues{#3}\ekvc@type@enum\ekvc@type@choice@{#1}#3}
-\protected\long\def\ekvc@type@enum#1#2#3%
+ {\ekvpAssertTwoValues{#3}\ekvc@type@choice{#1}#3}
+\protected\long\def\ekvc@type@enum@or@choice#1#2%
{%
- \ekvc@assert@defined{#3}%
+ \ekvc@assert@defined{#2}%
\ekvc@long\edef\ekvc@tmp##1%
{%
\ekv@unexpanded{\expandafter\ekvc@h@enum\detokenize}{##1}%
\ekv@unexpanded{\ekvc@stop}%
- {\ekvc@set}{#2}%
+ {\ekvc@set}{#1}%
}%
- \ekvlet\ekvc@set{#2}\ekvc@tmp
+ \ekvlet\ekvc@set{#1}\ekvc@tmp
+ }
+\protected\long\def\ekvc@type@enum#1#2%
+ {%
+ \ekvc@type@enum@or@choice{#1}{#2}%
\def\ekvc@tmp{0}%
\expandafter\ekvcsvloop\expandafter
- {\expandafter#1\csname\ekv@name\ekvc@set{#3}\endcsname{#2}}%
+ {\expandafter\ekvc@type@enum@\csname\ekv@name\ekvc@set{#2}\endcsname{#1}}%
}
\ekv@exparg{\protected\long\def\ekvc@type@enum@#1#2#3}%
{%
@@ -670,12 +674,29 @@
{\ekv@unexpanded{#1}{\ekvc@tmp}}%
\edef\ekvc@tmp{\the\numexpr\ekvc@tmp+1\relax}%
}
-\ekv@exparg{\protected\long\def\ekvc@type@choice@#1#2#3}%
+\protected\long\def\ekvc@type@choice#1#2%
+ {%
+ \ekvc@type@enum@or@choice{#1}{#2}%
+ \ekv@exparg
+ {%
+ \expandafter\ekvparse\expandafter
+ {%
+ \expandafter\ekvc@type@choice@k
+ \csname\ekv@name\ekvc@set{#2}\endcsname{#1}%
+ }%
+ }%
+ {%
+ \expandafter\ekvc@type@choice@p
+ \csname\ekv@name\ekvc@set{#2}\endcsname{#1}%
+ }%
+ }
+\ekv@exparg{\protected\long\def\ekvc@type@choice@p#1#2#3#4}%
{%
\expandafter\expandafter\expandafter\edef\expandafter
\csname\ekvc@enum@name\ekvc@set{#2}{\detokenize{#3}}\endcsname
- {\ekv@unexpanded{#1{#3}}}%
+ {\ekv@unexpanded{#1{#4}}}%
}
+\protected\long\def\ekvc@type@choice@k#1#2#3{\ekvc@type@choice@p#1{#2}{#3}{#3}}
\ekv@if@lastnamedcs
{%
\ekv@exparg{\def\ekvc@h@enum#1\ekvc@stop#2#3}%
diff --git a/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex b/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex
index 89ddadbf916..078f7ea0dac 100644
--- a/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex
+++ b/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -52,8 +52,8 @@
\else
\expandafter\endinput
\fi
-\def\ekvdVersion{1.0}
-\def\ekvdDate{2023-01-23}
+\def\ekvdVersion{1.1}
+\def\ekvdDate{2024-12-16}
\csname ekvd@tmp\endcsname
\expandafter\chardef\csname ekvd@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -456,6 +456,20 @@
}
\protected\long\def\ekvd@type@smeta@#1#2#3%
{\ekvd@prot\ekvd@long\ekv@expargtwice{\def\ekvd@tmp#3}{\ekvset{#1}{#2}}}
+\ekvd@def@type{alias}
+ {%
+ \ekvd@assert@arg
+ \ekvd@assert@not@protected
+ \ekvd@assert@not@long
+ \ekvd@assert@not@also
+ \ekvifdefined\ekvd@set{#3}{\ekvd@do@new{}{#1}}{}%
+ \ekvifdefinedNoVal\ekvd@set{#3}{\ekvd@do@new{NoVal}{#1}}{}%
+ \ekvpAssertTF
+ {\ekvifdefined\ekvd@set{#3}\@firstoftwo{\ekvifdefinedNoVal\ekvd@set{#3}}}%
+ {undefined key `#3'}%
+ \ekvifdefined\ekvd@set{#3}{\ekvletkv\ekvd@set{#1}\ekvd@set{#3}}{}%
+ \ekvifdefinedNoVal\ekvd@set{#3}{\ekvletkvNoVal\ekvd@set{#1}\ekvd@set{#3}}{}%
+ }
\protected\def\ekvd@type@choice#1%
{%
\ekvd@assert@not@long
@@ -542,6 +556,35 @@
{#1=\@firstofone{\ekvd@tmp} }%
\edef\ekvd@tmp{\the\numexpr\ekvd@tmp+1\relax}%
}
+\ekvd@def@type{choice-aliases}
+ {%
+ \ekvd@assert@arg
+ \ekvd@assert@not@protected
+ \ekvd@assert@not@long
+ \ekvd@assert@not@also
+ \ekvd@assert@already@choice{#1}%
+ \ekvparse\ekvd@err@missing@value{\ekvd@t@choicealias{#1}}{#3}%
+ }
+\protected\long\def\ekvd@t@choicealias#1#2#3%
+ {%
+ \ifx\ekvd@do@new\ekvd@assert@new
+ \ekv@fi@firstofone
+ \fi
+ \@gobble
+ {%
+ \ekv@ifdefined{\ekvd@choice@name\ekvd@set{#1}{#2}}%
+ {\ekvd@err@not@new@choice{#2}\ekv@gobbleto@stop}%
+ {}%
+ }%
+ \ekv@ifdefined{\ekvd@choice@name\ekvd@set{#1}{#3}}%
+ {%
+ \expandafter\let
+ \csname\ekvd@choice@name\ekvd@set{#1}{#2}\expandafter\endcsname
+ \csname\ekvd@choice@name\ekvd@set{#1}{#3}\endcsname
+ }%
+ {\ekvd@err@undefined@choice{#1}{#3}}%
+ \@gobble\ekv@stop
+ }
\ekvd@def@type{unknown-choice}
{%
\ekvd@do@new@for@name{\ekvd@unknown@choice@name\ekvd@set{#1}}%
@@ -770,9 +813,14 @@
}
\protected\def\ekvd@if@not@already@choice#1%
{%
- \expandafter\ekvd@if@not@already@choice@a
- \csname\ekv@name\ekvd@set{#1}\endcsname
- {}\ekvd@h@choice\ekvd@stop
+ \ekvifdefined\ekvd@set{#1}%
+ {%
+ \expandafter
+ \ekvd@if@not@already@choice@a
+ \csname\ekv@name\ekvd@set{#1}\endcsname
+ {}\ekvd@h@choice\ekvd@stop
+ }%
+ {\@firstofone}%
}
\protected\def\ekvd@if@not@already@choice@a
{%
@@ -782,6 +830,8 @@
{%
\ekv@ifempty{#2}\@firstofone\@gobble
}
+\long\def\ekvd@assert@already@choice#1%
+ {\ekvd@if@not@already@choice{#1}{\ekvd@err@not@choice\ekvpGobbleT}}
\long\def\ekvd@ifspace#1%
{%
\ekvd@ifspace@#1 \ekv@ifempty@B
@@ -813,7 +863,7 @@
{%
\ekvd@errm
{%
- Undefined noval key `\ekv@unexpanded{#1}' found while processing
+ Undefined NoVal key `\ekv@unexpanded{#1}' found while processing
`\ekvd@cur'%
}%
}
@@ -835,8 +885,19 @@
}
\protected\def\ekvd@err@not@new
{\ekvd@errm{The key for `\ekvd@cur' is already defined}}
-\protected\long\def\ekvd@err@misused@unknown
+\protected\def\ekvd@err@not@new@choice#1%
+ {\ekvd@errm{The choice `\detokenize{#1}' is already defined for `\ekvd@cur'}}
+\protected\def\ekvd@err@misused@unknown
{\ekvd@errm{Misuse of the unknown type found while processing `\ekvd@cur'}}
+\protected\long\def\ekvd@err@not@choice
+ {\ekvd@errm{The key for `\ekvd@cur' is not an existing choice key}}
+\protected\long\def\ekvd@err@missing@value#1%
+ {\ekvd@errm{Missing value for `#1' in `\ekvd@cur'}}
+\protected\long\def\ekvd@err@undefined@choice#1#2%
+ {%
+ \ekvd@errm
+ {Undefined choice `#2' for key `#1' found while processing `\ekvd@cur'}%
+ }
\def\ekvd@err@choice@invalid#1%
{%
\ekvd@err@choice@invalid@#1%
diff --git a/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex b/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex
index d0d77817d9a..163c72a30d9 100644
--- a/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex
+++ b/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex b/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex
index 5e6488039b1..a5bfd2b79af 100644
--- a/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex
+++ b/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -74,8 +74,8 @@
\expandafter\endinput
\fi
\fi
-\def\ekvVersion{2.0}
-\def\ekvDate{2023-01-23}
+\def\ekvVersion{2.1}
+\def\ekvDate{2024-12-26}
\csname ekv@tmp\endcsname
\expandafter\chardef\csname ekv@tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -123,6 +123,9 @@
\long\def\ekv@ifblank@\ekv@mark#1#2\ekv@stop{}
\long\def\ekv@ifblank@false\ekv@stop\@firstoftwo#1#2{#2}
\def\ekv@ifblank@gobbletrue\ekv@stop#1{}
+\long\def\ekv@ifatmostone#1%
+ {\ekv@ifatmostone@#1\ekv@stop\ekv@ifblank@false\ekv@stop\@firstoftwo}
+\long\def\ekv@ifatmostone@#1#2#3\ekv@stop{}
\ekv@if@lastnamedcs
{%
\long\def\ekv@ifdefined#1{\ifcsname#1\endcsname\ekv@ifdef@\fi\@secondoftwo}
@@ -228,14 +231,13 @@
{\ekv@csv@loop{#2}\ekv@mark}
\def\ekv@name@set#1{ekv#1(}
\long\def\ekv@name@key#1{#1)}
-\edef\ekv@name
+\long\ekv@expandedarg{\def\ekv@name#1#2}%
{%
\ekv@unexpanded\expandafter{\ekv@name@set{#1}}%
\ekv@unexpanded\expandafter{\ekv@name@key{\detokenize{#2}}}%
}
-\long\ekv@exparg{\def\ekv@name#1#2}{\ekv@name}
\def\ekv@undefined@set#1{! expkv Error: Set `#1' undefined.}
-\edef\ekv@checkvalid
+\protected\ekv@expandedarg{\def\ekv@checkvalid#1#2}%
{%
\ekv@unexpanded\expandafter{\ekv@ifempty{#1}}%
\ekv@unexpanded
@@ -256,7 +258,6 @@
}%
\ekv@unexpanded{\@gobble}%
}
-\ekv@exparg{\protected\def\ekv@checkvalid#1#2}{\ekv@checkvalid}%
\ekv@expargtwice{\long\def\ekvifdefined#1#2}%
{\expandafter\ekv@ifdefined\expandafter{\ekv@name{#1}{#2}}}
\ekv@expargtwice{\long\def\ekvifdefinedNoVal#1#2}%
@@ -1071,22 +1072,22 @@
\ekv@expansion@parse@pair@\@gobble{#2}%
}
\long\def\ekv@expansion@parse@pair@#1#2\@gobble#3{\ekv@unexpanded{#3{#1}{#2}}}
-\ekv@expargtwice{\protected\def\ekvsetdef#1#2}%
+\ekv@exparg{\protected\def\ekvsetdef#1#2}%
{%
\romannumeral
- \ekv@exparg{\ekv@zero\ekv@exparg{\def#1##1}}%
+ \ekv@exparg{\expandafter\ekv@zero\ekv@exparg{\def#1##1}}%
{\ekvset{#2}{##1}}%
}
-\ekv@expargtwice{\protected\def\ekvsetSneakeddef#1#2}%
+\ekv@exparg{\protected\def\ekvsetSneakeddef#1#2}%
{%
\romannumeral
- \ekv@exparg{\ekv@zero\ekv@exparg{\long\def#1##1##2}}%
+ \ekv@exparg{\expandafter\ekv@zero\ekv@exparg{\def#1##1##2}}%
{\ekvsetSneaked{#2}{##1}{##2}}%
}
-\ekv@expargtwice{\protected\def\ekvsetdefSneaked#1#2#3}%
+\ekv@exparg{\protected\long\def\ekvsetdefSneaked#1#2#3}%
{%
\romannumeral
- \ekv@exparg{\ekv@zero\ekv@exparg{\long\def#1##1}}%
+ \ekv@exparg{\expandafter\ekv@zero\ekv@exparg{\def#1##1}}%
{\ekvsetSneaked{#2}{#3}{##1}}%
}
\begingroup
@@ -1094,7 +1095,11 @@
\@firstofone{\endgroup
\def\ekv@alignsafe{\romannumeral\iffalse{\fi`^^@ }
}
-\def\ekv@endalignsafe{\ifnum`{=\ekv@zero}\fi}
+\begingroup
+\catcode`\^^@=1
+\@firstofone{\endgroup
+ \edef\ekv@endalignsafe{\ekv@unexpanded{\romannumeral`^^@\iffalse}\fi} }
+}
\begingroup
\def\ekvoptarg#1#2{%
\endgroup
@@ -1112,25 +1117,22 @@
#2%
\@firstofone{ ##2}{##3}%
}
-\long\def\ekv@optarg@b\ekv@mark[\ekv@mark\ifnum`##1\fi\@firstofone##2##3##4##5]%
+\@firstofone{\long\def\ekv@optarg@b
+ \ekv@mark[\ekv@mark\romannumeral`##1\fi} \@firstofone##2##3##4##5]%
{#2##2{##5}}
-\long\def\ekv@optargTF@b
- ##1\ekv@mark[\ekv@mark\ifnum`##2\fi\@firstofone##3##4##5]%
+\@firstofone{\long\def\ekv@optargTF@b
+ ##1\ekv@mark[\ekv@mark\romannumeral`##2\fi} \@firstofone##3##4##5]%
{#2 ##1{##5}}
}
\ekv@exparg
- {%
- \expandafter\ekv@strip\expandafter
- {\expandafter\ekv@mark\ekv@alignsafe}%
- \ekvoptarg
- }%
+ {\ekv@exparg\ekv@strip{\expandafter\ekv@mark\ekv@alignsafe}\ekvoptarg}%
\ekv@endalignsafe
\long\def\ekv@optarg@if#1\ekv@mark[\ekv@mark{}
\long\def\ekv@ifstar#1#2#3%
{%
- \if*\string#3%
- \ekv@fi@firstoftwo
- \fi
+ \ekv@ifatmostone{#3}%
+ {\if*\string#3\ekv@fi@firstoftwo\fi}%
+ {}%
\@secondoftwo
{#1}%
{#2{#3}}%
@@ -1223,7 +1225,7 @@
\ekv@exparg{\long\def\ekv@err@common@#1`#2' #3.#4#5}%
{\ekv@err{#4 `#5' in set `#2'}}
\ekv@exparg{\long\def\ekv@err@unknown#1#2}{\ekv@err@common{unknown key}{#1}}
-\ekv@exparg{\long\def\ekv@err@noarg#1#2}
+\ekv@exparg{\long\def\ekv@err@noarg#1#2}%
{\ekv@err@common{unwanted value for}{#1}}
\ekv@exparg{\long\def\ekv@err@reqval#1#2}%
{\ekv@err@common{missing value for}{#1}}
@@ -1232,7 +1234,7 @@
\ekv@exparg{\def\ekv@err@redirect@k@notfound#1#2\ekv@stop}%
{\ekv@err{no NoVal key `#1' in sets #2}}
\ekv@exparg{\def\ekv@err@undefined@expansion#1\fi}%
- {\expandafter\fi\ekv@err{Undefined expansion rule `#1'}}%
+ {\expandafter\fi\ekv@err{Undefined expansion rule `#1'}}
\ekv@exparg{\def\ekv@err@erroneous@variable#1}%
{\ekv@err{Erroneous variable `#1' used}}
\ekv@exparg{\def\ekv@err@key@no@reinsert}%
diff --git a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty
index 66faca62fe7..b84419000ca 100644
--- a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty
+++ b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty
index 300974bd57f..ae8bbb846f4 100644
--- a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty
+++ b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty
index c2082261d77..45864b6021b 100644
--- a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty
+++ b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% --------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty
index a3d3dd2a742..8b768949737 100644
--- a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty
+++ b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -58,8 +58,8 @@
}
\DeclareRelease{v0.1}{2020/10/10}{expkv-opt-2020-10-10.sty}
\DeclareCurrentRelease{v0.2}{2021/04/04}
-\newcommand*\ekvoVersion{1.0}
-\newcommand*\ekvoDate{2023-01-23}
+\newcommand*\ekvoVersion{1.1}
+\newcommand*\ekvoDate{2024-12-16}
\ProvidesPackage{expkv-opt}
[%
\ekvoDate\space v\ekvoVersion\space
@@ -146,6 +146,19 @@
{\unexpanded\expandafter{#1}}
\protected\def\ekvo@set@handlers@local
{%
+ \ifx\@currext\@clsextension
+ \unless\ifx\@classoptionslist\relax
+ \expandafter
+ \ifx
+ \csname @raw@opt@\@currname.\@currext\endcsname
+ \@raw@classoptionslist
+ \unless\ifx\@unusedoptionlist\@empty
+ \let\ekvo@handle@defined@k\ekvo@rmfrom@unused@one
+ \let\ekvo@handle@defined@kv\ekvo@rmfrom@unused@two
+ \fi
+ \fi
+ \fi
+ \fi
\ekvo@if@need@handlers
{%
\ifx\@currext\@clsextension
@@ -159,10 +172,6 @@
\@raw@classoptionslist
\let\ekvo@handle@undefined@k\ekvo@addto@unused@one
\let\ekvo@handle@undefined@kv\ekvo@addto@unused@two
- \unless\ifx\@unusedoptionlist\@empty
- \let\ekvo@handle@defined@k\ekvo@rmfrom@unused@one
- \let\ekvo@handle@defined@kv\ekvo@rmfrom@unused@two
- \fi
\else
\let\ekvo@handle@undefined@k\@gobble
\let\ekvo@handle@undefined@kv\@gobbletwo
@@ -401,17 +410,6 @@
\let\ekvo@handle@defined@kv\@gobbletwo
}%
}
-\protected\def\ekvoProcessUnusedGlobalOptions#1%
- {%
- \PackageError{expkv-opt}%
- {%
- \noexpand
- \ekvoProcessUnusedGlobalOptions no longer works because of changes in%
- \MessageBreak
- the LaTeX2e kernel%
- }%
- {}%
- }
\IfFormatAtLeastTF{2022/11/01}
{%
\protected\def\ekvoProcessFutureOptions#1%
@@ -489,7 +487,7 @@
\csname\ekvo@name{}uN\expandafter\endcsname\expandafter
{\detokenize{##1}}{##1}%
}%
- {\@gobble}%
+ {}%
}%
\long\def\ekvo@handle@undefined@kv##1##2%
{%
diff --git a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty
index d72d49d2567..28a58b43058 100644
--- a/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty
+++ b/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or
diff --git a/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty b/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty
index 310beff3bc9..80db4430728 100644
--- a/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty
+++ b/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty
@@ -13,7 +13,7 @@
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%%
-%% Copyright (C) 2020-2023 Jonathan P. Spratte
+%% Copyright (C) 2020-2024 Jonathan P. Spratte
%%
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this license or