From 0c52816f121429fd9e4277d4dc8895f92c2bdb52 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 19 Aug 2021 03:01:47 +0000 Subject: CTAN sync 202108190301 --- macros/latex/contrib/bytefield/README | 2 +- macros/latex/contrib/bytefield/bytefield.dtx | 57 ++- macros/latex/contrib/bytefield/bytefield.ins | 4 +- macros/latex/contrib/bytefield/bytefield.pdf | Bin 583061 -> 630473 bytes macros/latex/contrib/keyparse/README.md | 6 + macros/latex/contrib/keyparse/keyparse.dtx | 486 +++++++++++++++++++++ macros/latex/contrib/keyparse/keyparse.ins | 64 +++ macros/latex/contrib/keyparse/keyparse.pdf | Bin 0 -> 575187 bytes macros/latex/contrib/lambdax/README.md | 6 + macros/latex/contrib/lambdax/lambdax.dtx | 416 ++++++++++++++++++ macros/latex/contrib/lambdax/lambdax.ins | 64 +++ .../latex/contrib/verifiche/verifiche-example.pdf | Bin 175413 -> 182373 bytes macros/latex/contrib/verifiche/verifiche.dtx | 50 ++- macros/latex/contrib/verifiche/verifiche.pdf | Bin 518387 -> 519980 bytes 14 files changed, 1105 insertions(+), 50 deletions(-) create mode 100644 macros/latex/contrib/keyparse/README.md create mode 100644 macros/latex/contrib/keyparse/keyparse.dtx create mode 100644 macros/latex/contrib/keyparse/keyparse.ins create mode 100644 macros/latex/contrib/keyparse/keyparse.pdf create mode 100644 macros/latex/contrib/lambdax/README.md create mode 100644 macros/latex/contrib/lambdax/lambdax.dtx create mode 100644 macros/latex/contrib/lambdax/lambdax.ins (limited to 'macros/latex/contrib') diff --git a/macros/latex/contrib/bytefield/README b/macros/latex/contrib/bytefield/README index b76f221d76..5f8e64c3d2 100644 --- a/macros/latex/contrib/bytefield/README +++ b/macros/latex/contrib/bytefield/README @@ -33,7 +33,7 @@ supports hyperref hyperlinks. Copyright and license --------------------- -Copyright (C) 2000-2020 Scott Pakin, scott+bf@pakin.org +Copyright (C) 2000-2021 Scott Pakin, scott+bf@pakin.org This package may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3a of this diff --git a/macros/latex/contrib/bytefield/bytefield.dtx b/macros/latex/contrib/bytefield/bytefield.dtx index 8af3e52bbf..24ee535fda 100644 --- a/macros/latex/contrib/bytefield/bytefield.dtx +++ b/macros/latex/contrib/bytefield/bytefield.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -% Copyright (C) 2000-2020 by Scott Pakin +% Copyright (C) 2000-2021 by Scott Pakin % ----------------------------------------------------------- % % This file may be distributed and/or modified under the @@ -22,7 +22,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{bytefield} %<*package> - [2020/10/31 v2.6 Network protocol diagrams] + [2021/08/17 v2.7 Network protocol diagrams] % % %<*driver> @@ -46,7 +46,7 @@ pdfauthor={Scott Pakin}, pdfsubject={Protocol diagrams for LaTeX}, pdfkeywords={bits, bytes, bit fields, communication, network protocol diagrams, LaTeX2e, memory maps}, - pdfcopyright={Copyright (C) 2000-2020, Scott Pakin}, + pdfcopyright={Copyright (C) 2000-2021, Scott Pakin}, pdflicenseurl={http://www.latex-project.org/lppl/}, pdfcaptionwriter={Scott Pakin}, pdfcontactemail={scott+bf@pakin.org}, @@ -68,7 +68,7 @@ % % \fi % -% \CheckSum{1194} +% \CheckSum{1182} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -423,10 +423,7 @@ % % The first, optional, argument, \meta{sides}, is a list of letters % specifying which sides of the field box to draw---[|l|]eft, [|r|]ight, -% [|t|]op, and/or [|b|]ottom.\footnote{Uppercase |L|, |R|, |T|, and |B| -% undo a prior |l|, |r|, |t|, or |b| and may be useful for writing -% wrapper commands around \texttt{\string\bitbox} and -% \texttt{\string\wordbox}.} The default is ``|lrtb|'' (i.e.,~all +% [|t|]op, and/or [|b|]ottom. The default is ``|lrtb|'' (i.e.,~all % sides are drawn). The second, required, argument is the width in bits % of a bit box or the height in words of a word box. The third argument % is an optional, comma-separated list of \meta{key}=\meta{value} pairs, @@ -2342,9 +2339,7 @@ % Put some text~(|#4|) in a box that's a given number of bits~(|#2|) % wide and one byte tall. An optional argument~(|#1|) specifies which % lines to draw---|[l]|eft, |[r]|ight, |[t]|op, and/or |[b]|ottom -% (default: |lrtb|). Uppercase letters provide the opposite effect: -% They suppress drawing the |[L]|eft, |[R]|ight, |[T]|op, and/or -% |[B]|ottom sides. Additional drawing parameters can be provided via +% (default: |lrtb|). Additional drawing parameters can be provided via % another optional argument~(|#3|). % \begin{macrocode} \DeclareRobustCommand{\bitbox}{\bf@call@box@cmd{\bf@bitbox}} @@ -2389,9 +2384,7 @@ % Put some text~(|#4|) in a box that's a given number of bytes~(|#2|) % tall and one word (|\bits@wide| bits) wide. An optional % argument~(|#1|) specifies which lines to draw---|[l]|eft, |[r]|ight, -% |[t]|op, and/or |[b]|ottom (default: |lrtb|). Uppercase letters -% provide the opposite effect: They suppress drawing the |[L]|eft, -% |[R]|ight, |[T]|op, and/or |[B]|ottom sides. Additional drawing +% |[t]|op, and/or |[b]|ottom (default: |lrtb|). Additional drawing % parameters can be provided via another optional argument~(|#3|). % \begin{macrocode} \DeclareRobustCommand{\wordbox}{\bf@call@box@cmd{\bf@wordbox}} @@ -2565,9 +2558,8 @@ % Put each token in |#3| into a box that's a given number of bits (|#2|) % wide and one byte tall. An optional argument (|#1|) specifies which % lines to draw---|[l]|eft, |[r]|ight, |[t]|op, and/or |[b]|ottom -% (default: |lrtb|). Uppercase letters suppress drawing the |[L]|eft, -% |[R]|ight, |[T]|op, and/or |[B]|ottom sides. The |*|-form of the -% command omits interior left and right lines. +% (default: |lrtb|). The |*|-form of the command omits interior left +% and right lines. % \begin{macrocode} \DeclareRobustCommand{\bitboxes}{% \@ifstar @@ -2700,11 +2692,14 @@ % \subsubsection{Parsing arguments} % % The macros in this section are used to parse the optional argument to -% |\bitbox| or |\wordbox|, which is some subset of $\{ |l|, |r|, |t|, -% |b|, |L|, |R|, |T|, |B| \}$. Lowercase letters display the left, -% right, top, or bottom side of a box; uppercase letters inhibit the -% display. The default is not to display any sides, but an uppercase -% letter can negate the effect of a prior lowercase letter. +% \cs{bitbox}, \cs{wordbox}, and \cs{bitboxes}, which is some subset of +% $\{ |l|, |r|, |t|, |b|, |L|, |R|, |T|, |B| \}$ and defaults to +% ``|lrtb|'' for all three user macros. If the argument is empty, no +% lines are drawn. Lowercase letters in the argument display, +% respectively, the left, right, top, or bottom side of a box. +% Uppercase letters undo the effect of the corresponding, prior, +% lowercase letter and are used internally by \cs{bitboxes} to suppress +% internal left and right lines. % % \begin{macro}{\ifbitbox@top} % \begin{macro}{\ifbitbox@bottom} @@ -3064,6 +3059,8 @@ % \end{macro} % % \begin{macro}{\store@rcurly} +% \changes{v2.7}{2021/08/17}{Properly align right curly braces under +% Lua\string\LaTeX\ (bug reported by Georgi Nikiforov)} % \begin{macro}{\curly@height} % \begin{macro}{\half@curly@height} % \begin{macro}{\curly@shift} @@ -3083,16 +3080,15 @@ \bf@newdimen\curly@shift \setlength{\curly@shift}{\bf@rightcurlyshrinkage}% \setlength{\curly@shift}{\half@curly@height + 0.5\curly@shift}% + \addtolength{\curly@shift}{-\fontdimen22\textfont2}% \global\sbox{#1}{\raisebox{\curly@shift}{% - $\xdef\old@axis{\the\fontdimen22\textfont2}$% \bf@rightcurlystyle{% - $\fontdimen22\textfont2=0pt% - \left. + $\left. \vrule height\half@curly@height width 0pt depth\half@curly@height\right\bf@rightcurly$% }% - $\fontdimen22\textfont2=\old@axis$}}% + }}% \endgroup } % \end{macrocode} @@ -3103,6 +3099,8 @@ % \end{macro} % % \begin{macro}{\store@lcurly} +% \changes{v2.7}{2021/08/17}{Properly align left curly braces under +% Lua\string\LaTeX\ (bug reported by Georgi Nikiforov)} % \begin{macro}{\curly@height} % \begin{macro}{\half@curly@height} % \begin{macro}{\curly@shift} @@ -3118,16 +3116,15 @@ \bf@newdimen\curly@shift \setlength{\curly@shift}{\bf@leftcurlyshrinkage}% \setlength{\curly@shift}{\half@curly@height + 0.5\curly@shift}% + \addtolength{\curly@shift}{-\fontdimen22\textfont2}% \global\sbox{#1}{\raisebox{\curly@shift}{% - $\xdef\old@axis{\the\fontdimen22\textfont2}$% \bf@leftcurlystyle{% - $\fontdimen22\textfont2=0pt% - \left\bf@leftcurly + $\left\bf@leftcurly \vrule height\half@curly@height width 0pt depth\half@curly@height\right.$% }% - $\fontdimen22\textfont2=\old@axis$}}% + }}% \endgroup } % \end{macrocode} diff --git a/macros/latex/contrib/bytefield/bytefield.ins b/macros/latex/contrib/bytefield/bytefield.ins index d00c642405..fcbcf0584c 100644 --- a/macros/latex/contrib/bytefield/bytefield.ins +++ b/macros/latex/contrib/bytefield/bytefield.ins @@ -1,5 +1,5 @@ %% -%% Copyright (C) 2000-2020 by Scott Pakin +%% Copyright (C) 2000-2021 by Scott Pakin %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3a of this license @@ -21,7 +21,7 @@ This is a generated file. -Copyright (C) 2000-2020 by Scott Pakin +Copyright (C) 2000-2021 by Scott Pakin This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3a of this license diff --git a/macros/latex/contrib/bytefield/bytefield.pdf b/macros/latex/contrib/bytefield/bytefield.pdf index 46b2b36d09..655403099f 100644 Binary files a/macros/latex/contrib/bytefield/bytefield.pdf and b/macros/latex/contrib/bytefield/bytefield.pdf differ diff --git a/macros/latex/contrib/keyparse/README.md b/macros/latex/contrib/keyparse/README.md new file mode 100644 index 0000000000..a8179a4c80 --- /dev/null +++ b/macros/latex/contrib/keyparse/README.md @@ -0,0 +1,6 @@ +----------------------------------------------------------------- +##### keyparse --- key-based parser +- Source repository: https://github.com/rogard/keyparse +- Released under the LaTeX Project Public License v1.3c or later +- See http://www.latex-project.org/lppl.txt +----------------------------------------------------------------- diff --git a/macros/latex/contrib/keyparse/keyparse.dtx b/macros/latex/contrib/keyparse/keyparse.dtx new file mode 100644 index 0000000000..8017d273a5 --- /dev/null +++ b/macros/latex/contrib/keyparse/keyparse.dtx @@ -0,0 +1,486 @@ +% \iffalse meta-comment +% !TEX program = pdfLaTeX +%<*internal> +\iffalse +% +%<*readme> +----------------------------------------------------------------- +##### keyparse --- key-based parser +- Source repository: https://github.com/rogard/keyparse +- Released under the LaTeX Project Public License v1.3c or later +- See http://www.latex-project.org/lppl.txt +----------------------------------------------------------------- +% +%<*internal> +\fi +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else +\expandafter\begingroup +\fi +% +%<*install> +\input l3docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +----------------------------------------------------------------------------- +keyparse --- key-based parser +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2021 by Erwann Rogard + +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 +Erwann Rogard. + +This work consists of the file keyparse.dtx and the derived files: +keyparse.sty, and keyparse.pdf. + +\endpostamble +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +% +% \endbatchfile +%<*internal> +\generate{ + \file{\jobname.ins}{\from{\jobname.dtx}{install}} +} +\nopreamble\nopostamble +\generate{ + \file{README.md}{\from{\jobname.dtx}{readme}} +} +\ifx\fmtname\nameofplainTeX +\expandafter\endbatchfile +\else +\expandafter\endgroup +\fi +% +% \NeedsTeXFormat{LaTeX2e}[2021-06-01] +% \RequirePackage{expl3, xparse, l3keys2e}[2021-06-01] +% \ProvidesExplPackage +% {keyparse} % Package name +% {2021-08-18} % Release date +% {1.1} % Release version +% {keyparse --- key-based parser } % Description +%<*driver> +\documentclass[show-notes]{l3doc} +\EnableCrossrefs +\CodelineIndex +\RecordChanges +%^^A\documentclass[full, show-notes]{l3doc} +%^^A \listfiles +\usepackage{amsmath, bookmark, enumitem, mathtools, microtype, tcolorbox, xparse} +\usepackage[french, german, english]{babel} +\usepackage[T1]{fontenc} +\usepackage[bibencoding=auto, backend=biber, sorting=ynt]{biblatex} +\begin{filecontents*}{\jobname.bib} +@manual{interface3, + title = {The \LaTeX3 interfaces}, + author = {The \LaTeX3 Project Team}, + year = {2019}, + note = {\url{https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/l3kernel/expl3.pdf}}, + annote = {} } +@manual{xparse, + title = {The \pkg{xparse} package}, + author = {The \LaTeX3 Project Team}, + year = {2019}, + note = {\url{https://ctan.math.illinois.edu/macros/latex/contrib/l3packages/xparse.pdf}}, + annote = {} } +@misc{a-188053, + author = {@{}sean-allred}, + title = {``How to create lambda expressions?''}, + year = {2014}, + note = {\url{https://tex.stackexchange.com/a/188053/112708}}} +\end{filecontents*} +\addbibresource{\jobname.bib} +\ExplSyntaxOn +%^^A *** Sectioning +\tl_gset:Nn \partname {Part}%^^A allows to test w/o babel +\makeatletter +\newcommand*{\docsetnameref} +{\def\@currentlabelname}%https://tex.stackexchange.com/questions/537751 +\makeatother +\newcounter{cscounter} +\ProvideDocumentCommand +\DocPhantomSection{sO{subsection}D<>{}mo} +{\leavevmode + \refstepcounter{cscounter} + \IfBooleanF{#1}{\addcontentsline{toc}{#2}{#4}} + \IfValueT{#5} + {\docsetnameref{#3#4}\label{#5}}} +% ^^A *** Msg +\msg_new:nnn{__keyparse_doc}{unknown}{~#1:#2~unknown} +% ^^A *** Expressions +\ProvideDocumentCommand{\pkgpattpair}{mm}{\texttt{>\{#1\}\{#2\}}} +\ProvideDocumentCommand{\pkgrule}{}{\texttt{$\rightarrow$}} +% ^^A *** L3 package +\ProvideDocumentCommand{\docplaceh}{mO{1}}{\texttt{\prg_replicate:nn{#2}{\#}#1}} +% ^^A *** Lists +\newlist{arab-inl}{enumerate*}{1} +\setlist[arab-inl]{label=\arabic*)} +\newlist{colon-inl}{itemize*}{1} +\setlist[colon-inl] +{ %^^Abefore=\noindent, + label={}, + itemjoin={{; }}, + after={{.}}} +\newlist{descr}{description}{1} +\setlist[descr]{nosep, align=right, itemindent=0pt, font=\sffamily\tiny} +\ExplSyntaxOff +%^^A *** listing +\tcbuselibrary{listings, breakable} +\newtcblisting[auto counter] +{listing}[2][]{ + noparskip, + breakable, + colback=white, + colframe=black, + opacitybacktitle=.8,% + fonttitle=\bfseries, + title={Listing~\thetcbcounter. #1}, + arc=0pt, + outer arc=0pt, + boxrule=1pt, + listing and text, + #2} +\newtcblisting +{internal} +{text only, + breakable, + colback=white, + fontupper=\sffamily, + arc=1pt, + outer arc=1pt, + boxrule=0pt, + halign=left, + fontupper=\small\sffamily, + left=0pt, + top=0pt, + bottom=0pt} +\usepackage{keyparse} +\usepackage{hyperref} %^^A comes last +\begin{document} +\DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \GetFileInfo{\jobname.sty} +% \title{The \pkg{keyparse} package\thanks{^^A +% This file describes version \fileversion, last revised \filedate.^^A +% }^^A +% } +% \author{Erwann Rogard\thanks{first.lastname at gmail.com}} +% +% \date{Released \filedate} +% \begin{documentation} +% +% \maketitle +% +% \begin{abstract} +% This \LaTeX package provides an interface to define and evaluate key-based replacement rules\cite{interface3}. +% It can be used to parse the argument specification of a document command\cite{xparse}. +% \end{abstract} +% +% \tableofcontents +% +% \part{Usage}\label{part:usage} +% +% \section{Document command} +% \begin{function}{KeyparseKeys} +% \begin{syntax} +% \cs{KeyparseKeys}\Arg{rule} +% \end{syntax} +% \begin{descr} +% \item[Expands~to] The keys associated with \meta{rule} +% \end{descr} +% \end{function} +% +% \begin{function}{KeyparseEval} +% \begin{syntax} +% \cs{KeyparseEval} +% \end{syntax} +% \begin{descr} +% \item[Adapts] \nameref{cs:keyparse:eval} +% \end{descr} +% \end{function} +% +% \section{Programming} +% \DocPhantomSection*{\cs{keyparse_set:nnnnn}}[cs:keyparse:rule] +% \begin{function}{\keyparse_set:nnnnn} +% \begin{syntax} +% \cs{keyparse_set:nnnnn}\Arg{rule}\Arg{key}\Arg{signature}\Arg{replacement}\Arg{recurse} +% \end{syntax} +% \begin{descr} +% \item[Requires] +% \begin{colon-inl} +% \item \meta{rule} is a token~list +% \item \meta{key}\meta{signature} is a valid \enquote{weird} argument specifier\cite[Naming functions and variables]{interface3} +% \item \meta{replacement} and \meta{recurse} are in terms of \meta{signature} +% \end{colon-inl} +% \item[Semantics] As shown under {\sffamily\tiny{}Expands~to} for \nameref{cs:keyparse:eval} +% \item[Tip] Using |{|\meta{token}|}| as \meta{replacement}, one can iterate over the result of \nameref{cs:keyparse:eval} using \cs[no-index]{tl_map_function:nN}. +% Using \meta{token}, instead, merges the \meta{tokens}'s. +% \end{descr} +% \end{function} +% +% \DocPhantomSection*{\cs{keyparse_eval:nn}}[cs:keyparse:eval] +% \begin{function}[EXP]{\keyparse_eval:nn} +% \begin{syntax} +% \cs{keyparse_eval:nn}\Arg{rule}|{|\meta{key}\meta{args}|}| +% \end{syntax} +% \end{function} +% \begin{descr} +% \item[Requires] \meta{args} is compatible with \meta{signature} for that \meta{rule} and \meta{key} +% \item[Expands~to] \meta{replacement}\nameref{cs:keyparse:eval}\Arg{rule}\Arg{recurse} +% \end{descr} +% +% \subsection*{Other} +% \begin{function}[EXP]{\keyparse_argspec_e:n} +% \cs{keyparse_argspec_e:n}\Arg{token list} +% \end{function} +% +% \section{Rule} +% Hereafter are rules defined with \nameref{cs:keyparse:rule}. +% +% \DocPhantomSection{\textsf{argspec}}[keyparse:argspec] +% \DescribeEnv{argspec} +% \begin{descr} +% \item[Keys] \KeyparseKeys{argspec} +% \item[Requires] \meta{key_i}\meta{arg_i} is a valid document-command argument specifier\cite{xparse} +% \item[Rule i] \meta{key_i}\meta{arg_i}\pkgrule|{|\meta{key_i}\meta{arg_i}|}| +% \end{descr} +% +% \DocPhantomSection{\textsf{pair/first}}[keyparse:pair:first] +% \DescribeEnv{pair/first} +% \begin{descr} +% \item[Keys] \KeyparseKeys{pair/first} +% \item[Rule 1] \pkgpattpair{\meta{first}}{\meta{second}}\pkgrule\meta{first} +% \end{descr} +% +% \DocPhantomSection{\textsf{pair/merge}}[keyparse:pair:merge] +% \DescribeEnv{pair/merge} +% \begin{descr} +% \item[Keys] \KeyparseKeys{pair/merge} +% \item[Rule 1] \pkgpattpair{\meta{first}}{\meta{second}}\pkgrule\meta{first}\meta{second} +% \end{descr} +% +% \clearpage +% \part{Listing}\label{part:listing} +% \addcontentsline{toc}{subsection} +% {\ref{listing:keyparse:plain}. +% Making rules for \texttt{\&}, \texttt{>\{.\}}, and \texttt{+.+}} +% \iffalse +%<*guardlisting> +% \fi +\begin{listing} + [Making rules for \texttt{\&}, \texttt{>\{.\}}, and \texttt{+.+}] + {label=listing:keyparse:plain} + \ExplSyntaxOn + \group_begin: + \keyparse_set:nnnnn{foo}{&}{#1}{{&}}{#1} + \keyparse_set:nnnnn{foo}{>}{#1#2}{{#1}}{#2} + \keyparse_set:nnnnn{foo}{+}{#1+#2}{{#1}}{#2} + \exp_args:Nx + \tl_map_inline:nn + {\keyparse_eval:nn{foo}{&>{123}+xyz+}} + {\texttt{(\tl_to_str:n{#1})}} + \group_end: + \ExplSyntaxOff + \end{listing} +% \iffalse +% +% \fi +% +% \addcontentsline{toc}{subsection} +% {\ref{listing:keyparse:leslie}. Embedding `\LaTeX' in \enquote{Leslie Lamport built \dots}} +% \iffalse +%<*guardlisting> +% \fi +\begin{listing} + [Embedding `\LaTeX' in \enquote{Leslie Lamport built \dots}] + {label=listing:keyparse:leslie} + \begingroup + \KeyparseEval{pair/first} + {>{}{Leslie~} + >{La}{mport~built~LaTeX~on~top~of~Donald~Knuth's~} + >{TeX}{.}} + \endgroup +\end{listing} +% \iffalse +% +% \fi +% +% \addcontentsline{toc}{subsection} +% {\ref{listing:keyparse:argspec}. \nameref{keyparse:argspec}.} +% \iffalse +%<*guardlisting> +% \fi + \begin{listing} + [\nameref{keyparse:argspec}] + {label=listing:keyparse:argspec} + \ExplSyntaxOn + \group_begin: + \tl_set:Nx\l_tmpa_tl + {\keyparse_eval:nn{argspec}{msotae{_^}r<]d[>}} + \exp_args:Nx + \tl_map_inline:Nn + \l_tmpa_tl + {\texttt{(\tl_to_str:n{#1})}} + \group_end: + \ExplSyntaxOff + \end{listing} +% \iffalse +% +% \fi +% +% \section{Support}\label{other:support} +% +% This package is available from \url{https://github.com/rogard/keyparse}. +% +% \changes{Version 1.0} +% {2020/08/03} +% {Initial version} +% \changes{Version 1.1} +% {2020/08/18} +% {Name change from lex to keyparse at request of ctan} +% +% \StopEventually{ +% \clearpage +% \PrintChanges +% ^^A \PrintIndex % https://tex.stackexchange.com/q/610349/112708 +% } +%\end{documentation} +% \begin{implementation} +% \part{Implementation}\label{part:impl} +% \begin{macrocode} +%<*package> +%<@@=keyparse> +\ExplSyntaxOn +% \end{macrocode} +% \section{\textsf{keyparse}} +% \subsection{Interface} +% \begin{macro}[int] +% {not-set} +% \begin{macrocode} +\msg_new:nnn +{@@} +{not-set} +{recursion~for~rule~#1~is~not~set} +% \end{macrocode} +% \end{macro} +% \begin{macro} +% {\@@_keyparse_rule_w:n, +% \@@_keyparse_rule:n, +% \@@_keyparse_eval_aux:nn, +% \@@_keyparse_eval_aux:ne} +% \begin{arguments} +% \item rule +% \end{arguments} +% \begin{macrocode} +\cs_new_protected:Nn +\@@_keyparse_rule_w:n +{\clist_clear_new:c{@@_keys_#1_clist} + \cs_new:cpn + {@@_keyparse_eval_#1:w} ##1 ##2 \q_recursion_stop + {\quark_if_recursion_tail_stop:n{##1} + \use:c{@@_keyparse_eval_#1_##1:w}##2\q_recursion_stop }} +\cs_new_protected:Nn +\@@_keyparse_rule:n{\@@_keyparse_rule_w:n{#1}} +\cs_new:Nn +\@@_keyparse_eval_aux:nn +{\cs_if_exist:cTF + {@@_keyparse_eval_#1:w} + { \use:c{@@_keyparse_eval_#1:w}#2 + \q_recursion_tail + \q_recursion_stop} + {\msg_error:nnn{@@} + {not-set} + {#1}}} +\cs_generate_variant:Nn\@@_keyparse_eval_aux:nn{ne} +% \end{macrocode} +% \end{macro} +% \begin{macro} +% {\keyparse_eval:nn, +% \keyparse_set:nnnnn} +% \begin{macrocode} +\cs_new:Nn +\keyparse_eval:nn +{\@@_keyparse_eval_aux:ne{#1} + {\tl_trim_spaces:n{#2}}} +\cs_new_protected:Nn +\keyparse_set:nnnnn +{\cs_if_exist:cTF + {@@_keyparse_eval_#1:w} + {\clist_put_right:cn + {@@_keys_#1_clist}{\texttt{\tl_to_str:n{#2}}} + \cs_new:cpn + {@@_keyparse_eval_#1_#2:w}#3 \q_recursion_stop + {#4\use:c{@@_keyparse_eval_#1:w}#5 \q_recursion_stop}} + {\@@_keyparse_rule:n{#1} + \keyparse_set:nnnnn + {#1}{#2}{#3}{#4}{#5}}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\KeyparseKeys, \KeyparseEval} +% \begin{macrocode} +\ProvideDocumentCommand +{\KeyparseKeys} +{m} +{\clist_use:cnnn + {@@_keys_#1_clist} + {~and~}{,~}{~and~}} +\NewDocumentCommand{\KeyparseEval} +{mm} +{\keyparse_eval:nn{#1}{#2}} +% \end{macrocode} +% \end{macro} +% \subsection{\textsf{argspec}}\label{impl:argspec} +% \begin{macro} +% {\keyparse_argspec_e:n} +% \begin{macrocode} +\cs_new:Nn\keyparse_argspec_e:n{{e{#1}}} +% \end{macrocode} +% \end{macro} +% \begin{macro}[int] +% {argspec} +% Expandability forbids inline, hence \cs{keyparse_argspec_e:n} for key `e' +% \begin{macrocode} +\keyparse_set:nnnnn{argspec}{e}{#1#2} +{ \tl_map_function:nN{#1}\keyparse_argspec_e:n}{#2} +\keyparse_set:nnnnn{argspec}{d}{#1#2#3}{{d#1#2}}{#3} +\keyparse_set:nnnnn{argspec}{m}{#1}{{m}}{#1} +\keyparse_set:nnnnn{argspec}{o}{#1}{{o}}{#1} +\keyparse_set:nnnnn{argspec}{r}{#1#2#3}{{r#1#2}}{#3} +\keyparse_set:nnnnn{argspec}{s}{#1}{{s}}{#1} +\keyparse_set:nnnnn{argspec}{t}{#1#2}{{t#1}}{#2} +% \end{macrocode} +% \end{macro} +% \subsection{\textsf{pair}}\label{impl:pair} +% \begin{macro}[int] +% {pair/first, +% pair/merge} +% \begin{macrocode} +\keyparse_set:nnnnn{pair/first}{>}{#1#2#3}{#1}{#3} +\keyparse_set:nnnnn{pair/merge}{>}{#1#2#3}{#1#2}{#3} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\ExplSyntaxOff +% +% \end{macrocode} +% \end{implementation} +% \Finale +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/keyparse/keyparse.ins b/macros/latex/contrib/keyparse/keyparse.ins new file mode 100644 index 0000000000..ec855609b5 --- /dev/null +++ b/macros/latex/contrib/keyparse/keyparse.ins @@ -0,0 +1,64 @@ +%% +%% This is file `keyparse.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% keyparse.dtx (with options: `install') +%% ----------------------------------------------------------------------------- +%% keyparse --- key-based parser +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% ---------------------------------------------------------------------------- +%% +\input l3docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +----------------------------------------------------------------------------- +keyparse --- key-based parser +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2021 by Erwann Rogard + +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 +Erwann Rogard. + +This work consists of the file keyparse.dtx and the derived files: +keyparse.sty, and keyparse.pdf. + +\endpostamble +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} + \endbatchfile +%% +%% Copyright (C) 2021 by Erwann Rogard +%% +%% 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 +%% Erwann Rogard. +%% +%% This work consists of the file keyparse.dtx and the derived files: +%% keyparse.sty, and keyparse.pdf. +%% +%% +%% End of file `keyparse.ins'. diff --git a/macros/latex/contrib/keyparse/keyparse.pdf b/macros/latex/contrib/keyparse/keyparse.pdf new file mode 100644 index 0000000000..387d47bd8c Binary files /dev/null and b/macros/latex/contrib/keyparse/keyparse.pdf differ diff --git a/macros/latex/contrib/lambdax/README.md b/macros/latex/contrib/lambdax/README.md new file mode 100644 index 0000000000..d47d78106d --- /dev/null +++ b/macros/latex/contrib/lambdax/README.md @@ -0,0 +1,6 @@ +----------------------------------------------------------------- +##### lambdax --- lambda expression +- Source repository: https://github.com/rogard/lambdax +- Released under the LaTeX Project Public License v1.3c or later +- See http://www.latex-project.org/lppl.txt +----------------------------------------------------------------- diff --git a/macros/latex/contrib/lambdax/lambdax.dtx b/macros/latex/contrib/lambdax/lambdax.dtx new file mode 100644 index 0000000000..77e6a91115 --- /dev/null +++ b/macros/latex/contrib/lambdax/lambdax.dtx @@ -0,0 +1,416 @@ +% \iffalse meta-comment +% !TEX program = pdfLaTeX +%<*internal> +\iffalse +% +%<*readme> +----------------------------------------------------------------- +##### lambdax --- lambda expression +- Source repository: https://github.com/rogard/lambdax +- Released under the LaTeX Project Public License v1.3c or later +- See http://www.latex-project.org/lppl.txt +----------------------------------------------------------------- +% +%<*internal> +\fi +\def\nameofplainTeX{plain} +\ifx\fmtname\nameofplainTeX\else +\expandafter\begingroup +\fi +% +%<*install> +\input l3docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +---------------------------------------------------------------- +lambdax --- lambda expression +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2021 by Erwann Rogard + +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 +Erwann Rogard. + +This work consists of the file lambdax.dtx and the derived files: +lambdax.sty, and lambdax.pdf. + +\endpostamble +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +% +% \endbatchfile +%<*internal> +\generate{ + \file{\jobname.ins}{\from{\jobname.dtx}{install}} +} +\nopreamble\nopostamble +\generate{ + \file{README.md}{\from{\jobname.dtx}{readme}} +} +\ifx\fmtname\nameofplainTeX +\expandafter\endbatchfile +\else +\expandafter\endgroup +\fi +% +% \NeedsTeXFormat{LaTeX2e}[2021-06-01] +% \RequirePackage{expl3, xparse, xtemplate, l3keys2e}[2021-06-01] +% \RequirePackage{lex}[2021-08-03] +% \ProvidesExplPackage +% {lambdax} % Package name +% {2021-08-03} % Release date +% {1.0} % Release version +% {lambdax --- Lambda expression } % Description +%<*driver> +\documentclass[show-notes]{l3doc}%^^A full +% ^^A \listfiles +\usepackage[french, german, english]{babel} +\usepackage{bookmark, enumitem, tcolorbox, xparse} +\usepackage[bibencoding=auto, backend=biber, sorting=ynt]{biblatex} +\usepackage[T1]{fontenc} +\ExplSyntaxOn +% ^^A *** Sectioning +\tl_gset:Nn \partname {Part}%^^A allows to test w/o babel +% ^^A +\ExplSyntaxOff +% ^^A *** Typesetting +\ProvideDocumentCommand{\docdescrf}{}{\sffamily\bfseries\tiny{}} +% ^^A *** bibliography +\begin{filecontents*}{\jobname.bib} +@misc{erw-ccool, + author = {Rogard, Erwann}, + title = {The \pkg{ccool} package for \LaTeX}, + note = {\url{https://github.com/rogard/ccool/blob/master/ccool.pdf}}, + year = {2020}} +@misc{erw-lex, + author = {Rogard, Erwann}, + title = {The \pkg{lex} package for \LaTeX}, + note = {\url{https://github.com/rogard/lex/blob/master/lex.pdf}}, + year = {2021}} +@manual{xparse, + title = {The \pkg{xparse} package}, + author = {The \LaTeX3 Project Team}, + year = {2019}, + note = {\url{https://ctan.math.illinois.edu/macros/latex/contrib/l3packages/xparse.pdf}}, + annote = {} } +@misc{a-188053, + author = {@{}sean-allred}, + title = {``How to create lambda expressions?''}, + year = {2014}, + note = {\url{https://tex.stackexchange.com/a/188053/112708}}} +@misc{q-610349, + author = {@{}Erwann}, + title = {``Troubleshooting \PrintIndex \PrintChanges''}, + year = {2021}, + note = {\url{https://tex.stackexchange.com/questions/610349/troubleshooting-printindex-printchanges}}} +\end{filecontents*} +\addbibresource{\jobname.bib} +% ^^A *** Lists +\newlist{arab-inl}{enumerate*}{1} +\setlist[arab-inl]{label=\arabic*)} +\newlist{colon-inl}{itemize*}{1} +\setlist[colon-inl] +{ %^^Abefore=\noindent, + label={}, + itemjoin={{; }}, + after={{.}}} +\newlist{descr}{description}{1} +\setlist[descr]{nosep, align=left, itemindent=0pt, + font=\sffamily\tiny} +% ^^A *** This package's loading +\usepackage{lambdax} +\usepackage{hyperref} %^^A comes last +\begin{document} +\DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \GetFileInfo{\jobname.sty} +% \title{The \pkg{lambdax} package\thanks{^^A +% This file describes version \fileversion, last revised \filedate.^^A +% }^^A +% } +% \author{Erwann Rogard\thanks{first.lastname at gmail.com}} +% +% \date{Released \filedate} +% \begin{documentation} +% \maketitle +% \begin{abstract} +% This is a \LaTeX package that provides `lambda expressions', in other words +% an interface by which one consecutively, first, +% specifies the parameters and replacement code of a document-command\cite{xparse}, +% and, second, evaluates it with compatible arguments. +% Optionally, one can recurse. +% For example, +% |\LambdaX[mm]{$#1$#2}{x}| +% |{,~}^{y}{~and~}^{z}{.}|, +% where |<.>| specifies the recurse paramater, +% expands to ``\LambdaX[mm]{$#1$#2}{x}{,~}^{y}{~and~}^{z}{.}'' +% \end{abstract} +% \part{Usage}\label{part:usage} +% +% \tableofcontents +% +% \section{Settings} +% +% The options hereafter are load-time-only. +% +% \DescribeOption{xparse-command} +% \begin{descr} +% \item[Side effect] Sets the xparse-document-command used by \cs{lambdax:nn} +% \item[Initial] \cs[no-index]{DeclareDocumentCommand} +% \end{descr} +% +% \section{Programming} +% \begin{function} +% {\lambdax:nn} +% \begin{syntax} +% \cs{lambdax:nn}\Arg{argspec}\Arg{code}\meta{args} +% \end{syntax} +% \end{function} +% \begin{descr} +% \item[Expands to] \meta{code}, \meta{args} replacing the parameters implied by \meta{argspec} +% \end{descr} +% +% \begin{function} +% {\lambdax:nnn} +% \begin{syntax} +% \cs{lambdax:nn}\Arg{argspec}\Arg{code}\Arg{bool-arg-type}\meta{args}\meta{bool-arg} +% \end{syntax} +% \end{function} +% \begin{descr} +% \item[Limitation] That of \pkg{lex}\cite{erw-lex}'s \texttt{argspec} collection. +% \item[Argspec] Examples of \meta{bool-arg-type}\cite{xparse} and \meta{bool-arg} are |s| and |*|, respectively. +% \item[Semantics] That of \cs{lambdax:nn} and recurse if applicable. +% \end{descr} +% +% \begin{function}[EXP] +% {\lambdax_xcmd_if:NTF} +% \begin{syntax} +% \cs{lambdax_xcmd_if:NTF:Nn}\meta{xparse-command}\Arg{code~if~true}\Arg{code~if~false} +% \end{syntax} +% \end{function} +% +% \section{Document} +% \begin{function} +% {\LambdaX} +% \begin{syntax} +% \cs[no-index]{LambdaX}\oarg{argspec}|<|\meta{bool-arg-type}|>|\Arg{code} +% \end{syntax} +% \begin{descr} +% \item[Adapts] \cs{lambda:nn} and \cs{lambda:nnn} +% \end{descr} +% \end{function} +% +% \part{Other} +% \section{Acknowledgment} +% The basis for \cs{lambdax:nn} originates with \cite{a-188053}. Except for chaining, it was already provided by \cite{erw-ccool}. +% +% \section{Bibliograhy} +% \printbibliography[heading=none] +% +% \changes{Version 1.0} +% {2020/08/03} +% {Initial version} +% \clearpage +% \StopEventually{ +% \PrintChanges +%^^A \PrintIndex % waiting for a response to \cite{q-610349} +% } +% +% \end{documentation} +% \begin{implementation} +% +% \part{Implementation}\label{part:impl} +% +% \begin{macrocode} +%<*package> +%<@@=lambdax> +\ExplSyntaxOn +% \end{macrocode} +% \section{Auxiliary} +% \begin{macrocode} +\cs_generate_variant:Nn\tl_count:n{e} +\cs_generate_variant:Nn\int_eval:n{e} +\cs_generate_variant:Nn\bool_if:nT{o, e} +% \end{macrocode} +% \begin{macro}{\@@_str_case_empty:n} +% \begin{macrocode} +\cs_new:Nn +\@@_str_case_empty:n +{{#1} + {\c_empty_tl}} +% \end{macrocode} +% \end{macro} +% \section{\textsf{xcmdif}} +% \begin{macro}[int]{not-xparse} +% \begin{macrocode} +\msg_new:nnn{@@} +{not-xparse} +{Expecting~an~xparse~command,~got~#2} +% \end{macrocode} +% \end{macro} +% \begin{variable} +% {\c@@_xcmdname_tl} +% \begin{macrocode} +\tl_const:Nn +\c@@_xcmdname_tl +{ {NewDocumentCommand} + {RenewDocumentCommand} + {ProvideDocumentCommand} + {DeclareDocumentCommand} + {NewExpandableDocumentCommand} + {RenewExpandableDocumentCommand} + {ProvideExpandableDocumentCommand} + {DeclareExpandableDocumentCommand} } +% \end{macrocode} +% \end{variable} +% \begin{macro} +% {\@@_xcmd_if:nTF, +% \@@_xcmd_if:eTF, +% \lambdax_xcmd_if:NTF, +% \@@_xcmd_else_error:Nn} +% \begin{macrocode} +\prg_new_conditional:Nnn +\@@_xcmd_if:n{TF} +{\exp_args:Nnx + \str_case:nnTF{#1} + { \tl_map_function:NN + \c@@_xcmdname_tl + \@@_str_case_empty:n} + {\prg_return_true:} + {\prg_return_false:}} +\cs_generate_variant:Nn\@@_xcmd_if:nTF{e} +\cs_new:Nn +\lambdax_xcmd_if:NTF +{\@@_xcmd_if:eTF + {\cs_to_str:N#1}{#2}{#3}} +\cs_new:Nn +\@@_xcmd_else_error:Nn +{ \lambdax_xcmd_if:NTF#1 + { #2 } + { \msg_error:nne{@@} + {not-xparse} + {\token_to_str:N#1} } } +% \end{macrocode} +% \end{macro} +% \begin{variable} +% {\c@@_xenv_tl} +% \begin{macrocode} +\tl_const:Nn +\c@@_xenv_tl +{ {NewDocumentEnvironment} + {RenewDocumentEnvironment} + {ProvideDocumentEnvironment} + {DeclareDocumentEnvironment} } +% \end{macrocode} +% \end{variable} +% \begin{macro}[int] +% {\@@_msg_name:n} +% \begin{macrocode} +\cs_new:Nn +\@@_msg_name:n{msg_\g@@_opt_msg_tl{}:#1} +% \end{macrocode} +% \end{macro} +% \section{\textsf{lambda}}\label{impl:lambda} +% \begin{macro} +% {\@@_placeholder:n, +% \@@_placeholder:e, +% \@@_argspec:n, +% \@@_argspec_count:n, +% \@@_chain_position:n, +% \@@_chain_placeholder:n} +% \begin{macrocode} +\cs_new:Nn\@@_placeholder:n{#### #1} +\cs_generate_variant:Nn\@@_placeholder:n{o,e} +\cs_new:Nn\@@_argspec:n{\lex_eval:nn{argspec}{#1}} +\cs_new:Nn\@@_argspec_count:n{\tl_count:e{\@@_argspec:n{#1}}} +\cs_new:Nn\@@_chain_position:n{\int_eval:e{\@@_argspec_count:n{#1}+1}} +\cs_new:Nn\@@_chain_placeholder:n +{\@@_placeholder:e + {\@@_chain_position:n{#1}}} +% \end{macrocode} +% \end{macro} +% \begin{macro} +% {\@@_lambda:Nnn, +% \@@_lambda_dev:N, +% \@@_lambda_doc:NN } +% \begin{macrocode} +\cs_new_protected:Nn \@@_lambda:Nnn +{\exp_args:NNx + #1 \@@_lambda + {#2} + {#3} + \@@_lambda} +\cs_generate_variant:Nn\@@_lambda:N{c} +\cs_new_protected:Nn +\@@_lambda_chain:Nnnn +{ \tl_set:Nn + \l@@_head_tl + {\exp_args:NNx#1 \@@_lambda_chain + {#2#3} } + \exp_args:Nx + \l@@_head_tl + {\exp_not:n{#4} \exp_not:N + \bool_if:oT + {\@@_chain_placeholder:n{#2}} + {\exp_not:N\@@_lambda_chain}} + \@@_lambda_chain} +\cs_set_protected:Nn +\@@_lambda_dev:N +{ \cs_new_protected:Nn + \lambdax:nn + { \@@_lambda:Nnn #1 + {##1}{##2} } + \cs_new_protected:Nn + \lambdax:nnn + { \@@_lambda_chain:Nnnn #1 + {##1}{##2}{##3} } } +\cs_set_protected:Nn +\@@_lambda_doc:N +{ \NewDocumentCommand + #1 { O{m} d<> m } + {\IfValueTF{##2} + { \lambdax:nnn { ##1 } { ##2 } { ##3 } } + { \lambdax:nn { ##1 } { ##3 } } } } +\cs_generate_variant:Nn\@@_lambda_doc:N{c} +% \end{macrocode} +% \end{macro} +% \section{Settings} +% \begin{macrocode} +\keys_define:nn{ @@ } +{ dev.code:n = { + \@@_xcmd_else_error:Nn#1 + {\@@_lambda_dev:N#1 } + }, + internal / document-command-name.code:n = { \@@_lambda_doc:c{#1} }, + internal / document-command-name.initial:n = { LambdaX }, + xparse-command.code:n = + { \@@_xcmd_else_error:Nn #1 + { \keys_set:nn{ @@ }{ dev = #1 } } }, + xparse-command .initial:n = { \DeclareDocumentCommand } +} +% \end{macrocode} +% \begin{macrocode} +\ProcessKeysOptions{@@} +\ExplSyntaxOff +% +% \end{macrocode} +% \end{implementation} +% \Finale +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/lambdax/lambdax.ins b/macros/latex/contrib/lambdax/lambdax.ins new file mode 100644 index 0000000000..91db360b4c --- /dev/null +++ b/macros/latex/contrib/lambdax/lambdax.ins @@ -0,0 +1,64 @@ +%% +%% This is file `lambdax.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% lambdax.dtx (with options: `install') +%% ---------------------------------------------------------------- +%% lambdax --- lambda expression +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% ---------------------------------------------------------------- +%% +\input l3docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +---------------------------------------------------------------- +lambdax --- lambda expression +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +---------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2021 by Erwann Rogard + +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 +Erwann Rogard. + +This work consists of the file lambdax.dtx and the derived files: +lambdax.sty, and lambdax.pdf. + +\endpostamble +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} + \endbatchfile +%% +%% Copyright (C) 2021 by Erwann Rogard +%% +%% 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 +%% Erwann Rogard. +%% +%% This work consists of the file lambdax.dtx and the derived files: +%% lambdax.sty, and lambdax.pdf. +%% +%% +%% End of file `lambdax.ins'. diff --git a/macros/latex/contrib/verifiche/verifiche-example.pdf b/macros/latex/contrib/verifiche/verifiche-example.pdf index 0ac131160b..82611e6104 100644 Binary files a/macros/latex/contrib/verifiche/verifiche-example.pdf and b/macros/latex/contrib/verifiche/verifiche-example.pdf differ diff --git a/macros/latex/contrib/verifiche/verifiche.dtx b/macros/latex/contrib/verifiche/verifiche.dtx index 364354f072..dc5a4a9e7e 100644 --- a/macros/latex/contrib/verifiche/verifiche.dtx +++ b/macros/latex/contrib/verifiche/verifiche.dtx @@ -16,12 +16,12 @@ % % \iffalse %\NeedsTeXFormat{LaTeX2e} -%\ProvidesPackage{verifiche} [2021/02/16 v4.1 .dtx verifiche file] +%\ProvidesPackage{verifiche} [2021/08/18 v4.2 .dtx verifiche file] %<*driver> \documentclass{ltxdoc} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -\usepackage[italian]{babel} +\usepackage[english, italian]{babel} \usepackage{listings} \lstset{ language=[LaTeX]TeX, @@ -66,7 +66,7 @@ % % \fi % -% \CheckSum{741} +% \CheckSum{752} % \changes{v1.0}{2020/06/14}{Initial version.} % \changes{v2.0}{2020/06/26}{Better performance in exercise environment.} % \changes{v2.1}{2020/06/30}{Introduced closedquestionitem to control |item| symbol.} @@ -74,6 +74,7 @@ % \changes{v3.0}{2021/02/14}{Remove fancyhdr and introduce a new page style. Improve the printheading command.} % \changes{v4.0}{2021/02/15}{Introduce comando to change the aspect of the exercise score.} % \changes{v4.1}{2021/02/16}{Introduce ptrulerlength to change the aspect of the exercise score.} +% \changes{v4.2}{2021/08/18}{Solved truefalse issue in solutionsmode. Add noexercisept global option to hide the score of each exercise.} % \GetFileInfo{verifiche.sty} % \DoNotIndex{\newcommand,\newenvironment,\def,\begin,\end,\par} % \DoNotIndex{\DeclareOption,\ExecuteOptions,\ProcessOptions,\RequirePackage} @@ -107,7 +108,7 @@ % \DoNotIndex{\or, \overset, \PackageError, \PackageWarning, \parindent, \pgfmathparse, \pgfmathresult} % \DoNotIndex{\ProcessOptionsX, \protected@write, \ref, \refstepcounter, \reversemarginpar, \rule} % \DoNotIndex{\scshape, setkeys, \sffamily, \sisetup, \spacedim, \string, \tikz, \underline, \usetikzlibrary} -% \DoNotIndex{\val, \xout, \y, \usebox} +% \DoNotIndex{\val, \xout, \y, \usebox, \romannumeral, \@ifundefined, \ltx@zero, \rc@default, \rc@extract@, \chardef} % % % \title{Il pacchetto \textsf{verifiche} @@ -116,6 +117,12 @@ % \author{Francesco Raccanello\\ \texttt{raccanello.francesco@gmail.com}} % % \maketitle +%\begin{otherlanguage}{english} +%\begin{abstract} +% The aim of this package is to manage the elements of a middle or hight school test. It can composes the headings of the page, the exercises and their solutions. The exercises can show numeration, difficulty and score. +% The package manages some standard test typology: plain exercise, complete-the-text, true or false, open questions, closed questions, find-the-error. +%\end{abstract} +%\end{otherlanguage} %\begin{abstract} %Il presente pacchetto si propone di gestire gli elementi che generalmente compongono %una prova scritta per le scuole secondarie di primo e secondo grado: @@ -124,7 +131,7 @@ %Alcuni comandi permettono di generare alcune tipologie di test: esercizi semplici, esercizi di completamento, vero o falso, domande aperte e chiuse e trova l'errore. %Ciascun esercizio può presentare la soluzione corretta che viene riportata nel documento in base ad un'apposita opzione del pacchetto. %\end{abstract} -% +%\clearpage %\tableofcontents %\clearpage % @@ -164,16 +171,17 @@ %\textbf{\meta{options}}& \textbf{Descrizione} \\[.5em] %\hline\\ %|noinstitute| & non stampa il nome dell'istituto (si veda pag. \pageref{par:institute}).\\ -%|nocandidatename| & non stampa la sezione per il nome del candidato\\ -%|noinstruction| & non stampa le istruzioni della prova\\ +%|nocandidatename|& non stampa la sezione per il nome del candidato\\ +%|noinstruction| & non stampa le istruzioni della prova\\ %|noduration| & non stampa la durata della prova\\ -%|noasyear| & non stampa l'anno scolastico\\ +%|noasyear| & non stampa l'anno scolastico\\ %|notesttype| & non stampa il tipo di prova \\ -%|nonumbered| & quesiti non numerati\\ -%|solutions| & stampa le soluzioni degli esercizi (si veda pag.\pageref{sec:solutions})\\ -%|red| & il colore del font delle soluzioni è rosso\\ +%|nonumbered| & quesiti non numerati\\ +%|noexercisept| & non stampa il punteggio degli esercizi, anche se dichiarati\\ +%|solutions| & stampa le soluzioni degli esercizi (si veda pag.\pageref{sec:solutions})\\ +%|red| & il colore del font delle soluzioni è rosso\\ %|blue| & il colore del font delle soluzioni è blu\\ -%|color|=\meta{color} & il colore del font delle soluzioni è \meta{color}\\[.5em] +%|color|=\meta{color}& il colore del font delle soluzioni è \meta{color}\\[.5em] %\hline %\end{tabular} %\end{center} @@ -998,6 +1006,7 @@ dell'esercizio somministrato \newif\ifprintedheading\printedheadingfalse \newif\ifexercisesnumbered\exercisesnumberedtrue \newif\ifshowmarginexercise\showmarginexercisefalse +\newif\ifshowexercisept\showexercisepttrue \newif\ifopenquestionlines\openquestionlinesfalse \newif\ifopenquestionsquared\openquestionsquaredfalse % \end{macrocode} @@ -1015,6 +1024,7 @@ dell'esercizio somministrato \DeclareOptionX{nocandidatename}[]{\candidatenamefalse} \DeclareOptionX{notesttype}[]{\testtypefalse} \DeclareOptionX{nonumbered}[]{\exercisesnumberedfalse} +\DeclareOptionX{noexercisept}[]{\showexerciseptfalse} \DeclareOptionX{color}[red]{\solutionscolortrue\def\solutionscolor{#1}} \DeclareOptionX{red}[]{\ExecuteOptionsX{color=red}} \DeclareOptionX{blue}[]{\ExecuteOptionsX{color=blue}} @@ -1254,13 +1264,17 @@ dell'esercizio somministrato \def\diffstar{\hfill\foreach \i in {1,..., #1}{\diffsymb}}% \showmarginexercisetrue}% \define@key{esercizio}{pt}[none]{ + \ifshowexercisept% \def\pointes{#1}% \def\espoint{\hfill\@ptprefix\@lpt@delimiter\pointes\space\@useptlabel{\pointes}\@rpt@delimiter} - \showmarginexercisetrue}% + \showmarginexercisetrue + \fi}% \define@key{esercizio}{partialpt}[none]{% + \ifshowexercisept% \def\@totalpartialpt{\convertreftonum{ptes@\theexercisenumber}}% \def\sumpartialpt{\@ptprefix\@lpt@delimiter\@totalpartialpt\space\@useptlabel{\@totalpartialpt}\@rpt@delimiter}% - \showmarginexercisetrue}% + \showmarginexercisetrue + \fi}% % \end{macrocode} % % @@ -1343,9 +1357,11 @@ dell'esercizio somministrato %\begin{macro}{\partialpt}The |partialpt| macro define the content of the margin note where it's used. % \begin{macrocode} \NewDocumentCommand{\partialpt}{m}{% + \ifshowexercisept% \leavevmode\reversemarginpar\marginpar{% \hfill\@partialptprefix\@lpartialpt@delimiter#1\space\@usepartialptlabel{#1}\@rpartialpt@delimiter% - \addtocounter{partialpoints}{#1}}}% + \addtocounter{partialpoints}{#1}}% + \fi}% % \end{macrocode} %\end{macro} %\paragraph{Soluzione} @@ -1403,11 +1419,11 @@ dell'esercizio somministrato \tikz[baseline=-.8ex]{% %true part \node[draw, rectangle, minimum size=1.5em] {V};% - \ifsol\IfSubStr{#1}{V}{\node[shift={(1pt,1pt)}]{% + \ifsol\IfSubStr{#1}{V}{\node[inner sep=0pt, shift={(1pt,1pt)}]{% $\Large\ifsolutionscolor\color{\solutionscolor}\fi\checkmark$}}{};\fi% %false part \node[xshift=1cm, draw, rectangle, minimum size=1.5em]{F};% - \ifsol\IfSubStr{#1}{F}{\node[xshift=1cm, shift={(1pt,1pt)}]{% + \ifsol\IfSubStr{#1}{F}{\node[inner sep=0pt, xshift=1cm, shift={(1pt,1pt)}]{% $\Large\ifsolutionscolor\color{\solutionscolor}\fi\checkmark$}}{};\fi% }% } diff --git a/macros/latex/contrib/verifiche/verifiche.pdf b/macros/latex/contrib/verifiche/verifiche.pdf index f9b2801344..0f399271db 100644 Binary files a/macros/latex/contrib/verifiche/verifiche.pdf and b/macros/latex/contrib/verifiche/verifiche.pdf differ -- cgit v1.2.3