texlive[59341] Master/texmf-dist: expkv-def (25may21)
commits+karl at tug.org
commits+karl at tug.org
Tue May 25 22:46:48 CEST 2021
Revision: 59341
http://tug.org/svn/texlive?view=revision&revision=59341
Author: karl
Date: 2021-05-25 22:46:48 +0200 (Tue, 25 May 2021)
Log Message:
-----------
expkv-def (25may21)
Modified Paths:
--------------
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/expkv-def.dtx
trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
Modified: trunk/Master/texmf-dist/doc/latex/expkv-def/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/expkv-def/README.md 2021-05-25 20:46:32 UTC (rev 59340)
+++ trunk/Master/texmf-dist/doc/latex/expkv-def/README.md 2021-05-25 20:46:48 UTC (rev 59341)
@@ -1,7 +1,7 @@
-------------------------------------------------------------------------------
# expkv-def -- a key-defining frontend for expkv
-Version 2021-04-10 v0.8
+Version 2021-05-24 v0.8a
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
Modified: trunk/Master/texmf-dist/doc/latex/expkv-def/expkv-def.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx 2021-05-25 20:46:32 UTC (rev 59340)
+++ trunk/Master/texmf-dist/source/latex/expkv-def/expkv-def.dtx 2021-05-25 20:46:48 UTC (rev 59341)
@@ -64,6 +64,19 @@
\RequirePackage[oldstylenums,nott]{kpfonts}
\input{glyphtounicode}
\pdfgentounicode=1
+\RequirePackage{tcolorbox}
+\newtcolorbox{exresult}[2][]
+ {colback=expkvgrey!10!white,colframe=expkvgrey,fontupper=\small,width={#2},#1}
+\newtcbox\exres[1][]
+ {
+ colback=expkvgrey!10!white
+ ,colframe=expkvgrey
+ ,size=small
+ ,nobeforeafter
+ ,tcbox raise base
+ ,fontupper=\small
+ ,#1
+ }
\RequirePackage{listings}
\RequirePackage{booktabs}
\RequirePackage{array}
@@ -73,23 +86,117 @@
\RequirePackage{caption}
\RequirePackage{microtype}
\RequirePackage{accsupp}
+\lstdefinelanguage{expkvd}[primitive]{TeX}
+ {
+ ,moretexcs=[4]^^A e-TeX
+ {
+ expanded,
+ numexpr,
+ protected,
+ }
+ ,moretexcs=[5]^^A plain/LaTeX
+ {
+ approx,
+ begin,
+ empty,
+ item,
+ LaTeX,
+ makeatletter,makeatother,
+ newcommand,newdimen,
+ RequirePackage,
+ rule,
+ TeX,
+ textit,texttt,
+ usepackage,
+ }
+ ,moretexcs=[6]^^A used packages
+ {
+ ^^A xfp
+ fpeval,
+ ^^A keyval
+ setkeys,
+ ^^A yax
+ defactiveparameter,storevalue,setparameterlist
+ }
+ ,moretexcs=[2]^^A expkv-def macros
+ {
+ ekvdefinekeys
+ }
+ ,moretexcs=[3]^^A expkv-pkg macros
+ {
+ ^^A expkv
+ ekvdef,ekvdefNoVal,^^A
+ ekvlet,ekvletNoVal,ekvletkv,ekvletkvNoVal,^^A
+ ekvdefunknown,ekvdefunknownNoVal,^^A
+ ekvredirectunknown,ekvredirectunknownNoVal,^^A
+ ekvset,ekvsetSneaked,^^A
+ ekvsetdef,ekvsetSneakeddef,ekvsetdefSneaked,^^A
+ ekvparse,^^A
+ ekvVersion,ekvDate,^^A
+ ekvifdefined,ekvifdefinedNoVal,ekvifdefinedset,^^A
+ ekvbreak,ekvbreakPreSneak,ekvbreakPostSneak,^^A
+ ekvsneak,ekvsneakPre,^^A
+ ekvchangeset,^^A
+ ekvoptarg,ekvoptargTF,^^A
+ ekverr,
+ ^^A expkv-cs
+ ekvcSecondaryKeys,ekvcSplitAndForward,
+ }
+ }
+\colorlet{codeparam}{cyan!65!black}
+\def\mylstwd{.55em}
\lstset
{
+ ,language=expkvd
,flexiblecolumns=false
- ,basewidth=.53em
+ ,basewidth=\mylstwd
,gobble=2
,basicstyle=\fontfamily{jkp}\itshape
- ,morekeywords=^^A
- {^^A
- \ekvdefinekeys
- }
- ,morecomment=[l]\%
+ ,texcsstyle=*[1]{\bfseries\color{expkvgrey}} ^^A primitives
+ ,texcsstyle=*[2]{\bfseries\color{expkvred}} ^^A expkv
+ ,texcsstyle=*[3]{\color{expkvred}} ^^A expkv-pkg
+ ,texcsstyle=*[4]{\bfseries\color{expkvgrey}} ^^A e-TeX
+ ,texcsstyle=*[5]{\bfseries\color{expkvgrey}} ^^A plain/LaTeX macros
+ ,texcsstyle=*[6]{} ^^A macros of other packages
,commentstyle=\color[gray]{0.4}
- ,literate={\{}{{\CodeSymbol\{}}{1}
- {\}}{{\CodeSymbol\}}}{1}
+ ,literate=
+ {\{} {{\CodeUpBf\{}}{1}
+ {\}} {{\CodeUpBf\}}}{1}
+ {$} {{\CodeUpBf\$}}{1}
+ {[} {{\CodeUp[}}{1}
+ {]} {{\CodeUp]}}{1}
+ {(} {{\CodeUp(}}{1}
+ {)} {{\CodeUp)}}{1}
+ {*} {{$*$}}{1}
+ {1} {{\CodeUp{1}}}{1}
+ {2} {{\CodeUp{2}}}{1}
+ {3} {{\CodeUp{3}}}{1}
+ {4} {{\CodeUp{4}}}{1}
+ {5} {{\CodeUp{5}}}{1}
+ {6} {{\CodeUp{6}}}{1}
+ {7} {{\CodeUp{7}}}{1}
+ {8} {{\CodeUp{8}}}{1}
+ {9} {{\CodeUp{9}}}{1}
+ {0} {{\CodeUp{0}}}{1}
+ {##} {{\CodeColored{codeparam}{1}{\#}}}{1}
+ {##1}{{\CodeColored{codeparam}{2}{\#1}}}{2}
+ {##2}{{\CodeColored{codeparam}{2}{\#2}}}{2}
+ {##3}{{\CodeColored{codeparam}{2}{\#3}}}{2}
+ {##4}{{\CodeColored{codeparam}{2}{\#4}}}{2}
+ {##5}{{\CodeColored{codeparam}{2}{\#5}}}{2}
+ {##6}{{\CodeColored{codeparam}{2}{\#6}}}{2}
+ {##7}{{\CodeColored{codeparam}{2}{\#7}}}{2}
+ {##8}{{\CodeColored{codeparam}{2}{\#8}}}{2}
+ {##9}{{\CodeColored{codeparam}{2}{\#9}}}{2}
+ {<key>}{{$\langle$}key{$\rangle$}}{5}
+ {<set>}{{$\langle$}set{$\rangle$}}{5}
+ {<set1>}{{$\langle$}set1{$\rangle$}}{6}
+ {<set2>}{{$\langle$}set2{$\rangle$}}{6}
^^A,literate=*{<key>}{\key}{4}{<set>}{\set}{4}
}
-\newcommand*\CodeSymbol[1]{\textbf{#1}}
+\newcommand*\CodeColored[3]{\textcolor{#1}{\makebox[\dimexpr\mylstwd*#2]{#3}}}
+\newcommand*\CodeUpBf[1]{\makebox[\mylstwd]{\textup{\textbf{#1}}}}
+\newcommand*\CodeUp[1]{\makebox[\mylstwd]{\textup{#1}}}
\RequirePackage{randtext}
\let\metaORIG\meta
\protected\def\meta #1{\texttt{\metaORIG{#1}}}
@@ -511,7 +618,7 @@
% \begin{syntax}
% toks \key\ = \meta{cs} \prefixes2212
% \end{syntax}
-% The \meta{cs} should be a single control sequence, such as |\foo|.
+% 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|.
@@ -730,7 +837,7 @@
% in Italics. If a person has no hobbies the description item will be silently
% left out. The result of the above code looks like this:
%
-% \begingroup
+% \begin{exresult}{\linewidth}
% \ekvdefinekeys{ex}
% {
% data name = \Pname
@@ -751,7 +858,7 @@
% \Person{name=Jonathan P. Spratte, age=young, hobby=\TeX\ coding}
% \Person{name=Some User, age=unknown, hobby=Reading Documentation}
% \Person{name=Anybody, age=any}
-% \endgroup
+% \end{exresult}
%
% \subsection{License}
%
@@ -824,8 +931,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{0.8}
-\def\ekvdDate{2021-04-10}
+\def\ekvdVersion{0.8a}
+\def\ekvdDate{2021-05-24}
% \end{macrocode}
% \end{macro}
%
@@ -2075,7 +2182,7 @@
}%
}
\protected\def\ekvd at err@not at new
- {\ekvd at errm{The key for `\ekvd at cur' is already defined}}
+ {\ekvd at errm{The key for `\ekvd at cur' is already defined}}
\protected\long\def\ekvd at err@misused at unknown
{\ekvd at errm{Misuse of the unknown type found while processing `\ekvd at cur'}}
% \end{macrocode}
@@ -2111,7 +2218,7 @@
{%
\ekv at ifdefined{\ekvd at unknown@choice at name{#1}{#2}}%
{\csname\ekvd at unknown@choice at name{#1}{#2}\endcsname{#3}}%
- {\ekvd at err{invalid choice `#3' (`#2', set `#1')}}%
+ {\ekvd at err{invalid choice `#3' for `#2' in set `#1'}}%
}
}
% \end{macrocode}
@@ -2119,15 +2226,9 @@
%
% \begin{macro}[internal]{\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.
+% from \expkv. It uses a runaway argument to start the error message.
% \begin{macrocode}
-\def\ekvd at err#1%
- {%
- \long\def\ekvd at err##1{\expandafter\ekv at err@\@firstofone{#1##1.}\ekv at stop}%
- }
-\begingroup\expandafter\endgroup
-\expandafter\ekvd at err\csname ! expkv-def Error:\endcsname
+\ekv at exparg{\long\def\ekvd at err#1}{\ekverr{expkv-def}{#1}}
% \end{macrocode}
% \end{macro}
%
Modified: trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex 2021-05-25 20:46:32 UTC (rev 59340)
+++ trunk/Master/texmf-dist/tex/generic/expkv-def/expkv-def.tex 2021-05-25 20:46:48 UTC (rev 59341)
@@ -35,8 +35,8 @@
\else
\expandafter\endinput
\fi
-\def\ekvdVersion{0.8}
-\def\ekvdDate{2021-04-10}
+\def\ekvdVersion{0.8a}
+\def\ekvdDate{2021-05-24}
\csname ekvd at tmp\endcsname
\expandafter\chardef\csname ekvd at tmp\endcsname=\catcode`\@
\catcode`\@=11
@@ -886,15 +886,10 @@
{%
\ekv at ifdefined{\ekvd at unknown@choice at name{#1}{#2}}%
{\csname\ekvd at unknown@choice at name{#1}{#2}\endcsname{#3}}%
- {\ekvd at err{invalid choice `#3' (`#2', set `#1')}}%
+ {\ekvd at err{invalid choice `#3' for `#2' in set `#1'}}%
}
}
-\def\ekvd at err#1%
- {%
- \long\def\ekvd at err##1{\expandafter\ekv at err@\@firstofone{#1##1.}\ekv at stop}%
- }
-\begingroup\expandafter\endgroup
-\expandafter\ekvd at err\csname ! expkv-def Error:\endcsname
+\ekv at exparg{\long\def\ekvd at err#1}{\ekverr{expkv-def}{#1}}
\catcode`\@=\ekvd at tmp
%%
%%
More information about the tex-live-commits
mailing list.