texlive[73212] Master/texmf-dist: expkv-bundle (26dec24)
commits+karl at tug.org
commits+karl at tug.org
Thu Dec 26 22:14:12 CET 2024
Revision: 73212
https://tug.org/svn/texlive?view=revision&revision=73212
Author: karl
Date: 2024-12-26 22:14:11 +0100 (Thu, 26 Dec 2024)
Log Message:
-----------
expkv-bundle (26dec24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/expkv-bundle/README.md
trunk/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdf
trunk/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex
trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex
trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex
trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex
trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex
trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex
trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx
trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx
trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex
trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex
trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex
trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex
trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex
trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex
trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex
trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex
trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty
trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty
trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty
trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty
trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty
trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/README.md 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/README.md 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 @@
-------------------------------------------------------------------------------
-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
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/expkv-bundle.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-cs.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -380,19 +380,21 @@
\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 @@
\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 @@
\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}
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-def.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -320,7 +320,7 @@
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 @@
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 @@
\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 @@
\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]
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/pkg-main.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -928,10 +928,10 @@
\cs{ekv at name@set}\marg{set}
\cs{ekv at 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 at 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 at name@key} must be |\detokenize|d. Both blocks are put
together (with the necessary |\detokenize|) by \cs{ekv at name}. For \Nkey{}s an
additional |N| gets appended, so their name is
\cs{ekv at name}\marg{set}\marg{key}|N|.
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-enverb.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -1,348 +1,97 @@
-\RequirePackage{expkv-def}
+\RequirePackage{expkv-def,enverb}
-\ExplSyntaxOn
-\cs_new_eq:NN \enverb at count \tl_count:n
-\cs_set:Npx \enverb at othercr { \char_generate:nn {13} {12} }
-\ExplSyntaxOff
%% key setup
-\ekvdefinekeys{enverb}
+\enverbsetup{key-set=expkv/enverb}
+\ekvdefinekeys{expkv/enverb}
{
- boolTF auto-ignore = \enverb at ifautoignore
- ,initial auto-ignore
- ,protected code ignore = \let\enverb at ifautoignore\@secondoftwo
- ,eint more-ignore = \enverb at moreignore
- ,initial more-ignore = 2
- ,also eint ignore = \enverb at ignore
- ,boolTF same-line = \enverb at ifsameline
+ ,boolTF same-line = \ekvdoc at enverb@ifsameline
,unknown-choice same-line =
- \let\enverb at ifsameline\@firstoftwo\edef\enverb at codeshare{\unexpanded{#1}}
+ \let\ekvdoc at enverb@ifsameline\@firstoftwo\edef\ekvdoc at enverb@codeshare{\unexpanded{#1}}
,initial same-line = 0.75
- ,invboolTF other-line = \enverb at ifsameline
+ ,invboolTF other-line = \ekvdoc at enverb@ifsameline
,nmeta below = {same-line=false, no-aboveskip, no-belowskip}
,nmeta undo-below = {same-line=true, aboveskip, belowskip}
- ,store same-line-lst = \enverb at options@lst at same
- ,store same-line-tcb = \enverb at options@tcb at same
+ ,store same-line-lst = \ekvdoc at enverb@options at lst@same
+ ,store same-line-tcb = \ekvdoc at enverb@options at tcb@same
,initial same-line-lst = {aboveskip=0pt,belowskip=0pt}
,initial same-line-tcb = {nobeforeafter,box align=center}
- ,store other-line-lst = \enverb at options@lst at other
- ,store other-line-tcb = \enverb at options@tcb at other
+ ,store other-line-lst = \ekvdoc at enverb@options at lst@other
+ ,store other-line-tcb = \ekvdoc at enverb@options at 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 at options@lst
- ,store tcb = \enverb at options@tcb
- ,long store bol = \enverb at bol@content
- ,long store eol = \enverb at eol@content
- ,einitial eol = \enverb at othercr
- ,boolTF no-lst = \enverb at ifno@lst
+ ,store lst = \ekvdoc at enverb@options at lst
+ ,store tcb = \ekvdoc at enverb@options at tcb
+ ,boolTF no-lst = \ekvdoc at enverb@ifno at lst
,also nmeta no-lst = below
- ,boolTF no-tcb = \enverb at ifno@tcb
+ ,boolTF no-tcb = \ekvdoc at enverb@ifno at tcb
,also nmeta no-tcb = below
,nmeta undo-no-tcb = {no-tcb=false, undo-below}
- ,store inter = \enverb at inter
- ,data gappend = \enverb at append
- ,dataT pre-tcb = \enverb at pretcb
- ,store after = \enverb at after
- ,nmeta store = gappend=\enverb at store
- ,noval no-store = \let\enverb at append\@secondoftwo
- ,nmeta restore = {pre-tcb=\enverb at store,after=\enverb at clear@store}
- ,code aboveskip = \edef\enverb at aboveskip{\vskip\unexpanded{#1}\relax}
- ,code belowskip = \edef\enverb at belowskip{\vskip\unexpanded{#1}\relax}
+ ,store inter = \ekvdoc at enverb@inter
+ ,data gappend = \ekvdoc at enverb@append
+ ,dataT pre-tcb = \ekvdoc at enverb@pretcb
+ ,store after = \ekvdoc at enverb@after
+ ,nmeta store = gappend=\ekvdoc at enverb@store
+ ,noval no-store = \let\ekvdoc at enverb@append\@secondoftwo
+ ,nmeta restore = {o: pre-tcb=\ekvdoc at enverb@store,after=\ekvdoc at enverb@clear at store}
+ ,code aboveskip = \edef\ekvdoc at enverb@aboveskip{\vskip\unexpanded{#1}\relax}
+ ,code belowskip = \edef\ekvdoc at enverb@belowskip{\vskip\unexpanded{#1}\relax}
,default aboveskip = \medskipamount
,default belowskip = \medskipamount
,initial aboveskip
,initial belowskip
- ,noval no-aboveskip = \let\enverb at aboveskip\@empty
- ,noval no-belowskip = \let\enverb at belowskip\@empty
+ ,noval no-aboveskip = \let\ekvdoc at enverb@aboveskip\@empty
+ ,noval no-belowskip = \let\ekvdoc at enverb@belowskip\@empty
}
-\protected\long\ekvsetdef\enverbsetup{enverb}
-\protected\def\enverb at clear@store{\global\let\enverb at store\@empty}
-\enverb at clear@store
+\protected\def\ekvdoc at enverb@clear at store{\global\let\ekvdoc at enverb@store\@empty}
+\ekvdoc at enverb@clear at store
-%% start of nested environments
-\newcommand\enverb at tcb
+\newcommand\ekvdoc at enverb@gaddo[2]
+ {\xdef#1{\unexpanded\expandafter{#1}\unexpanded\expandafter{#2}}}
+\newcommand\ekvdoc at enverb@pre[2]
+ {\edef#1{\unexpanded{#2}\unexpanded\expandafter{#1}}}
+\NewCommandCopy\Enverb\enverb
+\def\enverb{\Enverb{}}
+\def\endenverb
{%
- \expanded
+ \ekvdoc at enverb@append\ekvdoc at enverb@gaddo\@gobble\enverbBody
+ \par
+ \ekvdoc at enverb@aboveskip
+ \ekvdoc at enverb@ifno at lst{}%
{%
- \noexpand\begin{exresult}%
- [{%
- \enverb at options@tcb,%
- \enverb at ifsameline\enverb at options@tcb at same\enverb at options@tcb at other
- }]%
+ \ekvdoc at enverb@ifsameline
+ {\noindent\begin{minipage}[c]{\ekvdoc at enverb@codeshare\linewidth}}%
+ {}%
+ \ExpandArgs{ne}\enverbListing{lstlisting}
+ {[{%
+ \ekvdoc at enverb@options at lst,%
+ \ekvdoc at enverb@ifsameline
+ \ekvdoc at enverb@options at lst@same
+ \ekvdoc at enverb@options at lst@other
+ }]}%
+ \ekvdoc at enverb@ifsameline{\end{minipage}}{}%
}%
- {\linewidth\enverb at ifsameline{-\enverb at codeshare\linewidth}{}}%
- }
-\newcommand\enverb at lst
- {%
- \expanded
+ \ekvdoc at enverb@inter
+ \ekvdoc at enverb@ifno at tcb{}%
{%
- \noexpand\begin{lstlisting}%
+ \expanded{\noexpand\begin{exresult}
[{%
- \enverb at options@lst,%
- \enverb at ifsameline\enverb at options@lst at same\enverb at options@lst at other
- }]%
- }%
- }
-
-%% auxiliary error function
-\newcommand\enverb at 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 at body@space{}%
-\def\enverb at body@tab{}%
-\def\enverb at body@newline#1~%
- {\enverb at ifnotend{#1}{\enverb at bol\unexpanded{#1}\enverb at eol~}}%
-%% activate the category code regime of the body
-\protected\def\enverb at body@setup
- {%
- \let\enverb at collected@body\@empty
- \let\do\@makeother\dospecials
- \catcode`\^^M=13 \let~\enverb at body@newline
- \catcode`\ =13 \let:\enverb at body@space
- \catcode`\^^I=13 \let;\enverb at body@tab
- \let\enverb at bol\relax
- \let\enverb at eol\relax
- }
-%% check for optional argument
-\newcommand\enverb at search@oarg at a
- {%
- \ifx:\next
- \ifenverb at firsteol
- \else
- \enverb at body@add{:}%
- \fi
- \let\next\enverb at search@oarg at b
- \else
- \ifx~\next
- \ifenverb at firsteol
- \enverb at firsteolfalse
- \else
- \enverb at body@add{~}%
- \fi
- \let\next\enverb at search@oarg at b
- \else
- \ifx[\next\@gobble]%
- \let\next\enverb at oarg
- \else
- \ifenverb at firsteol
- \let\next\enverb at body@after at begin
- \else
- \let\next\enverb at body
- \fi
- \fi
- \fi
- \fi
- \next
- }
-%% start body collection
-\newcommand\enverb at body
- {\edef\enverb at collected@body{\iffalse}\fi\expandafter~\enverb at collected@body}
-%% check the line after an oarg
-\def\enverb at body@after at oarg#1~%
- {\enverb at ensure@blank{#1}{closing bracket}\enverb at body}
-%% check the line after the \begin statement
-\def\enverb at body@after at begin#1~%
- {\enverb at ensure@blank{#1}{\string\begin}\enverb at body}
-}
-%% quick check for empty line
-\newcommand\enverb at ensure@blank[2]
- {%
- \expandafter\enverb at ifempty\expanded{{#1}}{}%
- {%
- \expanded{%
- \noexpand\enverb at error
+ \ekvdoc at enverb@options at tcb,%
+ \ekvdoc at enverb@ifsameline
+ \ekvdoc at enverb@options at tcb@same
+ \ekvdoc at enverb@options at tcb@other
+ }]}%
{%
- Line after #2 not empty.\noexpand\MessageBreak
- Contains: \detokenize\expandafter{\romannumeral`\^^@#1}%
+ \linewidth
+ \ekvdoc at enverb@ifsameline{-\ekvdoc at enverb@codeshare\linewidth}{}%
}%
- }%
+ \ekvdoc at enverb@pretcb{\ekvdoc at enverb@pre\enverbBody}%
+ \enverbExecute
+ \end{exresult}%
}%
- }
-%% quick check for empty argument
-\newcommand\enverb at ifempty[1]
- {%
- \enverb at ifempty@\enverb at ifempty@A#1\enverb at ifempty@B.\enverb at ifempty@true
- \enverb at ifempty@A\enverb at ifempty@B
- }
-\def\enverb at ifempty@#1\enverb at ifempty@A\enverb at ifempty@B#2#3{#3}
-\def\enverb at ifempty@true\enverb at ifempty@A\enverb at ifempty@B#1#2{#1}
-\newcommand\enverb at gadd[2]{\xdef#1{\unexpanded\expandafter{#1#2}}}
-\newcommand\enverb at body@add[1]
- {%
- \edef\enverb at collected@body
- {\unexpanded\expandafter{\enverb at collected@body#1}}%
- }
-% start of environment `enverb'
-\newcommand\enverb
- {%
- \begingroup
- \def\tmp{enverb}%
- \expandafter
- \endgroup
- \expandafter\enverb at ifnotend@setup at perhaps\expanded
- {{\string{\@currenvir\string}}}%
- \begingroup
- \enverb at body@setup
- \enverb at firsteoltrue
- \let\enverb at collected@oarg\@empty
- \enverb at search@oarg
- }
-\newif\ifenverb at firsteol
-\newcommand\enverb at search@oarg{\futurelet\next\enverb at search@oarg at a}
-\newcommand\enverb at search@oarg at b{\expandafter\enverb at search@oarg\@gobble}
-\newcommand\enverb at oarg{\endgroup\enverb at oarg@}
-\NewDocumentCommand\enverb at oarg@{O{}}
- {%
- \edef\enverb at collected@oarg{\unexpanded{#1}}%
- \begingroup
- \enverb at body@setup
- \enverb at body@after at oarg
- }
-\def\enverb at ifnotend#1%
- {%
- \def\enverb at ifnotend##1%
- {%
- \enverb at ifnotend@
- ##1\enverb at mark\enverb at ifnotend@maybe
- #1\enverb at mark\@thirdofthree
- \enverb at stop
- }%
- \def\enverb at ifnotend@##1#1##2\enverb at mark##3##4\enverb at stop{##3{##1}{##2}}%
- }
-\expandafter\enverb at ifnotend\expanded{{\expandafter\@gobble\string\\end}}
-\newcommand\enverb at ifnotend@maybe[2]
- {\expandafter\enverb at ifnotend@perhaps\expandafter{\romannumeral`\^^@#2}{#1}}
-\newcommand\enverb at ifnotend@setup at perhaps[1]
- {%
- \def\enverb at ifnotend@perhaps##1%
- {%
- \enverb at ifnotend@perhaps@\enverb at mark##1\enverb at mark\enverb at ifnotend@end
- \enverb at mark#1\enverb at mark\@thirdofthree
- \enverb at stop
- }%
- \def\enverb at ifnotend@perhaps@
- ##1\enverb at mark#1##2\enverb at mark##3##4\enverb at stop
- {##3{##2}}%
- }
-\providecommand\@thirdofthree[3]{#3}
-\outer\def\myabsolutestop{\stop}
-\newcommand\enverb at ifnotend@end[3]
- {%
- \iffalse{\fi}%
- \enverb at ensure@blank{#1}{\string\end}%
- \expanded
- {%
- \endgroup
- \enverbsetup
- {\unexpanded\expandafter{\enverb at collected@oarg}}%
- \noexpand\enverb at output
- {\unexpanded\expandafter{\enverb at collected@body}}%
- }%
- {#2}%
- \expandafter\end\expandafter{\@currenvir}%
- }
-\long\def\enverb at output#1#2%
- {%
- \enverb at ifautoignore
- {\enverb at setup@ignore{\enverb at count{#2}+\enverb at moreignore}}%
- {\enverb at setup@ignore\enverb at ignore}%
- \edef\enverb at line##1\enverb at eol
- {%
- \noexpand\detokenize{##1}%
- \noexpand\unexpanded{\unexpanded\expandafter{\enverb at eol@content}}%
- }%
- \edef\enverb at collected@body{#1}%
- \expanded
- {\unexpanded{\enverb at append\enverb at gadd\@gobble}\expandafter}%
- \expandafter{\enverb at collected@body}%
\par
- \enverb at aboveskip
- \enverb at ifno@lst{}%
- {%
- \enverb at ifsameline
- {\noindent\begin{minipage}[c]{\enverb at codeshare\linewidth}}%
- {}%
- \begingroup
- \everyeof{\noexpand}%
- \expandafter
- \endgroup
- \scantokens\expanded
- {{%
- \noexpand\csname enverb at lst\endcsname
- \enverb at othercr
- \enverb at collected@body
- \string\end{lstlisting}\enverb at othercr
- }}%
- \enverb at ifsameline{\end{minipage}}{}%
- }%
- \enverb at inter
- \enverb at ifno@tcb{}%
- {%
- \begingroup
- \everyeof{\noexpand}%
- \newlinechar=\endlinechar
- \expandafter
- \endgroup
- \scantokens\expanded
- {{%
- \noexpand\csname enverb at tcb\endcsname
- \enverb at pretcb{\unexpanded\expandafter}%
- \enverb at collected@body
- \noexpand\end{exresult}%
- }}%
- }%
- \par
- \enverb at belowskip
- \enverb at after
+ \ekvdoc at enverb@belowskip
+ \ekvdoc at enverb@after
\@endpetrue
}
-\providecommand\@firstofnine[9]{#1}
-\newcommand\enverb at setup@ignore[1]
- {\expandafter\enverb at setup@ignore@\the\numexpr#1\relax;\enverb at line}
-\def\enverb at setup@ignore@#1;#2%
- {%
- \ifnum#1>9
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
- {\expandafter\enverb at setup@ignore@\the\numexpr#1-8;{\@firstofnine{#2}}}%
- {%
- \let\enverb at bol@gobble\@empty % just so that renewcommand doesn't go nuts
- \expanded
- {%
- \unexpanded{\renewcommand\enverb at bol@gobble}\ifnum#1>\z@[#1]\fi
- {%
- \noexpand\unexpanded
- {\unexpanded\expandafter{\enverb at bol@content}}%
- \unexpanded{#2}%
- }%
- \unexpanded{\def\enverb at bol##1\enverb at eol}%
- {%
- \noexpand\unexpanded
- {\unexpanded\expandafter{\enverb at bol@content}}%
- \unexpanded{\expandafter\enverb at ifempty\expanded}{{##1}}%
- {\noexpand\enverb at line}%
- {\noexpand\enverb at bol@gobble}%
- ##1\unexpanded{\enverb at eol}%
- }%
- }%
- }%
- }
-\let\endenverb\@empty
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-l3doctweaks.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/doc/latex/expkv-bundle/preamble-lst.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -29,7 +29,7 @@
textit,texttt,
usepackage,
usemodule,
- @gobble, at gobbletwo, at firstofone, at empty,
+ @gobble, at gobbletwo, at firstofone, at empty, at firstoftwo, at secondoftwo,
ExplSyntaxOn,ExplSyntaxOff,
}
,moretexcs=[4]% used packages
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-bundle.ins 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 @@
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
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-cs.dtx 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at type@enum,\ekvc at h@enum,\ekvc at h@enum@,\ekvc at enum@name,
-% \ekvc at type@choice@
+% \ekvc at type@choice,\ekvc at type@choice at k,\ekvc at type@choice at 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 at enum@name#1#2#3{ekvc#1(#2)#3}
\ekvpDefType{ekvc at setup@secondary}{enum}
- {\ekvpAssertTwoValues{#3}\ekvc at type@enum\ekvc at type@enum@{#1}#3}
+ {\ekvpAssertTwoValues{#3}\ekvc at type@enum{#1}#3}
\ekvpDefType{ekvc at setup@secondary}{choice}
- {\ekvpAssertTwoValues{#3}\ekvc at type@enum\ekvc at type@choice@{#1}#3}
-\protected\long\def\ekvc at type@enum#1#2#3%
+ {\ekvpAssertTwoValues{#3}\ekvc at type@choice{#1}#3}
+\protected\long\def\ekvc at type@enum at or@choice#1#2%
{%
- \ekvc at assert@defined{#3}%
+ \ekvc at assert@defined{#2}%
% \end{macrocode}
% At run time we need another helper and we need to expand the current
-% |\ekvc at set| now. The helper will build a control sequence from each given
-% value, those will be set up in the |\ekvcsvloop|.
+% |\ekvc at set| now. The helper will check whether the given value is defined
+% and call the underlying macro (defined below).
% \begin{macrocode}
\ekvc at long\edef\ekvc at tmp##1%
{%
\ekv at unexpanded{\expandafter\ekvc at h@enum\detokenize}{##1}%
\ekv at unexpanded{\ekvc at stop}%
- {\ekvc at set}{#2}%
+ {\ekvc at set}{#1}%
}%
- \ekvlet\ekvc at set{#2}\ekvc at tmp
+ \ekvlet\ekvc at set{#1}\ekvc at tmp
+ }
+\protected\long\def\ekvc at type@enum#1#2%
+ {%
+ \ekvc at type@enum at or@choice{#1}{#2}%
+% \end{macrocode}
+% |\ekvc at type@enum@| will build a control sequence from each given value,
+% those will be set up in the |\ekvcsvloop|.
+% \begin{macrocode}
\def\ekvc at tmp{0}%
\expandafter\ekvcsvloop\expandafter
- {\expandafter#1\csname\ekv at name\ekvc at set{#3}\endcsname{#2}}%
+ {\expandafter\ekvc at type@enum@\csname\ekv at name\ekvc at 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 at unexpanded{#1}{\ekvc at tmp}}%
\edef\ekvc at tmp{\the\numexpr\ekvc at tmp+1\relax}%
}
-\ekv at exparg{\protected\long\def\ekvc at type@choice@#1#2#3}%
+% \end{macrocode}
+% Similar code for the |choice| type.
+% \begin{macrocode}
+\protected\long\def\ekvc at type@choice#1#2%
{%
+ \ekvc at type@enum at or@choice{#1}{#2}%
+ \ekv at exparg
+ {%
+ \expandafter\ekvparse\expandafter
+ {%
+ \expandafter\ekvc at type@choice at k
+ \csname\ekv at name\ekvc at set{#2}\endcsname{#1}%
+ }%
+ }%
+ {%
+ \expandafter\ekvc at type@choice at p
+ \csname\ekv at name\ekvc at set{#2}\endcsname{#1}%
+ }%
+ }
+\ekv at exparg{\protected\long\def\ekvc at type@choice at p#1#2#3#4}%
+ {%
\expandafter\expandafter\expandafter\edef\expandafter
\csname\ekvc at enum@name\ekvc at set{#2}{\detokenize{#3}}\endcsname
- {\ekv at unexpanded{#1{#3}}}%
+ {\ekv at unexpanded{#1{#4}}}%
}
+\protected\long\def\ekvc at type@choice at k#1#2#3{\ekvc at type@choice at 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
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-def.dtx 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at def@type{alias}
+ {%
+ \ekvd at assert@arg
+ \ekvd at assert@not at protected
+ \ekvd at assert@not at long
+ \ekvd at assert@not at 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 at set{#3}{\ekvd at do@new{}{#1}}{}%
+ \ekvifdefinedNoVal\ekvd at set{#3}{\ekvd at do@new{NoVal}{#1}}{}%
+% \end{macrocode}
+% Assert that at least one of |Val|- or |NoVal|-keys exist.
+% \begin{macrocode}
+ \ekvpAssertTF
+ {\ekvifdefined\ekvd at set{#3}\@firstoftwo{\ekvifdefinedNoVal\ekvd at set{#3}}}%
+ {undefined key `#3'}%
+% \end{macrocode}
+% Copy the definitions.
+% \begin{macrocode}
+ \ekvifdefined\ekvd at set{#3}{\ekvletkv\ekvd at set{#1}\ekvd at set{#3}}{}%
+ \ekvifdefinedNoVal\ekvd at set{#3}{\ekvletkvNoVal\ekvd at set{#1}\ekvd at set{#3}}{}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{choice}
% \begin{macro}[internal]{\ekvd at type@choice,\ekvd at 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 at 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 at def@type{choice-aliases}
+ {%
+ \ekvd at assert@arg
+ \ekvd at assert@not at protected
+ \ekvd at assert@not at long
+ \ekvd at assert@not at also
+ \ekvd at assert@already at choice{#1}%
+ \ekvparse\ekvd at err@missing at value{\ekvd at 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 at t@choicealias#1#2#3%
+ {%
+ \ifx\ekvd at do@new\ekvd at assert@new
+ \ekv at fi@firstofone
+ \fi
+ \@gobble
+ {%
+ \ekv at ifdefined{\ekvd at choice@name\ekvd at set{#1}{#2}}%
+ {\ekvd at err@not at new@choice{#2}\ekv at gobbleto@stop}%
+ {}%
+ }%
+ \ekv at ifdefined{\ekvd at choice@name\ekvd at set{#1}{#3}}%
+ {%
+ \expandafter\let
+ \csname\ekvd at choice@name\ekvd at set{#1}{#2}\expandafter\endcsname
+ \csname\ekvd at choice@name\ekvd at set{#1}{#3}\endcsname
+ }%
+ {\ekvd at err@undefined at choice{#1}{#3}}%
+ \@gobble\ekv at stop
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{unknown-choice}
% \begin{macrocode}
\ekvd at def@type{unknown-choice}
@@ -1220,9 +1297,14 @@
% \begin{macrocode}
\protected\def\ekvd at if@not at already@choice#1%
{%
- \expandafter\ekvd at if@not at already@choice at a
- \csname\ekv at name\ekvd at set{#1}\endcsname
- {}\ekvd at h@choice\ekvd at stop
+ \ekvifdefined\ekvd at set{#1}%
+ {%
+ \expandafter
+ \ekvd at if@not at already@choice at a
+ \csname\ekv at name\ekvd at set{#1}\endcsname
+ {}\ekvd at h@choice\ekvd at stop
+ }%
+ {\@firstofone}%
}
\protected\def\ekvd at if@not at already@choice at a
{%
@@ -1235,6 +1317,15 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[internal]{\ekvd at assert@already at choice}
+% A small assertion that a key is defined as a choice key. With the test
+% |\ekvd at if@not at already@choice| this becomes pretty easy.
+% \begin{macrocode}
+\long\def\ekvd at assert@already at choice#1%
+ {\ekvd at if@not at already@choice{#1}{\ekvd at err@not at choice\ekvpGobbleT}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[internal]{\ekvd at ifspace,\ekvd at 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 at errm,\ekvd at err@missing at definition,
-% \ekvd at err@missing at type,\ekvd at err@undefined at prefix,\ekvd at err@undefined at key,
+% \ekvd at err@missing at type,
+% \ekvd at err@undefined at prefix,\ekvd at err@undefined at key,
+% \ekvd at err@undefined at noval,\ekvd at err@undefined at choice,
% \ekvd at err@no at prefix,\ekvd at err@no at prefix@also,
% \ekvd at err@add at val@on at noval,\ekvd at err@add at noval@on at val,
-% \ekvd at err@unsupported at arg,\ekvd at err@not at new
+% \ekvd at err@unsupported at arg,\ekvd at err@not at new,\ekvd at err@not at new@choice,
+% \ekvd at err@not at choice,\ekvd at err@missing at value
% }
% The non-expandable error messages are boring, so here they are:
% \begin{macrocode}
@@ -1288,7 +1382,7 @@
{%
\ekvd at errm
{%
- Undefined noval key `\ekv at unexpanded{#1}' found while processing
+ Undefined NoVal key `\ekv at unexpanded{#1}' found while processing
`\ekvd at cur'%
}%
}
@@ -1310,8 +1404,19 @@
}
\protected\def\ekvd at err@not at new
{\ekvd at errm{The key for `\ekvd at cur' is already defined}}
-\protected\long\def\ekvd at err@misused at unknown
+\protected\def\ekvd at err@not at new@choice#1%
+ {\ekvd at errm{The choice `\detokenize{#1}' is already defined for `\ekvd at cur'}}
+\protected\def\ekvd at err@misused at unknown
{\ekvd at errm{Misuse of the unknown type found while processing `\ekvd at cur'}}
+\protected\long\def\ekvd at err@not at choice
+ {\ekvd at errm{The key for `\ekvd at cur' is not an existing choice key}}
+\protected\long\def\ekvd at err@missing at value#1%
+ {\ekvd at errm{Missing value for `#1' in `\ekvd at cur'}}
+\protected\long\def\ekvd at err@undefined at choice#1#2%
+ {%
+ \ekvd at errm
+ {Undefined choice `#2' for key `#1' found while processing `\ekvd at cur'}%
+ }
% \end{macrocode}
% \end{macro}
%
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt-2020-10-10.dtx 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 @@
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
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-opt.dtx 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at set@handlers at 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 at opt@\@currname.\@currext\endcsname
+ \@raw at classoptionslist
+ \unless\ifx\@unusedoptionlist\@empty
+ \let\ekvo at handle@defined at k\ekvo at rmfrom@unused at one
+ \let\ekvo at handle@defined at kv\ekvo at rmfrom@unused at two
+ \fi
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
+% The normal unused handlers for a class:
+% \begin{macrocode}
\ekvo at if@need at handlers
{%
\ifx\@currext\@clsextension
@@ -252,10 +273,6 @@
\@raw at classoptionslist
\let\ekvo at handle@undefined at k\ekvo at addto@unused at one
\let\ekvo at handle@undefined at kv\ekvo at addto@unused at two
- \unless\ifx\@unusedoptionlist\@empty
- \let\ekvo at handle@defined at k\ekvo at rmfrom@unused at one
- \let\ekvo at handle@defined at kv\ekvo at rmfrom@unused at two
- \fi
\else
\let\ekvo at handle@undefined at k\@gobble
\let\ekvo at handle@undefined at 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 at name{}uN\expandafter\endcsname\expandafter
{\detokenize{##1}}{##1}%
}%
- {\@gobble}%
+ {}%
}%
\long\def\ekvo at handle@undefined at kv##1##2%
{%
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv-pop.dtx 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/source/latex/expkv-bundle/expkv.dtx 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at 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 at ifatmostone@| will read
+% |\ekv at stop|\hspace{0pt}|\ekv at 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 at stop| as |#1#2| and |\ekv at 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 at stop|
+% as |#3|. Then |\ekv at ifblank@false| kicks in and the test is indeed false.
+% \begin{macrocode}
+\long\def\ekv at ifatmostone#1%
+ {\ekv at ifatmostone@#1\ekv at stop\ekv at ifblank@false\ekv at stop\@firstoftwo}
+\long\def\ekv at ifatmostone@#1#2#3\ekv at stop{}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[internal]{\ekv at 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 at name@set#1{ekv#1(}
\long\def\ekv at name@key#1{#1)}
-\edef\ekv at name
+\long\ekv at expandedarg{\def\ekv at name#1#2}%
{%
\ekv at unexpanded\expandafter{\ekv at name@set{#1}}%
\ekv at unexpanded\expandafter{\ekv at name@key{\detokenize{#2}}}%
}
-\long\ekv at exparg{\def\ekv at name#1#2}{\ekv at 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 at checkvalid
+\protected\ekv at expandedarg{\def\ekv at checkvalid#1#2}%
{%
\ekv at unexpanded\expandafter{\ekv at ifempty{#1}}%
\ekv at unexpanded
@@ -490,7 +511,6 @@
}%
\ekv at unexpanded{\@gobble}%
}
-\ekv at exparg{\protected\def\ekv at checkvalid#1#2}{\ekv at checkvalid}%
% \end{macrocode}
% \end{macro}
%
@@ -2072,10 +2092,10 @@
% |\ekv at 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 at expargtwice{\protected\def\ekvsetdef#1#2}%
+\ekv at exparg{\protected\def\ekvsetdef#1#2}%
{%
\romannumeral
- \ekv at exparg{\ekv at zero\ekv at exparg{\def#1##1}}%
+ \ekv at exparg{\expandafter\ekv at zero\ekv at 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 at expargtwice{\protected\def\ekvsetSneakeddef#1#2}%
+\ekv at exparg{\protected\def\ekvsetSneakeddef#1#2}%
{%
\romannumeral
- \ekv at exparg{\ekv at zero\ekv at exparg{\long\def#1##1##2}}%
+ \ekv at exparg{\expandafter\ekv at zero\ekv at exparg{\def#1##1##2}}%
{\ekvsetSneaked{#2}{##1}{##2}}%
}
-\ekv at expargtwice{\protected\def\ekvsetdefSneaked#1#2#3}%
+\ekv at exparg{\protected\long\def\ekvsetdefSneaked#1#2#3}%
{%
\romannumeral
- \ekv at exparg{\ekv at zero\ekv at exparg{\long\def#1##1}}%
+ \ekv at exparg{\expandafter\ekv at zero\ekv at exparg{\def#1##1}}%
{\ekvsetSneaked{#2}{#3}{##1}}%
}
% \end{macrocode}
@@ -2108,7 +2128,11 @@
\@firstofone{\endgroup
\def\ekv at alignsafe{\romannumeral\iffalse{\fi`^^@ }
}
-\def\ekv at endalignsafe{\ifnum`{=\ekv at zero}\fi}
+\begingroup
+\catcode`\^^@=1
+\@firstofone{\endgroup
+ \edef\ekv at endalignsafe{\ekv at 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 at optarg@b\ekv at mark[\ekv at mark\ifnum`##1\fi\@firstofone##2##3##4##5]%
+\@firstofone{\long\def\ekv at optarg@b
+ \ekv at mark[\ekv at mark\romannumeral`##1\fi} \@firstofone##2##3##4##5]%
{#2##2{##5}}
-\long\def\ekv at optargTF@b
- ##1\ekv at mark[\ekv at mark\ifnum`##2\fi\@firstofone##3##4##5]%
+\@firstofone{\long\def\ekv at optargTF@b
+ ##1\ekv at mark[\ekv at mark\romannumeral`##2\fi} \@firstofone##3##4##5]%
{#2 ##1{##5}}
}
% \end{macrocode}
@@ -2167,11 +2192,7 @@
% trailing space from the definition of |\ekv at alignsafe|.
% \begin{macrocode}
\ekv at exparg
- {%
- \expandafter\ekv at strip\expandafter
- {\expandafter\ekv at mark\ekv at alignsafe}%
- \ekvoptarg
- }%
+ {\ekv at exparg\ekv at strip{\expandafter\ekv at mark\ekv at alignsafe}\ekvoptarg}%
\ekv at endalignsafe
\long\def\ekv at optarg@if#1\ekv at mark[\ekv at mark{}
% \end{macrocode}
@@ -2183,9 +2204,9 @@
% \begin{macrocode}
\long\def\ekv at ifstar#1#2#3%
{%
- \if*\string#3%
- \ekv at fi@firstoftwo
- \fi
+ \ekv at ifatmostone{#3}%
+ {\if*\string#3\ekv at fi@firstoftwo\fi}%
+ {}%
\@secondoftwo
{#1}%
{#2{#3}}%
@@ -2346,7 +2367,7 @@
\ekv at exparg{\long\def\ekv at err@common@#1`#2' #3.#4#5}%
{\ekv at err{#4 `#5' in set `#2'}}
\ekv at exparg{\long\def\ekv at err@unknown#1#2}{\ekv at err@common{unknown key}{#1}}
-\ekv at exparg{\long\def\ekv at err@noarg#1#2}
+\ekv at exparg{\long\def\ekv at err@noarg#1#2}%
{\ekv at err@common{unwanted value for}{#1}}
\ekv at exparg{\long\def\ekv at err@reqval#1#2}%
{\ekv at err@common{missing value for}{#1}}
@@ -2355,7 +2376,7 @@
\ekv at exparg{\def\ekv at err@redirect at k@notfound#1#2\ekv at stop}%
{\ekv at err{no NoVal key `#1' in sets #2}}
\ekv at exparg{\def\ekv at err@undefined at expansion#1\fi}%
- {\expandafter\fi\ekv at err{Undefined expansion rule `#1'}}%
+ {\expandafter\fi\ekv at err{Undefined expansion rule `#1'}}
\ekv at exparg{\def\ekv at err@erroneous at variable#1}%
{\ekv at err{Erroneous variable `#1' used}}
\ekv at exparg{\def\ekv at err@key at no@reinsert}%
Modified: trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-cs.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-def.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv-pop.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex
===================================================================
--- trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/context/third/expkv-bundle/t-expkv.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-cs.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at tmp\endcsname
\expandafter\chardef\csname ekvc at tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -646,22 +646,26 @@
}
\def\ekvc at enum@name#1#2#3{ekvc#1(#2)#3}
\ekvpDefType{ekvc at setup@secondary}{enum}
- {\ekvpAssertTwoValues{#3}\ekvc at type@enum\ekvc at type@enum@{#1}#3}
+ {\ekvpAssertTwoValues{#3}\ekvc at type@enum{#1}#3}
\ekvpDefType{ekvc at setup@secondary}{choice}
- {\ekvpAssertTwoValues{#3}\ekvc at type@enum\ekvc at type@choice@{#1}#3}
-\protected\long\def\ekvc at type@enum#1#2#3%
+ {\ekvpAssertTwoValues{#3}\ekvc at type@choice{#1}#3}
+\protected\long\def\ekvc at type@enum at or@choice#1#2%
{%
- \ekvc at assert@defined{#3}%
+ \ekvc at assert@defined{#2}%
\ekvc at long\edef\ekvc at tmp##1%
{%
\ekv at unexpanded{\expandafter\ekvc at h@enum\detokenize}{##1}%
\ekv at unexpanded{\ekvc at stop}%
- {\ekvc at set}{#2}%
+ {\ekvc at set}{#1}%
}%
- \ekvlet\ekvc at set{#2}\ekvc at tmp
+ \ekvlet\ekvc at set{#1}\ekvc at tmp
+ }
+\protected\long\def\ekvc at type@enum#1#2%
+ {%
+ \ekvc at type@enum at or@choice{#1}{#2}%
\def\ekvc at tmp{0}%
\expandafter\ekvcsvloop\expandafter
- {\expandafter#1\csname\ekv at name\ekvc at set{#3}\endcsname{#2}}%
+ {\expandafter\ekvc at type@enum@\csname\ekv at name\ekvc at set{#2}\endcsname{#1}}%
}
\ekv at exparg{\protected\long\def\ekvc at type@enum@#1#2#3}%
{%
@@ -670,12 +674,29 @@
{\ekv at unexpanded{#1}{\ekvc at tmp}}%
\edef\ekvc at tmp{\the\numexpr\ekvc at tmp+1\relax}%
}
-\ekv at exparg{\protected\long\def\ekvc at type@choice@#1#2#3}%
+\protected\long\def\ekvc at type@choice#1#2%
{%
+ \ekvc at type@enum at or@choice{#1}{#2}%
+ \ekv at exparg
+ {%
+ \expandafter\ekvparse\expandafter
+ {%
+ \expandafter\ekvc at type@choice at k
+ \csname\ekv at name\ekvc at set{#2}\endcsname{#1}%
+ }%
+ }%
+ {%
+ \expandafter\ekvc at type@choice at p
+ \csname\ekv at name\ekvc at set{#2}\endcsname{#1}%
+ }%
+ }
+\ekv at exparg{\protected\long\def\ekvc at type@choice at p#1#2#3#4}%
+ {%
\expandafter\expandafter\expandafter\edef\expandafter
\csname\ekvc at enum@name\ekvc at set{#2}{\detokenize{#3}}\endcsname
- {\ekv at unexpanded{#1{#3}}}%
+ {\ekv at unexpanded{#1{#4}}}%
}
+\protected\long\def\ekvc at type@choice at k#1#2#3{\ekvc at type@choice at p#1{#2}{#3}{#3}}
\ekv at if@lastnamedcs
{%
\ekv at exparg{\def\ekvc at h@enum#1\ekvc at stop#2#3}%
Modified: trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-def.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at tmp\endcsname
\expandafter\chardef\csname ekvd at tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -456,6 +456,20 @@
}
\protected\long\def\ekvd at type@smeta@#1#2#3%
{\ekvd at prot\ekvd at long\ekv at expargtwice{\def\ekvd at tmp#3}{\ekvset{#1}{#2}}}
+\ekvd at def@type{alias}
+ {%
+ \ekvd at assert@arg
+ \ekvd at assert@not at protected
+ \ekvd at assert@not at long
+ \ekvd at assert@not at also
+ \ekvifdefined\ekvd at set{#3}{\ekvd at do@new{}{#1}}{}%
+ \ekvifdefinedNoVal\ekvd at set{#3}{\ekvd at do@new{NoVal}{#1}}{}%
+ \ekvpAssertTF
+ {\ekvifdefined\ekvd at set{#3}\@firstoftwo{\ekvifdefinedNoVal\ekvd at set{#3}}}%
+ {undefined key `#3'}%
+ \ekvifdefined\ekvd at set{#3}{\ekvletkv\ekvd at set{#1}\ekvd at set{#3}}{}%
+ \ekvifdefinedNoVal\ekvd at set{#3}{\ekvletkvNoVal\ekvd at set{#1}\ekvd at set{#3}}{}%
+ }
\protected\def\ekvd at type@choice#1%
{%
\ekvd at assert@not at long
@@ -542,6 +556,35 @@
{#1=\@firstofone{\ekvd at tmp} }%
\edef\ekvd at tmp{\the\numexpr\ekvd at tmp+1\relax}%
}
+\ekvd at def@type{choice-aliases}
+ {%
+ \ekvd at assert@arg
+ \ekvd at assert@not at protected
+ \ekvd at assert@not at long
+ \ekvd at assert@not at also
+ \ekvd at assert@already at choice{#1}%
+ \ekvparse\ekvd at err@missing at value{\ekvd at t@choicealias{#1}}{#3}%
+ }
+\protected\long\def\ekvd at t@choicealias#1#2#3%
+ {%
+ \ifx\ekvd at do@new\ekvd at assert@new
+ \ekv at fi@firstofone
+ \fi
+ \@gobble
+ {%
+ \ekv at ifdefined{\ekvd at choice@name\ekvd at set{#1}{#2}}%
+ {\ekvd at err@not at new@choice{#2}\ekv at gobbleto@stop}%
+ {}%
+ }%
+ \ekv at ifdefined{\ekvd at choice@name\ekvd at set{#1}{#3}}%
+ {%
+ \expandafter\let
+ \csname\ekvd at choice@name\ekvd at set{#1}{#2}\expandafter\endcsname
+ \csname\ekvd at choice@name\ekvd at set{#1}{#3}\endcsname
+ }%
+ {\ekvd at err@undefined at choice{#1}{#3}}%
+ \@gobble\ekv at stop
+ }
\ekvd at def@type{unknown-choice}
{%
\ekvd at do@new at for@name{\ekvd at unknown@choice at name\ekvd at set{#1}}%
@@ -770,9 +813,14 @@
}
\protected\def\ekvd at if@not at already@choice#1%
{%
- \expandafter\ekvd at if@not at already@choice at a
- \csname\ekv at name\ekvd at set{#1}\endcsname
- {}\ekvd at h@choice\ekvd at stop
+ \ekvifdefined\ekvd at set{#1}%
+ {%
+ \expandafter
+ \ekvd at if@not at already@choice at a
+ \csname\ekv at name\ekvd at set{#1}\endcsname
+ {}\ekvd at h@choice\ekvd at stop
+ }%
+ {\@firstofone}%
}
\protected\def\ekvd at if@not at already@choice at a
{%
@@ -782,6 +830,8 @@
{%
\ekv at ifempty{#2}\@firstofone\@gobble
}
+\long\def\ekvd at assert@already at choice#1%
+ {\ekvd at if@not at already@choice{#1}{\ekvd at err@not at choice\ekvpGobbleT}}
\long\def\ekvd at ifspace#1%
{%
\ekvd at ifspace@#1 \ekv at ifempty@B
@@ -813,7 +863,7 @@
{%
\ekvd at errm
{%
- Undefined noval key `\ekv at unexpanded{#1}' found while processing
+ Undefined NoVal key `\ekv at unexpanded{#1}' found while processing
`\ekvd at cur'%
}%
}
@@ -835,8 +885,19 @@
}
\protected\def\ekvd at err@not at new
{\ekvd at errm{The key for `\ekvd at cur' is already defined}}
-\protected\long\def\ekvd at err@misused at unknown
+\protected\def\ekvd at err@not at new@choice#1%
+ {\ekvd at errm{The choice `\detokenize{#1}' is already defined for `\ekvd at cur'}}
+\protected\def\ekvd at err@misused at unknown
{\ekvd at errm{Misuse of the unknown type found while processing `\ekvd at cur'}}
+\protected\long\def\ekvd at err@not at choice
+ {\ekvd at errm{The key for `\ekvd at cur' is not an existing choice key}}
+\protected\long\def\ekvd at err@missing at value#1%
+ {\ekvd at errm{Missing value for `#1' in `\ekvd at cur'}}
+\protected\long\def\ekvd at err@undefined at choice#1#2%
+ {%
+ \ekvd at errm
+ {Undefined choice `#2' for key `#1' found while processing `\ekvd at cur'}%
+ }
\def\ekvd at err@choice at invalid#1%
{%
\ekvd at err@choice at invalid@#1%
Modified: trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv-pop.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/generic/expkv-bundle/expkv.tex 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at tmp\endcsname
\expandafter\chardef\csname ekv at tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -123,6 +123,9 @@
\long\def\ekv at ifblank@\ekv at mark#1#2\ekv at stop{}
\long\def\ekv at ifblank@false\ekv at stop\@firstoftwo#1#2{#2}
\def\ekv at ifblank@gobbletrue\ekv at stop#1{}
+\long\def\ekv at ifatmostone#1%
+ {\ekv at ifatmostone@#1\ekv at stop\ekv at ifblank@false\ekv at stop\@firstoftwo}
+\long\def\ekv at ifatmostone@#1#2#3\ekv at stop{}
\ekv at if@lastnamedcs
{%
\long\def\ekv at ifdefined#1{\ifcsname#1\endcsname\ekv at ifdef@\fi\@secondoftwo}
@@ -228,14 +231,13 @@
{\ekv at csv@loop{#2}\ekv at mark}
\def\ekv at name@set#1{ekv#1(}
\long\def\ekv at name@key#1{#1)}
-\edef\ekv at name
+\long\ekv at expandedarg{\def\ekv at name#1#2}%
{%
\ekv at unexpanded\expandafter{\ekv at name@set{#1}}%
\ekv at unexpanded\expandafter{\ekv at name@key{\detokenize{#2}}}%
}
-\long\ekv at exparg{\def\ekv at name#1#2}{\ekv at name}
\def\ekv at undefined@set#1{! expkv Error: Set `#1' undefined.}
-\edef\ekv at checkvalid
+\protected\ekv at expandedarg{\def\ekv at checkvalid#1#2}%
{%
\ekv at unexpanded\expandafter{\ekv at ifempty{#1}}%
\ekv at unexpanded
@@ -256,7 +258,6 @@
}%
\ekv at unexpanded{\@gobble}%
}
-\ekv at exparg{\protected\def\ekv at checkvalid#1#2}{\ekv at checkvalid}%
\ekv at expargtwice{\long\def\ekvifdefined#1#2}%
{\expandafter\ekv at ifdefined\expandafter{\ekv at name{#1}{#2}}}
\ekv at expargtwice{\long\def\ekvifdefinedNoVal#1#2}%
@@ -1071,22 +1072,22 @@
\ekv at expansion@parse at pair@\@gobble{#2}%
}
\long\def\ekv at expansion@parse at pair@#1#2\@gobble#3{\ekv at unexpanded{#3{#1}{#2}}}
-\ekv at expargtwice{\protected\def\ekvsetdef#1#2}%
+\ekv at exparg{\protected\def\ekvsetdef#1#2}%
{%
\romannumeral
- \ekv at exparg{\ekv at zero\ekv at exparg{\def#1##1}}%
+ \ekv at exparg{\expandafter\ekv at zero\ekv at exparg{\def#1##1}}%
{\ekvset{#2}{##1}}%
}
-\ekv at expargtwice{\protected\def\ekvsetSneakeddef#1#2}%
+\ekv at exparg{\protected\def\ekvsetSneakeddef#1#2}%
{%
\romannumeral
- \ekv at exparg{\ekv at zero\ekv at exparg{\long\def#1##1##2}}%
+ \ekv at exparg{\expandafter\ekv at zero\ekv at exparg{\def#1##1##2}}%
{\ekvsetSneaked{#2}{##1}{##2}}%
}
-\ekv at expargtwice{\protected\def\ekvsetdefSneaked#1#2#3}%
+\ekv at exparg{\protected\long\def\ekvsetdefSneaked#1#2#3}%
{%
\romannumeral
- \ekv at exparg{\ekv at zero\ekv at exparg{\long\def#1##1}}%
+ \ekv at exparg{\expandafter\ekv at zero\ekv at exparg{\def#1##1}}%
{\ekvsetSneaked{#2}{#3}{##1}}%
}
\begingroup
@@ -1094,8 +1095,12 @@
\@firstofone{\endgroup
\def\ekv at alignsafe{\romannumeral\iffalse{\fi`^^@ }
}
-\def\ekv at endalignsafe{\ifnum`{=\ekv at zero}\fi}
\begingroup
+\catcode`\^^@=1
+\@firstofone{\endgroup
+ \edef\ekv at endalignsafe{\ekv at unexpanded{\romannumeral`^^@\iffalse}\fi} }
+}
+\begingroup
\def\ekvoptarg#1#2{%
\endgroup
\def\ekvoptarg{#1\ekv at optarg@a}
@@ -1112,25 +1117,22 @@
#2%
\@firstofone{ ##2}{##3}%
}
-\long\def\ekv at optarg@b\ekv at mark[\ekv at mark\ifnum`##1\fi\@firstofone##2##3##4##5]%
+\@firstofone{\long\def\ekv at optarg@b
+ \ekv at mark[\ekv at mark\romannumeral`##1\fi} \@firstofone##2##3##4##5]%
{#2##2{##5}}
-\long\def\ekv at optargTF@b
- ##1\ekv at mark[\ekv at mark\ifnum`##2\fi\@firstofone##3##4##5]%
+\@firstofone{\long\def\ekv at optargTF@b
+ ##1\ekv at mark[\ekv at mark\romannumeral`##2\fi} \@firstofone##3##4##5]%
{#2 ##1{##5}}
}
\ekv at exparg
- {%
- \expandafter\ekv at strip\expandafter
- {\expandafter\ekv at mark\ekv at alignsafe}%
- \ekvoptarg
- }%
+ {\ekv at exparg\ekv at strip{\expandafter\ekv at mark\ekv at alignsafe}\ekvoptarg}%
\ekv at endalignsafe
\long\def\ekv at optarg@if#1\ekv at mark[\ekv at mark{}
\long\def\ekv at ifstar#1#2#3%
{%
- \if*\string#3%
- \ekv at fi@firstoftwo
- \fi
+ \ekv at ifatmostone{#3}%
+ {\if*\string#3\ekv at fi@firstoftwo\fi}%
+ {}%
\@secondoftwo
{#1}%
{#2{#3}}%
@@ -1223,7 +1225,7 @@
\ekv at exparg{\long\def\ekv at err@common@#1`#2' #3.#4#5}%
{\ekv at err{#4 `#5' in set `#2'}}
\ekv at exparg{\long\def\ekv at err@unknown#1#2}{\ekv at err@common{unknown key}{#1}}
-\ekv at exparg{\long\def\ekv at err@noarg#1#2}
+\ekv at exparg{\long\def\ekv at err@noarg#1#2}%
{\ekv at err@common{unwanted value for}{#1}}
\ekv at exparg{\long\def\ekv at err@reqval#1#2}%
{\ekv at err@common{missing value for}{#1}}
@@ -1232,7 +1234,7 @@
\ekv at exparg{\def\ekv at err@redirect at k@notfound#1#2\ekv at stop}%
{\ekv at err{no NoVal key `#1' in sets #2}}
\ekv at exparg{\def\ekv at err@undefined at expansion#1\fi}%
- {\expandafter\fi\ekv at err{Undefined expansion rule `#1'}}%
+ {\expandafter\fi\ekv at err{Undefined expansion rule `#1'}}
\ekv at exparg{\def\ekv at err@erroneous at variable#1}%
{\ekv at err{Erroneous variable `#1' used}}
\ekv at exparg{\def\ekv at err@key at no@reinsert}%
Modified: trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-cs.sty 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-def.sty 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt-2020-10-10.sty 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-opt.sty 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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 at set@handlers at local
{%
+ \ifx\@currext\@clsextension
+ \unless\ifx\@classoptionslist\relax
+ \expandafter
+ \ifx
+ \csname @raw at opt@\@currname.\@currext\endcsname
+ \@raw at classoptionslist
+ \unless\ifx\@unusedoptionlist\@empty
+ \let\ekvo at handle@defined at k\ekvo at rmfrom@unused at one
+ \let\ekvo at handle@defined at kv\ekvo at rmfrom@unused at two
+ \fi
+ \fi
+ \fi
+ \fi
\ekvo at if@need at handlers
{%
\ifx\@currext\@clsextension
@@ -159,10 +172,6 @@
\@raw at classoptionslist
\let\ekvo at handle@undefined at k\ekvo at addto@unused at one
\let\ekvo at handle@undefined at kv\ekvo at addto@unused at two
- \unless\ifx\@unusedoptionlist\@empty
- \let\ekvo at handle@defined at k\ekvo at rmfrom@unused at one
- \let\ekvo at handle@defined at kv\ekvo at rmfrom@unused at two
- \fi
\else
\let\ekvo at handle@undefined at k\@gobble
\let\ekvo at handle@undefined at kv\@gobbletwo
@@ -401,17 +410,6 @@
\let\ekvo at handle@defined at 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 at name{}uN\expandafter\endcsname\expandafter
{\detokenize{##1}}{##1}%
}%
- {\@gobble}%
+ {}%
}%
\long\def\ekvo at handle@undefined at kv##1##2%
{%
Modified: trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv-pop.sty 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
Modified: trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty 2024-12-26 00:42:01 UTC (rev 73211)
+++ trunk/Master/texmf-dist/tex/latex/expkv-bundle/expkv.sty 2024-12-26 21:14:11 UTC (rev 73212)
@@ -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
More information about the tex-live-commits
mailing list.