texlive[53957] Master: expkv-def (28feb20)

commits+karl at tug.org commits+karl at tug.org
Fri Feb 28 23:27:15 CET 2020


Revision: 53957
          http://tug.org/svn/texlive?view=revision&revision=53957
Author:   karl
Date:     2020-02-28 23:27:15 +0100 (Fri, 28 Feb 2020)
Log Message:
-----------
expkv-def (28feb20)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/expkv-def/
    trunk/Master/texmf-dist/doc/latex/expkv-def/README.md
    trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf
    trunk/Master/texmf-dist/source/latex/expkv-def/
    trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx
    trunk/Master/texmf-dist/tex/generic/expkv-def/
    trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
    trunk/Master/texmf-dist/tex/latex/expkv-def/
    trunk/Master/texmf-dist/tex/latex/expkv-def/expkv-def.sty
    trunk/Master/tlpkg/tlpsrc/expkv-def.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/expkv-def/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-def/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/expkv-def/README.md	2020-02-28 22:27:15 UTC (rev 53957)
@@ -0,0 +1,32 @@
+-------------------------------------------------------------------------------
+# expkv-def -- a key-defining frontend for expkv
+
+Version 2020-02-27 v0.1
+
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+
+Hosted at https://github.com/Skillmon/tex_expkv-def
+
+-------------------------------------------------------------------------------
+
+Copyright (C) 2020 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 option) any later version.  The latest version of this license is in
+the file:
+
+  http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (as per LPPL maintenance status) by
+  Jonathan P. Spratte.
+
+-------------------------------------------------------------------------------
+
+This provides a key=val frontend to define keys for
+[`expkv`](https://github.com/Skillmon/tex_expkv). It is generic code and only
+requires `expkv` for its parsing. There is a LaTeX package `expkv-def.sty`
+included to play nice on LaTeX's package loading system, but that package is not
+needed and does not provide more functionality than the generic code in
+`expkv-def.tex`.


Property changes on: trunk/Master/texmf-dist/doc/latex/expkv-def/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf	2020-02-28 22:25:54 UTC (rev 53956)
+++ trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf	2020-02-28 22:27:15 UTC (rev 53957)

Property changes on: trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx	2020-02-28 22:27:15 UTC (rev 53957)
@@ -0,0 +1,1383 @@
+% \iffalse meta-comment
+%
+% File: expkv-def.dtx Copyright (C) 2020 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 option) any later version.  The latest version of this license is in
+% the file:
+%
+%   http://www.latex-project.org/lppl.txt
+%
+% ------------------------------------------------------------------------------
+%
+%<*driver>^^A>>=
+\def\nameofplainTeX{plain}
+\ifx\fmtname\nameofplainTeX\else
+  \expandafter\begingroup
+\fi
+\input l3docstrip.tex
+\askforoverwritefalse
+\preamble
+
+--------------------------------------------------------------
+expkv-def -- a key-defining frontend for expkv
+E-mail: jspratte at yahoo.de
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+--------------------------------------------------------------
+
+Copyright (C) 2020 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 option) any later version.  The latest version of this license is in
+the file:
+
+  http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (as per LPPL maintenance status) by
+  Jonathan P. Spratte.
+
+This work consists of the file  expkv-def.dtx
+and the derived files           expkv-def.pdf
+                                expkv-def.sty
+                                expkv-def.tex
+
+\endpreamble
+% stop docstrip adding \endinput
+\postamble
+\endpostamble
+\generate{\file{expkv-def.sty}{\from{expkv-def.dtx}{pkg}}}
+\generate{\file{expkv-def.tex}{\from{expkv-def.dtx}{tex}}}
+\ifx\fmtname\nameofplainTeX
+  \expandafter\endbatchfile
+\else
+  \expandafter\endgroup
+\fi
+%
+\IfFileExists{expkv-def.tex}{\input{expkv-def.tex}}{}
+\ProvidesFile{expkv-def.dtx}
+  [\csname ekvdDate\endcsname\ a key-defining frontend for expkv]
+\PassOptionsToPackage{full}{textcomp}
+\documentclass{l3doc}
+\RequirePackage[oldstylenums,nott]{kpfonts}
+\input{glyphtounicode}
+\pdfgentounicode=1
+\RequirePackage{listings}
+\RequirePackage{booktabs}
+\RequirePackage{array}
+\RequirePackage{collcell}
+\RequirePackage{siunitx}
+\RequirePackage{xcolor}
+\RequirePackage{caption}
+\RequirePackage{microtype}
+\RequirePackage{accsupp}
+\lstset
+  {
+    ,flexiblecolumns=false
+    ,basewidth=.53em
+    ,gobble=2
+    ,basicstyle=\fontfamily{jkp}\itshape
+    ,morekeywords=^^A
+      {^^A
+        \ekvdefinekeys
+      }
+    ,morecomment=[l]\%
+    ,commentstyle=\color[gray]{0.4}
+    ,literate={\{}{{\CodeSymbol\{}}{1}
+              {\}}{{\CodeSymbol\}}}{1}
+    ^^A,literate=*{<key>}{\key}{4}{<set>}{\set}{4}
+  }
+\newcommand*\CodeSymbol[1]{\textbf{#1}}
+\RequirePackage{randtext}
+\let\metaORIG\meta
+\protected\def\meta #1{\texttt{\metaORIG{#1}}}
+\renewcommand*\thefootnote{\fnsymbol{footnote}}
+\definecolor{expkvred}{HTML}{9F393D}
+\colorlet{expkvgrey}{black!75}
+\makeatletter
+\newcommand*\expkv
+  {^^A
+    \texorpdfstring
+      {^^A
+        \mbox
+          {^^A
+            \BeginAccSupp{ActualText=expkv}^^A
+            \href{https://github.com/Skillmon/tex_expkv}
+              {^^A
+                \rmfamily
+                \bfseries
+                {\color{expkvgrey}e\kern-.05em x\kern-.05em}^^A
+                \lower.493ex
+                  \hbox{{\color{expkvgrey}P}\kern-.1em{\color{expkvred}k}}^^A
+                \kern-.18em{\color{expkvred}v}^^A
+              }^^A
+            \EndAccSupp{}^^A
+          }^^A
+      }
+      {expkv}^^A
+  }
+\newcommand*\expkvd
+  {^^A
+    \texorpdfstring
+      {^^A
+        \mbox
+          {^^A
+            \BeginAccSupp{ActualText=expkv-def}^^A
+            \href{https://github.com/Skillmon/tex_expkv-def}
+              {^^A
+                \rmfamily
+                \bfseries
+                {\color{expkvgrey}e\kern-.05em x\kern-.05em}^^A
+                \lower.493ex
+                  \hbox{{\color{expkvgrey}P}\kern-.1em{\color{expkvred}k}}^^A
+                \kern-.18em{\color{expkvred}v}^^A
+                {\color{expkvgrey}^^A
+                  \kern.05em\rule[-.1ex]{.08em}{1.2ex}\kern.05em\textsc{def}^^A
+                }^^A
+              }^^A
+            \EndAccSupp{}^^A
+          }^^A
+      }
+      {expkv-def}^^A
+  }
+\newcommand\kv{\meta{key}=\meta{value}}
+\newcommand\key{\meta{key}}
+\newcommand\val{\meta{value}}
+\newcommand\set{\meta{set}}
+\newcommand\enfprot{\textcolor{black}{protected}}
+\newcommand\allprot{\textcolor{gray}{protected}}
+\newcommand\notprot{\textcolor{red!80!black}{protected}}
+\newcommand\enflong{\textcolor{black}{long}}
+\newcommand\alllong{\textcolor{gray}{long}}
+\newcommand\notlong{\textcolor{red!80!black}{long}}
+\newcommand\prefixes[2]
+  {^^A
+    \hfill
+    \ifcase\numexpr#1\relax\or
+      \enfprot\or
+      \allprot\or
+      \notprot\fi\space
+    \ifcase\numexpr#2\relax\or
+      \enflong\or
+      \alllong\or
+      \notlong\fi
+  }
+\hypersetup{linkcolor=red!80!black,urlcolor=purple!80!black}
+\DoNotIndex{\def,\edef,\,,\=,\begingroup,\catcode,\chardef,\csname,\endcsname}
+\DoNotIndex{\endgroup,\endinput,\errmessage,\expandafter,\input,\let,\long}
+\DoNotIndex{\noexpand,\protected,\ProvidesFile,\ProvidesPackage,\relax,\space}
+\DoNotIndex{\@,\unexpanded,\string,\expanded,\dimexpr,\global,\glueexpr,\hbox}
+\DoNotIndex{\numexpr,\RequirePackage,\setbox,\the,\unless,\xdef}
+\DoNotIndex{\ifcsname}
+\DoNotIndex{\ifx}
+\DoNotIndex{\ifdefined}
+\DoNotIndex{\iffalse}
+\DoNotIndex{\iftrue}
+\DoNotIndex{\else}
+\DoNotIndex{\fi}
+\@gobble\fi ^^A ignoring \ifx, \ifcsname, etc., but only one \fi
+\@gobble\fi ^^A ignoring \ifx, \ifcsname, etc., but only one \fi
+\@gobble\fi ^^A ignoring \ifx, \ifcsname, etc., but only one \fi
+\@gobble\fi ^^A ignoring \ifx, \ifcsname, etc., but only one \fi
+\@ifdefinable\gobbledocstriptag{\def\gobbledocstriptag#1>{}}
+\makeatother
+\begin{document}
+  \title
+    {^^A
+      \texorpdfstring
+        {^^A
+          \huge\expkvd
+          \\[\medskipamount]
+          \Large a key-defining frontend for \expkv
+        }{expkv-def - a key-defining frontend for expkv}^^A
+    }
+  \date{\ekvdDate\space v\ekvdVersion}
+  \author{Jonathan P. Spratte\thanks{\protect\randomize{jspratte at yahoo.de}}}
+  \DocInput{expkv-def.dtx}
+\end{document}
+%</driver>^^A=<<
+% \fi
+%
+% \maketitle
+% \renewcommand*\thefootnote{\arabic{footnote}}
+%
+% \begin{abstract}
+% \noindent\parfillskip=0pt
+% \expkvd\ provides a small \kv\ interface to define keys for \expkv. Key-types
+% are declared using prefixes, similar to static typed languages. The stylised
+% name is \expkvd\ but the files use \file{expkv-def}, this is due to CTAN-rules
+% which don't allow \string| in package names since that is the pipe symbol in *nix
+% shells.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \begin{documentation}^^A>>=
+%
+% \section{Documentation}
+%
+% Since the trend for the last couple of years goes to defining keys for a \kv\
+% interface using a \kv\ interface, I thought that maybe providing such an
+% interface for \expkv\ will make it more attractive for actual use, besides its
+% unique selling points of being fully expandable, and fast and reliable. But at
+% the same time I don't want to widen \expkv's initial scope. So here it is
+% \expkvd, go define \kv\ interfaces with \kv\ interfaces.
+%
+% Unlike many of the other established \kv\ interfaces to define keys, \expkvd\
+% works using prefixes instead of suffixes (\emph{e.g.}, |.tl_set:N| of
+% \pkg{l3keys}) or directory like handlers (\emph{e.g.}, |/.store in| of
+% \pkg{pgfkeys}). This was decided as a personal preference, more over in \TeX\
+% parsing for the first space is way easier than parsing for the last one.
+% \expkvd's prefixes are sorted into two categories |p|-type, which are
+% equivalent to \TeX's prefixes like |\long|, and |t|-type defining the type of
+% the key. For a description of the available |p|-prefixes take a look at
+% \autoref{sec:prefix:p}, the |t|-prefixes are described in
+% \autoref{sec:prefix:t}.
+%
+% \expkvd\ is usable as generic code and as a \LaTeX\ package. It'll
+% automatically load \expkv\ in the same mode as well. To use it, just use one
+% of
+% \begin{lstlisting}
+% \usepackage{expkv-def} % LaTeX
+% \input expkv-def       % plainTeX
+% \end{lstlisting}
+%
+% \subsection{Macros}
+% Apart from version and date containers there is only a single user-facing
+% macro, and that should be used to define keys.
+%
+% \begin{function}{\ekvdefinekeys}
+%   \begin{syntax}
+%     \cs{ekvdefinekeys}\marg{set}\{\kv, \ldots\}
+%   \end{syntax}
+%   In \set, define \key\ to have definition \val. The general syntax for \key\
+%   should be
+%   \begin{quote}\ttfamily\small
+%     \meta{prefix} \meta{name}
+%   \end{quote}
+%   Where \meta{prefix} is a space separated list of optional |p|-type prefixes
+%   followed by one |t|-type prefix. The syntax of \val\ is dependent on the
+%   used |t|-prefix.
+% \end{function}
+%
+% \begin{function}{\ekvdDate,\ekvdVersion}
+%   These two macros store the version and date of the package.
+% \end{function}
+%
+% \subsection{Prefixes}
+% As already said there are |p|-prefixes and |t|-prefixes. Not every |p|-prefix
+% is allowed for all |t|-prefixes.
+%
+% \subsubsection{\texttt{p}-Prefixes}\label{sec:prefix:p}
+% The |p|-type prefixes are pretty simple by nature, so their description is
+% pretty simple. They affect the \key\ at use-time, so omitting |long| doesn't
+% mean that a \meta{definition} can't contain a |\par| token, only that the
+% \key\ will not accept a |\par| in \val.
+% \begin{function}{protected,protect}
+%   The following key will be defined |\protected|. Note that key-types which
+%   can't be defined expandable will always use |\protected|.
+% \end{function}
+%
+% \begin{function}{long}
+%   The following key will be defined |\long|.
+% \end{function}
+%
+% \subsubsection{\texttt{t}-Prefixes}\label{sec:prefix:t}
+% Since the |p|-type prefixes apply to some of the |t|-prefixes automatically
+% but sometimes one might be disallowed we need some way to highlight this
+% behaviour. In the following an enforced prefix will be printed black
+% (\texttt{\enfprot}), allowed prefixes will be grey (\texttt{\allprot}), and
+% disallowed prefixes will be red (\texttt{\notprot}). This will be put
+% flush-right in the syntax showing line.
+%
+% \begin{function}{code,ecode}
+%   \begin{syntax}
+%     code \key\ = \marg{definition} \prefixes22
+%   \end{syntax}
+%   Define \key\ to expand to \meta{definition}. The \key\ will require a \val\
+%   for which you can use |#1| inside \meta{definition}. The |ecode| variant
+%   will fully expand \meta{definition} inside an |\edef|.
+% \end{function}
+%
+% \begin{function}{noval,enoval}
+%   \begin{syntax}
+%     noval \key\ = \marg{definition} \prefixes23
+%   \end{syntax}
+%   The |noval| type defines \key\ to expand to \meta{definition}. The \key\
+%   will not take a \val. |enoval| fully expands \meta{definition} inside an
+%   |\edef|.
+% \end{function}
+%
+% \begin{function}{default,qdefault,edefault}
+%   \begin{syntax}
+%     default \key\ = \marg{definition} \prefixes23
+%   \end{syntax}
+%   This serves to place a default \val\ for a \key\ that takes an argument, the
+%   \key\ can be of any argument-grabbing kind, and when used without a \val\
+%   it will be passed \meta{definition} instead. The |qdefault| variant will
+%   expand the \key's code once, so will be slightly quicker, but not change if
+%   you redefine \key. The |edefault| on the other hand fully expands the
+%   \key-code with \meta{definition} as its argument inside of an |\edef|.
+% \end{function}
+%
+% \begin{function}{initial}
+%   \begin{syntax}
+%     initial \key\ = \{\val\} \prefixes33
+%   \end{syntax}
+%   With |initial| you can set an initial \val\ for an already defined argument
+%   taking \key. It'll just call the key-macro of \key\ and pass it \val.
+% \end{function}
+%
+% \begin{function}{bool,gbool,boolTF,gboolTF}
+%   \begin{syntax}
+%     bool \key\ = \meta{cs} \prefixes23
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\iffoo|.
+%   This will define \key\ to be a boolean key, which only takes the values
+%   |true| or |false| and will throw an error for other values. If the key is
+%   used without a \val\ it'll have the same effect as if you use
+%   \texttt{\key=true}. |bool| and |gbool| will behave like \TeX-ifs so either
+%   be |\iftrue| or |\iffalse|. The |boolTF| and |gboolTF| variants will both
+%   take two arguments and if true the first will be used else the second, so
+%   they are always either |\@firstoftwo| or |\@secondoftwo|. The variants with
+%   a leading |g| will set the control sequence globally, the others locally. If
+%   \meta{cs} is not yet defined it'll be initialised as the |false| version.
+%   Note that the initialisation is \emph{not} done with |\newif|, so you will
+%   not be able to do |\footrue| outside of the \kv\ interface, but you could
+%   use |\newif| yourself. Even if the \key\ will not be |\protected| the
+%   commands which execute the |true| or |false| choice will be, so the usage
+%   should be safe in an expansion context (\emph{e.g.}, you can use
+%   \texttt{edefault \key\ = false} without an issue to change the default
+%   behaviour to execute the |false| choice).
+% \end{function}
+%
+% \begin{function}{store,estore,gstore,xstore}
+%   \begin{syntax}
+%     store \key\ = \meta{cs} \prefixes12
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\foo|.
+%   This will define \key\ to store \val\ inside of the control sequence. If
+%   \meta{cs} isn't yet defined it will be initialised as empty. The variants
+%   behave similarly to their |\def|, |\edef|, |\gdef|, and |\xdef|
+%   counterparts, but |store| and |gstore| will allow you to store macro
+%   parameters inside of them by using |\unexpanded|.
+% \end{function}
+%
+% \begin{function}{int,eint,gint,xint}
+%   \begin{syntax}
+%     int \key\ = \meta{cs} \prefixes12
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\foo|.
+%   An |int| key will be a \TeX-count register. If \meta{cs} isn't defined yet,
+%   |\newcount| will be used to initialise it. The |eint| and |xint| versions
+%   will use |\numexpr| to allow basic computations in their \val. The |gint|
+%   and |xint| variants set the register globally.
+% \end{function}
+%
+% \begin{function}{dimen,edimen,gdimen,xdimen}
+%   \begin{syntax}
+%     dimen \key\ = \meta{cs} \prefixes12
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\foo|.
+%   This is just like |int| but uses a dimen register, |\newdimen| and
+%   |\dimexpr| instead.
+% \end{function}
+%
+% \begin{function}{skip,eskip,gskip,xskip}
+%   \begin{syntax}
+%     dimen \key\ = \meta{cs} \prefixes12
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\foo|.
+%   This is just like |int| but uses a skip register, |\newskip| and |\glueexpr|
+%   instead.
+% \end{function}
+%
+% \begin{function}{toks,gtoks,apptoks,gapptoks}
+%   \begin{syntax}
+%     dimen \key\ = \meta{cs} \prefixes12
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\foo|. 
+%   Store \val\ inside of a toks-register. The |g| variants use |\global|, the
+%   |app| variants append \val\ to the contents of that register. If \meta{cs}
+%   is not yet defined it will be initialised with |\newtoks|.
+% \end{function}
+%
+% \begin{function}{box,gbox}
+%   \begin{syntax}
+%     box \key\ = \meta{cs} \prefixes12
+%   \end{syntax}
+%   The \meta{cs} should be a single control sequence, such as |\foo|.
+%   Typesets \val\ into a |\hbox| and stores the result in a box register. The
+%   boxes are colour safe. \expkvd\ doesn't provide a |vbox| type.
+% \end{function}
+%
+% \begin{function}{meta}
+%   \begin{syntax}
+%     meta \key\ = \{\kv, \ldots\} \prefixes22
+%   \end{syntax}
+%   This key type can set other keys, you can access the \val\ which was passed
+%   to \key\ inside the \kv\ list with |#1|. It works by calling a sub-|\ekvset|
+%   on the \kv\ list, so a |set| key will only affect that \kv\ list and not the
+%   current |\ekvset|.
+% \end{function}
+%
+% \begin{function}{nmeta}
+%   \begin{syntax}
+%     nmeta \key\ = \{\kv, \ldots\} \prefixes23
+%   \end{syntax}
+%   This key type can set other keys, the difference to |meta| is, that this key
+%   doesn't take a value, so the \kv\ list is static.
+% \end{function}
+%
+% \begin{function}{smeta}
+%   \begin{syntax}
+%     smeta \key\ = \marg{set}\{\kv, \ldots\} \prefixes22
+%   \end{syntax}
+%   Yet another |meta| variant. An |smeta| key will take a \val\ which you can
+%   access using |#1|, but it sets the \kv\ list inside of \set, so is equal to
+%   \texttt{\cs[no-index]{ekvset}\marg{set}\{\kv, \ldots\}}.
+% \end{function}
+%
+% \begin{function}{snmeta}
+%   \begin{syntax}
+%     snmeta \key\ = \marg{set}\{\kv, \ldots\} \prefixes23
+%   \end{syntax}
+%   And the last |meta| variant. |snmeta| is a combination of |smeta| and
+%   |nmeta|. It doesn't take an argument and sets the \kv\ list inside of \set.
+% \end{function}
+%
+% \begin{function}{set}
+%   \begin{syntax}
+%     set \key\ = \marg{set} \prefixes33
+%   \end{syntax}
+%   This will define |\key| to change the set of the current |\ekvset|
+%   invocation to \set. You can omit \set\ (including the equals sign),
+%   which is the same as using \texttt{set \key\ = \{\key\}}. The created |set|
+%   key will not take a \val. Note that just like in \expkv\ it'll not be
+%   checked whether \set\ is defined and you'll get a low-level \TeX\ error if
+%   you use an undefined \set.
+% \end{function}
+%
+% \begin{function}{choice}
+%   \begin{syntax}
+%     choice \key\ = \{\val=\meta{definition}, \ldots\} \prefixes23
+%   \end{syntax}
+%   Defines \key\ to be a |choice| key, meaning it will only accept a limited
+%   set of values. You should define each possible \val\ inside of the
+%   \val=\meta{definition} list. If a defined \val\ is passed to \key\ the
+%   \meta{dafinition} will be left in the input stream. You can make
+%   individual values |protected| inside the \val=\meta{definition} list. By
+%   default a |choice| key is expandable, an undefined \val\ will throw an error
+%   in an expandable way.
+% \end{function}
+%
+% \subsection{Bugs}
+% I don't think there are any (but every developer says that), if you find some
+% please let me know, either via the email address on the first page or on
+% GitHub:
+% \url{https://github.com/Skillmon/tex_expkv-def}
+%
+% \subsection{Example}
+% The following is an example code defining each base key-type once. Please
+% admire the very creative key-name examples.
+%
+% \begin{lstlisting}
+% \ekvdefinekeys{example}
+%   {
+%     ,long code keyA = #1
+%     ,noval     keyA = NoVal given
+%     ,bool      keyB = \keyB
+%     ,boolTF    keyC = \keyC
+%     ,store     keyD = \keyD
+%     ,int       keyE = \keyE
+%     ,dimen     keyF = \keyF
+%     ,skip      keyG = \keyG
+%     ,toks      keyH = \keyH
+%     ,default   keyH = \empty test
+%     ,box       keyI = \keyI
+%     ,qdefault  keyI = text
+%     ,choice    keyJ =
+%       {
+%         ,protected 1 = \texttt{a}
+%         ,2 = b
+%         ,3 = c
+%         ,4 = d
+%         ,5 = e
+%       }
+%     ,edefault  keyJ = 2
+%     ,meta      keyK = {keyA={#1},keyB=false}
+%     ,set       setB = B
+%   }
+% \end{lstlisting}
+%
+% \subsection{License}
+%
+% Copyright \textcopyright\ 2020\unless\ifnum\year=2020--\the\year\fi\
+% Jonathan P. Spratte
+%
+% \medskip\noindent
+% 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 option) any later version. The latest version of this license is in
+% the file:
+%
+% \url{http://www.latex-project.org/lppl.txt}
+%
+% \noindent
+% This work is ``maintained'' (as per LPPL maintenance status) by
+%
+% \mbox{Jonathan P. Spratte}.
+%
+% \end{documentation}^^A=<<
+%
+% \begin{implementation}^^A>>=
+%
+% \clearpage
+%
+% \section{Implementation}^^A>>=
+%^^A the LaTeX package >>=
+% \subsection{The \LaTeX\ Package}
+% Just like for \expkv\ we provide a small \LaTeX\ package that sets up things
+% such that we behave nicely on \LaTeX\ packages and files system. It'll
+% |\input| the generic code which implements the functionality.
+% \gobbledocstriptag
+%<*pkg>
+%    \begin{macrocode}
+\RequirePackage{expkv}
+\def\ekvd at tmp
+  {%
+    \ProvidesFile{expkv-def.tex}%
+      [\ekvdDate\space v\ekvdVersion\space a key-defining frontend for expkv]%
+  }
+\input{expkv-def.tex}
+\ProvidesPackage{expkv-def}%
+  [\ekvdDate\space v\ekvdVersion\space a key-defining frontend for expkv]
+%    \end{macrocode}
+% \gobbledocstriptag
+%</pkg>
+%^^A=<<
+%^^A main file >>=
+% \subsection{The Generic Code}
+% The rest of this implementation will be the generic code.
+% \gobbledocstriptag
+%<*tex>
+%
+% Load \expkv\ if the package didn't already do so -- since \expkv\ has
+% safeguards against being loaded twice this does no harm and the overhead
+% isn't that big. Also we reuse some of the internals of \expkv\ to save us from
+% retyping them.
+%    \begin{macrocode}
+\input expkv
+%    \end{macrocode}
+%
+% We make sure that \file{expkv-def.tex} is only input once:
+%    \begin{macrocode}
+\expandafter\ifx\csname ekvdVersion\endcsname\relax
+\else
+  \expandafter\endinput
+\fi
+%    \end{macrocode}
+%
+% \begin{macro}{\ekvdVersion,\ekvdDate}
+% We're on our first input, so lets store the version and date in a macro.
+%    \begin{macrocode}
+\def\ekvdVersion{0.1}
+\def\ekvdDate{2020-02-27}
+%    \end{macrocode}
+% \end{macro}
+%
+% If the \LaTeX\ format is loaded we want to be a good file and report back who
+% we are, for this the package will have defined |\ekvd at tmp| to use
+% |\ProvidesFile|, else this will expand to a |\relax| and do no harm.
+%    \begin{macrocode}
+\csname ekvd at tmp\endcsname
+%    \end{macrocode}
+%
+% Store the category code of |@| to later be able to reset it and change it to
+% 11 for now.
+%    \begin{macrocode}
+\expandafter\chardef\csname ekvd at tmp\endcsname=\catcode`\@
+\catcode`\@=11
+%    \end{macrocode}
+% |\ekvd at tmp| will be reused later to handle expansion during the key
+% defining. But we don't need it to ever store information long-term after
+% \expkvd\ was initialized.
+%
+% \begin{macro}[internal]
+%   {\ekvd at long,\ekvd at prot,\ekvd at clear@prefixes,\ekvd at empty}
+% \expkvd\ will use |\ekvd at long| and |\ekvd at prot| to store whether a key should
+% be defined an |\long| or |\protected|, and we have to clear them for every new
+% key. By default they'll just be empty.
+%    \begin{macrocode}
+\def\ekvd at empty{}
+\protected\def\ekvd at clear@prefixes
+  {%
+    \let\ekvd at long\ekvd at empty
+    \let\ekvd at prot\ekvd at empty
+  }
+\ekvd at clear@prefixes
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ekvdefinekeys}
+% This is the one front-facing macro which provides the interface to define
+% keys. It's using |\ekvparse| to handle the \kv\ list, the interpretation will
+% be done by |\ekvd at noarg| and |\ekvd@|. The \set\ for which the keys should be
+% defined is stored in |\ekvd at set|.
+%    \begin{macrocode}
+\protected\def\ekvdefinekeys#1%
+  {%
+    \def\ekvd at set{#1}%
+    \ekvparse\ekvd at noarg\ekvd@
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at noarg,\ekvd@}
+% |\ekvd at noarg| just places a special marker and gives control to |\ekvd@|.
+% |\ekvd@| has to test whether there is a space inside the key and if so calls
+% the prefix grabbing routine, else we throw an error and ignore the key.
+%    \begin{macrocode}
+\protected\def\ekvd at noarg#1{\ekvd@{#1}\ekvd at noarg@mark}
+\protected\def\ekvd@#1#2%
+  {%
+    \ekvd at clear@prefixes
+    \ekvd at ifspace{#1}%
+      {\ekvd at prefix\ekv at mark#1\ekv at stop{#2}}%
+      {\ekvd at missing@prefix{#1}}%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at prefix,\ekvd at prefix@}
+% \expkvd\ separates prefixes into two groups, the first being prefixes in the
+% \TeX\ sense (|long| and |protected|) which use |@p@| in their name, the other
+% being key-types (|code|, |int|, \emph{etc.}) which use |@t@| instead.
+% |\ekvd at prefix| splits at the first space and checks whether its a |@p@|
+% or |@t@| type prefix. If it is neither throw an error and gobble the
+% definition (the value).
+%    \begin{macrocode}
+\protected\def\ekvd at prefix#1 {\ekv at strip{#1}\ekvd at prefix@\ekv at mark}
+\protected\def\ekvd at prefix@#1#2\ekv at stop
+  {%
+    \ekv at ifdefined{ekvd at t@#1}%
+      {\ekv at strip{#2}{\csname ekvd at t@#1\endcsname}}%
+      {%
+        \ekv at ifdefined{ekvd at p@#1}%
+          {\csname ekvd at p@#1\endcsname{#2}}%
+          {\ekvd at err@undefined at prefix{#1}\@gobble}%
+      }%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at prefix@after at p}
+% The |@p@| type prefixes are all just modifying a following |@t@| type, so they
+% will need to search for another prefix. This is true for all of them, so we
+% use a macro to handle this. It'll throw an error if there is no other prefix.
+%    \begin{macrocode}
+\protected\def\ekvd at prefix@after at p#1%
+  {%
+    \ekvd at ifspace{#1}%
+      {\ekvd at prefix#1\ekv at stop}%
+      {%
+        \expandafter\ekvd at err@missing at prefix\expandafter{\ekv at gobble@mark#1}%
+        \@gobble
+      }%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at p@long,\ekvd at p@protected,\ekvd at p@protect}
+% Define the |@p@| type prefixes, they all just store some information in a
+% temporary macro and call |\ekvd at prefix@after at p|.
+%    \begin{macrocode}
+\protected\def\ekvd at p@long{\let\ekvd at long\long\ekvd at prefix@after at p}
+\protected\def\ekvd at p@protected{\let\ekvd at prot\protected\ekvd at prefix@after at p}
+\let\ekvd at p@protect\ekvd at p@protected
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Key Types}
+%
+% \begin{macro}[internal]{\ekvd at t@set}
+% The |set| type is quite straight forward, just define a |NoVal| key to call
+% |\ekvchangeset|.
+%    \begin{macrocode}
+\protected\def\ekvd at t@set#1#2%
+  {%
+    \ekvd at assert@not at long{set #1}%
+    \ekvd at assert@not at protected{set #1}%
+    \ekvd at ifnoarg{#2}%
+      {\ekvdefNoVal\ekvd at set{#1}{\ekvchangeset{#1}}}%
+      {%
+        \ekv at ifempty{#2}%
+          {\ekvd at err@missing at definition{set #1}}%
+          {\ekvdefNoVal\ekvd at set{#1}{\ekvchangeset{#2}}}%
+      }%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@noval,\ekvd at t@noval,\ekvd at t@enoval}
+% Another pretty simple type, |noval| just needs to assert that there is a
+% definition and that |long| wasn't specified.
+% There are types where the difference in the variants is so small, that we
+% define a common handler for them, those common handlers are named with
+% |@type@|. |noval| and |enoval| are so similar that we can use such a |@type@|
+% macro, even if we could've done |noval| in a slightly faster way without it.
+%    \begin{macrocode}
+\protected\long\def\ekvd at type@noval#1#2#3#4%
+  {%
+    \ekvd at assert@arg{#1noval #3}{#4}%
+      {%
+        \ekvd at assert@not at long{#1noval #3}%
+        \ekvd at prot#2\ekvd at tmp{#4}%
+        \ekvletNoVal\ekvd at set{#3}\ekvd at tmp
+      }%
+  }
+\protected\def\ekvd at t@noval{\ekvd at type@noval{}\def}
+\protected\def\ekvd at t@enoval{\ekvd at type@noval e\edef}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@code,\ekvd at t@code,\ekvd at t@ecode}
+% |code| is simple as well, |ecode| has to use |\edef| on a temporary macro,
+% since \expkv\ doesn't provide an |\ekvedef|.
+%    \begin{macrocode}
+\protected\long\def\ekvd at type@code#1#2#3#4%
+  {%
+    \ekvd at assert@arg{#1code #3}{#4}
+      {%
+        \ekvd at prot\ekvd at long#2\ekvd at tmp##1{#4}%
+        \ekvlet\ekvd at set{#3}\ekvd at tmp
+      }%
+  }
+\protected\def\ekvd at t@code{\ekvd at type@code{}\def}
+\protected\def\ekvd at t@ecode{\ekvd at type@code e\edef}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@default,\ekvd at t@default,\ekvd at t@qdefault}
+% |\ekvd at type@default| asserts there was an argument, also the key for which one
+% wants to set a default has to be already defined (this is not so important for
+% |default|, but |qdefault| requires is). If everything is good, |\edef| a
+% temporary macro that expands |\ekvd at set| and the |\csname| for the key, and in
+% the case of |qdefault| does the first expansion step of the key-macro.
+%    \begin{macrocode}
+\protected\long\def\ekvd at type@default#1#2#3#4%
+  {%
+    \ekvd at assert@arg{#1default #3}{#4}%
+      {%
+        \ekvifdefined\ekvd at set{#3}%
+          {%
+            \ekvd at assert@not at long{#1default #3}%
+            \ekvd at prot\edef\ekvd at tmp
+              {%
+                \unexpanded\expandafter#2%
+                  {\csname\ekv at name\ekvd at set{#3}\endcsname{#4}}%
+              }%
+            \ekvletNoVal\ekvd at set{#3}\ekvd at tmp
+          }%
+          {\ekvd at err@undefined at key{#3}}%
+      }%
+  }
+\protected\def\ekvd at t@default{\ekvd at type@default{}{}}
+\protected\def\ekvd at t@qdefault{\ekvd at type@default q{\expandafter\expandafter}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at t@edefault}
+% |edefault| is too different from |default| and |qdefault| to reuse the
+% |@type@| macro, as it doesn't need |\unexpanded| inside of |\edef|.
+%    \begin{macrocode}
+\protected\long\def\ekvd at t@edefault#1#2%
+  {%
+    \ekvd at assert@arg{edefault #1}{#2}%
+      {%
+        \ekvifdefined\ekvd at set{#1}%
+          {%
+            \ekvd at assert@not at long{edefault #1}%
+            \ekvd at prot\edef\ekvd at tmp
+              {\csname\ekv at name\ekvd at set{#1}\endcsname{#2}}%
+            \ekvletNoVal\ekvd at set{#1}\ekvd at tmp
+          }%
+          {\ekvd at err@undefined at key{#1}}%
+      }%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at t@initial}
+%    \begin{macrocode}
+\long\def\ekvd at t@initial#1#2%
+  {%
+    \ekvd at assert@arg{initial #1}{#2}%
+      {%
+        \ekvifdefined\ekvd at set{#1}%
+          {%
+            \ekvd at assert@not at long{initial #1}%
+            \ekvd at assert@not at protected{initial #1}%
+            \csname\ekv at name\ekvd at set{#1}\endcsname{#2}%
+          }%
+          {\ekvd at err@undefined at key{#1}}%
+      }%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {\ekvd at type@bool,\ekvd at t@bool,\ekvd at t@gbool,\ekvd at t@boolTF,\ekvd at t@gboolTF}
+% The boolean types are a quicker version of a |choice| that accept |true| and
+% |false|, and set up the |NoVal| action to be identical to \texttt{\key=true}.
+% The |true| and |false| actions are always just |\let|ting the macro in |#7| to
+% some other macro (\emph{e.g.}, \cs[no-index]{iftrue}).
+%    \begin{macrocode}
+\protected\def\ekvd at type@bool#1#2#3#4#5#6#7%
+  {%
+    \ekvd at assert@filledarg{#1bool#2 #6}{#7}%
+      {%
+        \ekvd at newlet#7#5%
+        \ekvd at type@choice{#1bool#2}{#6}%
+        \protected\ekvdefNoVal\ekvd at set{#6}{#3\let#7#4}%
+        \protected\expandafter\def
+          \csname\ekvd at choice@name\ekvd at set{#6}{true}\endcsname
+          {#3\let#7#4}%
+        \protected\expandafter\def
+          \csname\ekvd at choice@name\ekvd at set{#6}{false}\endcsname
+          {#3\let#7#5}%
+      }%
+  }
+\protected\def\ekvd at t@bool{\ekvd at type@bool{}{}{}\iftrue\iffalse}
+\protected\def\ekvd at t@gbool{\ekvd at type@bool g{}\global\iftrue\iffalse}
+\protected\def\ekvd at t@boolTF{\ekvd at type@bool{}{TF}{}\@firstoftwo\@secondoftwo}
+\protected\def\ekvd at t@gboolTF
+  {\ekvd at type@bool g{TF}\global\@firstoftwo\@secondoftwo}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@box,\ekvd at t@box,\ekvd at t@gbox}
+% Set up our boxes. Though we're a generic package we want to be colour safe, so
+% we put an additional grouping level inside the box contents, for the case that
+% someone uses \pkg{color}. |\ekvd at newreg| is a small wrapper which tests
+% whether the first argument is defined and if not does
+% |\csname new#2\endcsname#1|.
+%    \begin{macrocode}
+\protected\def\ekvd at type@box#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1box #3}{#4}%
+      {%
+        \ekvd at newreg#4{box}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}%
+          {#2\setbox#4\hbox{\begingroup##1\endgroup}}%
+      }%
+  }
+\protected\def\ekvd at t@box{\ekvd at type@box{}{}}
+\protected\def\ekvd at t@gbox{\ekvd at type@box g\global}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@toks,\ekvd at t@toks,\ekvd at t@gtoks}
+% Similar to |box|, but set the |toks|.
+%    \begin{macrocode}
+\protected\def\ekvd at type@toks#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1toks #3}{#4}%
+      {%
+        \ekvd at newreg#4{toks}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4{##1}}%
+      }%
+  }
+\protected\def\ekvd at t@toks{\ekvd at type@toks{}{}}
+\protected\def\ekvd at t@gtoks{\ekvd at type@toks{g}\global}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@apptoks,\ekvd at t@apptoks,\ekvd at t@gapptoks}
+% Just like |toks|, but expand the current contents of the |toks| register to
+% append the new contents.
+%    \begin{macrocode}
+\protected\def\ekvd at type@apptoks#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1apptoks #3}{#4}%
+      {%
+        \ekvd at newreg#4{toks}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4\expandafter{\the#4##1}}%
+      }%
+  }
+\protected\def\ekvd at t@apptoks{\ekvd at type@apptoks{}{}}
+\protected\def\ekvd at t@gapptoks{\ekvd at type@apptoks{g}\global}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {
+%     \ekvd at type@reg,\ekvd at t@int,\ekvd at t@eint,\ekvd at t@gint,\ekvd at t@xint,
+%     \ekvd at t@dimen,\ekvd at t@edimen,\ekvd at t@gdimen,\ekvd at t@xdimen,
+%     \ekvd at t@skip,\ekvd at t@eskip,\ekvd at t@gskip,\ekvd at t@xskip
+%   }
+% The |\ekvd at type@reg| can handle all the types for which the assignment will
+% just be \texttt{\meta{register}=\meta{value}}.
+%    \begin{macrocode}
+\protected\def\ekvd at type@reg#1#2#3#4#5#6#7%
+  {%
+    \ekvd at assert@filledarg{#1 #6}{#7}%
+      {%
+        \ekvd at newreg#7{#2}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#6}{#3#7=#4##1#5\relax}%
+      }%
+  }
+\protected\def\ekvd at t@int{\ekvd at type@reg{int}{count}{}{}{}}
+\protected\def\ekvd at t@eint{\ekvd at type@reg{eint}{count}{}\numexpr\relax}
+\protected\def\ekvd at t@gint{\ekvd at type@reg{gint}{count}\global{}{}}
+\protected\def\ekvd at t@xint{\ekvd at type@reg{xint}{count}\global\numexpr\relax}
+\protected\def\ekvd at t@dimen{\ekvd at type@reg{dimen}{dimen}{}{}{}}
+\protected\def\ekvd at t@edimen{\ekvd at type@reg{edimen}{dimen}{}\dimexpr\relax}
+\protected\def\ekvd at t@gdimen{\ekvd at type@reg{gdimen}{dimen}\global{}{}}
+\protected\def\ekvd at t@xdimen{\ekvd at type@reg{xdimen}{dimen}\global\dimexpr\relax}
+\protected\def\ekvd at t@skip{\ekvd at type@reg{skip}{skip}{}{}{}}
+\protected\def\ekvd at t@eskip{\ekvd at type@reg{eskip}{skip}{}\glueexpr\relax}
+\protected\def\ekvd at t@gskip{\ekvd at type@reg{gskip}{skip}\global{}{}}
+\protected\def\ekvd at t@xskip{\ekvd at type@reg{xskip}{skip}\global\glueexpr\relax}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@store,\ekvd at t@store,\ekvd at t@gstore}
+% The none-expanding |store| types use an |\edef| or |\xdef| and |\unexpanded|
+% to be able to also store |#| easily.
+%    \begin{macrocode}
+\protected\def\ekvd at type@store#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1store #3}{#4}%
+      {%
+        \unless\ifdefined#4\let#4\ekvd at empty\fi
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4{\unexpanded{##1}}}%
+      }%
+  }
+\protected\def\ekvd at t@store{\ekvd at type@store{}\edef}
+\protected\def\ekvd at t@gstore{\ekvd at type@store{g}\xdef}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at type@estore,\ekvd at t@estore,\ekvd at t@xstore}
+% And the straight forward |estore| types.
+%    \begin{macrocode}
+\protected\def\ekvd at type@estore#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1store #3}{#4}%
+      {%
+        \ekvd at newlet#4\ekvd at empty
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4{##1}}%
+      }%
+  }
+\protected\def\ekvd at t@estore{\ekvd at type@estore{e}\edef}
+\protected\def\ekvd at t@xstore{\ekvd at type@estore{x}\xdef}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {\ekvd at type@meta,\ekvd at type@meta@,\ekvd at t@meta,\ekvd at t@nmeta}
+% |meta| sets up things such that another instance of |\ekvset| will be run on
+% the argument, with the same \set.
+%    \begin{macrocode}
+\protected\long\def\ekvd at type@meta#1#2#3#4#5%
+  {%
+    \ekvd at assert@filledarg{#1meta #4}{#5}%
+      {%
+        \edef\ekvd at tmp{\ekvd at set}%
+        \expandafter\ekvd at type@meta@\expandafter{\ekvd at tmp}{#3}{#5}%
+        #2\ekvd at set{#4}\ekvd at tmp
+      }%
+  }
+\protected\long\def\ekvd at type@meta@#1#2#3%
+  {%
+    \ekvd at prot\ekvd at long\def\ekvd at tmp#2{\ekvset{#1}{#3}}%
+  }
+\protected\def\ekvd at t@meta{\ekvd at type@meta{}\ekvlet{##1}}
+\protected\def\ekvd at t@nmeta#1#2%
+  {%
+    \ekvd at assert@not at long{nmeta #1}%
+    \ekvd at type@meta n\ekvletNoVal{}{#1}{#2}%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {\ekvd at type@smeta,\ekvd at type@smeta@,\ekvd at t@smeta,\ekvd at t@snmeta}
+% |smeta| is pretty similar to |meta|, but needs two arguments inside of \val,
+% such that the first is the \set\ for which the sub-|\ekvset| and the second is
+% the \kv\ list.
+%    \begin{macrocode}
+\protected\long\def\ekvd at type@smeta#1#2#3#4#5%
+  {%
+    \ekvd at assert@twoargs{s#1meta #4}{#5}%
+      {%
+        \expandafter\ekvd at type@smeta@\expandafter{\@secondoftwo#5}{#5}{#3}
+        #2\ekvd at set{#4}\ekvd at tmp
+      }%
+  }
+\protected\long\def\ekvd at type@smeta@#1#2#3%
+  {%
+    \expandafter\ekvd at type@meta@\expandafter{\@firstoftwo#2}{#3}{#1}%
+  }
+\protected\def\ekvd at t@smeta{\ekvd at type@smeta{}\ekvlet{##1}}
+\protected\def\ekvd at t@snmeta#1#2%
+  {%
+    \ekvd at assert@not at long{snmeta #1}%
+    \ekvd at type@smeta n\ekvletNoVal{}{#1}{#2}%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {
+%     \ekvd at type@choice,\ekvd at populate@choice,\ekvd at populate@choice@,
+%     \ekvd at populate@choice at noarg,\ekvd at choice@prefix,\ekvd at choice@prefix@,
+%     \ekvd at choice@p at protected,\ekvd at choice@p at protect,
+%     \ekvd at choice@p at long,\ekvd at choice@p at long@,\ekvd at t@choice
+%   }
+% The |choice| type is by far the most complex type, as we have to run a
+% sub-parser on the choice-definition list, which should support the |@p@| type
+% prefixes as well (but |long| will always throw an error, as they are not
+% allowed to be long). |\ekvd at type@choice| will just define the choice-key, the
+% handling of the choices definition will be done by |\ekvd at populate@choice|.
+%    \begin{macrocode}
+\protected\def\ekvd at type@choice#1#2%
+  {%
+    \ekvd at assert@not at long{#1 #2}%
+    \ekvd at prot\edef\ekvd at tmp##1%
+      {%
+        \unexpanded{\ekvd at h@choice}{\ekvd at choice@name\ekvd at set{#2}{##1}}%
+      }%
+    \ekvlet\ekvd at set{#2}\ekvd at tmp
+  }
+%    \end{macrocode}
+% |\ekvd at populate@choice| just uses |\ekvparse| and then gives control to
+% |\ekvd at populate@choice at noarg|, which throws an error, and
+% |\ekvd at populate@choice@|.
+%    \begin{macrocode}
+\protected\def\ekvd at populate@choice
+  {%
+    \ekvparse\ekvd at populate@choice at noarg\ekvd at populate@choice@
+  }
+\protected\def\ekvd at populate@choice at noarg#1%
+  {%
+    \expandafter\ekvd at err@missing at definition\expandafter{\ekvd at set@choice : #1}%
+  }
+%    \end{macrocode}
+% |\ekvd at populate@choice@| runs the prefix-test, if there is none we can
+% directly define the choice, for that |\ekvd at set@choice| will expand to the
+% current choice-key's name, which will have been defined by |\ekvd at t@choice|.
+% If there is a prefix run the prefix grabbing routine, which was altered for
+% |@type at choice|.
+%    \begin{macrocode}
+\protected\long\def\ekvd at populate@choice@#1#2%
+  {%
+    \ekvd at clear@prefixes
+    \expandafter\ekvd at assert@arg\expandafter{\ekvd at set@choice : #1}{#2}%
+      {%
+        \ekvd at ifspace{#1}%
+          {\ekvd at choice@prefix\ekv at mark#1\ekv at stop}%
+          {%
+            \expandafter\def
+              \csname\ekvd at choice@name\ekvd at set\ekvd at set@choice{#1}\endcsname
+          }%
+          {#2}%
+      }%
+  }
+\protected\def\ekvd at choice@prefix#1
+  {%
+    \ekv at strip{#1}\ekvd at choice@prefix@\ekv at mark
+  }
+\protected\def\ekvd at choice@prefix@#1#2\ekv at stop
+  {%
+    \ekv at ifdefined{ekvd at choice@p@#1}%
+      {%
+        \csname ekvd at choice@p@#1\endcsname
+        \ekvd at ifspace{#2}%
+          {\ekvd at choice@prefix#2\ekv at stop}%
+          {%
+            \ekvd at prot\expandafter\def
+              \csname
+                \ekv at strip{#2}{\ekvd at choice@name\ekvd at set\ekvd at set@choice}%
+              \endcsname
+          }%
+      }%
+      {\ekvd at err@undefined at prefix{#1}\@gobble}%
+  }
+\protected\def\ekvd at choice@p at protected{\let\ekvd at prot\protected}
+\let\ekvd at choice@p at protect\ekvd at choice@p at protected
+\protected\def\ekvd at choice@p at long\ekvd at ifspace#1%
+  {%
+    \expandafter\ekvd at choice@p at long@\expandafter{\ekv at gobble@mark#1}%
+    \ekvd at ifspace{#1}%
+  }
+\protected\def\ekvd at choice@p at long@#1%
+  {%
+    \expandafter\ekvd at err@no at long\expandafter
+      {\ekvd at set@choice : long #1}%
+  }
+%    \end{macrocode}
+% Finally we're able to set up the |@t at choice| macro, which has to store the
+% current choice-key's name, define the key, and parse the available choices.
+%    \begin{macrocode}
+\protected\long\def\ekvd at t@choice#1#2%
+  {%
+    \ekvd at assert@arg{choice #1}{#2}%
+      {%
+        \ekvd at type@choice{choice}{#1}%
+        \def\ekvd at set@choice{#1}%
+        \ekvd at populate@choice{#2}%
+      }%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Key Type Helpers}
+% There are some keys that might need helpers during their execution (not during
+% their definition, which are gathered as |@type@| macros). These helpers are
+% named |@h@|.
+%
+% \begin{macro}[internal]{\ekvd at h@choice,\ekvd at h@choice@}
+% The |choice| helper will just test whether the given choice was defined, if
+% not throw an error expandably, else call the macro which stores the code for
+% this choice.
+%    \begin{macrocode}
+\def\ekvd at h@choice#1%
+  {%
+    \expandafter\ekvd at h@choice@
+      \csname\ifcsname#1\endcsname#1\else relax\fi\endcsname
+      {#1}%
+  }
+\def\ekvd at h@choice@#1#2%
+  {%
+    \ifx#1\relax
+      \ekvd at err@choice at invalid{#2}%
+      \expandafter\@gobble
+    \fi
+    #1%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Tests}
+%
+% \begin{macro}[internal]{\ekvd at noarg@mark}
+% This macro serves as a flag for the case that no \val\ was specified for a
+% key. As such it is not a test, but exists only for some tests.
+%    \begin{macrocode}
+\def\ekvd at noarg@mark{\ekvd at noarg@mark}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at fi@firstoftwo}
+% While we can reuse many of the internals of \expkv\ the specific case for this
+% branch wasn't needed by \expkv\ and hence isn't defined. We'll need it, so we
+% define it.
+%    \begin{macrocode}
+\long\def\ekvd at fi@firstoftwo\fi\@secondoftwo#1#2{\fi#1}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at newlet,\ekvd at newreg}
+% These macros test whether a control sequence is defined, if it isn't they
+% define it, either via |\let| or via the correct \cs[no-index]{new\meta{reg}}.
+%    \begin{macrocode}
+\protected\def\ekvd at newlet#1#2%
+  {%
+    \unless\ifdefined#1\let#1#2\fi
+  }
+\protected\def\ekvd at newreg#1#2%
+  {%
+    \unless\ifdefined#1\csname new#2\endcsname#1\fi
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {\ekvd at assert@twoargs,\ekvd at ifnottwoargs,\ekvd at ifempty@gtwo}
+% A test for exactly two tokens can be reduced for an empty-test after gobbling
+% two tokens, in the case that there are fewer tokens than two in the argument,
+% only macros will be gobbled that are needed for the true branch, which doesn't
+% hurt, and if there are more this will not be empty.
+%    \begin{macrocode}
+\long\def\ekvd at assert@twoargs#1#2%
+  {%
+    \ekvd at ifnottwoargs{#2}%
+      {\ekvd at err@missing at definition{#1}}%
+  }
+\long\def\ekvd at ifnottwoargs#1%
+  {%
+    \ekvd at ifempty@gtwo#1\ekv at ifempty@B
+      \ekv at ifempty@false\ekv at ifempty@A\ekv at ifempty@B\@firstoftwo
+  }
+\long\def\ekvd at ifempty@gtwo#1#2{\ekv at ifempty@\ekv at ifempty@A}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at assert@arg,\ekvd at ifnoarg}
+% The test for an argument is just an |\ifx| comparison with our |noarg at mark|.
+%    \begin{macrocode}
+\long\def\ekvd at assert@arg#1#2%
+  {%
+    \ekvd at ifnoarg{#2}%
+      {\ekvd at err@missing at definition{#1}}%
+  }
+\long\def\ekvd at ifnoarg#1%
+  {%
+    \ifx\ekvd at noarg@mark#1%
+      \ekvd at fi@firstoftwo
+    \fi
+    \@secondoftwo
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at assert@filledarg,\ekvd at ifnoarg@or at empty}
+%    \begin{macrocode}
+\long\def\ekvd at assert@filledarg#1#2%
+  {%
+    \ekvd at ifnoarg@or at empty{#2}%
+      {\ekvd at err@missing at definition{#1}}%
+  }
+\long\def\ekvd at ifnoarg@or at empty#1%
+  {%
+    \ekvd at ifnoarg{#1}%
+      \@firstoftwo
+      {\ekv at ifempty{#1}}%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]{\ekvd at assert@not at long,\ekvd at assert@not at protected}
+% Some key-types don't want to be |\long| or |\protected|, so we provide macros
+% to test this and throw an error, this could be silently ignored but now users
+% will learn to not use unnecessary stuff which slows the compilation down.
+%    \begin{macrocode}
+\long\def\ekvd at assert@not at long#1%
+  {%
+    \ifx\ekvd at long\long\ekvd at err@no at long{#1}\fi
+  }
+\long\def\ekvd at assert@not at protected#1%
+  {%
+    \ifx\ekvd at prot\protected\ekvd at err@no at protected{#1}\fi
+  }
+%    \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.
+%    \begin{macrocode}
+\long\def\ekvd at ifspace#1%
+  {%
+    \ekvd at ifspace@#1 \ekv at ifempty@B
+      \ekv at ifempty@false\ekv at ifempty@A\ekv at ifempty@B\@firstoftwo
+  }
+\long\def\ekvd at ifspace@#1 % keep this space
+  {%
+    \ekv at ifempty@\ekv at ifempty@A
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Messages}
+%
+% Most messages of \expkvd\ are not expandable, since they only appear during
+% key-definition, which is not expandable anyway.
+%
+% \begin{macro}[internal]
+%   {
+%     \ekvd at err@missing at definition,\ekvd at err@missing at prefix,
+%     \ekvd at err@undefined at prefix,\ekvd at err@undefined at key,\ekvd at err@no at protected,
+%     \ekvd at err@no at long
+%   }
+% The non-expandable error messages are boring, so here they are:
+%    \begin{macrocode}
+\protected\def\ekvd at err@missing at definition#1%
+  {\errmessage{expkv-def Error: Missing definition for key `\unexpanded{#1}'}}
+\protected\def\ekvd at err@missing at prefix#1%
+  {\errmessage{expkv-def Error: Missing prefix for key `\unexpanded{#1}'}}
+\protected\def\ekvd at err@undefined at prefix#1%
+  {\errmessage{expkv-def Error: Undefined prefix `\unexpanded{#1}'}}
+\protected\def\ekvd at err@undefined at key#1%
+  {\errmessage{expkv-def Error: Undefined key `\unexpanded{#1}'}}
+\protected\def\ekvd at err@no at protected#1%
+  {%
+    \errmessage
+      {expkv-def Error: prefix `protected' not accepted for `\unexpanded{#1}'}%
+  }
+\protected\def\ekvd at err@no at long#1%
+  {%
+    \errmessage
+      {expkv-def Error: prefix `long' not accepted for `\unexpanded{#1}'}%
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[internal]
+%   {
+%     \ekvd at err@choice at invalid,\ekvd at err@choice at invalid@,\ekvd at choice@name,
+%     \ekvd at err
+%   }
+% The expandable error messages use |\ekvd at err|, which is just like |\ekv at err|
+% from \expkv\ or the way \pkg{expl3} throws expandable error messages. It uses
+% an undefined control sequence to start the error message.
+% |\ekvd at err@choice at invalid| will have to use this mechanism to throw its
+% message. Also we have to retrieve the name parts of the choice in an easy way,
+% so we use parentheses of catcode 8 here, which should suffice in most cases to
+% allow for a correct separation.
+%    \begin{macrocode}
+\def\ekvd at err@choice at invalid#1%
+  {%
+    \ekvd at err@choice at invalid@#1\ekv at stop
+  }
+\begingroup
+\catcode40=8
+\catcode41=8
+\@firstofone{\endgroup
+\def\ekvd at choice@name#1#2#3%
+  {%
+    ekvd#1(#2)#3%
+  }
+\def\ekvd at err@choice at invalid@ ekvd#1(#2)#3\ekv at stop%
+  {%
+    \ekvd at err{invalid choice `#3' (`#2', set `#1')}%
+  }
+}
+\begingroup
+\edef\ekvd at err
+  {%
+    \endgroup
+    \unexpanded{\long\def\ekvd at err}##1%
+      {%
+        \unexpanded{\expandafter\ekv at err@\@firstofone}%
+        {\expandafter\noexpand\csname ! expkv-def Error:\endcsname ##1.}%
+        \unexpanded{\ekv at stop}%
+      }%
+  }
+\ekvd at err
+%    \end{macrocode}
+% \end{macro}
+%
+% Now everything that's left is to reset the category code of |@|.
+%    \begin{macrocode}
+\catcode`\@=\ekvd at tmp
+%    \end{macrocode}
+%
+% \gobbledocstriptag
+%</tex>
+%^^A=<<
+%
+%^^A=<<
+%
+% \end{implementation}^^A=<<
+%
+% \clearpage
+% \PrintIndex
+%
+\endinput
+%
+^^A vim: ft=tex fdm=marker fmr=>>=,=<<


Property changes on: trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex	2020-02-28 22:27:15 UTC (rev 53957)
@@ -0,0 +1,490 @@
+%%
+%% This is file `expkv-def.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% expkv-def.dtx  (with options: `tex')
+%% 
+%% --------------------------------------------------------------
+%% expkv-def -- a key-defining frontend for expkv
+%% E-mail: jspratte at yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%% 
+%% Copyright (C) 2020 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 option) any later version.  The latest version of this license is in
+%% the file:
+%% 
+%%   http://www.latex-project.org/lppl.txt
+%% 
+%% This work is "maintained" (as per LPPL maintenance status) by
+%%   Jonathan P. Spratte.
+%% 
+%% This work consists of the file  expkv-def.dtx
+%% and the derived files           expkv-def.pdf
+%%                                 expkv-def.sty
+%%                                 expkv-def.tex
+%% 
+\input expkv
+\expandafter\ifx\csname ekvdVersion\endcsname\relax
+\else
+  \expandafter\endinput
+\fi
+\def\ekvdVersion{0.1}
+\def\ekvdDate{2020-02-27}
+\csname ekvd at tmp\endcsname
+\expandafter\chardef\csname ekvd at tmp\endcsname=\catcode`\@
+\catcode`\@=11
+\def\ekvd at empty{}
+\protected\def\ekvd at clear@prefixes
+  {%
+    \let\ekvd at long\ekvd at empty
+    \let\ekvd at prot\ekvd at empty
+  }
+\ekvd at clear@prefixes
+\protected\def\ekvdefinekeys#1%
+  {%
+    \def\ekvd at set{#1}%
+    \ekvparse\ekvd at noarg\ekvd@
+  }
+\protected\def\ekvd at noarg#1{\ekvd@{#1}\ekvd at noarg@mark}
+\protected\def\ekvd@#1#2%
+  {%
+    \ekvd at clear@prefixes
+    \ekvd at ifspace{#1}%
+      {\ekvd at prefix\ekv at mark#1\ekv at stop{#2}}%
+      {\ekvd at missing@prefix{#1}}%
+  }
+\protected\def\ekvd at prefix#1 {\ekv at strip{#1}\ekvd at prefix@\ekv at mark}
+\protected\def\ekvd at prefix@#1#2\ekv at stop
+  {%
+    \ekv at ifdefined{ekvd at t@#1}%
+      {\ekv at strip{#2}{\csname ekvd at t@#1\endcsname}}%
+      {%
+        \ekv at ifdefined{ekvd at p@#1}%
+          {\csname ekvd at p@#1\endcsname{#2}}%
+          {\ekvd at err@undefined at prefix{#1}\@gobble}%
+      }%
+  }
+\protected\def\ekvd at prefix@after at p#1%
+  {%
+    \ekvd at ifspace{#1}%
+      {\ekvd at prefix#1\ekv at stop}%
+      {%
+        \expandafter\ekvd at err@missing at prefix\expandafter{\ekv at gobble@mark#1}%
+        \@gobble
+      }%
+  }
+\protected\def\ekvd at p@long{\let\ekvd at long\long\ekvd at prefix@after at p}
+\protected\def\ekvd at p@protected{\let\ekvd at prot\protected\ekvd at prefix@after at p}
+\let\ekvd at p@protect\ekvd at p@protected
+\protected\def\ekvd at t@set#1#2%
+  {%
+    \ekvd at assert@not at long{set #1}%
+    \ekvd at assert@not at protected{set #1}%
+    \ekvd at ifnoarg{#2}%
+      {\ekvdefNoVal\ekvd at set{#1}{\ekvchangeset{#1}}}%
+      {%
+        \ekv at ifempty{#2}%
+          {\ekvd at err@missing at definition{set #1}}%
+          {\ekvdefNoVal\ekvd at set{#1}{\ekvchangeset{#2}}}%
+      }%
+  }
+\protected\long\def\ekvd at type@noval#1#2#3#4%
+  {%
+    \ekvd at assert@arg{#1noval #3}{#4}%
+      {%
+        \ekvd at assert@not at long{#1noval #3}%
+        \ekvd at prot#2\ekvd at tmp{#4}%
+        \ekvletNoVal\ekvd at set{#3}\ekvd at tmp
+      }%
+  }
+\protected\def\ekvd at t@noval{\ekvd at type@noval{}\def}
+\protected\def\ekvd at t@enoval{\ekvd at type@noval e\edef}
+\protected\long\def\ekvd at type@code#1#2#3#4%
+  {%
+    \ekvd at assert@arg{#1code #3}{#4}
+      {%
+        \ekvd at prot\ekvd at long#2\ekvd at tmp##1{#4}%
+        \ekvlet\ekvd at set{#3}\ekvd at tmp
+      }%
+  }
+\protected\def\ekvd at t@code{\ekvd at type@code{}\def}
+\protected\def\ekvd at t@ecode{\ekvd at type@code e\edef}
+\protected\long\def\ekvd at type@default#1#2#3#4%
+  {%
+    \ekvd at assert@arg{#1default #3}{#4}%
+      {%
+        \ekvifdefined\ekvd at set{#3}%
+          {%
+            \ekvd at assert@not at long{#1default #3}%
+            \ekvd at prot\edef\ekvd at tmp
+              {%
+                \unexpanded\expandafter#2%
+                  {\csname\ekv at name\ekvd at set{#3}\endcsname{#4}}%
+              }%
+            \ekvletNoVal\ekvd at set{#3}\ekvd at tmp
+          }%
+          {\ekvd at err@undefined at key{#3}}%
+      }%
+  }
+\protected\def\ekvd at t@default{\ekvd at type@default{}{}}
+\protected\def\ekvd at t@qdefault{\ekvd at type@default q{\expandafter\expandafter}}
+\protected\long\def\ekvd at t@edefault#1#2%
+  {%
+    \ekvd at assert@arg{edefault #1}{#2}%
+      {%
+        \ekvifdefined\ekvd at set{#1}%
+          {%
+            \ekvd at assert@not at long{edefault #1}%
+            \ekvd at prot\edef\ekvd at tmp
+              {\csname\ekv at name\ekvd at set{#1}\endcsname{#2}}%
+            \ekvletNoVal\ekvd at set{#1}\ekvd at tmp
+          }%
+          {\ekvd at err@undefined at key{#1}}%
+      }%
+  }
+\long\def\ekvd at t@initial#1#2%
+  {%
+    \ekvd at assert@arg{initial #1}{#2}%
+      {%
+        \ekvifdefined\ekvd at set{#1}%
+          {%
+            \ekvd at assert@not at long{initial #1}%
+            \ekvd at assert@not at protected{initial #1}%
+            \csname\ekv at name\ekvd at set{#1}\endcsname{#2}%
+          }%
+          {\ekvd at err@undefined at key{#1}}%
+      }%
+  }
+\protected\def\ekvd at type@bool#1#2#3#4#5#6#7%
+  {%
+    \ekvd at assert@filledarg{#1bool#2 #6}{#7}%
+      {%
+        \ekvd at newlet#7#5%
+        \ekvd at type@choice{#1bool#2}{#6}%
+        \protected\ekvdefNoVal\ekvd at set{#6}{#3\let#7#4}%
+        \protected\expandafter\def
+          \csname\ekvd at choice@name\ekvd at set{#6}{true}\endcsname
+          {#3\let#7#4}%
+        \protected\expandafter\def
+          \csname\ekvd at choice@name\ekvd at set{#6}{false}\endcsname
+          {#3\let#7#5}%
+      }%
+  }
+\protected\def\ekvd at t@bool{\ekvd at type@bool{}{}{}\iftrue\iffalse}
+\protected\def\ekvd at t@gbool{\ekvd at type@bool g{}\global\iftrue\iffalse}
+\protected\def\ekvd at t@boolTF{\ekvd at type@bool{}{TF}{}\@firstoftwo\@secondoftwo}
+\protected\def\ekvd at t@gboolTF
+  {\ekvd at type@bool g{TF}\global\@firstoftwo\@secondoftwo}
+\protected\def\ekvd at type@box#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1box #3}{#4}%
+      {%
+        \ekvd at newreg#4{box}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}%
+          {#2\setbox#4\hbox{\begingroup##1\endgroup}}%
+      }%
+  }
+\protected\def\ekvd at t@box{\ekvd at type@box{}{}}
+\protected\def\ekvd at t@gbox{\ekvd at type@box g\global}
+\protected\def\ekvd at type@toks#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1toks #3}{#4}%
+      {%
+        \ekvd at newreg#4{toks}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4{##1}}%
+      }%
+  }
+\protected\def\ekvd at t@toks{\ekvd at type@toks{}{}}
+\protected\def\ekvd at t@gtoks{\ekvd at type@toks{g}\global}
+\protected\def\ekvd at type@apptoks#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1apptoks #3}{#4}%
+      {%
+        \ekvd at newreg#4{toks}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4\expandafter{\the#4##1}}%
+      }%
+  }
+\protected\def\ekvd at t@apptoks{\ekvd at type@apptoks{}{}}
+\protected\def\ekvd at t@gapptoks{\ekvd at type@apptoks{g}\global}
+\protected\def\ekvd at type@reg#1#2#3#4#5#6#7%
+  {%
+    \ekvd at assert@filledarg{#1 #6}{#7}%
+      {%
+        \ekvd at newreg#7{#2}%
+        \protected\ekvd at long\ekvdef\ekvd at set{#6}{#3#7=#4##1#5\relax}%
+      }%
+  }
+\protected\def\ekvd at t@int{\ekvd at type@reg{int}{count}{}{}{}}
+\protected\def\ekvd at t@eint{\ekvd at type@reg{eint}{count}{}\numexpr\relax}
+\protected\def\ekvd at t@gint{\ekvd at type@reg{gint}{count}\global{}{}}
+\protected\def\ekvd at t@xint{\ekvd at type@reg{xint}{count}\global\numexpr\relax}
+\protected\def\ekvd at t@dimen{\ekvd at type@reg{dimen}{dimen}{}{}{}}
+\protected\def\ekvd at t@edimen{\ekvd at type@reg{edimen}{dimen}{}\dimexpr\relax}
+\protected\def\ekvd at t@gdimen{\ekvd at type@reg{gdimen}{dimen}\global{}{}}
+\protected\def\ekvd at t@xdimen{\ekvd at type@reg{xdimen}{dimen}\global\dimexpr\relax}
+\protected\def\ekvd at t@skip{\ekvd at type@reg{skip}{skip}{}{}{}}
+\protected\def\ekvd at t@eskip{\ekvd at type@reg{eskip}{skip}{}\glueexpr\relax}
+\protected\def\ekvd at t@gskip{\ekvd at type@reg{gskip}{skip}\global{}{}}
+\protected\def\ekvd at t@xskip{\ekvd at type@reg{xskip}{skip}\global\glueexpr\relax}
+\protected\def\ekvd at type@store#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1store #3}{#4}%
+      {%
+        \unless\ifdefined#4\let#4\ekvd at empty\fi
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4{\unexpanded{##1}}}%
+      }%
+  }
+\protected\def\ekvd at t@store{\ekvd at type@store{}\edef}
+\protected\def\ekvd at t@gstore{\ekvd at type@store{g}\xdef}
+\protected\def\ekvd at type@estore#1#2#3#4%
+  {%
+    \ekvd at assert@filledarg{#1store #3}{#4}%
+      {%
+        \ekvd at newlet#4\ekvd at empty
+        \protected\ekvd at long\ekvdef\ekvd at set{#3}{#2#4{##1}}%
+      }%
+  }
+\protected\def\ekvd at t@estore{\ekvd at type@estore{e}\edef}
+\protected\def\ekvd at t@xstore{\ekvd at type@estore{x}\xdef}
+\protected\long\def\ekvd at type@meta#1#2#3#4#5%
+  {%
+    \ekvd at assert@filledarg{#1meta #4}{#5}%
+      {%
+        \edef\ekvd at tmp{\ekvd at set}%
+        \expandafter\ekvd at type@meta@\expandafter{\ekvd at tmp}{#3}{#5}%
+        #2\ekvd at set{#4}\ekvd at tmp
+      }%
+  }
+\protected\long\def\ekvd at type@meta@#1#2#3%
+  {%
+    \ekvd at prot\ekvd at long\def\ekvd at tmp#2{\ekvset{#1}{#3}}%
+  }
+\protected\def\ekvd at t@meta{\ekvd at type@meta{}\ekvlet{##1}}
+\protected\def\ekvd at t@nmeta#1#2%
+  {%
+    \ekvd at assert@not at long{nmeta #1}%
+    \ekvd at type@meta n\ekvletNoVal{}{#1}{#2}%
+  }
+\protected\long\def\ekvd at type@smeta#1#2#3#4#5%
+  {%
+    \ekvd at assert@twoargs{s#1meta #4}{#5}%
+      {%
+        \expandafter\ekvd at type@smeta@\expandafter{\@secondoftwo#5}{#5}{#3}
+        #2\ekvd at set{#4}\ekvd at tmp
+      }%
+  }
+\protected\long\def\ekvd at type@smeta@#1#2#3%
+  {%
+    \expandafter\ekvd at type@meta@\expandafter{\@firstoftwo#2}{#3}{#1}%
+  }
+\protected\def\ekvd at t@smeta{\ekvd at type@smeta{}\ekvlet{##1}}
+\protected\def\ekvd at t@snmeta#1#2%
+  {%
+    \ekvd at assert@not at long{snmeta #1}%
+    \ekvd at type@smeta n\ekvletNoVal{}{#1}{#2}%
+  }
+\protected\def\ekvd at type@choice#1#2%
+  {%
+    \ekvd at assert@not at long{#1 #2}%
+    \ekvd at prot\edef\ekvd at tmp##1%
+      {%
+        \unexpanded{\ekvd at h@choice}{\ekvd at choice@name\ekvd at set{#2}{##1}}%
+      }%
+    \ekvlet\ekvd at set{#2}\ekvd at tmp
+  }
+\protected\def\ekvd at populate@choice
+  {%
+    \ekvparse\ekvd at populate@choice at noarg\ekvd at populate@choice@
+  }
+\protected\def\ekvd at populate@choice at noarg#1%
+  {%
+    \expandafter\ekvd at err@missing at definition\expandafter{\ekvd at set@choice : #1}%
+  }
+\protected\long\def\ekvd at populate@choice@#1#2%
+  {%
+    \ekvd at clear@prefixes
+    \expandafter\ekvd at assert@arg\expandafter{\ekvd at set@choice : #1}{#2}%
+      {%
+        \ekvd at ifspace{#1}%
+          {\ekvd at choice@prefix\ekv at mark#1\ekv at stop}%
+          {%
+            \expandafter\def
+              \csname\ekvd at choice@name\ekvd at set\ekvd at set@choice{#1}\endcsname
+          }%
+          {#2}%
+      }%
+  }
+\protected\def\ekvd at choice@prefix#1
+  {%
+    \ekv at strip{#1}\ekvd at choice@prefix@\ekv at mark
+  }
+\protected\def\ekvd at choice@prefix@#1#2\ekv at stop
+  {%
+    \ekv at ifdefined{ekvd at choice@p@#1}%
+      {%
+        \csname ekvd at choice@p@#1\endcsname
+        \ekvd at ifspace{#2}%
+          {\ekvd at choice@prefix#2\ekv at stop}%
+          {%
+            \ekvd at prot\expandafter\def
+              \csname
+                \ekv at strip{#2}{\ekvd at choice@name\ekvd at set\ekvd at set@choice}%
+              \endcsname
+          }%
+      }%
+      {\ekvd at err@undefined at prefix{#1}\@gobble}%
+  }
+\protected\def\ekvd at choice@p at protected{\let\ekvd at prot\protected}
+\let\ekvd at choice@p at protect\ekvd at choice@p at protected
+\protected\def\ekvd at choice@p at long\ekvd at ifspace#1%
+  {%
+    \expandafter\ekvd at choice@p at long@\expandafter{\ekv at gobble@mark#1}%
+    \ekvd at ifspace{#1}%
+  }
+\protected\def\ekvd at choice@p at long@#1%
+  {%
+    \expandafter\ekvd at err@no at long\expandafter
+      {\ekvd at set@choice : long #1}%
+  }
+\protected\long\def\ekvd at t@choice#1#2%
+  {%
+    \ekvd at assert@arg{choice #1}{#2}%
+      {%
+        \ekvd at type@choice{choice}{#1}%
+        \def\ekvd at set@choice{#1}%
+        \ekvd at populate@choice{#2}%
+      }%
+  }
+\def\ekvd at h@choice#1%
+  {%
+    \expandafter\ekvd at h@choice@
+      \csname\ifcsname#1\endcsname#1\else relax\fi\endcsname
+      {#1}%
+  }
+\def\ekvd at h@choice@#1#2%
+  {%
+    \ifx#1\relax
+      \ekvd at err@choice at invalid{#2}%
+      \expandafter\@gobble
+    \fi
+    #1%
+  }
+\def\ekvd at noarg@mark{\ekvd at noarg@mark}
+\long\def\ekvd at fi@firstoftwo\fi\@secondoftwo#1#2{\fi#1}
+\protected\def\ekvd at newlet#1#2%
+  {%
+    \unless\ifdefined#1\let#1#2\fi
+  }
+\protected\def\ekvd at newreg#1#2%
+  {%
+    \unless\ifdefined#1\csname new#2\endcsname#1\fi
+  }
+\long\def\ekvd at assert@twoargs#1#2%
+  {%
+    \ekvd at ifnottwoargs{#2}%
+      {\ekvd at err@missing at definition{#1}}%
+  }
+\long\def\ekvd at ifnottwoargs#1%
+  {%
+    \ekvd at ifempty@gtwo#1\ekv at ifempty@B
+      \ekv at ifempty@false\ekv at ifempty@A\ekv at ifempty@B\@firstoftwo
+  }
+\long\def\ekvd at ifempty@gtwo#1#2{\ekv at ifempty@\ekv at ifempty@A}
+\long\def\ekvd at assert@arg#1#2%
+  {%
+    \ekvd at ifnoarg{#2}%
+      {\ekvd at err@missing at definition{#1}}%
+  }
+\long\def\ekvd at ifnoarg#1%
+  {%
+    \ifx\ekvd at noarg@mark#1%
+      \ekvd at fi@firstoftwo
+    \fi
+    \@secondoftwo
+  }
+\long\def\ekvd at assert@filledarg#1#2%
+  {%
+    \ekvd at ifnoarg@or at empty{#2}%
+      {\ekvd at err@missing at definition{#1}}%
+  }
+\long\def\ekvd at ifnoarg@or at empty#1%
+  {%
+    \ekvd at ifnoarg{#1}%
+      \@firstoftwo
+      {\ekv at ifempty{#1}}%
+  }
+\long\def\ekvd at assert@not at long#1%
+  {%
+    \ifx\ekvd at long\long\ekvd at err@no at long{#1}\fi
+  }
+\long\def\ekvd at assert@not at protected#1%
+  {%
+    \ifx\ekvd at prot\protected\ekvd at err@no at protected{#1}\fi
+  }
+\long\def\ekvd at ifspace#1%
+  {%
+    \ekvd at ifspace@#1 \ekv at ifempty@B
+      \ekv at ifempty@false\ekv at ifempty@A\ekv at ifempty@B\@firstoftwo
+  }
+\long\def\ekvd at ifspace@#1 % keep this space
+  {%
+    \ekv at ifempty@\ekv at ifempty@A
+  }
+\protected\def\ekvd at err@missing at definition#1%
+  {\errmessage{expkv-def Error: Missing definition for key `\unexpanded{#1}'}}
+\protected\def\ekvd at err@missing at prefix#1%
+  {\errmessage{expkv-def Error: Missing prefix for key `\unexpanded{#1}'}}
+\protected\def\ekvd at err@undefined at prefix#1%
+  {\errmessage{expkv-def Error: Undefined prefix `\unexpanded{#1}'}}
+\protected\def\ekvd at err@undefined at key#1%
+  {\errmessage{expkv-def Error: Undefined key `\unexpanded{#1}'}}
+\protected\def\ekvd at err@no at protected#1%
+  {%
+    \errmessage
+      {expkv-def Error: prefix `protected' not accepted for `\unexpanded{#1}'}%
+  }
+\protected\def\ekvd at err@no at long#1%
+  {%
+    \errmessage
+      {expkv-def Error: prefix `long' not accepted for `\unexpanded{#1}'}%
+  }
+\def\ekvd at err@choice at invalid#1%
+  {%
+    \ekvd at err@choice at invalid@#1\ekv at stop
+  }
+\begingroup
+\catcode40=8
+\catcode41=8
+\@firstofone{\endgroup
+\def\ekvd at choice@name#1#2#3%
+  {%
+    ekvd#1(#2)#3%
+  }
+\def\ekvd at err@choice at invalid@ ekvd#1(#2)#3\ekv at stop%
+  {%
+    \ekvd at err{invalid choice `#3' (`#2', set `#1')}%
+  }
+}
+\begingroup
+\edef\ekvd at err
+  {%
+    \endgroup
+    \unexpanded{\long\def\ekvd at err}##1%
+      {%
+        \unexpanded{\expandafter\ekv at err@\@firstofone}%
+        {\expandafter\noexpand\csname ! expkv-def Error:\endcsname ##1.}%
+        \unexpanded{\ekv at stop}%
+      }%
+  }
+\ekvd at err
+\catcode`\@=\ekvd at tmp
+%% 
+%%
+%% End of file `expkv-def.tex'.


Property changes on: trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/expkv-def/expkv-def.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/expkv-def/expkv-def.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/expkv-def/expkv-def.sty	2020-02-28 22:27:15 UTC (rev 53957)
@@ -0,0 +1,44 @@
+%%
+%% This is file `expkv-def.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% expkv-def.dtx  (with options: `pkg')
+%% 
+%% --------------------------------------------------------------
+%% expkv-def -- a key-defining frontend for expkv
+%% E-mail: jspratte at yahoo.de
+%% Released under the LaTeX Project Public License v1.3c or later
+%% See http://www.latex-project.org/lppl.txt
+%% --------------------------------------------------------------
+%% 
+%% Copyright (C) 2020 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 option) any later version.  The latest version of this license is in
+%% the file:
+%% 
+%%   http://www.latex-project.org/lppl.txt
+%% 
+%% This work is "maintained" (as per LPPL maintenance status) by
+%%   Jonathan P. Spratte.
+%% 
+%% This work consists of the file  expkv-def.dtx
+%% and the derived files           expkv-def.pdf
+%%                                 expkv-def.sty
+%%                                 expkv-def.tex
+%% 
+\RequirePackage{expkv}
+\def\ekvd at tmp
+  {%
+    \ProvidesFile{expkv-def.tex}%
+      [\ekvdDate\space v\ekvdVersion\space a key-defining frontend for expkv]%
+  }
+\input{expkv-def.tex}
+\ProvidesPackage{expkv-def}%
+  [\ekvdDate\space v\ekvdVersion\space a key-defining frontend for expkv]
+%% 
+%%
+%% End of file `expkv-def.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/expkv-def/expkv-def.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2020-02-28 22:25:54 UTC (rev 53956)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2020-02-28 22:27:15 UTC (rev 53957)
@@ -278,7 +278,8 @@
     exam exam-n exam-randomizechoices examdesign example examplep
     exceltex excludeonly exercise exercisebank exercisepoints exercises
     exframe exp-testopt
-    expdlist expex expkv export expressg exsheets exsol extarrows exteps
+    expdlist expex expkv expkv-def export expressg
+    exsheets exsol extarrows exteps
     extpfeil extract extsizes
   facsimile factura facture facture-belge-simple-sans-tva faktor
     fancybox fancyhandout fancyhdr fancyhdr-it fancylabel fancynum fancypar

Modified: trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc	2020-02-28 22:25:54 UTC (rev 53956)
+++ trunk/Master/tlpkg/tlpsrc/collection-plaingeneric.tlpsrc	2020-02-28 22:27:15 UTC (rev 53957)
@@ -27,6 +27,7 @@
 depend epsf
 depend epsf-dvipdfmx
 depend expkv
+depend expkv-def
 depend fenixpar
 depend figflow
 depend fixpdfmag

Added: trunk/Master/tlpkg/tlpsrc/expkv-def.tlpsrc
===================================================================


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