diff options
author | Norbert Preining <norbert@preining.info> | 2023-05-17 03:01:58 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-05-17 03:01:58 +0000 |
commit | 92ffb9032b85f818a8d3b469ad4d3889c2a44ba1 (patch) | |
tree | 54bc1ce009357117a376baa5ffa223f904acee4f /macros/latex | |
parent | 95bdae3d8a40af1f2f82f786dc29d3761fe431f1 (diff) |
CTAN sync 202305170301
Diffstat (limited to 'macros/latex')
113 files changed, 1156 insertions, 1704 deletions
diff --git a/macros/latex/contrib/codedescribe/README.md b/macros/latex/contrib/codedescribe/README.md index 8045a1a210..ee3db68821 100644 --- a/macros/latex/contrib/codedescribe/README.md +++ b/macros/latex/contrib/codedescribe/README.md @@ -86,5 +86,10 @@ The Current Maintainer of this work is Alceu Frigeri ## Changelog -* Version 1.0 (this) +* Version 1.1 (this) + - Added two commands to allow <obj-types> customization + - requiring (now) pifont for EXP/rEXP <format-keys> + - Added a date command (auxiliary command) + +* Version 1.0 - Initial release by CTAN diff --git a/macros/latex/contrib/codedescribe/doc/codedescribe.pdf b/macros/latex/contrib/codedescribe/doc/codedescribe.pdf Binary files differindex 882a93affd..9e2924847f 100644 --- a/macros/latex/contrib/codedescribe/doc/codedescribe.pdf +++ b/macros/latex/contrib/codedescribe/doc/codedescribe.pdf diff --git a/macros/latex/contrib/codedescribe/doc/codedescribe.tex b/macros/latex/contrib/codedescribe/doc/codedescribe.tex index b16853b40a..4b2a03ecbe 100644 --- a/macros/latex/contrib/codedescribe/doc/codedescribe.tex +++ b/macros/latex/contrib/codedescribe/doc/codedescribe.tex @@ -2,7 +2,7 @@ % !TEX ext = --interaction=nonstopmode --enable-etex --enable-write18 % !BIB program = none %%%============================================================================== -%% Copyright 2022 by Alceu Frigeri +%% Copyright 2023 by Alceu Frigeri %% %% This work may be distributed and/or modified under the conditions of %% @@ -15,15 +15,15 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.0 (2023/05/11) +%% This is version 1.1 (2023/05/16) %% %% The list of files that compose this work can be found in the README.md file at -%% https://ctan.org/pkg/democodetools +%% https://ctan.org/pkg/codedescribe %% %%%============================================================================== %\documentclass[dctools,english]{ufrgscca} \documentclass{article} -\RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={40mm,20mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry} +\RequirePackage[verbose,a4paper,marginparwidth=28mm,top=3cm,bottom=1.5cm,hmargin={45mm,25mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry} \usepackage{codedescribe} \usepackage{enumitem} @@ -34,13 +34,13 @@ \tstitle{ author={Alceu Frigeri\footnote{\tsverb{https://github.com/alceu-frigeri/codedescribe}}}, - date={2023/05/11}, - title={The codedescribe and codelisting Packages\break Version \PkgInfo{codedesc}{version}} + date={\tsdate}, + title={The codedescribe and codelisting Packages\break Version \PkgInfo{codedescribe}{version}} } \begin{typesetabstract} -This documentation package is designed to be `as class independent as possible', depending only on \tsobj[pkg]{expl3,scontents,listing}. Unlike other packages of the kind, a minimal set of macros/commands/environments is defined: most/all defined commands have an 'object type' as a \tsobj[key]{keyval} parameter, allowing for an easy expansion mechanism (instead of the usual 'one set of macros/environments' for each object type). +This documentation package is designed to be `as class independent as possible', depending only on \tsobj[pkg]{expl3,scontents,listing,pifont}. Unlike other packages of the kind, a minimal set of macros/commands/environments is defined: most/all defined commands have an 'object type' as a \tsobj[key]{keyval} parameter, allowing for an easy expansion mechanism (instead of the usual 'one set of macros/environments' for each object type). No assumption about page layout is made (besides `having a marginpar'), or underlying macros, so that it can be used with any document class. @@ -48,11 +48,10 @@ No assumption about page layout is made (besides `having a marginpar'), or unde \tableofcontents -%\setcodefmt{fontsize=\large} - \section{Introduction} -This package aims to document both \tsobj[code]{Document} level (i.e. final user) commands, as well \tsobj[code]{Package/Class} level commands. It's fully implemented using \tsobj[pkg]{expl3} syntax and structures, in special \tsobj[pkg]{l3coffins, l3seq, l3keys}. Besides those \tsobj[pkg]{scontents,listing} packages are used to typeset code snippets. + +This package aims to document both \tsobj[code]{Document} level (i.e. final user) commands, as well \tsobj[code]{Package/Class} level commands. It's fully implemented using \tsobj[pkg]{expl3} syntax and structures, in special \tsobj[pkg]{l3coffins, l3seq, l3keys}. Besides those \tsobj[pkg]{scontents,listing} packages are used to typeset code snippets. The package \tsobj[pkg]{pifont} is needed just to typeset those (open)stars, in case one wants to mark a command as (restricted) expandable. No other package/class is needed, any class can be used as the base one, which allows to demonstrate the documented commands with any desired layout. @@ -63,7 +62,7 @@ No other package/class is needed, any class can be used as the base one, which a This package 'can' be used with multi-column classes, given that the \tsobj[code]{\linewidth,\columnsep} are defined appropriately. \tsobj{\linewidth} shall defaults to text/column real width, whilst \tsobj{\columnsep}, if needed (2 or more columns) shall be greater than \tsobj{\marginparwidth} plus \tsobj{\marginparsep}. \subsection{Current Version} -This doc regards to \tsobj[pkg]{codedescribe} version \PkgInfo{codedesc}{version}~ and \tsobj[pkg]{codelisting} version \PkgInfo{codedesc}{version}. Those two packages are fairly stable, and given the \tsobj[meta]{obj-type} mechanism (see below, \ref{obj-type-def}) it can be easily extended without changing it's interface. +This doc regards to \tsobj[pkg]{codedescribe} version \PkgInfo{codedescribe}{version}~ and \tsobj[pkg]{codelisting} version \PkgInfo{codelisting}{version}. Those two packages are fairly stable, and given the \tsobj[meta]{obj-type} mechanism (see below, \ref{obj-type-def}) it can be easily extended without changing it's interface. \section{codelisting Package} @@ -84,7 +83,19 @@ This environment is an alias to \tsobj[env]{scontents} environment (from \tsobj[ -\subsection{Code Display/Demo} +\subsection{Code Display/Demo}\label{codelist} + +\begin{codedescribe}{\setcodekeys} + \begin{codesyntax}% + \tsmacro{\setcodekeys}{code-keys} + \end{codesyntax} + +One has the option to set \tsmeta{code-keys} (see \ref{code-keys}) per \tsmacro{\tscode}{}/\tsmacro{\tsdemo}{} call, or \emph{globally}, better said, \emph{in the called context group} .\\ +\begin{tsremark}[N.B.:] +All \tsobj[code]{\tscode,\tsdemo} commands create a local group in which the \tsmeta{code-keys} are defined, and discarded once said local group is closed. \tsmacro{\setcodekeys}{} defines those keys in the \emph{current} context/group. +\end{tsremark} +\end{codedescribe} + \begin{codedescribe}{\tscode*,\tsdemo*} \begin{codesyntax}% \tsmacro{\tscode*}[code-keys]{st-name} @@ -99,38 +110,21 @@ This environment is an alias to \tsobj[env]{scontents} environment (from \tsobj[ For Example: \begin{codestore}[st=democodestore] - \begin{codestore}[stmeta] +\begin{codestore}[stmeta] Some \LaTeX~coding, for example: \ldots. - \end{codestore} - +\end{codestore} This will just typesets \tsobj[key]{stmeta}: - \tscode*[codeprefix={Sample Code:}] {stmeta} - and this will demonstrate it, side by side with source code: - -\tsdemo[numbers=left,ruleht=0.5, +\tsdemo[numbers=left,ruleht=0.5, codeprefix={inner sample code}, resultprefix={inner sample result}] {stmeta} \end{codestore} - \tsdemo*[emph2={tscode,tsdemo},emph={stmeta},keywd2={codestore}]{democodestore} -\begin{codedescribe}{\setcodekeys} - \begin{codesyntax}% - \tsmacro{\setcodekeys}{code-keys} - \end{codesyntax} - -Instead of setting/defining \tsmeta{code-keys} per \tsmacro{\tscode}{}/\tsmacro{\tsdemo}{} call, one can set those \emph{globally}, better said, \emph{in the called context group} .\\ -\begin{tsremark}[N.B.:] -All \tsobj[code]{\tscode,\tsdemo} commands create a local group in which the \tsmeta{code-keys} are defined, and discarded once said local group is closed. \tsmacro{\setcodekeys}{} defines those keys in the \emph{current} context/group. -\end{tsremark} -\end{codedescribe} - - -\subsubsection{Code Keys} +\subsubsection{Code Keys}\label{code-keys} Using a \tsobj[key]{key}\,=\tsobj[value]{value} syntax, one can fine tune \tsobj[pkg]{listings} syntax highlight. \begin{codedescribe}[key]{settexcs,texcs,texcsstyle} @@ -142,6 +136,7 @@ Using a \tsobj[key]{key}\,=\tsobj[value]{value} syntax, one can fine tune \tsobj Those define sets of \LaTeX~commands (csnames), the \tsobj[key]{set} variants initialize/redefine those sets (an empty list, clears the set), while the others extend those sets. The \tsobj[key]{style} ones redefines the command display style (an empty \tsobj[meta]{value} resets the style to it's default).\\ \end{codedescribe} + \begin{codedescribe}[key]{setkeywd,keywd,keywdstyle} \begin{codesyntax} % \tsobj[key]{setkeywd,setkeywd2,setkeywd3} @@ -192,10 +187,10 @@ those set the \tsobj[key]{codeprefix} (default: \LaTeX~Code:) and \tsobj[key]{re \begin{codesyntax} % \tsobj[key]{parindent} \end{codesyntax} -Sets the indentation to be used when 'demonstrating' \LaTeXe code (\tsobj[code]{\tsdemo}). Defaults to whatever value \tsobj[code]{\parindent} was when the package was first loaded. +Sets the indentation to be used when 'demonstrating' \LaTeX\ code (\tsobj[code]{\tsdemo}). Defaults to whatever value \tsobj[code]{\parindent} was when the package was first loaded. \end{codedescribe} -\begin{codedescribe}[key]{ruleht} +\begin{codedescribe}[key]{ruleht}%-very-long-long-long,xyz,xyh,kjh,ljd,kls} \begin{codesyntax} % \tsobj[key]{ruleht} \end{codesyntax} @@ -203,90 +198,139 @@ When typesetting the 'code demo' (\tsobj{\tsdemo}) a set of rules is drawn. The \end{codedescribe} - \section{codedescribe Package} This package aims at minimizing the number of commands, having the object kind (if a macro, or a function, or environment, or variable, or key ...) as a parameter, allowing for a simple 'extension mechanism': other object types can be easily introduced without having to change, or add commands. \subsection{Package Options} It has a single package option: + \begin{describelist}{option} \describe{nolisting}{it will suppress the \tsobj[pkg]{codelisting} package load. In case it's not necessary or one wants to use a differen package for \LaTeX\ code listing.} \end{describelist} -\subsection{\tsobj[oarg]{obj-type} keys}\label{obj-type-def} +\subsection{Object Type keys}\label{obj-type-def} + +The applied text format is defined in terms of \tsobj[arg]{obj-types}, which are defined in terms of \tsobj[arg]{format-groups} and each one defines a 'formatting function', 'font shape', bracketing, etc. to be applied. + +\subsubsection{Format Keys}\label{format-keys} +There is a set of primitive \tsobj[arg]{format-keys} used to define \tsobj[arg]{format-groups,obj-types}, which are: + +\begin{describelist*}{keys} + \describe {meta} { to typeset between angles,} + \describe {xmeta} { to typeset *verbatim* between angles,} + \describe {verb} { to typeset *verbatim*,} + \describe {xverb} { to typeset *verbatim*, suppressing all spaces,} + \describe {code} { to typeset *verbatim*, suppressing all spaces and replacing a TF by \underline{TF},} + \describe {nofmt} { in case of a redefinition, to remove the 'base' formatting,} + \describe {slshape} { to use a slanted font shape,} + \describe {itshape} { to use an italic font shape,} + \describe {noshape} { in case of a redefinition, to remove the 'base' shape,} + \describe {lbracket} { defines the left bracket (when using \tsobj{\tsargs}). \textbf{Note:} this key must have an associated value,} + \describe {rbracket} { defines the right bracket (when using \tsobj{\tsargs}). \textbf{Note:} this key must have an associated value,} + \describe {color} { defines the text color. \textbf{Note:} this key must have an associated value (a color, as understood by \tsobj[pkg]{xcolor} package).} +\end{describelist*} + +\subsubsection{Format Groups} +Using \tsobj{\defgroupfmt} one can (re-)define custom \tsobj[arg]{format-groups}. There is, though, a set of pre-defined ones as follow: + +\begin{describelist*}{keys} + \describe {meta} {which sets \tsobj[keys]{meta,color}} + \describe {verb} {which sets \tsobj[keys]{color}} + \describe {oarg} {which sets \tsobj[keys]{meta,color}} + \describe {code} {which sets \tsobj[keys]{code,color}} + \describe {syntax} {which sets \tsobj[keys]{color}} + \describe {keyval} {which sets \tsobj[keys]{slshape,color}} + \describe {option} {which sets \tsobj[keys]{color}} + \describe {defaultval} {which sets \tsobj[keys]{color}} + \describe {env} {which sets \tsobj[keys]{slshape,color}} + \describe {pkg} {which sets \tsobj[keys]{slshape,color}} +\end{describelist*} +\begin{tsremark} +\tsobj[keys]{color} was used in the list above just as a 'reminder' that a color is defined/associated with the given group. +\end{tsremark} + +\subsubsection{Object Types} +Using \tsobj{\defobjectfmt} one can (re-)define custom \tsobj[arg]{obj-types}. +Similarly, there is a set of predefined ones, as follow: +\begin{describelist*}{keys} + \describe {arg, meta} {based on (group) \tsobj[key]{meta}} + \describe {verb, xverb} {based on (group) \tsobj[key]{verb} plus \tsobj[key,sep=or]{verb,xverb}} + \describe {marg} {based on (group) \tsobj[key]{meta} plus brackets} + \describe {oarg, parg, xarg} {based on (group) \tsobj[key]{oarg} plus brackets} + \describe {code, macro, function} {based on (group) \tsobj[key]{code}} + \describe {syntax} {based on (group) \tsobj[key]{syntax}} + \describe {keyval, key, keys, values} {based on (group) \tsobj[key]{keyval}} + \describe {option} {based on (group) \tsobj[key]{option}} + \describe {defaultval} {based on (group) \tsobj[key]{defaultval}} + \describe {env} {based on (group) \tsobj[key]{env}} + \describe {pkg, pack} {based on (group) \tsobj[key]{pkg}} +\end{describelist*} -The current known Object Types (keys) are: -\begin{itemize}[noitemsep] -\item \tsobj[keys]{meta} for a 'general' case, -\item \tsobj[keys]{arg,marg,oarg,parg,xarg} for commands/functions arguments, -\item \tsobj[keys]{code,macro,function} for macros in general, -\item \tsobj[keys]{syntax} to describe/typeset code syntax, -\item \tsobj[keys]{key,keys,keyval,value,defaultval} to list keys, values, etc., -\item \tsobj[keys]{option} for package/macros options, -\item \tsobj[keys]{env} for environments, -\item \tsobj[keys]{pkg,pack} for packages. -\end{itemize} -% Besides those, for \tsmacro{\tsobj}{} one has \tsobj[keys]{sep,comma} keys to change the last 'connector term' (default: and) and \tsobj[keys]{rulecolor,new,update,note} to customize the \tsobj[env]{codedescribe} environment. -The format's defaults can be changed with \tsobj{\setcodefmt} +\subsubsection{Customization}\label{format-custom} -\begin{codedescribe}[code]{\setcodefmt} +One can add user defined groups/objects or change the pre-defined ones with the following commands: + + +\begin{codedescribe}[code,new=2023/05/16]{\defgroupfmt} \begin{codesyntax} % - \tsmacro{\setcodefmt}{fmt-keys} + \tsmacro{\defgroupfmt}{format-group,format-keys} \end{codesyntax} -\tsobj[marg]{fmt-keys} are basically the same as above: -\begin{itemize}[noitemsep] - \item To change default colors: (note each group defines a single entry/alias) - \begin{itemize}[noitemsep] -\item \tsobj[keys,sep=or]{meta,marg,arg} , -\item \tsobj[keys,sep=or]{oarg,parg,xarg} , -\item \tsobj[keys,sep=or]{code,macro,function} , -\item \tsobj[keys,sep=or]{syntax} , -\item \tsobj[keys,sep=or]{key,keys,keyval,value} , -\item \tsobj[keys,sep=or]{defaultval} , -\item \tsobj[keys,sep=or]{option} , -\item \tsobj[keys,sep=or]{env} , -\item \tsobj[keys,sep=or]{pkg,pack} , -\item \tsobj[keys,sep=or]{allcolors} to set all colors at once, single value. - \end{itemize} -\item others - \begin{itemize} - \item \tsobj[keys]{font} to change font (default: \tsobj{\ttfamily}) - \item \tsobj[keys]{fontsize} to change size (default: \tsobj{\small}) - \item \tsobj[keys]{fontshape} to change the used 'slshape' (default: \tsobj{\slshape}) - \end{itemize} -\end{itemize} +\tsobj[marg]{format-group} is the name of the new group (or one being redefined, which can be one of the standard ones). \tsobj[marg]{format-keys} is any combination of the keys defined in \ref{format-keys} +\end{codedescribe} + +For example, one can redefine the \tsobj[key]{code group} standard color with \tsobj{\defgroupfmt{code}{color=red}} and all \tsobj[key]{obj-types} based on it will be typeset in red (in the standard case: \tsobj[key]{code, macro, function} objects). + +\begin{codedescribe}[code,new=2023/05/16]{\defobjectfmt} +\begin{codesyntax} % + \tsmacro{\defobjectfmt}{obj-type,format-group,format-keys} +\end{codesyntax} +\tsobj[marg]{obj-type} is the name of the new \tsobj[arg]{object} being defined (or redefined), +\tsobj[marg]{format-group} is the base group to be used. \tsobj[marg]{format-keys} allows for further differentiation. \end{codedescribe} +For instance, the many optional \tsobj[arg]{*arg} are defined as follow: +\begin{codestore}[demo.fmtdef] +\colorlet {c__codedesc_oarg_color} { gray!90!black } +\defgroupfmt {oarg} { meta , color=c__codedesc_oarg_color } +\defobjectfmt {oarg} {oarg} { lbracket={[} , rbracket={]} } +\defobjectfmt {parg} {oarg} { lbracket={(} , rbracket={)} } +\defobjectfmt {xarg} {oarg} { lbracket={<} , rbracket={>} } +\end{codestore} +\tscode*[codeprefix=~,keywd={oarg,arg,parg,xarg},keywd2={meta,color},emph={lbracket,rbracket}]{demo.fmtdef} \subsection{Environments} + \begin{codedescribe}[env,new=2023/05/01,update=2023/05/1,note={this is an example}]{codedescribe} \begin{codesyntax} \tsmacro{\begin{codedescribe}}[obj-type]{csv-list} \ldots \tsmacro{\end{codedescribe}}{} -\end{codesyntax} +\end{codesyntax}[Note 1:] This is the main environment to describe \tsobj[env]{Macros, Functions, Variable, Environments, etc.} \tsobj[meta]{csv-list} is typeset in the margin. The optional \tsobj[oarg]{obj-type} defines the object-type format. \end{codedescribe} \begin{tsremark} One can change the rule color with the key \tsobj[keys]{rulecolor}, for instance \tsmacro{\begin{codedescribe}[rulecolor=white]}{} will remove the rules. \end{tsremark} -\begin{tsremark} +\begin{tsremark}[Note 2:] Besides that, one can use the keys \tsobj[keys]{new,update,note} to further customize it as: \tsverb{\begin{codedescribe}[new=2023/05/01,update=2023/05/1,note={this is an example}]} \end{tsremark} +\begin{tsremark}[Note 3:] +Finally, one can use \tsobj[key]{EXP,rEXP} to add a star \ding{72} or a hollow star \ding{73}, as per expl3/doc3 conventions (if expandable, restricted expandable or not). +\end{tsremark} \begin{codedescribe}[env]{codesyntax} \begin{codesyntax} \tsmacro{\begin{codesyntax}}{} +\ldots +\tsmacro{\end{codesyntax}}{} \end{codesyntax} The \tsobj[env]{codesyntax} environment sets the fontsize and activates \tsmacro{\obeylines,\obeyspaces}{}, so one can list macros/cmds/keys use, one per line. - \end{codedescribe} - \begin{tsremark} \tsobj[env]{codesyntax} environment shall appear only once, inside of a \tsobj[env]{codedescribe} environment. Take note, as well, this is not a verbatim environment! %\begin{describelist*}{code} @@ -341,7 +385,7 @@ This is the \tsobj[env]{describelist} companion macro. In case of the \tsobj[env \tsmacro{\typesetobj}[obj-type]{csv-list} \tsmacro{\tsobj}[obj-type]{csv-list} \end{codesyntax} -It can be used to typeset a single 'object' or a list thereof. In the case of a list, each term will be separated by commas. The last two by \tsobj[key]{sep} (defaults to: and). +This is the main typesetting command (most of the others are based on this). It can be used to typeset a single 'object' or a list thereof. In the case of a list, each term will be separated by commas. The last two by \tsobj[key]{sep} (defaults to: and). \end{codedescribe} \begin{tsremark} One can change the last 'separator' with the key \tsobj[keys]{sep}, for instance \tsverb[code]{\tsobj[env,sep=or] {}} (in case one wants to produce an 'or' list of environments). Additionally, one can use the key \tsobj[keys]{comma} to change the last separator to a single comma, like \tsverb[code]{\tsobj[env,comma] {}}. @@ -352,7 +396,7 @@ One can change the last 'separator' with the key \tsobj[keys]{sep}, for instance \tsmacro{\typesetargs}[obj-type]{csv-list} \tsmacro{\tsargs}[obj-type]{csv-list} \end{codesyntax} - Those will typeset \tsobj[marg]{csv-list} as a list of parameters, like \tsargs[oarg]{arg1,arg2,arg3}, or \tsargs[marg]{arg1,arg2,arg3}, etc. \tsobj[oarg]{obj-type} defines the formating AND kind of braces used: \tsverb{[]} for optional arguments (oarg), \tsverb{{}} for mandatory arguments (marg), and so on. + Those will typeset \tsobj[marg]{csv-list} as a list of parameters, like \tsargs[oarg]{arg1,arg2,arg3}, or \tsargs[marg]{arg1,arg2,arg3}, etc. \tsobj[oarg]{obj-type} defines the formating AND kind of brackets used (see \ref{obj-type-def}): \tsverb{[]} for optional arguments (oarg), \tsverb{{}} for mandatory arguments (marg), and so on. \end{codedescribe} @@ -377,8 +421,12 @@ This is just a short-cut for\par \tsobj[code]{\tsobj [code] {macro-list}} \tsobj \tsmacro{\typesetverb}[obj-type]{verbatim text} \tsmacro{\tsverb}[obj-type]{verbatim text} \end{codesyntax} - Typesets \tsobj[marg]{verbatim text} as is (verbatim...). \tsobj[oarg]{obj-type} defines the used format. + Typesets \tsobj[marg]{verbatim text} as is (verbatim...). \tsobj[oarg]{obj-type} defines the used format. The difference with \tsverb{\tsobj[verb]{something}} is that \tsmeta{something} can contain commas (which, otherwise, would be interpreted as a list separator in \tsobj{\tsobj}. \end{codedescribe} +\begin{tsremark} +This is meant to short expressions, and not multi-line, complex code (one is better of, then, using \ref{codelist}). \tsobj[meta]{verbatim text} must be balanced ! otherwise, some low level \TeX\ errors may pop out. +\end{tsremark} + \begin{codedescribe}[code]{\typesetmarginnote,\tsmarginnote} \begin{codesyntax} @@ -390,7 +438,7 @@ Typesets a small note at the margin. \begin{codedescribe}[env]{tsremark} \begin{codesyntax} -\tsmacro{\begin{tsremark}[NB]}{} +\tsmacro{\begin{tsremark}}[NB]{} \tsmacro{\end{tsremark}}{} \end{codesyntax} The environment body will be typeset as a text note. \tsobj[oarg]{NB} (defaults to Note:) is the note begin (in boldface). For instance: @@ -403,7 +451,7 @@ Typesets a small note at the margin. \tsdemo{demo.remark} \end{codedescribe} -\subsection{Auxiliar Command / Environment} +\subsection{Auxiliary Command / Environment} In case the used Document Class redefines the \tsobj[code]{\maketitle} command and/or \tsobj[env]{abstract} environment, alternatives are provided (based on the article class). \begin{codedescribe}[code]{typesettitle,tstitle} @@ -429,5 +477,12 @@ This is based on the \tsobj[code]{\maketitle} from the \tsobj[pkg]{article} clas This is the \tsobj[env]{abstract} environment from the \tsobj[pkg]{article} class. \end{codedescribe} +\begin{codedescribe}[code,new=2023/05/16]{typesetdate,tsdate} +\begin{codesyntax} +\tsmacro{\typesetdate}{} +\tsmacro{\tsdate}{} +\end{codesyntax} +This provides the current date (Month Year, format). +\end{codedescribe} \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/codedescribe/latex/codedescribe.sty b/macros/latex/contrib/codedescribe/latex/codedescribe.sty index 370f01ba82..a260c0d422 100644 --- a/macros/latex/contrib/codedescribe/latex/codedescribe.sty +++ b/macros/latex/contrib/codedescribe/latex/codedescribe.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.0.1beta (2023/05/11) +%% This is version 1.1 (2023/05/16) %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codedescribe @@ -22,33 +22,37 @@ \RequirePackage{ expl3 } \ProvidesExplPackage {codedescribe} - {2023/05/11} - {1.0} + {2023/05/16} + {1.1} {LaTeX Code Description/Documentation} -\prop_if_exist:NTF \g__codedesc_pkg_prop - {} - { \prop_new:N \g__codedesc_pkg_prop } - -\prop_put_from_keyval:Nn \g__codedesc_pkg_prop +%%%%%%% +%%% +%%% Just an attempt of having my packages info in a regular way +%%% Idea being: { <pck-name> / pkg info } for each and all. +%%% +%%%%%%% +\keys_define:nn { codedescribe / pkg info} { - codedesc . name = codedescribe , - codedesc . prefix = codedesc , - codedesc . date = 2023/05/11 , - codedesc . version = 1.0 , - codedesc . description = LaTeX Code Description/Documentation + name .code:n = codedescribe , + prefix .code:n = codedesc , + date .code:n = 2023/05/16 , + version .code:n = 1.1 , + description .code:n = \LaTeX~Code~Description/Documentation } - -\cs_gset:Npn \__codedesc_pkg_info:nn #1#2 +\cs_if_exist:NF \__codedesc_pkg_info:nn { - \prop_item:Nn \g__codedesc_pkg_prop {#1.#2} + \cs_new_protected:Npn \__codedesc_pkg_info:nn #1#2 + { \keys_set:nn {#1 / pkg info}{#2} } } +\cs_if_exist:NF \PkgInfo + { \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} } } +%%%%%%% +%%% End of cut-n-paste +%%%%%%% + + -\cs_if_exist:NTF \PkgInfo - {} - { - \NewDocumentCommand \PkgInfo {mm} { \prop_item:Nn \g__codedesc_pkg_prop {#1.#2} } - } \use:c {@reversemargintrue} @@ -58,20 +62,55 @@ \keys_define:nn { codedescribe } { - nolisting.usage:n = general, + nolisting.usage:n = load, nolisting.bool_set_inverse:N = \l__codedesc_loadlisting_bool, nolisting.default:n = {true}, } \ProcessKeyOptions [codedescribe ] +%% bbding is need for those hollow stars... \RequirePackage{xcolor} +\RequirePackage{pifont} \bool_if:nT {\l__codedesc_loadlisting_bool} { \RequirePackage{codelisting} } + \cs_generate_variant:Nn \tl_set:Nn {Ne} +\cs_generate_variant:Nn \keys_set:nn {ne} +\cs_generate_variant:Nn \keys_define:nn {ne} +\cs_generate_variant:Nn \tl_to_str:n {o , e} + + +\msg_new:nnnn {codedesc} {format-err} + { + (ID:#1)~Format~Key~(#2)~not~defined! + } + { + You~tried~to~use~a~non~defined~format~key:#2. + ~Error~Code~ ID:<#1>. + } + +\msg_new:nnnn {codedesc} {group-err} + { + (ID:#1)~Format~group~(#2)~not~defined! + } + { + You~tried~to~use~a~non~defined~format~group:#2. + ~Error~Code~ ID:<#1>. + } + +\msg_new:nnnn {codedesc} {object-err} + { + (ID:#1)~Objetc~Type~(#2)~not~defined! + } + { + You~tried~to~use~a~non~defined~object~type:#2. + ~Error~Code~ ID:<#1>. + } + @@ -99,7 +138,7 @@ \dim_new:N \l__codedesc_linewidth_dim \dim_new:N \l__codedesc_textcolwidth_dim -\cs_new:Npn \__codedesc_set_textcolwidth: +\cs_new_protected:Npn \__codedesc_set_textcolwidth: { \dim_compare:nNnTF {\linewidth} = {\l__codedesc_linewidth_dim} {} @@ -113,246 +152,309 @@ } -\colorlet{c__codedesc_none_color}{red!70!black} -\bool_new:N \l__codedesc_descnotes_bool -\bool_new:N \l__codedesc_descdate_new_bool -\tl_new:N \l__codedesc_descdate_new_tl -\bool_new:N \l__codedesc_descdate_update_bool -\tl_new:N \l__codedesc_descdate_update_tl -\bool_new:N \l__codedesc_sidenote_bool -\tl_new:N \l__codedesc_sidenote_tl -\cs_new:Npn \__codedesc_keysmetadefaults:nn #1#2 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +\keys_define:nn { codedesc / scratch_def } +{ + meta.usage:n = general , + meta .value_forbidden:n = true , + meta .code:n ={ \tl_set:Nn \l__codedesc_tmpfmt_tl {meta} } , + + xmeta.usage:n = general , + xmeta .value_forbidden:n = true , + xmeta .code:n ={ \tl_set:Nn \l__codedesc_tmpfmt_tl {xmeta} } , + + code.usage:n = general , + code .value_forbidden:n = true , + code .code:n ={ \tl_set:Nn \l__codedesc_tmpfmt_tl {code} } , + + verb.usage:n = general , + verb .value_forbidden:n = true , + verb .code:n ={ \tl_set:Nn \l__codedesc_tmpfmt_tl {verb} } , + + xverb.usage:n = general , + xverb .value_forbidden:n = true , + xverb .code:n ={ \tl_set:Nn \l__codedesc_tmpfmt_tl {xverb} } , + + nofmt.usage:n = general , + nofmt .value_forbidden:n = true , + nofmt .code:n = {\tl_clear:N \l__codedesc_tmpfmt_tl } , + + slshape.usage:n = general , + slshape .value_forbidden:n = true , + slshape .code:n ={ \tl_set:Nn \l__codedesc_tmpshape_tl { slshape} } , + + itshape.usage:n = general , + itshape .value_forbidden:n = true , + itshape .code:n ={ \tl_set:Nn \l__codedesc_tmpshape_tl { itshape} } , + + noshape.usage:n = general , + noshape .value_forbidden:n = true , + noshape .code:n ={ \tl_clear:N \l__codedesc_tmpshape_tl } , + + color.usage:n = general , + color .value_required:n = true , + color.code:n = { \tl_set:Nn \l__codedesc_tmpcolor_tl { #1 } } , + + lbracket .usage:n = general , + lbracket .value_required:n = true , + lbracket .code:n = { \tl_set:Nn \l__codedesc_tmplbracket_tl { #1 } } , + + rbracket .usage:n = general , + rbracket .value_required:n = true , + rbracket .code:n = { \tl_set:Nn \l__codedesc_tmprbracket_tl { #1 } } , + + unknown.code:n = + { + \msg_error:nnxx { codedesc } {format-err} {format}{\l_keys_key_str} + }, + +} + + +\keys_define:nn { codedesc / grp_scratch } { - \tl_if_blank:nTF {#2} - { \keys_set:nn {codedesc / defaults} { #1 } } - { \keys_set:nn {codedesc / defaults} { #1 = {#2} } } + unknown .code:n = {} } -\keys_define:nn { codedesc / defaults } -{ - meta.usage:n = general, - meta.code:n = { \colorlet{c__codedesc_marg_color}{#1} } , - meta.default:n = { gray!60!black } , - % - marg.usage:n = general, - marg.code:n = { \__codedesc_keysmetadefaults:nn {meta}{#1} } , - % - arg.usage:n = general, - arg.code:n = { \__codedesc_keysmetadefaults:nn {meta}{#1} } , - % +\cs_new_protected:Npn \__codedesc_group_define:nn #1#2 + { + \tl_clear:N \l__codedesc_tmpfmt_tl + \tl_clear:N \l__codedesc_tmpshape_tl + \tl_clear:N \l__codedesc_tmpcolor_tl + \tl_clear:N \l__codedesc_tmplbracket_tl + \tl_clear:N \l__codedesc_tmprbracket_tl + + \keys_set:nn { codedesc / grp_scratch } {#1} + \keys_set:nn { codedesc / scratch_def } {#2} + + \tl_clear:N \l_tmpa_tl + \tl_clear:N \l_tmpb_tl + \tl_if_empty:NF \l__codedesc_tmpfmt_tl + { + \tl_put_right:No \l_tmpa_tl{\l__codedesc_tmpfmt_tl} + \tl_set:Nn \l_tmpb_tl { , } + } + \tl_if_empty:NF \l__codedesc_tmpshape_tl + { + \tl_put_right:No \l_tmpa_tl{ \l_tmpb_tl } + \tl_put_right:No \l_tmpa_tl{\l__codedesc_tmpshape_tl} + \tl_set:Nn \l_tmpb_tl { , } + } + \tl_if_empty:NF \l__codedesc_tmpcolor_tl + { + \tl_put_right:No \l_tmpa_tl{ \l_tmpb_tl } + \tl_put_right:Nn \l_tmpa_tl{ color = } + \tl_put_right:No \l_tmpa_tl{ \l__codedesc_tmpcolor_tl} + \tl_set:Nn \l_tmpb_tl { , } + } + \tl_if_empty:NF \l__codedesc_tmplbracket_tl + { + \tl_put_right:No \l_tmpa_tl{ \l_tmpb_tl } + \tl_put_right:Nn \l_tmpa_tl{ lbracket = } + \tl_put_right:No \l_tmpa_tl{ \l__codedesc_tmplbracket_tl} + \tl_set:Nn \l_tmpb_tl { , } + } + \tl_if_empty:NF \l__codedesc_tmprbracket_tl + { + \tl_put_right:No \l_tmpa_tl{ \l_tmpb_tl } + \tl_put_right:Nn \l_tmpa_tl{ rbracket = } + \tl_put_right:No \l_tmpa_tl{ \l__codedesc_tmprbracket_tl} +% \tl_set:Nn \l_tmpb_tl { , } + } + + \keys_define:ne { codedesc / grp_scratch } { #1 .meta:nn = { codedesc / scratch_def } { \l_tmpa_tl} } + \keys_define:ne { codedesc / grp_fmt } { #1 .meta:nn = { codedesc / base_fmt } { \l_tmpa_tl} } + } - oarg.usage:n = general, - oarg.code:n = { \colorlet{c__codedesc_oarg_color}{#1} } , - oarg.default:n = { gray!90!black } , - % - parg.usage:n = general, - parg.code:n = { \__codedesc_keysmetadefaults:nn {oarg}{#1} } , - % - xarg.usage:n = general, - xarg.code:n = { \__codedesc_keysmetadefaults:nn {oarg}{#1} } , - % - code.usage:n = general, - code.code:n = { \colorlet{c__codedesc_code_color}{#1} } , - code.default:n = { blue!40!black } , - % - macro.usage:n = general, - macro.code:n = { \__codedesc_keysmetadefaults:nn {code}{#1} } , - % - function.usage:n = general, - function.code:n = { \__codedesc_keysmetadefaults:nn {code}{#1} } , - % - syntax.usage:n = general, - syntax.code:n = { \colorlet{c__codedesc_syntax_color}{#1} } , - syntax.default:n = { blue!60!black } , - % - keyval.usage:n = general, - keyval.code:n = { \colorlet{c__codedesc_keyval_color}{#1} } , - keyval.default:n = { teal!40!black } , - % - key.usage:n = general, - key.code:n = { \__codedesc_keysmetadefaults:nn {keyval}{#1} } , - % - keys.usage:n = general, - keys.code:n = { \__codedesc_keysmetadefaults:nn {keyval}{#1} } , - % - value.usage:n = general, - value.code:n = { \__codedesc_keysmetadefaults:nn {keyval}{#1} } , - % +\keys_define:nn { codedesc / grp_fmt } + { + unknown .code:n = \msg_error:nnxx { codedesc } {group-err} {grpfmt}{\l_keys_key_str} + } - option.usage:n = general, - option.code:n = { \colorlet{c__codedesc_options_color}{#1} } , - option.default:n = { green!30!black } , - % - defaultval.usage:n = general, - defaultval.code:n = { \colorlet{c__codedesc_defaultval_color}{#1} } , - defaultval.default:n = { blue!60!black } , - % +\cs_new_protected:Npn \__codedesc_object_define:nnn #1#2#3 + { + \tl_if_blank:nTF {#3} + { + \keys_define:nn { codedesc / format } + { #1 .meta:nn = { codedesc / grp_fmt } { #2 } } + } + { + \__codedesc_group_define:nn { #1_objfmt } {#3} + \keys_define:nn { codedesc / format } + { #1 .meta:nn = { codedesc / grp_fmt } { #2 , #1_objfmt} } + } + } - env.usage:n = general, - env.code:n = { \colorlet{c__codedesc_env_color}{#1} } , - env.default:n = { green!30!black } , - % - pkg.usage:n = general, - pkg.code:n = { \colorlet{c__codedesc_pkg_color}{#1} } , - pkg.default:n = { green!30!black } , - % - pack.usage:n = general, - pack.code:n = { \__codedesc_keysmetadefaults:nn {pkg}{#1} } , - % - - allcolors.usage:n = general, - allcolors.meta:n = - { - meta = {#1} , - oarg = {#1} , - code = {#1} , - syntax = {#1} , - keyval = {#1} , - option = {#1} , - defaultval = {#1} , - env = {#1} , - pkg = {#1} , - } , - allcolors.default:n = { black } , - - font.usage:n = general , - font.code:n = { \tl_set:Nn \__codedesc_metafont_tl: {#1} } , - font.default:n = { \ttfamily } , - - fontsize.usage:n = general , - fontsize.code:n = { \tl_set:Nn \__codedesc_metasize_tl: {#1} } , - fontsize.default:n = { \small } , +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - fontshape.usage:n = general , - fontshape.code:n = { \tl_set:Nn \__codedesc_slshape_tl: {#1} } , - fontshape.default:n = { \slshape } , + - setdefaults.usage:n = general , - setdefaults.meta:n = { meta, oarg, code, syntax, keyval, option, defaultval, env, pkg , font, fontsize, fontshape} , +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - unknown.usage:n = general, - unknown.code:n = - { }, % unknown keys are silently ignored... -} +\tl_set:Nn \__codedesc_metasize_tl: {\small} +\tl_set:Nn \__codedesc_metafont_tl: {\ttfamily} -\keys_set:nn {codedesc / defaults}{setdefaults} -\NewDocumentCommand \setcodefmt {m} { \keys_set:nn {codedesc / defaults}{#1}} + \colorlet{c__codedesc_none_color}{red!70!black} -\keys_define:nn { codedesc / format } -{ - meta.usage:n = general, - meta.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_marg_color} } - \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_meta:n } - \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_meta:o } - }, - marg.usage:n = general, - marg.meta:n = { meta } , - % - % - arg.usage:n = general, - arg.meta:n = { meta } , - % + \colorlet{c__codedesc_verb_color}{ black } +\__codedesc_group_define:nn {verb} {color=c__codedesc_verb_color} +\__codedesc_object_define:nnn {verb}{verb}{verb} +\__codedesc_object_define:nnn {xverb}{verb}{xverb} - oarg.usage:n = general, - oarg.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_oarg_color} } - \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_meta:n } - \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_meta:o } - }, - % - parg.usage:n = general, - parg.meta:n = { oarg } , - % - xarg.usage:n = general, - xarg.meta:n = { oarg } , - % + \colorlet{c__codedesc_marg_color}{ gray!60!black } +\__codedesc_group_define:nn {meta} {meta,color=c__codedesc_marg_color} +\__codedesc_object_define:nnn {meta}{meta}{} +\__codedesc_object_define:nnn {arg}{meta}{} +\__codedesc_object_define:nnn {marg}{meta}{lbracket={\{},rbracket={\}}} - code.usage:n = general, - code.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_code_color} } - \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_macro_typeset:n } - \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_macro_typeset:o } - }, - % - macro.usage:n = general, - macro.meta:n = { code } , - % - function.usage:n = general, - function.meta:n = { code } , - % + \colorlet{c__codedesc_oarg_color}{ gray!90!black } +\__codedesc_group_define:nn {oarg} {meta,color=c__codedesc_oarg_color} +\__codedesc_object_define:nnn {oarg}{oarg}{lbracket={[},rbracket={]}} +\__codedesc_object_define:nnn {parg}{oarg}{lbracket={(},rbracket={)}} +\__codedesc_object_define:nnn {xarg}{oarg}{lbracket={<},rbracket={>}} - syntax.usage:n = general, - syntax.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_syntax_color} } - }, - % + \colorlet{c__codedesc_code_color}{ blue!40!black } +\__codedesc_group_define:nn {code} {code,color=c__codedesc_code_color} +\__codedesc_object_define:nnn {code}{code}{} +\__codedesc_object_define:nnn {macro}{code}{} +\__codedesc_object_define:nnn {function}{code}{} +%\__codedesc_group_define:nn {code} {xverb,color=red} - keyval.usage:n = general, - keyval.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_keyval_color} } - \tl_set:Nn \__codedesc_metashape_tl: { \__codedesc_slshape_tl: } - }, - % - key.usage:n = general, - key.meta:n = { keyval } , - % - keys.usage:n = general, - keys.meta:n = { keyval } , - % - value.usage:n = general, - value.meta:n = { keyval } , - % + \colorlet{c__codedesc_syntax_color}{ blue!60!black } +\__codedesc_group_define:nn {syntax} {color=c__codedesc_syntax_color} +\__codedesc_object_define:nnn {syntax}{syntax}{} - option.usage:n = general, - option.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_options_color} } - }, - % + \colorlet{c__codedesc_keyval_color}{ teal!40!black } +\__codedesc_group_define:nn {keyval} {slshape,color=c__codedesc_keyval_color} +\__codedesc_object_define:nnn {keyval}{keyval}{} +\__codedesc_object_define:nnn {key}{keyval}{} +\__codedesc_object_define:nnn {keys}{keyval}{} +\__codedesc_object_define:nnn {value}{keyval}{} - defaultval.usage:n = general, - defaultval.code:n = - { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_defaultval_color} } - }, - % + \colorlet{c__codedesc_options_color}{ green!30!black } +\__codedesc_group_define:nn {option} {color=c__codedesc_options_color} +\__codedesc_object_define:nnn {option}{option}{} + + \colorlet{c__codedesc_defaultval_color}{ blue!60!black } +\__codedesc_group_define:nn {defaultval} {color=c__codedesc_defaultval_color} +\__codedesc_object_define:nnn {defaultval}{defaultval}{} - env.usage:n = general, - env.code:n = + \colorlet{c__codedesc_env_color}{ green!30!black } +\__codedesc_group_define:nn {env} {slshape,color=c__codedesc_env_color} +\__codedesc_object_define:nnn {env}{env}{} + + \colorlet{c__codedesc_pkg_color}{ green!30!black } +\__codedesc_group_define:nn {pkg} {slshape,color=c__codedesc_pkg_color} +\__codedesc_object_define:nnn {pkg}{pkg}{} +\__codedesc_object_define:nnn {pack}{pkg}{} + + + + +\keys_define:nn { codedesc / base_fmt } +{ + meta .usage:n = general , + meta .value_forbidden:n = true , + meta .code:n = { + \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_meta:n } + \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_meta:o } + } , + + xmeta .usage:n = general , + xmeta .value_forbidden:n = true , + xmeta .code:n = { + \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_meta*:n } + \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_meta*:o } + } , + + verb .usage:n = general , + verb .value_forbidden:n = true , + verb .code:n = { + \tl_set:Nn \__codedesc_typeset_tl:n { \tl_to_str:n } + \tl_set:Nn \__codedesc_typeset_tl:o { \tl_to_str:o } + } , + + xverb .usage:n = general , + xverb .value_forbidden:n = true , + xverb .code:n = { + \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_verb_nospc_typeset:n } + \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_verb_nospc_typeset:o } + } , + + code .usage:n = general , + code .value_forbidden:n = true , + code .code:n = { + \tl_set:Nn \__codedesc_typeset_tl:n { \__codedesc_macro_typeset:n } + \tl_set:Nn \__codedesc_typeset_tl:o { \__codedesc_macro_typeset:o } + } , + + slshape .usage:n = general , + slshape .value_forbidden:n = true , + slshape .code:n = { + \tl_set:Nn \__codedesc_metashape_tl: { \slshape} + } , + + itshape .usage:n = general , + itshape .value_forbidden:n = true , + itshape .code:n = { + \tl_set:Nn \__codedesc_metashape_tl: { \itshape } + } , + + lbracket .usage:n = general , + lbracket .value_required:n = true , + lbracket .code:n = { \tl_set:Nn \__codedesc_Lbracket_tl { #1 } } , + + rbracket .usage:n = general , + rbracket .value_required:n = true , + rbracket .code:n = { \tl_set:Nn \__codedesc_Rbracket_tl { #1 } } , + + color .usage:n = general , + color .value_required:n = true , + color .code:n = { + \tl_set:Nn \__codedesc_metacolor_tl: { \color{#1} } + } , +} + +\keys_define:nn { codedesc / format } +{ + EXP.usage:n = general, + EXP.code:n = { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_env_color} } - \tl_set:Nn \__codedesc_metashape_tl: { \__codedesc_slshape_tl: } + \tl_set:Nn \__codedesc_exp_tl { ~\hfill{\scriptsize\ding{72}} } }, % - - pkg.usage:n = general, - pkg.code:n = + rEXP.usage:n = general, + rEXP.code:n = { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_pkg_color} } - \tl_set:Nn \__codedesc_metashape_tl: { \__codedesc_slshape_tl: } + \tl_set:Nn \__codedesc_exp_tl { ~\hfill{\scriptsize\ding{73}} } }, % - pack.usage:n = general, - pack.meta:n = { pkg } , - % - sep.usage:n = general, - sep.code:n = + sep.code:n = { \tl_set:Nn \__codedesc_lastsep_tl { ~#1~ } }, @@ -396,19 +498,23 @@ unknown.usage:n = general, unknown.code:n = { - \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_none_color} } - }, - + \tl_set:Nn \__codedesc_metacolor_tl: { \color{c__codedesc_none_color} } + \msg_error:nnxx { codedesc } {object-err} {format}{\l_keys_key_str} + }, } -\cs_new:Npn \__codedesc_metafmt_set:n #1 +\cs_new_protected:Npn \__codedesc_metafmt_set:n #1 { \tl_set:Nn \__codedesc_rulecolor_tl: { \__codedesc_metacolor_tl: } \tl_set:Nn \__codedesc_metashape_tl: { } \tl_set:Nn \__codedesc_typeset_tl:n { } - \tl_set:Nn \__codedesc_typeset_tl:o { \relax } + \tl_set:Nn \__codedesc_typeset_tl:o { } + \tl_set:Nn \__codedesc_Lbracket_tl { } + \tl_set:Nn \__codedesc_Rbracket_tl { } \tl_set:Nn \__codedesc_sep_tl {,\ } \tl_set:Nn \__codedesc_lastsep_tl {\ and\ } + \tl_set:Nn \__codedesc_exp_tl { } + \bool_set_false:N \l__codedesc_descnotes_bool \bool_set_false:N \l__codedesc_descdate_new_bool @@ -420,29 +526,16 @@ \cs_generate_variant:Nn \__codedesc_metafmt_set:n {o} -\cs_new:Npn \__codedesc_metafmt:n #1 +\cs_new_protected:Npn \__codedesc_metafmt:n #1 { - \tl_set:Nn \__codedesc_rulecolor_tl: { \__codedesc_metacolor_tl: } - \tl_set:Nn \__codedesc_metashape_tl: { } - \tl_set:Nn \__codedesc_typeset_tl:n { } - \tl_set:Nn \__codedesc_typeset_tl:o { } - \tl_set:Nn \__codedesc_sep_tl {,\ } - \tl_set:Nn \__codedesc_lastsep_tl {\ and\ } - - \bool_set_false:N \l__codedesc_descnotes_bool - \bool_set_false:N \l__codedesc_descdate_new_bool - \bool_set_false:N \l__codedesc_descdate_update_bool - \bool_set_false:N \l__codedesc_sidenote_bool - - \keys_set:nn {codedesc / format}{#1} - %\tl_show:N \__codedesc_rulecolor_tl + \__codedesc_metafmt_set:n {#1} \__codedesc_metafmt: } \cs_generate_variant:Nn \__codedesc_metafmt:n {o} -\cs_new:Npn \__codedesc_metafmt: +\cs_new_protected:Npn \__codedesc_metafmt: { \__codedesc_metacolor_tl: \__codedesc_metasize_tl: @@ -451,57 +544,12 @@ } -\keys_define:nn { codedesc / delimiters } -{ - oarg.usage:n = general, - oarg.code:n = - { - \tl_set:Nn \__codedesc_open_delimit_tl {[} - \tl_set:Nn \__codedesc_close_delimit_tl {]} - }, - marg.usage:n = general, - marg.code:n = - { - \tl_set:Nn \__codedesc_open_delimit_tl {\{} - \tl_set:Nn \__codedesc_close_delimit_tl {\}} - }, - parg.usage:n = general, - parg.code:n = - { - \tl_set:Nn \__codedesc_open_delimit_tl {(} - \tl_set:Nn \__codedesc_close_delimit_tl {)} - }, - % - xarg.usage:n = general, - xarg.code:n = - { - \tl_set:Nn \__codedesc_open_delimit_tl {<} - \tl_set:Nn \__codedesc_close_delimit_tl {>} - }, - % - meta.usage:n = general, - meta.code:n = - { - \tl_set:Nn \__codedesc_open_delimit_tl {} - \tl_set:Nn \__codedesc_close_delimit_tl {} - }, - % - unknown.usage:n = general, - unknown.code:n = - { -% \tl_set:Nn \__codedesc_open_delimit_tl {!} -% \tl_set:Nn \__codedesc_close_delimit_tl {!} - }, - % -} - - %%%%%%% %%% %%% < meta > %%% %%%%%%% -\cs_new:Npn \__codedesc_meta:n #1 +\cs_new_protected:Npn \__codedesc_meta:n #1 { \ensuremath\langle #1 \ensuremath\rangle } @@ -513,7 +561,7 @@ %%% < meta > 'detokenized' %%% %%%%%%% -\cs_new:Npn \__codedesc_meta*:n #1 +\cs_new_protected:Npn \__codedesc_meta*:n #1 { \ensuremath\langle \tl_to_str:n {#1} \ensuremath\rangle } @@ -523,7 +571,7 @@ -\cs_new:Npn \__codedesc_macro_typeset:n #1 +\cs_new_protected:Npn \__codedesc_macro_typeset:n #1 { \tl_set:Ne \l_tmpb_tl {\tl_to_str:n{#1}} \regex_replace_all:nnN {\ }{} \l_tmpb_tl @@ -536,11 +584,18 @@ \cs_generate_variant:Nn \__codedesc_macro_typeset:n {o} +\cs_new_protected:Npn \__codedesc_verb_nospc_typeset:n #1 + { + \tl_set:Ne \l_tmpb_tl {\tl_to_str:n{#1}} + \regex_replace_all:nnN {\ }{} \l_tmpb_tl + \l_tmpb_tl + } +\cs_generate_variant:Nn \__codedesc_verb_nospc_typeset:n {o} -\cs_new:Npn \__codedesc_list_typeset:nnn #1#2#3 +\cs_new_protected:Npn \__codedesc_list_typeset:nnn #1#2#3 { \seq_set_from_clist:Nn \l_tmpa_seq {#1} \bool_set:Nn \l__codedesc_bool {\seq_if_empty_p:N \l_tmpa_seq} @@ -578,7 +633,7 @@ -\cs_new:Npn \__codedesc_args_typeset:nnnn #1#2#3#4 +\cs_new_protected:Npn \__codedesc_args_typeset:nnnn #1#2#3#4 { \seq_set_from_clist:Nn \l_tmpa_seq {#3} \group_begin: @@ -586,6 +641,13 @@ \seq_map_inline:Nn \l_tmpa_seq {~\!\!#2 \__codedesc_meta:n {##1} #4 } \group_end: } + + +%%%%%%%%%%%%%%%%%%% +%%%% +%%%% Variables used in the codedescibe environment +%%%% +%%%%%%%%%%%%%%%%%%% \bool_new:N \l__codedesc_longblock_bool @@ -596,6 +658,22 @@ \dim_new:N \l__codedesc_syntax_wd_dim \dim_new:N \l__codedesc_margin_wd_dim +\bool_new:N \l__codedesc_descnotes_bool +\bool_new:N \l__codedesc_descdate_new_bool +\tl_new:N \l__codedesc_descdate_new_tl +\bool_new:N \l__codedesc_descdate_update_bool +\tl_new:N \l__codedesc_descdate_update_tl +\bool_new:N \l__codedesc_sidenote_bool +\tl_new:N \l__codedesc_sidenote_tl + + +\coffin_new:N \__codedesc_describe_coffin +\dim_new:N \__codedesc_describelabel_wd_dim +\dim_new:N \__codedesc_describelist_wd_dim +\tl_new:N \__codedesc_join_tl: +\tl_new:N \__codedesc_ragged_tl: + +\dim_new:N \__codedesc_paradvance_dim %%%%%%%%%%%%%%%%%%% @@ -604,10 +682,26 @@ %%%% %%%%%%%%%%%%%%%%%%% - + +\NewDocumentCommand \defgroupfmt {mm} + { + \__codedesc_group_define:nn {#1} {#2} + } + +\NewDocumentCommand \defobjectfmt {mmm} + { + \__codedesc_object_define:nn {#1} {#2} {#3} + } \NewDocumentEnvironment {codedescribe}{O{code}m} { + \mode_if_horizontal:TF + { + \dim_set:Nn \__codedesc_paradvance_dim {\baselineskip} + } + { + \dim_set:Nn \__codedesc_paradvance_dim {0pt} + } \seq_set_from_clist:Nn \l_tmpa_seq {#2} \__codedesc_set_textcolwidth: \hcoffin_set:Nn \l__codedesc_margin_coffin @@ -616,21 +710,23 @@ \begin{tabular}{@{} l @{} } \__codedesc_hline:nnnn {\__codedesc_rulecolor_tl:}{0.5ex}{2}{0.25ex} - \seq_map_inline:Nn \l_tmpa_seq { \__codedesc_typeset_tl:n {##1} \\ } + \seq_map_inline:Nn \l_tmpa_seq { \__codedesc_typeset_tl:n {##1} \__codedesc_exp_tl \\ } \bool_if:nTF {\l__codedesc_descnotes_bool} { - \\[-2.5ex] - \__codedesc_hline:nnnn {\color{black}}{0.5ex}{0.25}{0.25ex} - - \bool_if:nT {\l__codedesc_descdate_new_bool} - {\scriptsize\color{black}new:~ \l__codedesc_descdate_new_tl\\} - \bool_if:nT {\l__codedesc_descdate_update_bool} - {\scriptsize\color{black}update:~ \l__codedesc_descdate_update_tl\\} - \bool_if:nT {\l__codedesc_sidenote_bool} - {\scriptsize\color{black}NB:~ \l__codedesc_sidenote_tl\\} + \\[-2.5ex] + \__codedesc_hline:nnnn {\color{black}}{0.5ex}{0.25}{0.25ex} + + \bool_if:nT {\l__codedesc_descdate_new_bool} + {\scriptsize\color{black}new:~ \l__codedesc_descdate_new_tl\\[-1ex]} + \bool_if:nT {\l__codedesc_descdate_update_bool} + {\scriptsize\color{black}update:~ \l__codedesc_descdate_update_tl\\[-1ex]} + \bool_if:nT {\l__codedesc_sidenote_bool} + {\scriptsize\color{black}NB:~ \l__codedesc_sidenote_tl\\[-1ex]} + \\[-1.5ex] + } + { + \\[-2.5ex] } - {} - \\[-2.5ex] \__codedesc_hline:nnnn {\__codedesc_rulecolor_tl:}{-0.25ex}{2}{1ex} \end{tabular} } @@ -656,17 +752,18 @@ \bool_if:NTF \l__codedesc_longblock_bool { % __describeblock starting at marginpar \coffin_join:NnnNnnnn \l__codedesc_syntax_coffin {l}{t} \l__codedesc_margin_coffin {r}{t} {-\marginparsep}{0pt} - \coffin_join:NnnNnnnn \l__codedesc_syntax_coffin {l}{b} \l__codedesc_text_coffin {l}{t} {\marginparwidth+\marginparsep}{0pt}%{-0.25\baselineskip} + \coffin_join:NnnNnnnn \l__codedesc_syntax_coffin {l}{b} \l__codedesc_text_coffin {l}{t} {\marginparwidth+\marginparsep}{\baselineskip} \par\noindent - \coffin_typeset:Nnnnn \l__codedesc_syntax_coffin {l}{t} {-\marginparwidth-\marginparsep}{0pt} + \coffin_typeset:Nnnnn \l__codedesc_syntax_coffin {l}{t} {-\marginparwidth-\marginparsep}{\__codedesc_paradvance_dim} } { % __describeblock at marginpar \coffin_attach:NnnNnnnn \l__codedesc_syntax_coffin {l}{t} \l__codedesc_margin_coffin {r}{t} {-\marginparsep}{0pt} - \coffin_join:NnnNnnnn \l__codedesc_syntax_coffin {l}{b} \l__codedesc_text_coffin {l}{t} {0pt}{0pt}%{-0.25\baselineskip} + \coffin_join:NnnNnnnn \l__codedesc_syntax_coffin {l}{b} \l__codedesc_text_coffin {l}{t} {0pt}{\baselineskip} \par\noindent - \coffin_typeset:Nnnnn \l__codedesc_syntax_coffin {l}{t} {0pt}{0pt} + \coffin_typeset:Nnnnn \l__codedesc_syntax_coffin {l}{t} {0pt}{\__codedesc_paradvance_dim} } - \\[0.25\baselineskip] + \\[0.5\baselineskip] + %\\[\__codedesc_paradvance_dim]%[-0.5\baselineskip] } @@ -691,20 +788,13 @@ \vcoffin_gset_end: } - -\coffin_new:N \__codedesc_describe_coffin -\dim_new:N \__codedesc_describelabel_wd_dim -\dim_new:N \__codedesc_describelist_wd_dim -\tl_new:N \__codedesc_join_tl: -\tl_new:N \__codedesc_ragged_tl: - \NewDocumentEnvironment{describelist}{O{20mm}m} { %\vspace*{-1.5ex} \mode_if_horizontal:TF - {\vspace*{-0.75ex}} + {\\[-0.5\baselineskip]} {} \__codedesc_set_textcolwidth: \coffin_clear:N \__codedesc_describe_coffin @@ -722,7 +812,7 @@ { %\vspace*{-1.5ex} \mode_if_horizontal:TF - {\vspace*{-1ex}} + {\\[-0.5\baselineskip]}%{\vspace*{-1ex}} {} \__codedesc_set_textcolwidth: \coffin_clear:N \__codedesc_describe_coffin @@ -737,34 +827,31 @@ } \NewDocumentCommand \describe {mm} - { - + { \hcoffin_set:Nn \l_tmpb_coffin { \__codedesc_metafmt:o { \__codedesc_listkind_tl } \__codedesc_ragged_tl: \__codedesc_typeset_tl:n {#1} - } + } + \dim_compare:nNnTF {\coffin_wd:N \l_tmpb_coffin} > {\__codedesc_describelabel_wd_dim} + { + \vcoffin_set:Nnn \l_tmpa_coffin + { \__codedesc_describelabel_wd_dim } + { ~\ ~ } + \coffin_attach:NnnNnnnn + \l_tmpa_coffin {r}{t} + \l_tmpb_coffin {r}{t} + {0pt}{0pt} - \dim_compare:nNnTF {\coffin_wd:N \l_tmpb_coffin} > {\__codedesc_describelabel_wd_dim} - { - \vcoffin_set:Nnn \l_tmpa_coffin - { \__codedesc_describelabel_wd_dim } - { ~\ ~ } - \coffin_attach:NnnNnnnn - \l_tmpa_coffin {r}{t} - \l_tmpb_coffin {r}{t} - {0pt}{0pt} - - } - { - \vcoffin_set:Nnn \l_tmpa_coffin - { \__codedesc_describelabel_wd_dim } - { - \__codedesc_metafmt:o { \__codedesc_listkind_tl } - \noindent\__codedesc_ragged_tl: \__codedesc_typeset_tl:n {#1} - } - } - + } + { + \vcoffin_set:Nnn \l_tmpa_coffin + { \__codedesc_describelabel_wd_dim } + { + \__codedesc_metafmt:o { \__codedesc_listkind_tl } + \noindent\__codedesc_ragged_tl: \__codedesc_typeset_tl:n {#1} + } + } \vcoffin_set:Nnn \l_tmpb_coffin { \__codedesc_describelist_wd_dim } { @@ -772,26 +859,21 @@ \begin{minipage}[t]{ \__codedesc_describelist_wd_dim } #2 \end{minipage} - } - - + } \__codedesc_join_tl: \l_tmpb_coffin {l}{t} \l_tmpa_coffin {r}{t} {-\marginparsep}{0pt} - \mode_if_horizontal:TF { - \\ -% \tl_set:Nn \l_tmpa_tl {~\ ~} - } - { -% \tl_set:Nn \l_tmpa_tl {~\ ~} + \\[-\baselineskip] } - \noindent%\vspace*{-1ex} + { } + + \noindent \coffin_typeset:Nnnnn \l_tmpb_coffin {l}{t} {0pt}{0pt} - \\[-0.5\baselineskip] + \\ } @@ -804,8 +886,11 @@ \NewDocumentCommand \typesetargs {O{meta}m} { - \keys_set:nn {codedesc / delimiters}{#1} - \__codedesc_args_typeset:nnnn {#1} \__codedesc_open_delimit_tl {#2} \__codedesc_close_delimit_tl +% \keys_set:nn {codedesc / delimiters}{#1} + \group_begin: + \__codedesc_metafmt:n {#1} + \__codedesc_args_typeset:nnnn {#1} {\__codedesc_Lbracket_tl} {#2} {\__codedesc_Rbracket_tl} + \group_end: } \cs_new_eq:NN \tsargs \typesetargs @@ -847,7 +932,6 @@ \NewDocumentEnvironment {tsremark} {O{Note:}} { -% \par\vspace*{0.5\baselineskip} \mode_if_horizontal:TF {\par\vspace*{0.25\baselineskip}}%\vspace*{-1.5ex}} {\vspace*{0.75\baselineskip}} @@ -861,7 +945,7 @@ { \end{minipage} \group_end: - \par + \\[0.5\baselineskip] } @@ -870,20 +954,20 @@ \keys_define:nn { codedesc / title } { title .usage:n = general , + title .value_required:n = true , title .tl_set:N = \l__codedesc_title_tl , author .usage:n = general , + author .value_required:n = true , author .tl_set:N = \l__codedesc_author_tl , date .usage:n = general , + date .value_required:n = true , date .tl_set:N = \l__codedesc_descdate_tl , - - abstract .usage:n = general , - abstract .tl_set:N = \l__codedesc_abstract_tl , } -\cs_new:Npn \__codedesc_make_title: {% +\cs_new_protected:Npn \__codedesc_make_title: {% \newpage \null \vskip 2em% @@ -904,6 +988,29 @@ } + +\NewDocumentCommand \typesetdate {} + { + \int_case:nn {\month} + { + {1}{January} + {2}{February} + {3}{March} + {4}{April} + {5}{May} + {6}{June} + {7}{July} + {8}{August} + {9}{September} + {10}{October} + {11}{November} + {12}{December} + } + \use:n {~} \int_to_arabic:n {\year} + } + +\cs_new_eq:NN \tsdate \typesetdate + %%%ARGH !!!!! %%% 'adapted' from 'abstract.cls' %%% diff --git a/macros/latex/contrib/codedescribe/latex/codelisting.sty b/macros/latex/contrib/codedescribe/latex/codelisting.sty index ede0132e3e..c02633d912 100644 --- a/macros/latex/contrib/codedescribe/latex/codelisting.sty +++ b/macros/latex/contrib/codedescribe/latex/codelisting.sty @@ -12,43 +12,51 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.0 (2023/05/11) +%% This is version 1.1 (2023/05/16) %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/codedescribe %% %%%============================================================================== \NeedsTeXFormat{LaTeX2e}[2022/06/01] - \RequirePackage{ expl3 } \ProvidesExplPackage {codelisting} - {2023/05/11} - {1.0} + {2023/05/16} + {1.1} {LaTeX Code Listing} -\prop_if_exist:NTF \g__codedesc_pkg_prop - {} - { \prop_new:N \g__codedesc_pkg_prop } - -\prop_put_from_keyval:Nn \g__codedesc_pkg_prop +%%%%%%% +%%% +%%% Just an attempt of having my packages info in a regular way +%%% Idea being: { <pck-name> / pkg info } for each and all. +%%% +%%%%%%% +\keys_define:nn { codelisting / pkg info} { - codelist . name = codelisting , - codelist . prefix = codelist , - codelist . date = 2023/05/11 , - codelist . version = 1.0 , - codelist . description = LaTeX Code Listing + name .code:n = codelisting , + prefix .code:n = codelist , + date .code:n = 2023/05/16 , + version .code:n = 1.1 , + description .code:n = \LaTeX~Code~Listing } - -\cs_gset:Npn \__codedesc_pkg_info:nn #1#2 +\cs_if_exist:NF \__codedesc_pkg_info:nn { - \prop_item:Nn \g__codedesc_pkg_prop {#1.#2} + \cs_new_protected:Npn \__codedesc_pkg_info:nn #1#2 + { \keys_set:nn {#1 / pkg info}{#2} } } +\cs_if_exist:NF \PkgInfo + { \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} } } +%%%%%%% +%%% End of cut-n-paste +%%%%%%% + -\RequirePackage{listings,scontents} +\RequirePackage{listings,scontents} + \dim_new:N \l__codelist_demo_parindent_dim \dim_new:N \l__codelist_org_parindent_dim @@ -277,6 +285,9 @@ } +%%%%%% +%%% This one can't be proteced +%%%%%% \cs_new:Npn \__codelist_set_options:n #1 {\keys_set:nn {CodeListingOptions}{#1}} \__codelist_set_options:n{default} @@ -461,6 +472,9 @@ \cs_undefine:c{endverbatimsc} \lstnewenvironment{verbatimsc}{\lstset{style=codestyle}}{} +%%%%%% +%%% This one can't be proteced +%%%%%% \cs_new:Npn \__codelist_set_verbsc:n #1 { \cs_undefine:c{verbatimsc} diff --git a/macros/latex/contrib/l3kernel/CHANGELOG.md b/macros/latex/contrib/l3kernel/CHANGELOG.md index e973577cff..9b2db54278 100644 --- a/macros/latex/contrib/l3kernel/CHANGELOG.md +++ b/macros/latex/contrib/l3kernel/CHANGELOG.md @@ -7,6 +7,15 @@ this project uses date-based 'snapshot' version identifiers. ## [Unreleased] +## [2023-05-15] + +### Changed +- Require `\expanded` and 'pdfTeX extension' primitives, + and thus TeX distributions from mid-2019 onward + +### Fixed +- Treatment of trailing `/` in `\input@path` + ## [2023-05-11] ### Added @@ -1398,7 +1407,8 @@ this project uses date-based 'snapshot' version identifiers. - Step functions have been added for dim variables, e.g. `\dim_step_inline:nnnn` -[Unreleased]: https://github.com/latex3/latex3/compare/2023-05-11...HEAD +[Unreleased]: https://github.com/latex3/latex3/compare/2023-05-15...HEAD +[2023-05-15]: https://github.com/latex3/latex3/compare/2023-05-11...2023-05-15 [2023-05-11]: https://github.com/latex3/latex3/compare/2023-05-05...2023-05-11 [2023-05-05]: https://github.com/latex3/latex3/compare/2023-04-20...2023-05-05 [2023-04-20]: https://github.com/latex3/latex3/compare/2023-04-19...2023-04-20 diff --git a/macros/latex/contrib/l3kernel/README.md b/macros/latex/contrib/l3kernel/README.md index 14a42feda5..44bb66a2f7 100644 --- a/macros/latex/contrib/l3kernel/README.md +++ b/macros/latex/contrib/l3kernel/README.md @@ -1,7 +1,7 @@ LaTeX3 Programming Conventions ============================== -Release 2023-05-11 +Release 2023-05-15 Overview -------- diff --git a/macros/latex/contrib/l3kernel/expl3.dtx b/macros/latex/contrib/l3kernel/expl3.dtx index 3b86288ffa..cdd27753ee 100644 --- a/macros/latex/contrib/l3kernel/expl3.dtx +++ b/macros/latex/contrib/l3kernel/expl3.dtx @@ -24,7 +24,7 @@ % %<*driver|generic|package|2ekernel> %</driver|generic|package|2ekernel> -\def\ExplFileDate{2023-05-11}% +\def\ExplFileDate{2023-05-15}% %<*driver> \documentclass[full]{l3doc} \usepackage{graphicx} @@ -51,7 +51,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/expl3.pdf b/macros/latex/contrib/l3kernel/expl3.pdf Binary files differindex 0a40032cef..ae93ec6850 100644 --- a/macros/latex/contrib/l3kernel/expl3.pdf +++ b/macros/latex/contrib/l3kernel/expl3.pdf diff --git a/macros/latex/contrib/l3kernel/interface3.pdf b/macros/latex/contrib/l3kernel/interface3.pdf Binary files differindex f1d727899c..84f53f8947 100644 --- a/macros/latex/contrib/l3kernel/interface3.pdf +++ b/macros/latex/contrib/l3kernel/interface3.pdf diff --git a/macros/latex/contrib/l3kernel/interface3.tex b/macros/latex/contrib/l3kernel/interface3.tex index 5d53fcc74b..7dea564c3f 100644 --- a/macros/latex/contrib/l3kernel/interface3.tex +++ b/macros/latex/contrib/l3kernel/interface3.tex @@ -62,7 +62,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2023-05-11} +\date{Released 2023-05-15} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/l3kernel/l3basics.dtx b/macros/latex/contrib/l3kernel/l3basics.dtx index 2440b8ea32..fa09cc4806 100644 --- a/macros/latex/contrib/l3kernel/l3basics.dtx +++ b/macros/latex/contrib/l3kernel/l3basics.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -1631,12 +1631,8 @@ % \end{macrocode} % % \begin{macro}[EXP]{\use:e} -% In non-\LuaTeX engines older than 2019, \cs{expanded} is emulated. % \begin{macrocode} \cs_set:Npn \use:e #1 { \tex_expanded:D {#1} } -\tex_ifdefined:D \tex_expanded:D \tex_else:D - \cs_set:Npn \use:e #1 { \exp_args:Ne \use:n {#1} } -\tex_fi:D % \end{macrocode} % \end{macro} % diff --git a/macros/latex/contrib/l3kernel/l3bootstrap.dtx b/macros/latex/contrib/l3kernel/l3bootstrap.dtx index 7c5e8f5e66..03749f402a 100644 --- a/macros/latex/contrib/l3kernel/l3bootstrap.dtx +++ b/macros/latex/contrib/l3kernel/l3bootstrap.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -133,35 +133,6 @@ %<@@=kernel> % \end{macrocode} % -% \subsection{\LuaTeX{}-specific code} -% -% Depending on the versions available, the \LaTeX{} format may not have -% the raw |\Umath| primitive names available. We fix that globally: -% it should cause no issues. Older \LuaTeX{} versions do not have -% a pre-built table of the primitive names here so sort one out -% ourselves. These end up globally-defined but at that is true with -% a newer format anyway and as they all start |\U| this should be -% reasonably safe. -% \begin{macrocode} -\begingroup - \expandafter\ifx\csname directlua\endcsname\relax - \else - \directlua{% - local i - local t = { } - for _,i in pairs(tex.extraprimitives("luatex")) do - if string.match(i,"^U") then - if not string.match(i,"^Uchar$") then %$ - table.insert(t,i) - end - end - end - tex.enableprimitives("", t) - }% - \fi -\endgroup -% \end{macrocode} -% % \subsection{The \tn{pdfstrcmp} primitive in \XeTeX{}} % % Only \pdfTeX{} has a primitive called \tn{pdfstrcmp}. The \XeTeX{} @@ -222,39 +193,40 @@ % % \subsection{Engine requirements} % -% The code currently requires \eTeX{} and functionality equivalent to -% \tn{pdfstrcmp}, and also driver and Unicode character support. This is -% available in a reasonably-wide range of engines. -% +% The code currently requires \eTeX{}, the set of \enquote{\pdfTeX{} +% extensions} \emph{including} \tn{expanded}, and for Unicode engines the +% ability to generate arbitrary character tokens by expansion. That is covered +% by all supported engines since \TeX{} Live 2019, which we therefore use +% as a baseline for engine and \LaTeX{} format support. % For \LuaTeX, we require at least Lua 5.3 and the |token.set_lua| function. -% This is available at least since \LuaTeX{} 1.10. +% This is available at least since \LuaTeX{} 1.10, which again is the one +% in \TeX{} Live 2019. (u)p\TeX{} only gained \tn{ifincsname} for \TeX{} +% Live 2020, but at present that primitive is unused in \pkg{expl3} so for +% the present it's not tested. If and when that changes, we will need to +% revisit the code here. % \begin{macrocode} \begingroup \def\next{\endgroup}% \def\ShortText{Required primitives not found}% \def\LongText% {% - The L3 programming layer requires the e-TeX primitives and additional - \LineBreak functionality as described in the README file. + The L3 programming layer requires the e-TeX primitives and the + \LineBreak 'pdfTeX extensions' as described in the README file. \LineBreak These are available in the engines\LineBreak - - pdfTeX v1.40.0\LineBreak - - XeTeX v0.99992\LineBreak + - pdfTeX v1.40.20\LineBreak + - XeTeX v0.999991\LineBreak - LuaTeX v1.10\LineBreak - - e-(u)pTeX mid-2012\LineBreak + - e-(u)pTeX v3.8.2\LineBreak - Prote (2021)\LineBreak or later.\LineBreak \LineBreak }% \ifnum0% - \expandafter\ifx\csname expanded\endcsname\relax - \expandafter\ifx\csname pdfstrcmp\endcsname\relax\else 1\fi + \expandafter\ifx\csname luatexversion\endcsname\relax + \expandafter\ifx\csname expanded\endcsname\relax\else 1\fi \else - \expandafter\ifx\csname luatexversion\endcsname\relax - 1% - \else - \ifnum\luatexversion<110 \else 1\fi - \fi + \ifnum\luatexversion<110 \else 1\fi \fi =0 % \newlinechar`\^^J % @@ -282,44 +254,6 @@ Type H <return> for immediate help}\def~{\errmessage{% \next % \end{macrocode} % -% \subsection{Extending allocators} -% -% The ability to extend \TeX{}'s allocation routine to allow for \eTeX{} has -% been around since 1997 in the \pkg{etex} package. -% Loading this support is delayed until here as we are now sure that the -% \eTeX{} extensions and \tn{pdfstrcmp} or equivalent are available. Thus -% there is no danger of an \enquote{uncontrolled} error if the engine -% requirements are not met. -% -% For \LaTeXe{} we need to make sure that the extended pool is being used: -% \pkg{expl3} uses a lot of registers. For formats from 2015 onward there is -% nothing to do as this is automatic. For older formats, the \pkg{etex} -% package needs to be loaded to do the job. In that case, some inserts are -% reserved also as these have to be from the standard pool. Note that -% \tn{reserveinserts} is \tn{outer} and so is accessed here by csname. In -% earlier versions, loading \pkg{etex} was done directly and so -% \tn{reserveinserts} appeared in the code: this then required a \tn{relax} -% after \tn{RequirePackage} to prevent an error with \enquote{unsafe} -% definitions as seen for example with \pkg{capoptions}. The optional loading -% here is done using a group and \tn{ifx} test as we are not quite in the -% position to have a single name for \tn{pdfstrcmp} just yet. -% \begin{macrocode} -\begingroup - \def\@tempa{LaTeX2e}% - \def\next{}% - \ifx\fmtname\@tempa - \expandafter\ifx\csname extrafloats\endcsname\relax - \def\next - {% - \RequirePackage{etex}% - \csname reserveinserts\endcsname{32}% - }% - \fi - \fi -\expandafter\endgroup -\next -% \end{macrocode} -% % \subsection{The \LaTeX3 code environment} % % The code environment is now set up. diff --git a/macros/latex/contrib/l3kernel/l3box.dtx b/macros/latex/contrib/l3kernel/l3box.dtx index 33b46834db..63cd2ac51a 100644 --- a/macros/latex/contrib/l3kernel/l3box.dtx +++ b/macros/latex/contrib/l3kernel/l3box.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3candidates.dtx b/macros/latex/contrib/l3kernel/l3candidates.dtx index 4bbdc84bbb..3f25a76e88 100644 --- a/macros/latex/contrib/l3kernel/l3candidates.dtx +++ b/macros/latex/contrib/l3kernel/l3candidates.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3cctab.dtx b/macros/latex/contrib/l3kernel/l3cctab.dtx index 18dbc69238..7d6c2ec300 100644 --- a/macros/latex/contrib/l3kernel/l3cctab.dtx +++ b/macros/latex/contrib/l3kernel/l3cctab.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3clist.dtx b/macros/latex/contrib/l3kernel/l3clist.dtx index ff4f9f7197..5abf32d8f0 100644 --- a/macros/latex/contrib/l3kernel/l3clist.dtx +++ b/macros/latex/contrib/l3kernel/l3clist.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3coffins.dtx b/macros/latex/contrib/l3kernel/l3coffins.dtx index 66f601180d..759672403c 100644 --- a/macros/latex/contrib/l3kernel/l3coffins.dtx +++ b/macros/latex/contrib/l3kernel/l3coffins.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3color.dtx b/macros/latex/contrib/l3kernel/l3color.dtx index e931d0b871..047467075c 100644 --- a/macros/latex/contrib/l3kernel/l3color.dtx +++ b/macros/latex/contrib/l3kernel/l3color.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3debug.dtx b/macros/latex/contrib/l3kernel/l3debug.dtx index c0475ede4e..79039b4773 100644 --- a/macros/latex/contrib/l3kernel/l3debug.dtx +++ b/macros/latex/contrib/l3kernel/l3debug.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3deprecation.dtx b/macros/latex/contrib/l3kernel/l3deprecation.dtx index c1fe0db03a..f9c788a097 100644 --- a/macros/latex/contrib/l3kernel/l3deprecation.dtx +++ b/macros/latex/contrib/l3kernel/l3deprecation.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3doc.dtx b/macros/latex/contrib/l3kernel/l3doc.dtx index 6056a215d0..039ee830a8 100644 --- a/macros/latex/contrib/l3kernel/l3doc.dtx +++ b/macros/latex/contrib/l3kernel/l3doc.dtx @@ -85,7 +85,7 @@ and all files in that bundle must be distributed together. % require you to do updates, if the class changes.}} % % \author{\Team} -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % \maketitle % \tableofcontents % diff --git a/macros/latex/contrib/l3kernel/l3doc.pdf b/macros/latex/contrib/l3kernel/l3doc.pdf Binary files differindex e4f681f131..a83c0c03df 100644 --- a/macros/latex/contrib/l3kernel/l3doc.pdf +++ b/macros/latex/contrib/l3kernel/l3doc.pdf diff --git a/macros/latex/contrib/l3kernel/l3docstrip.dtx b/macros/latex/contrib/l3kernel/l3docstrip.dtx index e58953c8bb..deff694c40 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.dtx +++ b/macros/latex/contrib/l3kernel/l3docstrip.dtx @@ -63,7 +63,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3docstrip.pdf b/macros/latex/contrib/l3kernel/l3docstrip.pdf Binary files differindex 194e4f8e35..1f63b51479 100644 --- a/macros/latex/contrib/l3kernel/l3docstrip.pdf +++ b/macros/latex/contrib/l3kernel/l3docstrip.pdf diff --git a/macros/latex/contrib/l3kernel/l3expan.dtx b/macros/latex/contrib/l3kernel/l3expan.dtx index 8e6e06deeb..28ac1c8123 100644 --- a/macros/latex/contrib/l3kernel/l3expan.dtx +++ b/macros/latex/contrib/l3kernel/l3expan.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -1043,18 +1043,10 @@ % \end{macro} % % \begin{macro}[EXP]{\::e} -% With the \tn{expanded} primitive available, just expand. Otherwise -% defer to \cs{exp_args:Ne} implemented later. +% With the \tn{expanded} primitive available, just expand. % \begin{macrocode} -\cs_if_exist:NTF \tex_expanded:D - { - \cs_new:Npn \::e #1 \::: #2#3 - { \tex_expanded:D { \exp_not:n { #1 \::: } { \exp_not:n {#2} {#3} } } } - } - { - \cs_new:Npn \::e #1 \::: #2#3 - { \exp_args:Ne \@@_arg_next:nnn {#3} {#1} {#2} } - } +\cs_new:Npn \::e #1 \::: #2#3 + { \tex_expanded:D { \exp_not:n { #1 \::: } { \exp_not:n {#2} {#3} } } } % \end{macrocode} % \end{macro} % @@ -1242,21 +1234,10 @@ % \end{macro} % % \begin{macro}[EXP]{\exp_args:Ne} -% When the \tn{expanded} primitive is available, use it. Otherwise -% use \cs{@@_e:nn}, defined later, to fully expand tokens. +% When the \tn{expanded} primitive is available, use it. % \begin{macrocode} -\cs_if_exist:NTF \tex_expanded:D - { - \cs_new:Npn \exp_args:Ne #1#2 - { \exp_after:wN #1 \tex_expanded:D { {#2} } } - } - { - \cs_new:Npn \exp_args:Ne #1#2 - { - \exp_after:wN #1 \exp_after:wN - { \exp:w \@@_e:nn {#2} { } } - } - } +\cs_new:Npn \exp_args:Ne #1#2 + { \exp_after:wN #1 \tex_expanded:D { {#2} } } % \end{macrocode} % \end{macro} % @@ -1300,16 +1281,12 @@ \exp_after:wN #2 \exp_after:wN { \exp:w \@@_eval_register:c {#3} } } -\cs_if_exist:NTF \tex_expanded:D +\cs_new:Npn \exp_args:NNe #1#2#3 { - \cs_new:Npn \exp_args:NNe #1#2#3 - { - \exp_after:wN #1 - \exp_after:wN #2 - \tex_expanded:D { {#3} } - } + \exp_after:wN #1 + \exp_after:wN #2 + \tex_expanded:D { {#3} } } - { \cs_new:Npn \exp_args:NNe { \::N \::e \::: } } \cs_new:Npn \exp_args:NNf #1#2#3 { \exp_after:wN #1 @@ -1428,15 +1405,8 @@ \exp_after:wN \@@_arg_last_unbraced:nn \exp_after:wN { \exp:w \@@_eval_register:c {#2} } {#1} } -\cs_if_exist:NTF \tex_expanded:D - { - \cs_new:Npn \::e_unbraced \::: #1#2 - { \tex_expanded:D { \exp_not:n {#1} #2 } } - } - { - \cs_new:Npn \::e_unbraced \::: #1#2 - { \exp:w \@@_e:nn {#2} {#1} } - } +\cs_new:Npn \::e_unbraced \::: #1#2 + { \tex_expanded:D { \exp_not:n {#1} #2 } } \cs_new:Npn \::f_unbraced \::: #1#2 { \exp_after:wN \@@_arg_last_unbraced:nn @@ -1487,12 +1457,8 @@ { \exp_after:wN #1 \exp:w \@@_eval_register:N #2 } \cs_new:Npn \exp_last_unbraced:Nv #1#2 { \exp_after:wN #1 \exp:w \@@_eval_register:c {#2} } -\cs_if_exist:NTF \tex_expanded:D - { - \cs_new:Npn \exp_last_unbraced:Ne #1#2 - { \exp_after:wN #1 \tex_expanded:D {#2} } - } - { \cs_new:Npn \exp_last_unbraced:Ne { \::e_unbraced \::: } } +\cs_new:Npn \exp_last_unbraced:Ne #1#2 + { \exp_after:wN #1 \tex_expanded:D {#2} } \cs_new:Npn \exp_last_unbraced:Nf #1#2 { \exp_after:wN #1 \exp:w \exp_end_continue_f:w #2 } \cs_new:Npn \exp_last_unbraced:NNo #1#2#3 @@ -1591,15 +1557,8 @@ % \begin{macrocode} \cs_new:Npn \exp_not:c #1 { \exp_after:wN \exp_not:N \cs:w #1 \cs_end: } \cs_new:Npn \exp_not:o #1 { \__kernel_exp_not:w \exp_after:wN {#1} } -\cs_if_exist:NTF \tex_expanded:D - { - \cs_new:Npn \exp_not:e #1 - { \__kernel_exp_not:w \tex_expanded:D { {#1} } } - } - { - \cs_new:Npn \exp_not:e - { \__kernel_exp_not:w \exp_args:Ne \prg_do_nothing: } - } +\cs_new:Npn \exp_not:e #1 + { \__kernel_exp_not:w \tex_expanded:D { {#1} } } \cs_new:Npn \exp_not:f #1 { \__kernel_exp_not:w \exp_after:wN { \exp:w \exp_end_continue_f:w #1 } } \cs_new:Npn \exp_not:V #1 @@ -1685,475 +1644,6 @@ % \end{macro} % \end{macro} % -% -% \subsection{Emulating \texttt{e}-type expansion} -% -% When the \tn{expanded} primitive is available it is used to implement -% \texttt{e}-type expansion; otherwise we emulate it. -% -% \begin{macrocode} -\cs_if_exist:NF \tex_expanded:D - { -% \end{macrocode} -% -% \begin{macro}[EXP]{\@@_e:nn, \@@_e_end:nn} -% Repeatedly expand tokens, keeping track of fully-expanded tokens in -% the second argument to \cs{@@_e:nn}; this function eventually -% calls \cs{@@_e_end:nn} to leave \cs{exp_end:} in the input -% stream, followed by the result of the expansion. There are many -% special cases: spaces, brace groups, \tn{noexpand}, \tn{unexpanded}, -% \tn{the}, \tn{primitive}. -% While we use brace tricks \cs{if_false:} |{| \cs{fi:}, the expansion -% of this function is always triggered by \cs{exp:w} so brace balance -% is eventually restored after that is hit with a single step of -% expansion. Otherwise we could not nest \texttt{e}-type expansions -% within each other. -% \begin{macrocode} - \cs_new:Npn \@@_e:nn #1 - { - \if_false: { \fi: - \tl_if_head_is_N_type:nTF {#1} - { \@@_e:N } - { - \tl_if_head_is_group:nTF {#1} - { \@@_e_group:n } - { - \tl_if_empty:nTF {#1} - { \exp_after:wN \@@_e_end:nn } - { \exp_after:wN \@@_e_space:nn } - \exp_after:wN { \if_false: } \fi: - } - } - #1 - } - } - \cs_new:Npn \@@_e_end:nn #1#2 { \exp_end: #2 } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_e_space:nn} -% For an explicit space character, remove it by \texttt{f}-expansion -% and put it in the (future) output. -% \begin{macrocode} - \cs_new:Npn \@@_e_space:nn #1#2 - { \exp_args:Nf \@@_e:nn {#1} { #2 ~ } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_e_group:n, \@@_e_put:nn, \@@_e_put:nnn} -% For a group, expand its contents, wrap it in two pairs of braces, -% and call \cs{@@_e_put:nn}. This function places the first item (the -% double-brace wrapped result) into the output. Importantly, -% \cs{tl_head:n} works even if the input contains quarks. -% \begin{macrocode} - \cs_new:Npn \@@_e_group:n #1 - { - \exp_after:wN \@@_e_put:nn - \exp_after:wN { \exp_after:wN { \exp_after:wN { - \exp:w \if_false: } \fi: \@@_e:nn {#1} { } } } - } - \cs_new:Npn \@@_e_put:nn #1 - { - \exp_args:NNo \exp_args:No \@@_e_put:nnn - { \tl_head:n {#1} } {#1} - } - \cs_new:Npn \@@_e_put:nnn #1#2#3 - { \exp_args:No \@@_e:nn { \use_none:n #2 } { #3 #1 } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP] -% {\@@_e:N, \@@_e:Nnn, \@@_e_protected:Nnn, \@@_e_expandable:Nnn} -% For an \texttt{N}-type token, call \cs{@@_e:Nnn} with arguments the -% \meta{first token}, the remaining tokens to expand and what's -% already been expanded. If the \meta{first token} is non-expandable, -% including \tn{protected} (\tn{long} or not) macros, it is put in the -% result by \cs{@@_e_protected:Nnn}. The four special primitives -% \tn{unexpanded}, \tn{noexpand}, \tn{the}, \tn{primitive} are -% detected; otherwise the token is expanded by -% \cs{@@_e_expandable:Nnn}. -% \begin{macrocode} - \cs_new:Npn \@@_e:N #1 - { - \exp_after:wN \@@_e:Nnn - \exp_after:wN #1 - \exp_after:wN { \if_false: } \fi: - } - \cs_new:Npn \@@_e:Nnn #1 - { - \if_case:w - \exp_after:wN \if_meaning:w \exp_not:N #1 #1 1 ~ \fi: - \token_if_protected_macro:NT #1 { 1 ~ } - \token_if_protected_long_macro:NT #1 { 1 ~ } - \if_meaning:w \exp_not:n #1 2 ~ \fi: - \if_meaning:w \exp_not:N #1 3 ~ \fi: - \if_meaning:w \tex_the:D #1 4 ~ \fi: - \if_meaning:w \tex_primitive:D #1 5 ~ \fi: - 0 ~ - \exp_after:wN \@@_e_expandable:Nnn - \or: \exp_after:wN \@@_e_protected:Nnn - \or: \exp_after:wN \@@_e_unexpanded:Nnn - \or: \exp_after:wN \@@_e_noexpand:Nnn - \or: \exp_after:wN \@@_e_the:Nnn - \or: \exp_after:wN \@@_e_primitive:Nnn - \fi: - #1 - } - \cs_new:Npn \@@_e_protected:Nnn #1#2#3 - { \@@_e:nn {#2} { #3 #1 } } - \cs_new:Npn \@@_e_expandable:Nnn #1#2 - { \exp_args:No \@@_e:nn { #1 #2 } } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP] -% { -% \@@_e_primitive:Nnn, -% \@@_e_primitive_aux:NNw, -% \@@_e_primitive_aux:NNnn, -% \@@_e_primitive_other:NNnn, -% \@@_e_primitive_other_aux:nNNnn -% } -% We don't try hard to make sensible error recovery since the error -% recovery of \cs{tex_primitive:D} when followed by something else -% than a primitive depends on the engine. The only valid case is when -% what follows is \texttt{N}-type. Then distinguish special -% primitives \tn{unexpanded}, \tn{noexpand}, \tn{the}, \tn{primitive} -% from other primitives. In the \enquote{other} case, the only -% reasonable way to check if the primitive that follows -% \cs{tex_primitive:D} is expandable is to expand and compare the -% before-expansion and after-expansion results. If they coincide then -% probably the primitive is non-expandable and should be put in the -% output together with \cs{tex_primitive:D} (one can cook up contrived -% counter-examples where the true \tn{expanded} would have an infinite -% loop), and otherwise one should continue expanding. -% \begin{macrocode} - \cs_new:Npn \@@_e_primitive:Nnn #1#2 - { - \if_false: { \fi: - \tl_if_head_is_N_type:nTF {#2} - { \@@_e_primitive_aux:NNw #1 } - { - \msg_expandable_error:nnn { kernel } { e-type } - { Missing~primitive~name } - \@@_e_primitive_aux:NNw #1 \c_empty_tl - } - #2 - } - } - \cs_new:Npn \@@_e_primitive_aux:NNw #1#2 - { - \exp_after:wN \@@_e_primitive_aux:NNnn - \exp_after:wN #1 - \exp_after:wN #2 - \exp_after:wN { \if_false: } \fi: - } - \cs_new:Npn \@@_e_primitive_aux:NNnn #1#2 - { - \exp_args:Nf \str_case_e:nnTF { \cs_to_str:N #2 } - { - { unexpanded } { \@@_e_unexpanded:Nnn \exp_not:n } - { noexpand } { \@@_e_noexpand:Nnn \exp_not:N } - { the } { \@@_e_the:Nnn \tex_the:D } - { - \sys_if_engine_xetex:T { pdf } - \sys_if_engine_luatex:T { pdf } - primitive - } { \@@_e_primitive:Nnn #1 } - } - { \@@_e_primitive_other:NNnn #1 #2 } - } - \cs_new:Npn \@@_e_primitive_other:NNnn #1#2#3 - { - \exp_args:No \@@_e_primitive_other_aux:nNNnn - { #1 #2 #3 } - #1 #2 {#3} - } - \cs_new:Npn \@@_e_primitive_other_aux:nNNnn #1#2#3#4#5 - { - \str_if_eq:nnTF {#1} { #2 #3 #4 } - { \@@_e:nn {#4} { #5 #2 #3 } } - { \@@_e:nn {#1} {#5} } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_e_noexpand:Nnn} -% The \tn{noexpand} primitive has no effect when followed by a token -% that is not \texttt{N}-type; otherwise \cs{@@_e_put:nn} can grab the -% next token and put it in the result unchanged. -% \begin{macrocode} - \cs_new:Npn \@@_e_noexpand:Nnn #1#2 - { - \tl_if_head_is_N_type:nTF {#2} - { \@@_e_put:nn } { \@@_e:nn } {#2} - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP] -% { -% \@@_e_unexpanded:Nnn, \@@_e_unexpanded:nn, -% \@@_e_unexpanded:nN, \@@_e_unexpanded:N -% } -% The \tn{unexpanded} primitive expands and ignores any space, -% \cs{scan_stop:}, or token affected by \cs{exp_not:N}, then expects a -% brace group. Since we only support brace-balanced token lists it is -% impossible to support the case where the argument of \tn{unexpanded} -% starts with an implicit brace. Even though we want to expand and -% ignore spaces we cannot blindly \texttt{f}-expand because tokens -% affected by \cs{exp_not:N} should discarded without being expanded -% further. -% -% As usual distinguish four cases: brace group (the normal case, where -% we just put the item in the result), space (just \texttt{f}-expand -% to remove the space), empty (an error), or \texttt{N}-type -% \meta{token}. In the last case call \cs{@@_e_unexpanded:nN} -% triggered by an \texttt{f}-expansion. Having a non-expandable -% \meta{token} after \tn{unexpanded} is an error (we recover by -% passing |{}| to \tn{unexpanded}; this is different from \TeX{} -% because the error recovery of \tn{unexpanded} changes the balance of -% braces), unless that \meta{token} is \cs{scan_stop:} or a space -% (recall that we don't implement the case of an implicit begin-group -% token). An expandable \meta{token} is instead expanded, unless it -% is \tn{noexpand}. The latter primitive can be followed by an expandable -% \texttt{N}-type token (removed), by a non-expandable one (kept -% and later causing an error), by a space (removed by -% \texttt{f}-expansion), or by a brace group or nothing (later causing -% an error). -% \begin{macrocode} - \cs_new:Npn \@@_e_unexpanded:Nnn #1 { \@@_e_unexpanded:nn } - \cs_new:Npn \@@_e_unexpanded:nn #1 - { - \tl_if_head_is_N_type:nTF {#1} - { - \exp_args:Nf \@@_e_unexpanded:nn - { \@@_e_unexpanded:nN {#1} #1 } - } - { - \tl_if_head_is_group:nTF {#1} - { \@@_e_put:nn } - { - \tl_if_empty:nTF {#1} - { - \msg_expandable_error:nnn - { kernel } { e-type } - { \unexpanded missing~brace } - \@@_e_end:nn - } - { \exp_args:Nf \@@_e_unexpanded:nn } - } - {#1} - } - } - \cs_new:Npn \@@_e_unexpanded:nN #1#2 - { - \exp_after:wN \if_meaning:w \exp_not:N #2 #2 - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { - \token_if_eq_catcode:NNTF #2 \c_space_token - { \exp_stop_f: } - { - \token_if_eq_meaning:NNTF #2 \scan_stop: - { \exp_stop_f: } - { - \msg_expandable_error:nnn - { kernel } { e-type } - { \unexpanded missing~brace } - { } - } - } - } - { - \token_if_eq_meaning:NNTF #2 \exp_not:N - { - \exp_args:No \tl_if_head_is_N_type:nT { \use_none:n #1 } - { \@@_e_unexpanded:N } - } - { \exp_after:wN \exp_stop_f: #2 } - } - } - \cs_new:Npn \@@_e_unexpanded:N #1 - { - \exp_after:wN \if_meaning:w \exp_not:N #1 #1 \else: - \exp_after:wN \use_i:nn - \fi: - \exp_stop_f: #1 - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_e_the:Nnn, \@@_e_the:N, \@@_e_the_toks_reg:N} -% Finally implement \tn{the}. Followed by anything other than an -% \texttt{N}-type \meta{token} this causes an error (we just let -% \TeX{} make one), otherwise we test the \meta{token}. If the -% \meta{token} is expandable, expand it. Otherwise it could be any -% kind of register, or things like \tn{numexpr}, so there is no way to -% deal with all cases. Thankfully, only \tn{toks} data needs to be -% protected from expansion since everything else gives a string of -% characters. If the \meta{token} is \tn{toks} we find a number and -% unpack using the |the_toks| functions. If it is a token register we -% unpack it in a brace group and call \cs{@@_e_put:nn} to move it to -% the result. Otherwise we unpack and continue expanding (useless but -% safe) since it is basically impossible to have a handle on where the -% result of \tn{the} ends. -% \begin{macrocode} - \cs_new:Npn \@@_e_the:Nnn #1#2 - { - \tl_if_head_is_N_type:nTF {#2} - { \if_false: { \fi: \@@_e_the:N #2 } } - { \exp_args:No \@@_e:nn { \tex_the:D #2 } } - } - \cs_new:Npn \@@_e_the:N #1 - { - \exp_after:wN \if_meaning:w \exp_not:N #1 #1 - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { - \if_meaning:w \tex_toks:D #1 - \exp_after:wN \@@_e_the_toks:wnn \int_value:w - \exp_after:wN \@@_e_the_toks:n - \exp_after:wN { \int_value:w \if_false: } \fi: - \else: - \@@_e_if_toks_register:NTF #1 - { \exp_after:wN \@@_e_the_toks_reg:N } - { - \exp_after:wN \@@_e:nn \exp_after:wN { - \tex_the:D \if_false: } \fi: - } - \exp_after:wN #1 - \fi: - } - { - \exp_after:wN \@@_e_the:Nnn \exp_after:wN ? - \exp_after:wN { \exp:w \if_false: } \fi: - \exp_after:wN \exp_end: #1 - } - } - \cs_new:Npn \@@_e_the_toks_reg:N #1 - { - \exp_after:wN \@@_e_put:nn \exp_after:wN { - \exp_after:wN { - \tex_the:D \if_false: } \fi: #1 } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_e_the_toks:wnn, \@@_e_the_toks:n, \@@_e_the_toks:N} -% The calling function has applied \cs{int_value:w} so we collect -% digits with \cs{@@_e_the_toks:n} (which gets the token list as an -% argument) and \cs{@@_e_the_toks:N} (which gets the first token in -% case it is \texttt{N}-type). The digits are themselves collected -% into an \cs{int_value:w} argument to \cs{@@_e_the_toks:wnn}. Then -% that function unpacks the \tn{toks}\meta{number} into the result. -% We include |?| because \cs{@@_e_put:nnn} removes one item from its -% second argument. Note that our approach is rather crude: in cases -% like |\the\toks12~34| the first \cs{int_value:w} removes the space -% and we will incorrectly unpack the |\the\toks1234|. -% \begin{macrocode} - \cs_new:Npn \@@_e_the_toks:wnn #1; #2 - { - \exp_args:No \@@_e_put:nnn - { \tex_the:D \tex_toks:D #1 } { ? #2 } - } - \cs_new:Npn \@@_e_the_toks:n #1 - { - \tl_if_head_is_N_type:nTF {#1} - { \exp_after:wN \@@_e_the_toks:N \if_false: { \fi: #1 } } - { ; {#1} } - } - \cs_new:Npn \@@_e_the_toks:N #1 - { - \if_int_compare:w 10 < 9 \token_to_str:N #1 \exp_stop_f: - \exp_after:wN \use_i:nn - \else: - \exp_after:wN \use_ii:nn - \fi: - { - #1 - \exp_after:wN \@@_e_the_toks:n - \exp_after:wN { \if_false: } \fi: - } - { - \exp_after:wN ; - \exp_after:wN { \if_false: } \fi: #1 - } - } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}[EXP]{\@@_e_if_toks_register:NTF} -% \begin{macro}[EXP] -% { -% \@@_e_the_XeTeXinterchartoks:, -% \@@_e_the_errhelp:, -% \@@_e_the_everycr:, -% \@@_e_the_everydisplay:, -% \@@_e_the_everyeof:, -% \@@_e_the_everyhbox:, -% \@@_e_the_everyjob:, -% \@@_e_the_everymath:, -% \@@_e_the_everypar:, -% \@@_e_the_everyvbox:, -% \@@_e_the_output:, -% \@@_e_the_pdfpageattr:, -% \@@_e_the_pdfpageresources:, -% \@@_e_the_pdfpagesattr:, -% \@@_e_the_pdfpkmode: -% } -% We need to detect both \tn{toks} registers like \tn{toks@} in -% \LaTeXe{} and parameters such as \tn{everypar}, as the result of -% unpacking the register should not expand further. Registers are -% found by \cs{token_if_toks_register:NTF} by inspecting the meaning. -% The list of parameters is finite so we just use a -% \cs{cs_if_exist:cTF} test to look up in a table. We abuse -% \cs{cs_to_str:N}'s ability to remove a leading escape character -% whatever it is. -% \begin{macrocode} - \prg_new_conditional:Npnn \@@_e_if_toks_register:N #1 { TF } - { - \token_if_toks_register:NTF #1 { \prg_return_true: } - { - \cs_if_exist:cTF - { - @@_e_the_ - \exp_after:wN \cs_to_str:N - \token_to_meaning:N #1 - : - } { \prg_return_true: } { \prg_return_false: } - } - } - \cs_new_eq:NN \@@_e_the_XeTeXinterchartoks: ? - \cs_new_eq:NN \@@_e_the_errhelp: ? - \cs_new_eq:NN \@@_e_the_everycr: ? - \cs_new_eq:NN \@@_e_the_everydisplay: ? - \cs_new_eq:NN \@@_e_the_everyeof: ? - \cs_new_eq:NN \@@_e_the_everyhbox: ? - \cs_new_eq:NN \@@_e_the_everyjob: ? - \cs_new_eq:NN \@@_e_the_everymath: ? - \cs_new_eq:NN \@@_e_the_everypar: ? - \cs_new_eq:NN \@@_e_the_everyvbox: ? - \cs_new_eq:NN \@@_e_the_output: ? - \cs_new_eq:NN \@@_e_the_pdfpageattr: ? - \cs_new_eq:NN \@@_e_the_pdfpageresources: ? - \cs_new_eq:NN \@@_e_the_pdfpagesattr: ? - \cs_new_eq:NN \@@_e_the_pdfpkmode: ? -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% We are done emulating \texttt{e}-type argument expansion when -% \tn{expanded} is unavailable. -% \begin{macrocode} - } -% \end{macrocode} -% -% % \subsection{Defining function variants} % % \begin{macrocode} @@ -2638,22 +2128,8 @@ } \cs_new_protected:Npn \@@_generate_internal_test_aux:w ##1 #1 ##2 \s_@@_mark ##3 ##4 \s_@@_stop {##3} - \cs_if_exist:NTF \tex_expanded:D - { - \cs_new_eq:NN \@@_generate_internal_test:Nw - \@@_generate_internal_test_aux:w - } - { - \cs_new_protected:Npn \@@_generate_internal_test:Nw ##1 - { - \if_meaning:w \tex_expanded:D ##1 - \exp_after:wN \@@_generate_internal_test_aux:w - \exp_after:wN #1 - \else: - \exp_after:wN \@@_generate_internal_test_aux:w - \fi: - } - } + \cs_new_eq:NN \@@_generate_internal_test:Nw + \@@_generate_internal_test_aux:w } \exp_args:No \@@_tmp:w { \token_to_str:N p } \cs_new_protected:Npn \@@_generate_internal_one_go:NNn #1#2#3 diff --git a/macros/latex/contrib/l3kernel/l3file.dtx b/macros/latex/contrib/l3kernel/l3file.dtx index c5e7fc1df7..4be6f56f80 100644 --- a/macros/latex/contrib/l3kernel/l3file.dtx +++ b/macros/latex/contrib/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -2817,7 +2817,7 @@ % % \begin{macro}[EXP]{\file_full_name:n, \@@_full_name:n, \@@_full_name_aux:n} % \begin{macro}[EXP]{\@@_full_name_auxi:nn, \@@_full_name_auxii:nn} -% \begin{macro}[EXP]{\@@_full_name_aux:Nnn} +% \begin{macro}[EXP]{\@@_full_name_aux:Nnnn} % \begin{macro}[EXP]{\@@_full_name_aux:nN} % \begin{macro}[EXP]{\@@_full_name_aux:nnN} % \begin{macro}[EXP]{\@@_name_cleanup:w} @@ -2887,11 +2887,11 @@ \tl_if_blank:nTF {#2} { \seq_map_tokens:Nn \l_file_search_path_seq - { \@@_full_name_aux:Nnn \seq_map_break:n {#1} } + { \@@_full_name_aux:Nnnn \seq_map_break:n {#1} { / } } \cs_if_exist:NT \input@path { \tl_map_tokens:Nn \input@path - { \@@_full_name_aux:Nnn \tl_map_break:n {#1} } + { \@@_full_name_aux:Nnnn \tl_map_break:n {#1} { } } } \@@_name_end: } @@ -2901,8 +2901,8 @@ % Two pars to the auxiliary here so we can avoid doing quoting % twice in the event we find the right file. % \begin{macrocode} -\cs_new:Npn \@@_full_name_aux:Nnn #1#2#3 - { \exp_args:Ne \@@_full_name_aux:nN { \tl_to_str:n {#3} / #2 } #1 } +\cs_new:Npn \@@_full_name_aux:Nnnn #1#2#3#4 + { \exp_args:Ne \@@_full_name_aux:nN { \tl_to_str:n {#4} #3 #2 } #1 } \cs_new:Npn \@@_full_name_aux:nN #1 { \exp_args:Nne \@@_full_name_aux:nnN {#1} { \@@_full_name_aux:n {#1} } } \cs_new:Npn \@@_full_name_aux:nnN #1 #2 #3 @@ -2958,24 +2958,6 @@ } } % \end{macrocode} -% Deal with the fact that the primitive might not be available. -% \begin{macrocode} -\cs_if_exist:NF \tex_filesize:D - { - \cs_gset:Npn \file_full_name:n #1 - { - \msg_expandable_error:nnn - { kernel } { primitive-not-available } - { \(pdf)filesize } - } - } -\msg_new:nnnn { kernel } { primitive-not-available } - { Primitive~\token_to_str:N #1 not~available } - { - The~version~of~your~TeX~engine~does~not~provide~functionality~equivalent~to~ - the~#1~primitive. - } -% \end{macrocode} % \end{macro} % \end{macro} % \end{macro} @@ -3014,68 +2996,12 @@ \cs_generate_variant:Nn \file_get_full_name:nNF { V } \cs_generate_variant:Nn \file_get_full_name:nNTF { V } % \end{macrocode} -% If \cs{tex_filesize:D} is not available, the -% way to test if a file exists is to try to open it: if it does -% not exist then \TeX{} reports end-of-file. A search is made -% looking at each potential path in turn (starting from the current -% directory). The first location is of course treated as the correct -% one: this is done by jumping to \cs{prg_break_point:}. If nothing -% is found, |#2| is returned empty. A special case when there is no -% extension is that once the first location is found we test the -% existence of the file with |.tex| extension in that directory, and -% if it exists we include the |.tex| extension in the result. -% \begin{macrocode} -\cs_if_exist:NF \tex_filesize:D - { - \prg_set_protected_conditional:Npnn \file_get_full_name:nN #1#2 { T , F , TF } - { - \__kernel_tl_set:Nx \l_@@_base_name_tl - { \__kernel_file_name_sanitize:n {#1} } - \@@_get_full_name_search:nN { } \use:n - \seq_map_inline:Nn \l_file_search_path_seq - { \@@_get_full_name_search:nN { ##1 / } \seq_map_break:n } - \cs_if_exist:NT \input@path - { - \tl_map_inline:Nn \input@path - { \@@_get_full_name_search:nN { ##1 } \tl_map_break:n } - } - \tl_set:Nn \l_@@_full_name_tl { \q_no_value } - \prg_break_point: - \quark_if_no_value:NTF \l_@@_full_name_tl - { - \ior_close:N \g_@@_internal_ior - \prg_return_false: - } - { - \file_parse_full_name:VNNN \l_@@_full_name_tl - \l_@@_dir_str \l_@@_name_str \l_@@_ext_str - \str_if_empty:NT \l_@@_ext_str - { - \__kernel_ior_open:No \g_@@_internal_ior - { \l_@@_full_name_tl .tex } - \ior_if_eof:NF \g_@@_internal_ior - { \tl_put_right:Nn \l_@@_full_name_tl { .tex } } - } - \ior_close:N \g_@@_internal_ior - \tl_set_eq:NN #2 \l_@@_full_name_tl - \prg_return_true: - } - } - } -\cs_new_protected:Npn \@@_get_full_name_search:nN #1#2 - { - \__kernel_tl_set:Nx \l_@@_full_name_tl - { \tl_to_str:n {#1} \l_@@_base_name_tl } - \__kernel_ior_open:No \g_@@_internal_ior \l_@@_full_name_tl - \ior_if_eof:NF \g_@@_internal_ior { #2 { \prg_break: } } - } -% \end{macrocode} % \end{macro} % \end{macro} % \end{macro} +% % \begin{variable}{\g_@@_internal_ior} -% A reserved stream to test for file existence (if required), and for -% opening a shell. +% A reserved stream to test for opening a shell. % \begin{macrocode} \ior_new:N \g_@@_internal_ior % \end{macrocode} @@ -3226,30 +3152,6 @@ { \prg_return_true: } } % \end{macrocode} -% Where the primitive is not available, issue an error: this is a little -% more conservative than absolutely needed, but does work. -% \begin{macrocode} -\cs_if_exist:NF \tex_filesize:D - { - \cs_set_protected:Npn \@@_get_details:nnN #1#2#3 - { - \tl_clear:N #3 - \msg_error:nnx - { kernel } { primitive-not-available } - { - \token_to_str:N \(pdf)file - \str_case:nn {#2} - { - { hex_dump } { dump } - { mdfive_hash } { mdfivesum } - { timestamp } { moddate } - { size } { size } - } - } - \prg_return_false: - } - } -% \end{macrocode} % \end{macro} % \end{macro} % @@ -3328,17 +3230,6 @@ } } \cs_new_eq:NN \@@_timestamp:n \tex_filemoddate:D -\cs_if_exist:NF \@@_timestamp:n - { - \prg_set_conditional:Npnn \file_compare_timestamp:nNn #1#2#3 - { p , T , F , TF } - { - \msg_expandable_error:nnn - { kernel } { primitive-not-available } - { \(pdf)filemoddate } - \prg_return_false: - } - } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/macros/latex/contrib/l3kernel/l3flag.dtx b/macros/latex/contrib/l3kernel/l3flag.dtx index 581b7a7227..80981884fb 100644 --- a/macros/latex/contrib/l3kernel/l3flag.dtx +++ b/macros/latex/contrib/l3kernel/l3flag.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-assign.dtx b/macros/latex/contrib/l3kernel/l3fp-assign.dtx index 1fcd33b8d9..af1b0b98be 100644 --- a/macros/latex/contrib/l3kernel/l3fp-assign.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-assign.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-aux.dtx b/macros/latex/contrib/l3kernel/l3fp-aux.dtx index b18b39218d..e5c3a0f5a2 100644 --- a/macros/latex/contrib/l3kernel/l3fp-aux.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-aux.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-basics.dtx b/macros/latex/contrib/l3kernel/l3fp-basics.dtx index 635ebbcdde..17e2193713 100644 --- a/macros/latex/contrib/l3kernel/l3fp-basics.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-basics.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-convert.dtx b/macros/latex/contrib/l3kernel/l3fp-convert.dtx index 6eb83223ab..fcc2b130e5 100644 --- a/macros/latex/contrib/l3kernel/l3fp-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-convert.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-expo.dtx b/macros/latex/contrib/l3kernel/l3fp-expo.dtx index 99824f74a8..43f1e9e0be 100644 --- a/macros/latex/contrib/l3kernel/l3fp-expo.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-expo.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-extended.dtx b/macros/latex/contrib/l3kernel/l3fp-extended.dtx index ca1372da43..91ff16141e 100644 --- a/macros/latex/contrib/l3kernel/l3fp-extended.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-extended.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-logic.dtx b/macros/latex/contrib/l3kernel/l3fp-logic.dtx index ca76fecb2c..ee89eacb40 100644 --- a/macros/latex/contrib/l3kernel/l3fp-logic.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-logic.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-parse.dtx b/macros/latex/contrib/l3kernel/l3fp-parse.dtx index d3969b735c..082dbaf8ba 100644 --- a/macros/latex/contrib/l3kernel/l3fp-parse.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-parse.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-random.dtx b/macros/latex/contrib/l3kernel/l3fp-random.dtx index 76c797e2eb..c4c718c72a 100644 --- a/macros/latex/contrib/l3kernel/l3fp-random.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-random.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-round.dtx b/macros/latex/contrib/l3kernel/l3fp-round.dtx index 3ece03051c..98584be2f6 100644 --- a/macros/latex/contrib/l3kernel/l3fp-round.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-round.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp-traps.dtx b/macros/latex/contrib/l3kernel/l3fp-traps.dtx index 7c2b5cf957..06630644e0 100644 --- a/macros/latex/contrib/l3kernel/l3fp-traps.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-traps.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % \maketitle % % \begin{documentation} diff --git a/macros/latex/contrib/l3kernel/l3fp-trig.dtx b/macros/latex/contrib/l3kernel/l3fp-trig.dtx index 991a56ec7a..24ac6a9115 100644 --- a/macros/latex/contrib/l3kernel/l3fp-trig.dtx +++ b/macros/latex/contrib/l3kernel/l3fp-trig.dtx @@ -40,7 +40,7 @@ % {latex-team@latex-project.org}^^A % }^^A % } -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fp.dtx b/macros/latex/contrib/l3kernel/l3fp.dtx index 1d14dba2b6..88c323e415 100644 --- a/macros/latex/contrib/l3kernel/l3fp.dtx +++ b/macros/latex/contrib/l3kernel/l3fp.dtx @@ -49,7 +49,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3fparray.dtx b/macros/latex/contrib/l3kernel/l3fparray.dtx index 7311ad5358..5836d5bee7 100644 --- a/macros/latex/contrib/l3kernel/l3fparray.dtx +++ b/macros/latex/contrib/l3kernel/l3fparray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3int.dtx b/macros/latex/contrib/l3kernel/l3int.dtx index ca095b0359..f7d065d874 100644 --- a/macros/latex/contrib/l3kernel/l3int.dtx +++ b/macros/latex/contrib/l3kernel/l3int.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3intarray.dtx b/macros/latex/contrib/l3kernel/l3intarray.dtx index 3cc0e52578..b671f5e4ed 100644 --- a/macros/latex/contrib/l3kernel/l3intarray.dtx +++ b/macros/latex/contrib/l3kernel/l3intarray.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx index 2bd0c676f0..3542167a7a 100644 --- a/macros/latex/contrib/l3kernel/l3kernel-functions.dtx +++ b/macros/latex/contrib/l3kernel/l3kernel-functions.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3keys.dtx b/macros/latex/contrib/l3kernel/l3keys.dtx index 60645c8363..64a301d906 100644 --- a/macros/latex/contrib/l3kernel/l3keys.dtx +++ b/macros/latex/contrib/l3kernel/l3keys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -1113,26 +1113,14 @@ % The use of \cs{s_@@_mark} here prevents loss of braces from the key % argument. % \begin{macrocode} - \cs_if_exist:NTF \tex_expanded:D + \cs_new:Npn \keyval_parse:nnn ##1 ##2 ##3 { - \cs_new:Npn \keyval_parse:nnn ##1 ##2 ##3 + \__kernel_exp_not:w \tex_expanded:D { - \__kernel_exp_not:w \tex_expanded:D - { - { - \@@_loop_active:nnw {##1} {##2} - \s_@@_mark ##3 #1 \s_@@_tail #1 - } - } - } - } - { - \cs_new:Npn \keyval_parse:nnn ##1 ##2 ##3 - { - \group_align_safe_begin: - \@@_loop_active:nnw {##1} {##2} - \s_@@_mark ##3 #1 \s_@@_tail #1 - \group_align_safe_end: + { + \@@_loop_active:nnw {##1} {##2} + \s_@@_mark ##3 #1 \s_@@_tail #1 + } } } \cs_new_eq:NN \keyval_parse:NNn \keyval_parse:nnn @@ -1415,9 +1403,7 @@ \@@_loop_other:nnw {##2} } } - \cs_if_exist:NTF \tex_expanded:D - { \@@_tmp:w { } { } } - { \@@_tmp:w \group_align_safe_end: \group_align_safe_begin: } + \@@_tmp:w { } { } \group_end: % \end{macrocode} % \end{macro} diff --git a/macros/latex/contrib/l3kernel/l3legacy.dtx b/macros/latex/contrib/l3kernel/l3legacy.dtx index 0b228b4333..aa144fdb29 100644 --- a/macros/latex/contrib/l3kernel/l3legacy.dtx +++ b/macros/latex/contrib/l3kernel/l3legacy.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3luatex.dtx b/macros/latex/contrib/l3kernel/l3luatex.dtx index e73b5cbe7c..048fd472b8 100644 --- a/macros/latex/contrib/l3kernel/l3luatex.dtx +++ b/macros/latex/contrib/l3kernel/l3luatex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3msg.dtx b/macros/latex/contrib/l3kernel/l3msg.dtx index bb739840dc..c256def116 100644 --- a/macros/latex/contrib/l3kernel/l3msg.dtx +++ b/macros/latex/contrib/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -2077,11 +2077,6 @@ { Relation~'#1'~not~among~=,<,>,==,!=,<=,>=. } \msg_new:nnn { kernel } { zero-step } { Zero~step~size~for~function~#1. } -\cs_if_exist:NF \tex_expanded:D - { - \msg_new:nnn { kernel } { e-type } - { #1 ~ in~e-type~argument } - } % \end{macrocode} % % Messages used by the \enquote{\texttt{show}} functions. diff --git a/macros/latex/contrib/l3kernel/l3names.dtx b/macros/latex/contrib/l3kernel/l3names.dtx index 1470671ec6..09ec8a83ba 100644 --- a/macros/latex/contrib/l3kernel/l3names.dtx +++ b/macros/latex/contrib/l3kernel/l3names.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -1333,72 +1333,6 @@ \tex_fi:D \tex_fi:D % \end{macrocode} -% That is also true for the \LuaTeX{} primitives under \LaTeXe{} -% (depending on the format-building date). There are a few primitives -% that get the right names anyway so are missing here! -% \begin{macrocode} -\tex_ifdefined:D \luatexsuppressfontnotfounderror - \tex_let:D \tex_alignmark:D \luatexalignmark - \tex_let:D \tex_aligntab:D \luatexaligntab - \tex_let:D \tex_attribute:D \luatexattribute - \tex_let:D \tex_attributedef:D \luatexattributedef - \tex_let:D \tex_catcodetable:D \luatexcatcodetable - \tex_let:D \tex_clearmarks:D \luatexclearmarks - \tex_let:D \tex_crampeddisplaystyle:D \luatexcrampeddisplaystyle - \tex_let:D \tex_crampedscriptscriptstyle:D - \luatexcrampedscriptscriptstyle - \tex_let:D \tex_crampedscriptstyle:D \luatexcrampedscriptstyle - \tex_let:D \tex_crampedtextstyle:D \luatexcrampedtextstyle - \tex_let:D \tex_fontid:D \luatexfontid - \tex_let:D \tex_formatname:D \luatexformatname - \tex_let:D \tex_gleaders:D \luatexgleaders - \tex_let:D \tex_initcatcodetable:D \luatexinitcatcodetable - \tex_let:D \tex_latelua:D \luatexlatelua - \tex_let:D \tex_luaescapestring:D \luatexluaescapestring - \tex_let:D \tex_luafunction:D \luatexluafunction - \tex_let:D \tex_mathstyle:D \luatexmathstyle - \tex_let:D \tex_nokerns:D \luatexnokerns - \tex_let:D \tex_noligs:D \luatexnoligs - \tex_let:D \tex_outputbox:D \luatexoutputbox - \tex_let:D \tex_pageleftoffset:D \luatexpageleftoffset - \tex_let:D \tex_pagetopoffset:D \luatexpagetopoffset - \tex_let:D \tex_postexhyphenchar:D \luatexpostexhyphenchar - \tex_let:D \tex_posthyphenchar:D \luatexposthyphenchar - \tex_let:D \tex_preexhyphenchar:D \luatexpreexhyphenchar - \tex_let:D \tex_prehyphenchar:D \luatexprehyphenchar - \tex_let:D \tex_savecatcodetable:D \luatexsavecatcodetable - \tex_let:D \tex_scantextokens:D \luatexscantextokens - \tex_let:D \tex_suppressifcsnameerror:D - \luatexsuppressifcsnameerror - \tex_let:D \tex_suppresslongerror:D \luatexsuppresslongerror - \tex_let:D \tex_suppressmathparerror:D - \luatexsuppressmathparerror - \tex_let:D \tex_suppressoutererror:D \luatexsuppressoutererror - \tex_let:D \tex_Uchar:D \luatexUchar - \tex_let:D \tex_suppressfontnotfounderror:D - \luatexsuppressfontnotfounderror -% \end{macrocode} -% Which also covers those slightly odd ones. -% \begin{macrocode} - \tex_let:D \tex_bodydir:D \luatexbodydir - \tex_let:D \tex_boxdir:D \luatexboxdir - \tex_let:D \tex_leftghost:D \luatexleftghost - \tex_let:D \tex_localbrokenpenalty:D \luatexlocalbrokenpenalty - \tex_let:D \tex_localinterlinepenalty:D - \luatexlocalinterlinepenalty - \tex_let:D \tex_localleftbox:D \luatexlocalleftbox - \tex_let:D \tex_localrightbox:D \luatexlocalrightbox - \tex_let:D \tex_mathdir:D \luatexmathdir - \tex_let:D \tex_pagebottomoffset:D \luatexpagebottomoffset - \tex_let:D \tex_pagedir:D \luatexpagedir - \tex_let:D \tex_pageheight:D \luatexpageheight - \tex_let:D \tex_pagerightoffset:D \luatexpagerightoffset - \tex_let:D \tex_pagewidth:D \luatexpagewidth - \tex_let:D \tex_pardir:D \luatexpardir - \tex_let:D \tex_rightghost:D \luatexrightghost - \tex_let:D \tex_textdir:D \luatextextdir -\tex_fi:D -% \end{macrocode} % Only \pdfTeX{} and \LuaTeX{} define \tn{pdfmapfile} and \tn{pdfmapline}: % Tidy up the fact that some format-building processes leave % a couple of questionable decisions about that! @@ -1440,16 +1374,6 @@ \tex_fi:D \tex_endgroup:D % \end{macrocode} -% Up to v0.80, \LuaTeX{} defines the \pdfTeX{} version data: rather -% confusing. Removing them means that \cs{tex_pdftexversion:D} is -% a marker for \pdfTeX{} alone: useful in engine-dependent code later. -% \begin{macrocode} -\tex_ifdefined:D \tex_luatexversion:D - \tex_let:D \tex_pdftexbanner:D \tex_undefined:D - \tex_let:D \tex_pdftexrevision:D \tex_undefined:D - \tex_let:D \tex_pdftexversion:D \tex_undefined:D -\tex_fi:D -% \end{macrocode} % \pkg{cslatex} moves a couple of primitives which we recover here; as there % is no other marker, we can only work by looking for the names. % \begin{macrocode} diff --git a/macros/latex/contrib/l3kernel/l3news.pdf b/macros/latex/contrib/l3kernel/l3news.pdf Binary files differindex 636a6e0ec5..71a9e6840e 100644 --- a/macros/latex/contrib/l3kernel/l3news.pdf +++ b/macros/latex/contrib/l3kernel/l3news.pdf diff --git a/macros/latex/contrib/l3kernel/l3news01.pdf b/macros/latex/contrib/l3kernel/l3news01.pdf Binary files differindex 3f72f1e5b3..6a994a24c1 100644 --- a/macros/latex/contrib/l3kernel/l3news01.pdf +++ b/macros/latex/contrib/l3kernel/l3news01.pdf diff --git a/macros/latex/contrib/l3kernel/l3news02.pdf b/macros/latex/contrib/l3kernel/l3news02.pdf Binary files differindex ae10be53a6..5e76c8d5aa 100644 --- a/macros/latex/contrib/l3kernel/l3news02.pdf +++ b/macros/latex/contrib/l3kernel/l3news02.pdf diff --git a/macros/latex/contrib/l3kernel/l3news03.pdf b/macros/latex/contrib/l3kernel/l3news03.pdf Binary files differindex ff4daf4033..9c38abc8c8 100644 --- a/macros/latex/contrib/l3kernel/l3news03.pdf +++ b/macros/latex/contrib/l3kernel/l3news03.pdf diff --git a/macros/latex/contrib/l3kernel/l3news04.pdf b/macros/latex/contrib/l3kernel/l3news04.pdf Binary files differindex 57731785c3..1b410c1ef8 100644 --- a/macros/latex/contrib/l3kernel/l3news04.pdf +++ b/macros/latex/contrib/l3kernel/l3news04.pdf diff --git a/macros/latex/contrib/l3kernel/l3news05.pdf b/macros/latex/contrib/l3kernel/l3news05.pdf Binary files differindex 1c51600729..c3fb4f022b 100644 --- a/macros/latex/contrib/l3kernel/l3news05.pdf +++ b/macros/latex/contrib/l3kernel/l3news05.pdf diff --git a/macros/latex/contrib/l3kernel/l3news06.pdf b/macros/latex/contrib/l3kernel/l3news06.pdf Binary files differindex c170a56ff6..951757da63 100644 --- a/macros/latex/contrib/l3kernel/l3news06.pdf +++ b/macros/latex/contrib/l3kernel/l3news06.pdf diff --git a/macros/latex/contrib/l3kernel/l3news07.pdf b/macros/latex/contrib/l3kernel/l3news07.pdf Binary files differindex 3fa83fddad..fee9bbf2df 100644 --- a/macros/latex/contrib/l3kernel/l3news07.pdf +++ b/macros/latex/contrib/l3kernel/l3news07.pdf diff --git a/macros/latex/contrib/l3kernel/l3news08.pdf b/macros/latex/contrib/l3kernel/l3news08.pdf Binary files differindex c3a95d78de..a858a42c43 100644 --- a/macros/latex/contrib/l3kernel/l3news08.pdf +++ b/macros/latex/contrib/l3kernel/l3news08.pdf diff --git a/macros/latex/contrib/l3kernel/l3news09.pdf b/macros/latex/contrib/l3kernel/l3news09.pdf Binary files differindex c4902677af..c043e68add 100644 --- a/macros/latex/contrib/l3kernel/l3news09.pdf +++ b/macros/latex/contrib/l3kernel/l3news09.pdf diff --git a/macros/latex/contrib/l3kernel/l3news10.pdf b/macros/latex/contrib/l3kernel/l3news10.pdf Binary files differindex 3f1f303dc5..02e724712d 100644 --- a/macros/latex/contrib/l3kernel/l3news10.pdf +++ b/macros/latex/contrib/l3kernel/l3news10.pdf diff --git a/macros/latex/contrib/l3kernel/l3news11.pdf b/macros/latex/contrib/l3kernel/l3news11.pdf Binary files differindex 623bb991d2..a521a6ca25 100644 --- a/macros/latex/contrib/l3kernel/l3news11.pdf +++ b/macros/latex/contrib/l3kernel/l3news11.pdf diff --git a/macros/latex/contrib/l3kernel/l3news12.pdf b/macros/latex/contrib/l3kernel/l3news12.pdf Binary files differindex ad090e333b..166cdf0386 100644 --- a/macros/latex/contrib/l3kernel/l3news12.pdf +++ b/macros/latex/contrib/l3kernel/l3news12.pdf diff --git a/macros/latex/contrib/l3kernel/l3pdf.dtx b/macros/latex/contrib/l3kernel/l3pdf.dtx index f3e7834b6e..0a76fc54e0 100644 --- a/macros/latex/contrib/l3kernel/l3pdf.dtx +++ b/macros/latex/contrib/l3kernel/l3pdf.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3prefixes.csv b/macros/latex/contrib/l3kernel/l3prefixes.csv index 00e59e10de..410b927d89 100644 --- a/macros/latex/contrib/l3kernel/l3prefixes.csv +++ b/macros/latex/contrib/l3kernel/l3prefixes.csv @@ -39,8 +39,10 @@ classics,classics,Eduardo C. Lourenço de Lima,,,,2013-03-16,2013-03-16, clist,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2012-09-27, cmd,latex2e,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex2e.git,https://github.com/latex3/latex2e/issues,2021-01-20,2021-03-03, code,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2021-04-23,2021-04-23, +codedesc,codedescribe,Alceu Frigeri,https://github.com/alceu-frigeri/codedescribe,https://github.com/alceu-frigeri/codedescribe,https://github.com/alceu-frigeri/codedescribe/issues,2023-05-15,2023-05-15, codedoc,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2012-09-27,Somewhat experimental: may change codehigh,codehigh,Jianrui Lyu,https://github.com/lvjr/codehigh,https://github.com/lvjr/codehigh.git,https://github.com/lvjr/codehigh/issues,2022-04-02,2022-04-02, +codelist,codelisting,Alceu Frigeri,https://github.com/alceu-frigeri/codedescribe,https://github.com/alceu-frigeri/codedescribe,https://github.com/alceu-frigeri/codedescribe/issues,2023-05-15,2023-05-15, codepoint,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2012-09-27, coffin,"l3kernel,xcoffins",The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2012-09-27, colon,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2018-05-12,2018-05-12, @@ -208,6 +210,7 @@ reverse,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,htt right,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2018-05-12,2018-05-12, rivbook,rivbook,Julien Rivaud,,,,2018-06-13,2018-06-14, rivmath,rivmath,Julien Rivaud,,,,2018-06-13,2018-06-13, +sanuml,sanitize-umlaut,Thomas F. Sturm,https://github.com/T-F-S/sanitize-umlaut,https://github.com/T-F-S/sanitize-umlaut.git,https://github.com/T-F-S/sanitize-umlaut/issues,2022-07-19,2022-07-19, scan,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2012-09-27, schulma,schulmathematik,Keno Wehr,https://ctan.org/pkg/schulmathematik,,,2021-08-23,2021-08-23, scontents,scontents,Pablo González,https://github.com/pablgonz/scontents,git@github.com:pablgonz/scontents.git,https://github.com/pablgonz/scontents/issues,2019-12-05,2019-12-05, @@ -221,6 +224,7 @@ skel,skeldoc,Magnus Lie Hetland,https://github.com/mlhetland/skeldoc.sty,https:/ skip,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2012-09-27, sort,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2012-09-27,2017-02-13, space,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2018-05-12,2018-05-12, +starray,starray,Alceu Frigeri,https://github.com/alceu-frigeri/starray,https://github.com/alceu-frigeri/starray,https://github.com/alceu-frigeri/starray/issues,2023-05-15,2023-05-15, statistics,statistics,Julien Rivaud,https://gitlab.com/frnchfrgg-latex/statistics,https://gitlab.com/frnchfrgg-latex/statistics.git,https://gitlab.com/frnchfrgg-latex/statistics/issues,2018-06-25,2018-06-25, stm,lt3-stm,CV Radhakrishnan,http://www.cvr.cc/,,,2014-02-26,2014-02-26, stop,l3kernel,The LaTeX Project,https://www.latex-project.org/latex3.html,https://github.com/latex3/latex3.git,https://github.com/latex3/latex3/issues,2018-05-12,2018-05-12, diff --git a/macros/latex/contrib/l3kernel/l3prefixes.pdf b/macros/latex/contrib/l3kernel/l3prefixes.pdf Binary files differindex d3204c1c37..b065870c91 100644 --- a/macros/latex/contrib/l3kernel/l3prefixes.pdf +++ b/macros/latex/contrib/l3kernel/l3prefixes.pdf diff --git a/macros/latex/contrib/l3kernel/l3prg.dtx b/macros/latex/contrib/l3kernel/l3prg.dtx index 83b2904740..c1d42e10be 100644 --- a/macros/latex/contrib/l3kernel/l3prg.dtx +++ b/macros/latex/contrib/l3kernel/l3prg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3prop.dtx b/macros/latex/contrib/l3kernel/l3prop.dtx index 297fcd877f..341b46bdff 100644 --- a/macros/latex/contrib/l3kernel/l3prop.dtx +++ b/macros/latex/contrib/l3kernel/l3prop.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -1087,66 +1087,31 @@ % have to make sure that the behaviour is as good as possible. Using a space % before the opening brace we get the correct brace stripping behaviour for % most of the key--value parsers available in \LaTeX. -% If \cs{tex_expanded:D} is available this function makes use of it, so there -% are two different implementations here. They both start with -% \cs{__kernel_exp_not:w} to start the expansion context to expand in two -% steps. If the \meta{property list} is empty they just leave an empty set of -% braces in the input stream for \cs{__kernel_exp_not:w}. -% \begin{macrocode} -\cs_if_exist:NTF \tex_expanded:D - { -% \end{macrocode} -% The variant using \cs{tex_expanded:D} can just iterate over the +% Iterate over the % \meta{property list} and remove the leading comma afterwards. Only the value % has to be protected in \cs{__kernel_exp_not:w} as the property name is % always a string. After the loop the leading comma is removed by % \cs{use_none:n} and afterwards \cs{__kernel_exp_not:w} eventually finds the % opening brace of its argument. % \begin{macrocode} - \cs_new:Npn \prop_to_keyval:N #1 - { - \__kernel_exp_not:w - \prop_if_empty:NTF #1 - { {} } - { - \exp_after:wN \exp_after:wN \exp_after:wN +\cs_new:Npn \prop_to_keyval:N #1 + { + \__kernel_exp_not:w + \prop_if_empty:NTF #1 + { {} } + { + \exp_after:wN \exp_after:wN \exp_after:wN + { + \tex_expanded:D { - \tex_expanded:D - { - \__kernel_exp_not:w { \use_none:n } - \prop_map_function:NN #1 \@@_to_keyval:nn - } + \__kernel_exp_not:w { \use_none:n } + \prop_map_function:NN #1 \@@_to_keyval:nn } - } - } - \cs_new:Npn \@@_to_keyval:nn #1#2 - { , ~ {#1} =~ { \__kernel_exp_not:w {#2} } } - } -% \end{macrocode} -% The other variant will iterate over the \meta{property list} and has to -% output the result in a group after the marker -% \cs{@@_to_keyval_exp_after:wN}. As a result this is considerably slower than -% the \cs{tex_expanded:D} using variant as it has to read the entire contents -% of the \meta{property list} for each item. Since the marker is just -% \cs{exp_after:wN} with another name, after the loop the leading comma is -% gobbled by \cs{use_none:n}, leaving the result as the argument to -% \cs{__kernel_exp_not:w}. -% \begin{macrocode} - { - \cs_new:Npn \prop_to_keyval:N #1 - { - \__kernel_exp_not:w - \prop_if_empty:NTF #1 - { {} } - { - \prop_map_function:NN #1 \@@_to_keyval:nnw - \@@_to_keyval_exp_after:wN { \use_none:n } - } - } - \cs_new_eq:NN \@@_to_keyval_exp_after:wN \exp_after:wN - \cs_new:Npn \@@_to_keyval:nnw #1#2#3 \@@_to_keyval_exp_after:wN #4 - { #3 \@@_to_keyval_exp_after:wN { #4 , ~ {#1} =~ {#2} } } + } + } } +\cs_new:Npn \@@_to_keyval:nn #1#2 + { , ~ {#1} =~ { \__kernel_exp_not:w {#2} } } % \end{macrocode} % \end{macro} % \end{macro} diff --git a/macros/latex/contrib/l3kernel/l3quark.dtx b/macros/latex/contrib/l3kernel/l3quark.dtx index fda47356ef..67a431db2f 100644 --- a/macros/latex/contrib/l3kernel/l3quark.dtx +++ b/macros/latex/contrib/l3kernel/l3quark.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3regex.dtx b/macros/latex/contrib/l3kernel/l3regex.dtx index 46629fc8d6..629acfbf44 100644 --- a/macros/latex/contrib/l3kernel/l3regex.dtx +++ b/macros/latex/contrib/l3kernel/l3regex.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3seq.dtx b/macros/latex/contrib/l3kernel/l3seq.dtx index d5d0a52146..601083909e 100644 --- a/macros/latex/contrib/l3kernel/l3seq.dtx +++ b/macros/latex/contrib/l3kernel/l3seq.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3skip.dtx b/macros/latex/contrib/l3kernel/l3skip.dtx index 808807483a..8b2af6bb35 100644 --- a/macros/latex/contrib/l3kernel/l3skip.dtx +++ b/macros/latex/contrib/l3kernel/l3skip.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3sort.dtx b/macros/latex/contrib/l3kernel/l3sort.dtx index 72db7d8c42..5f2b7335bc 100644 --- a/macros/latex/contrib/l3kernel/l3sort.dtx +++ b/macros/latex/contrib/l3kernel/l3sort.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str-convert.dtx b/macros/latex/contrib/l3kernel/l3str-convert.dtx index f71d2cb47e..5608305e28 100644 --- a/macros/latex/contrib/l3kernel/l3str-convert.dtx +++ b/macros/latex/contrib/l3kernel/l3str-convert.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3str.dtx b/macros/latex/contrib/l3kernel/l3str.dtx index e199e98b94..bb7c1e9f23 100644 --- a/macros/latex/contrib/l3kernel/l3str.dtx +++ b/macros/latex/contrib/l3kernel/l3str.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3styleguide.pdf b/macros/latex/contrib/l3kernel/l3styleguide.pdf Binary files differindex bf81491af3..76b087f846 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.pdf +++ b/macros/latex/contrib/l3kernel/l3styleguide.pdf diff --git a/macros/latex/contrib/l3kernel/l3styleguide.tex b/macros/latex/contrib/l3kernel/l3styleguide.tex index 093b2e6e83..5c83920436 100644 --- a/macros/latex/contrib/l3kernel/l3styleguide.tex +++ b/macros/latex/contrib/l3kernel/l3styleguide.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2023-05-11} +\date{Released 2023-05-15} \begin{document} diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf Binary files differindex d5534b9fa4..6f8bc1166d 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.pdf +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.pdf diff --git a/macros/latex/contrib/l3kernel/l3syntax-changes.tex b/macros/latex/contrib/l3kernel/l3syntax-changes.tex index e8b8b4911a..8218429e71 100644 --- a/macros/latex/contrib/l3kernel/l3syntax-changes.tex +++ b/macros/latex/contrib/l3kernel/l3syntax-changes.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2023-05-11} +\date{Released 2023-05-15} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3sys.dtx b/macros/latex/contrib/l3kernel/l3sys.dtx index 6f64b5ea4c..e7280bb33c 100644 --- a/macros/latex/contrib/l3kernel/l3sys.dtx +++ b/macros/latex/contrib/l3kernel/l3sys.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.pdf b/macros/latex/contrib/l3kernel/l3term-glossary.pdf Binary files differindex 96e6dba07f..11c4fbb8f7 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.pdf +++ b/macros/latex/contrib/l3kernel/l3term-glossary.pdf diff --git a/macros/latex/contrib/l3kernel/l3term-glossary.tex b/macros/latex/contrib/l3kernel/l3term-glossary.tex index 4ef72973f7..9fae8221bb 100644 --- a/macros/latex/contrib/l3kernel/l3term-glossary.tex +++ b/macros/latex/contrib/l3kernel/l3term-glossary.tex @@ -32,7 +32,7 @@ The released version of this bundle is available from CTAN. {latex-team@latex-project.org}% }% } -\date{Released 2023-05-11} +\date{Released 2023-05-15} \newcommand{\TF}{\textit{(TF)}} diff --git a/macros/latex/contrib/l3kernel/l3text-case.dtx b/macros/latex/contrib/l3kernel/l3text-case.dtx index 0dc9db24ed..b0aa1ceba9 100644 --- a/macros/latex/contrib/l3kernel/l3text-case.dtx +++ b/macros/latex/contrib/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text-map.dtx b/macros/latex/contrib/l3kernel/l3text-map.dtx index 958ac7370e..d46ab15e38 100644 --- a/macros/latex/contrib/l3kernel/l3text-map.dtx +++ b/macros/latex/contrib/l3kernel/l3text-map.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text-purify.dtx b/macros/latex/contrib/l3kernel/l3text-purify.dtx index 799d676b13..e6c967ca0f 100644 --- a/macros/latex/contrib/l3kernel/l3text-purify.dtx +++ b/macros/latex/contrib/l3kernel/l3text-purify.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3text.dtx b/macros/latex/contrib/l3kernel/l3text.dtx index 11fe78a202..5190bd4d8e 100644 --- a/macros/latex/contrib/l3kernel/l3text.dtx +++ b/macros/latex/contrib/l3kernel/l3text.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx index 127aaaab2a..2e84945989 100644 --- a/macros/latex/contrib/l3kernel/l3tl-analysis.dtx +++ b/macros/latex/contrib/l3kernel/l3tl-analysis.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/l3tl.dtx b/macros/latex/contrib/l3kernel/l3tl.dtx index 6f0eb9f39e..958273893b 100644 --- a/macros/latex/contrib/l3kernel/l3tl.dtx +++ b/macros/latex/contrib/l3kernel/l3tl.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -2882,49 +2882,18 @@ % empty result. The result is returned within the \tn{unexpanded} primitive. % The approach here is to use \cs{if_false:} to allow us to use |}| as % the closing delimiter: this is the only safe choice, as any other token -% would not be able to parse it's own code. If the \tn{expanded} primitive -% is available it is used to get a fast and safe code variant in which we -% don't have to ensure that the left-most token is an internal to not break -% in an |f|-type expansion. If \tn{expanded} isn't available, using a marker, -% we can see if what we are grabbing is exactly the marker, or there is -% anything else to deal with. If there is, there is a loop. If not, tidy up -% and leave the item in the output stream. More detail in +% would not be able to parse it's own code. More detail in % \url{http://tex.stackexchange.com/a/70168}. % \begin{macrocode} -\cs_if_exist:NTF \tex_expanded:D +\cs_new:Npn \tl_head:n #1 { - \cs_new:Npn \tl_head:n #1 - { - \__kernel_exp_not:w \tex_expanded:D - { { \if_false: { \fi: \@@_head_aux:n #1 { } } } } - } - \cs_new:Npn \@@_head_aux:n #1 - { - \__kernel_exp_not:w {#1} - \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi: - } + \__kernel_exp_not:w \tex_expanded:D + { { \if_false: { \fi: \@@_head_aux:n #1 { } } } } } +\cs_new:Npn \@@_head_aux:n #1 { - \cs_new:Npn \tl_head:n #1 - { - \__kernel_exp_not:w - \if_false: { \fi: \@@_head_auxi:nw #1 { } \s_@@_stop } - } - \cs_new:Npn \@@_head_auxi:nw #1#2 \s_@@_stop - { - \exp_after:wN \@@_head_auxii:n \exp_after:wN { - \if_false: } \fi: {#1} - } - \exp_args:Nno \use:n - { \cs_new:Npn \@@_head_auxii:n #1 } - { - \@@_if_empty_if:o { \use_none:n #1 } - \exp_after:wN \use_ii:nnn - \fi: - \use_ii:nn - {#1} - { \if_false: { \fi: \@@_head_auxi:nw #1 } } - } + \__kernel_exp_not:w {#1} + \exp_after:wN \use_none:n \exp_after:wN { \if_false: } \fi: } \cs_generate_variant:Nn \tl_head:n { V , v , f } \cs_new:Npn \tl_head:w #1#2 \q_stop {#1} diff --git a/macros/latex/contrib/l3kernel/l3token.dtx b/macros/latex/contrib/l3kernel/l3token.dtx index 77e94d5b25..7b5467246f 100644 --- a/macros/latex/contrib/l3kernel/l3token.dtx +++ b/macros/latex/contrib/l3kernel/l3token.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % @@ -1584,20 +1584,6 @@ \exp_after:wN \exp_end: \tex_Ucharcat:D #1 \exp_stop_f: #2 \exp_stop_f: } - \cs_if_exist:NF \tex_expanded:D - { - \cs_new_eq:NN \@@_generate_auxii:nnw \@@_generate_aux:nnw - \cs_gset:Npn \@@_generate_aux:nnw #1#2#3 \exp_end: - { - #3 - \if_int_compare:w #2 = 13 \exp_stop_f: - \msg_expandable_error:nn { char } { active } - \else: - \@@_generate_auxii:nnw {#1} {#2} - \fi: - \exp_end: - } - } \else: % \end{macrocode} % For engines where \tn{Ucharcat} isn't available or emulated, we have diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx index fc3a2ba5e0..899937914e 100644 --- a/macros/latex/contrib/l3kernel/l3unicode.dtx +++ b/macros/latex/contrib/l3kernel/l3unicode.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-05-11} +% \date{Released 2023-05-15} % % \maketitle % diff --git a/macros/latex/contrib/l3kernel/source3.pdf b/macros/latex/contrib/l3kernel/source3.pdf Binary files differindex 68f89b6013..84fa054d5f 100644 --- a/macros/latex/contrib/l3kernel/source3.pdf +++ b/macros/latex/contrib/l3kernel/source3.pdf diff --git a/macros/latex/contrib/l3kernel/source3.tex b/macros/latex/contrib/l3kernel/source3.tex index ba7f8d430f..e12bd2b98d 100644 --- a/macros/latex/contrib/l3kernel/source3.tex +++ b/macros/latex/contrib/l3kernel/source3.tex @@ -53,7 +53,7 @@ for those people who are interested. {latex-team@latex-project.org}% }% } -\date{Released 2023-05-11} +\date{Released 2023-05-15} \pagenumbering{roman} \maketitle diff --git a/macros/latex/contrib/starray/README.md b/macros/latex/contrib/starray/README.md index 81c97cd931..d783c91e1e 100644 --- a/macros/latex/contrib/starray/README.md +++ b/macros/latex/contrib/starray/README.md @@ -33,7 +33,7 @@ at [the github page](http://github.com/alceu-frigeri/starray) ## Contacting Author -For bug reports and enhacement suggestions, the preferred way is to use +For bug reports and enhancement suggestions, the preferred way is to use [the project's issue page](https://github.com/alceu-frigeri/starray/issues). Please be ready to provide an example code showing the bug, if any. @@ -73,5 +73,12 @@ The Current Maintainer of this work is Alceu Frigeri ## Changelog +* Version 1.1 + - Issues #1/#2 + - most/all commands are protected now + - removed predicate version of conditionals + - documentation + + * Version 1.0 - Initial release by CTAN. diff --git a/macros/latex/contrib/starray/doc/starray.pdf b/macros/latex/contrib/starray/doc/starray.pdf Binary files differindex c77d198ba9..01eb376434 100644 --- a/macros/latex/contrib/starray/doc/starray.pdf +++ b/macros/latex/contrib/starray/doc/starray.pdf diff --git a/macros/latex/contrib/starray/doc/starray.tex b/macros/latex/contrib/starray/doc/starray.tex index ee260e9ed8..a18117ac37 100644 --- a/macros/latex/contrib/starray/doc/starray.tex +++ b/macros/latex/contrib/starray/doc/starray.tex @@ -1,3 +1,6 @@ +% !TEX program = pdflatex +% !TEX ext = --interaction=nonstopmode --enable-etex +% !BIB program = none %%%============================================================================== %% Copyright 2023 by Alceu Frigeri %% @@ -12,20 +15,16 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.0 (2023/05/11) +%% This is version 1.1 (2023/05/16) %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/starray %% %%%============================================================================== -% !TEX program = pdflatex -% !TEX ext = --interaction=nonstopmode --enable-etex -% !BIB program = none \documentclass[10pt]{article} \RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={40mm,20mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry} %\RequirePackage[verbose,a4paper,marginparwidth=27.5mm,top=2.5cm,bottom=1.5cm,hmargin={45mm,25mm},marginparsep=2.5mm,columnsep=10mm,asymmetric]{geometry} \usepackage{codedescribe} -\usepackage{codelisting} \usepackage{starray} \RequirePackage[inline]{enumitem} \SetEnumitemKey{miditemsep}{parsep=0ex,itemsep=0.4ex} @@ -34,7 +33,7 @@ \begin{document} \tstitle{ author={Alceu Frigeri\footnote{\tsverb{https://github.com/alceu-frigeri/starray}}}, - date={2023/05/11}, + date={\tsdate}, title={The starray Package\break Version \PkgInfo{starray}{version}} } @@ -54,14 +53,21 @@ Internally, a \tsobj[pkg]{starray} is stored as a collection of property lists. The construction/definition of a \tsobj[pkg]{starray} can be done piecewise (a property/sub-structure a time) or with a keyval interface or both, either way, one has to first ''create a root starray'' (\tsmacro{\starray_new:n}{}), define it's elements (properties and sub-structures), then instantiate them ''as needed''. An instance of a \tsobj[pkg]{starray} (or one of it's sub-structures) is referred, in this text, as a ''term''. -Finally, almost all defined functions have a branching version, as per \tsobj[pkg]{expl3}: \tsobj[code]{_p,T,F,TF}. For simplicity, in the text bellow only the \underline{\textsl{TF}} variant is described, as in \tsobj[code]{\starray_new:nTF}, keep in mind that all 4 variants do exist, e.g. \tsobj[code]{\starray_new_p:n,\starray_new:nT,\starray_new_p:nF,\starray_new_p:nTF}. As usual, the \tsobj[code]{_p} version denotes, is the predicate one (which can be used in boolena expressions). +Finally, almost all defined functions have a branching version, as per \tsobj[pkg]{expl3}: \tsobj[code]{T,F,TF} (note: no \tsobj{_p} variants, see below). For simplicity, in the text bellow only the \underline{\textsl{TF}} variant is described, as in \tsobj[code]{\starray_new:nTF}, keep in mind that all 3 variants are defined, e.g. \tsobj[code]{\starray_new:nT,\starray_new:nF,\starray_new:nTF}. -\begin{tsremark}[N.B.:] +\begin{tsremark}[Note:] Could it be implemented with a single property list? It sure could, but at a cost: \begin{enumerate*} \item complexity; \item access time. \end{enumerate*} The current implementation, albeit also complex, tries to reach a balance between inherent structure complexity, number of used/defined auxiliary property lists and access time. \end{tsremark} +\begin{tsremark}[\color{red}Important:] + \textsl{Expandability}, unfortunately most/all defined functions are not ''fully expandable'', in particular, the conditional/branching functions aren't. This means, among other things, one can't have a 'predicated variant' of any conditional defined in this (for instance, to be used in a boolean expression). + + For what it's worth, all user visible functions are 'protected'. +\end{tsremark} + + \section{Class Options}\label{pack:options} The package options (\tsobj[key]{key}\,=\tsobj[value]{value}) are: \begin{describelist}{option} @@ -95,7 +101,6 @@ By default, the \tsobj[pkg]{starray} package only generates ''warnings'', with \ \tsmacro{\starray_new:nTF}{starray,if-true,if-false} \end{codesyntax} \end{codedescribe} - Creates a new \tsobj[marg]{starray} or raises a warning if the name is already taken. The declaration (and associated property lists) is global. The given name is referred (in this text) as the \tsobj[marg]{starray-root} or just \tsobj[marg]{root}. \begin{tsremark} A warning is raised (see \ref{pack:options}) if the name is already taken. The branching version doesn't raise any warning. @@ -172,8 +177,9 @@ the construction \tsobj[key]{\tsobj[marg]{key} . struct} denotes a nested struct The definitions/assignments to \tsobj[marg]{starray-ref} are all global. - -The non-branching version raises a warning (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning. Please note that, syntax errors on the \tsobj[marg]{keyval-lst} might raise low level (\TeX) errors. +\begin{tsremark} +The non-branching version raises a warning (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning. Also note that, syntax errors on the \tsobj[marg]{keyval-lst} might raise low level (\TeX) errors. +\end{tsremark} \subsection{Fixing an ill-instantiated starray}\label{pack:def-fix} @@ -250,9 +256,9 @@ One will have created 6 \textsl{terms}: \end{enumerate} Note that, in the above example, it was used the ''implicit'' indexing (aka. iterator, see \ref{pack:ref}). Also note that no \textsl{term} of kind \tsobj[marg]{subYYY} was created. - +\begin{tsremark} A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error. The branching version doesn't raise any warning. - +\end{tsremark} \subsection{referencing terms}\label{pack:ref} @@ -553,6 +559,7 @@ The \tsmacro{\starray_if_in:nnTF}{starray-ref,key,\ldots,\ldots} tests if a give \end{codedescribe} Displays the \tsobj[marg]{starray} structure definition and initial property values in the terminal or directly in text. + \begin{codedescribe}{\starray_show_terms:n,\starray_show_terms_in_text:n} \begin{codesyntax}% \tsmacro{\starray_show_terms:n}{starray-ref} diff --git a/macros/latex/contrib/starray/latex/starray.sty b/macros/latex/contrib/starray/latex/starray.sty index 332118809f..c94304d0b1 100644 --- a/macros/latex/contrib/starray/latex/starray.sty +++ b/macros/latex/contrib/starray/latex/starray.sty @@ -12,7 +12,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.0 (2023/05/11) +%% This is version 1.1 (2023/05/16) %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/starray @@ -20,35 +20,41 @@ %%%============================================================================== \NeedsTeXFormat{LaTeX2e}[2022/06/01] \RequirePackage{ expl3 } + + \ProvidesExplPackage {starray} - {2023/05/11} + {2023/05/16} {1.0} {A structured array/hash of properties} -\prop_if_exist:NTF \g__codedesc_pkg_prop - {} - { \prop_new:N \g__codedesc_pkg_prop } - -\prop_put_from_keyval:Nn \g__codedesc_pkg_prop +%%%%%%% +%%% +%%% Just an attempt of having my packages info in a regular way +%%% Idea being: { <pck-name> / pkg info } for each and all. +%%% +%%%%%%% +\keys_define:nn { starray / pkg info} { - starray . name = starrayr , - starray . prefix = starray , - starray . date = 2023/05/01 , - starray . version = 1.0 , - starray . description = A structured array/hash of properties + name .code:n = starray , + prefix .code:n = starray , + date .code:n = 2023/05/16 , + version .code:n = 1.1 , + description .code:n = A~structured~array/hash~of~properties } - -\cs_gset:Npn \__codedesc_pkg_info:nn #1#2 +\cs_if_exist:NF \__codedesc_pkg_info:nn { - \prop_item:Nn \g__codedesc_pkg_prop {#1.#2} + \cs_new_protected:Npn \__codedesc_pkg_info:nn #1#2 + { \keys_set:nn {#1 / pkg info}{#2} } } +\cs_if_exist:NF \PkgInfo + { \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} } } +%%%%%%% +%%% End of cut-n-paste +%%%%%%% + + -\cs_if_exist:NTF \PkgInfo - {} - { - \NewDocumentCommand \PkgInfo {mm} { \prop_item:Nn \g__codedesc_pkg_prop {#1.#2} } - } %%%%%%%%%%%%%%%%%%% @@ -277,7 +283,7 @@ -\cs_new:Npn \__starray_msg:nnnnn #1#2#3#4#5 +\cs_new_protected:Npn \__starray_msg:nnnnn #1#2#3#4#5 { \bool_gset_false:N \l__starray_rtn_bool @@ -290,7 +296,7 @@ \cs_generate_variant:Nn \__starray_msg:nnnnn { nneee , neeee } -\cs_new:Npn \__starray_msg_dispatch: +\cs_new_protected:Npn \__starray_msg_dispatch: { \seq_map_tokens:Nn \l__starray_msg_seq { } \seq_clear:N \l__starray_msg_seq @@ -398,23 +404,25 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% -\prg_new_conditional:Npnn \__starray_if_free:n #1 {p, T, F, TF} +% probably EXP +\prg_new_protected_conditional:Npnn \__starray_if_free:n #1 {T, F, TF} { \prop_if_exist:cTF {#1} { \prg_return_false: } { \prg_return_true: } } -\prg_generate_conditional_variant:Nnn \__starray_if_free:n {e} {p, T, F, TF} +\prg_generate_conditional_variant:Nnn \__starray_if_free:n {e} {T, F, TF} -\prg_new_conditional:Npnn \__starray_if_valid:n #1 {p, T, F, TF} +% possible rEXP +\prg_new_protected_conditional:Npnn \__starray_if_valid:n #1 {T, F, TF} { \bool_lazy_and:nnTF {\prop_if_exist_p:c {#1}} {\prop_item:cn {#1} {is_starray}} { \prg_return_true: } { \prg_return_false: } } -\prg_generate_conditional_variant:Nnn \__starray_if_valid:n {e} {p, T, F, TF} +\prg_generate_conditional_variant:Nnn \__starray_if_valid:n {e} {T, F, TF} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% @@ -425,8 +433,8 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% - -\cs_new:Npn \__starray_base_new:nn #1#2 +% needs protection. +\cs_new_protected:Npn \__starray_base_new:nn #1#2 { \int_new:c { \l__starray_prefix_tl #2 _cnt_int } @@ -466,11 +474,13 @@ \cs_generate_variant:Nn \__starray_base_new:nn { ee } -\cs_new:Npn \__starray_sub_base_new:nnn #1#2#3 +% needs protection. +\cs_new_protected:Npn \__starray_sub_base_new:nnn #1#2#3 { \__starray_base_new:ee {#1.#3}{#2.#3} } -\cs_new:Npn \__starray_new:n #1 +% needs protection. +\cs_new_protected:Npn \__starray_new:n #1 { \prop_new:c { \l__starray_prefix_tl #1 _def_prop } @@ -500,7 +510,8 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_new:n #1 +% needs protection. +\cs_new_protected:Npn \starray_new:n #1 { \__starray_if_free:nTF {\l__starray_prefix_tl #1 _def_prop} { @@ -513,7 +524,8 @@ } -\prg_new_conditional:Npnn \starray_new:n #1 {p, T, F, TF} +% needs protection. +\prg_new_protected_conditional:Npnn \starray_new:n #1 {T, F, TF} { \__starray_if_free:nTF {\l__starray_prefix_tl #1 _def_prop} { @@ -547,6 +559,11 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% +%%% +%%% This one can't be protected... it is used in {e} expantion +%%% if protected, it results in a quark loop +%%% +% \cs_new:Npn \__starray_get_root:w #1 . #2 \q_stop { #1 } @@ -561,7 +578,8 @@ %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_def_prop:nnn #1#2#3 +% needs protection. +\cs_new_protected:Npn \__starray_def_prop:nnn #1#2#3 { \prop_get:cnN {\l__starray_prefix_tl #1 _def_prop} {def} \l_tmpa_prop \prop_put:Nnn \l_tmpa_prop {#2} {#3} @@ -576,7 +594,8 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_def_prop:nnn #1#2#3 +% needs protection, because of _p +\cs_new_protected:Npn \starray_def_prop:nnn #1#2#3 { \__starray_if_valid:nTF {\l__starray_prefix_tl #1 _def_prop} { \__starray_def_prop:nnn {#1} {#2} {#3} } @@ -587,7 +606,8 @@ } -\prg_new_conditional:Npnn \starray_def_prop:nnn #1#2#3 {p, T, F, TF} +% needs protection, because of _p +\prg_new_protected_conditional:Npnn \starray_def_prop:nnn #1#2#3 {T, F, TF} { \__starray_if_valid:nTF {\l__starray_prefix_tl #1 _def_prop} { @@ -607,7 +627,8 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_def_struct:nn #1#2 +% needs protection because of \seq_if... +\cs_new_protected:Npn \__starray_def_struct:nn #1#2 { \prop_get:cnN {\l__starray_prefix_tl #1 _def_prop} {@st_seq} \l_tmpa_seq \seq_if_in:NnF \l_tmpa_seq {#2} @@ -633,7 +654,7 @@ %%%%%%%%%%%%%%% %TODO: recurse over 'terms' to fix a 'late addtion' (after being instantiated?) -\cs_new:Npn \__starray_fix_terms_seq_aux:nnnn #1#2#3#4 +\cs_new_protected:Npn \__starray_fix_terms_seq_aux:nnnn #1#2#3#4 { \__starray_if_valid:eTF {\l__starray_prefix_tl #2 _ #3 . #4 _base_prop} { @@ -644,7 +665,7 @@ } } -\cs_new:Npn \__starray_fix_terms_seq:nnnn #1#2#3#4 +\cs_new_protected:Npn \__starray_fix_terms_seq:nnnn #1#2#3#4 { \prop_get:cnN {\l__starray_prefix_tl #2 _base_prop} @@ -660,7 +681,7 @@ } -\cs_new:Npn \__starray_fix_terms:nn #1#2 +\cs_new_protected:Npn \__starray_fix_terms:nn #1#2 { \group_begin: \prop_get:cnc @@ -680,7 +701,7 @@ -\cs_new:Npn \starray_fix_terms:n #1 +\cs_new_protected:Npn \starray_fix_terms:n #1 { \tl_set:Ne \l_tmpb_tl {\__starray_get_root:w #1 . \q_nil \q_stop} @@ -702,7 +723,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_def_struct:nn #1#2 +\cs_new_protected:Npn \starray_def_struct:nn #1#2 { \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} { @@ -714,7 +735,7 @@ } } -\prg_new_conditional:Npnn \starray_def_struct:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_def_struct:nn #1#2 {T, F, TF} { \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} { @@ -735,7 +756,7 @@ %%%%%%%%%%%%%%% -\prg_new_conditional:Npnn \__starray_def_from_keyval_testdot_aux:w #1 . \q_nil { p, TF} +\prg_new_protected_conditional:Npnn \__starray_def_from_keyval_testdot_aux:w #1 . \q_nil { TF} { \str_compare:nNnTF {#1} = {struct} { \prg_return_true: } @@ -743,7 +764,7 @@ } -\prg_new_conditional:Npnn \__starray_def_from_keyval_testdot:w #1 . #2 \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_def_from_keyval_testdot:w #1 . #2 \q_stop { TF} { \quark_if_nil:nTF {#2} { @@ -763,7 +784,7 @@ } -\cs_new:Npn \__starray_def_from_keyval_parse:nnn #1#2#3 +\cs_new_protected:Npn \__starray_def_from_keyval_parse:nnn #1#2#3 { \group_begin: \__starray_def_from_keyval_testdot:wTF #2 . \q_nil \q_stop @@ -784,7 +805,7 @@ \cs_generate_variant:Nn \__starray_def_from_keyval_parse:nnn {enn} -\cs_new:Npn \__starray_def_from_keyval_parse:nn #1#2 +\cs_new_protected:Npn \__starray_def_from_keyval_parse:nn #1#2 { \__starray_def_prop:nnn {#1} {#2} {} } @@ -799,7 +820,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_def_from_keyval:nn #1#2 +\cs_new_protected:Npn \starray_def_from_keyval:nn #1#2 { % \bool_set_true:N \l__starray_rtn_bool \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} @@ -818,7 +839,7 @@ \cs_generate_variant:Nn \starray_def_from_keyval:nn {ne , ee} -\prg_new_conditional:Npnn \starray_def_from_keyval:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_def_from_keyval:nn #1#2 {T, F, TF} { \__starray_if_valid:nTF { \l__starray_prefix_tl #1 _def_prop} { @@ -841,7 +862,7 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_new_term:nn #1#2 +\cs_new_protected:Npn \__starray_new_term:nn #1#2 { \int_gincr:N {\prop_item:cn {\l__starray_prefix_tl #1 _base_prop} {cnt} } @@ -898,7 +919,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_new_term:nn #1#2 +\cs_new_protected:Npn \starray_new_term:nn #1#2 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -912,7 +933,7 @@ } } -\prg_new_conditional:Npnn \starray_new_term:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_new_term:nn #1#2 {T, F, TF} { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -928,14 +949,14 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% %%%% -%%%% changing iterator value (recursing sub-structures) +%%%% changing iterator value (recursing over sub-structures) %%%% %%%% NOTE: since iterator change 'can' be just local, 'temp vars' are recursive aware. %%%% %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_incr_iter:n #1 +\cs_new_protected:Npn \__starray_incr_iter:n #1 { \int_compare:nNnTF {\prop_item:cn {\l__starray_prefix_tl #1 _base_prop} {iter}} < @@ -949,7 +970,7 @@ } } -\prg_new_conditional:Npnn \__starray_set_iter:nn #1#2 {p , T , F , TF} +\prg_new_protected_conditional:Npnn \__starray_set_iter:nn #1#2 {T , F , TF} { \int_compare:nNnTF {#1} > {\prop_item:cn {\l__starray_prefix_tl #2 _base_prop} {cnt}} { @@ -966,9 +987,9 @@ } } -\prg_generate_conditional_variant:Nnn \__starray_set_iter:nn {ne} {p , T , F , TF} +\prg_generate_conditional_variant:Nnn \__starray_set_iter:nn {ne} {T , F , TF} -\cs_new:Npn \__starray_set_sub_iter:nnn #1#2#3 +\cs_new_protected:Npn \__starray_set_sub_iter:nnn #1#2#3 { \prop_get:cnN {\l__starray_prefix_tl #2#3 _base_prop} {idx_hash} \l_tmpa_prop @@ -1016,7 +1037,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_set_iter:nn #1#2 +\cs_new_protected:Npn \starray_set_iter:nn #1#2 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1039,7 +1060,7 @@ -\prg_new_conditional:Npnn \starray_set_iter:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_set_iter:nn #1#2 {T, F, TF} { \bool_set_true:N \l__starray_rtn_bool @@ -1075,7 +1096,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_reset_iter:n #1 +\cs_new_protected:Npn \starray_reset_iter:n #1 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1089,7 +1110,7 @@ } -\prg_new_conditional:Npnn \starray_reset_iter:n #1 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_reset_iter:n #1 {T, F, TF} { \bool_set_true:N \l__starray_rtn_bool @@ -1114,7 +1135,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_next_iter:n #1 +\cs_new_protected:Npn \starray_next_iter:n #1 { % \bool_set_true:N \l__starray_rtn_bool \seq_clear:N \l__starray_msg_seq @@ -1133,7 +1154,7 @@ -\prg_new_conditional:Npnn \starray_next_iter:n #1 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_next_iter:n #1 {T, F, TF} { \bool_set_true:N \l__starray_rtn_bool \seq_clear:N \l__starray_msg_seq @@ -1159,7 +1180,7 @@ %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_get_prop:nn #1#2 +\cs_new_protected:Npn \__starray_get_prop:nn #1#2 { \prop_item:cn {\l__starray_prefix_tl #1 _term_prop}{#2} } @@ -1173,7 +1194,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_get_prop:nn #1#2 +\cs_new_protected:Npn \starray_get_prop:nn #1#2 { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} { @@ -1185,7 +1206,7 @@ } % returns nothing by default } -\cs_new:Npn \starray_get_prop:nnN #1#2#3 +\cs_new_protected:Npn \starray_get_prop:nnN #1#2#3 { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} { @@ -1202,7 +1223,7 @@ } -\prg_new_conditional:Npnn \starray_get_prop:nnN #1#2#3 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_get_prop:nnN #1#2#3 {T, F, TF} { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} { @@ -1224,7 +1245,7 @@ } -\prg_new_conditional:Npnn \starray_if_in:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_if_in:nn #1#2 {T, F, TF} { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} { @@ -1244,7 +1265,7 @@ } -\cs_new:Npn \starray_get_cnt:n #1 +\cs_new_protected:Npn \starray_get_cnt:n #1 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1257,7 +1278,7 @@ } % returns nothing by default } -\cs_new:Npn \starray_get_cnt:nN #1#2 +\cs_new_protected:Npn \starray_get_cnt:nN #1#2 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1272,7 +1293,7 @@ } % returns nothing by default } -\prg_new_conditional:Npnn \starray_get_cnt:nN #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_get_cnt:nN #1#2 {T, F, TF} { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1287,7 +1308,7 @@ } % returns nothing by default } -\cs_new:Npn \starray_get_iter:n #1 +\cs_new_protected:Npn \starray_get_iter:n #1 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1302,7 +1323,7 @@ } -\cs_new:Npn \starray_get_iter:nN #1#2 +\cs_new_protected:Npn \starray_get_iter:nN #1#2 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1317,7 +1338,7 @@ } % returns nothing by default } -\prg_new_conditional:Npnn \starray_get_iter:nN #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_get_iter:nN #1#2 {T, F, TF} { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} { @@ -1336,7 +1357,7 @@ -\cs_new:Npn \__starray_set_prop:nnn #1#2#3 +\cs_new_protected:Npn \__starray_set_prop:nnn #1#2#3 { \l__starray_put_tl {\l__starray_prefix_tl #1 _term_prop}{#2}{#3} } @@ -1348,7 +1369,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_set_prop:nnn #1#2#3 +\cs_new_protected:Npn \starray_set_prop:nnn #1#2#3 { \tl_set:Nn \l__starray_put_tl \prop_put:cnn \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1364,7 +1385,7 @@ \cs_generate_variant:Nn \starray_set_prop:nnn {nnV} -\cs_new:Npn \starray_gset_prop:nnn #1#2#3 +\cs_new_protected:Npn \starray_gset_prop:nnn #1#2#3 { \tl_set:Nn \l__starray_put_tl \prop_gput:cnn \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1381,7 +1402,7 @@ \cs_generate_variant:Nn \starray_gset_prop:nnn {nnV} -\prg_new_conditional:Npnn \starray_set_prop:nnn #1#2#3 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_set_prop:nnn #1#2#3 {T, F, TF} { \tl_set:Nn \l__starray_put_tl \prop_put:cnn \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1397,7 +1418,7 @@ \prg_generate_conditional_variant:Nnn \starray_set_prop:nnn { nnV } { p , T, F , TF } -\prg_new_conditional:Npnn \starray_gset_prop:nnn #1#2#3 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_gset_prop:nnn #1#2#3 {T, F, TF} { \tl_set:Nn \l__starray_put_tl \prop_gput:cnn \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1425,7 +1446,7 @@ %%%%%%%%%%%%%%% -\prg_new_conditional:Npnn \__starray_set_parse_end:w #1#2 ] #3 \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_set_parse_end:w #1#2 ] #3 \q_stop { TF} { \quark_if_nil:nTF {#3} { \prg_return_false: } %% syntax ERR @@ -1436,7 +1457,7 @@ } -\prg_new_conditional:Npnn \__starray_set_parse_aux:w #1#2 [ \q_nil \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_set_parse_aux:w #1#2 [ \q_nil \q_stop { TF} { \__starray_set_parse_end:wTF {#1}#2 ] \q_nil\q_stop {\prg_return_true:} @@ -1444,7 +1465,7 @@ } -\prg_new_conditional:Npnn \__starray_set_parse_begin:w #1#2 [ #3 \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_set_parse_begin:w #1#2 [ #3 \q_stop { TF} { \quark_if_nil:nTF {#3} { % no 'term' ref, just array_name (current/iter term) @@ -1461,7 +1482,7 @@ -\cs_new:Npn \__starray_set_from_keyval_parse:nnnn #1#2#3#4 +\cs_new_protected:Npn \__starray_set_from_keyval_parse:nnnn #1#2#3#4 { \__starray_set_prop:nnn {#3}{#4}{} } @@ -1479,7 +1500,7 @@ %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_set_from_keyval_parse:nnnnn #1#2#3#4#5 +\cs_new_protected:Npn \__starray_set_from_keyval_parse:nnnnn #1#2#3#4#5 { \tl_clear:c {l__starray_tmp #1 _tl} \__starray_set_parse_begin:wTF {#1}#4 [ \q_nil \q_stop @@ -1604,7 +1625,7 @@ %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_set_from_keyval:nn #1#2 +\cs_new_protected:Npn \__starray_set_from_keyval:nn #1#2 { \bool_set_true:N \l__starray_rtn_bool \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1624,20 +1645,22 @@ } -\cs_new:Npn \starray_set_from_keyval:nn #1#2 +\cs_new_protected:Npn \starray_set_from_keyval:nn #1#2 { \tl_set:Nn \l__starray_put_tl \prop_put:cnn \__starray_set_from_keyval:nn {#1}{#2} } -\cs_new:Npn \starray_gset_from_keyval:nn #1#2 +\cs_new_protected:Npn \starray_gset_from_keyval:nn #1#2 { \tl_set:Nn \l__starray_put_tl \prop_gput:cnn \__starray_set_from_keyval:nn {#1}{#2} } - -\cs_new:Npn \__starray_set_from_keyvalTF:nn #1#2 +%%% +%%% small surprise, it was possible to _protected it... TODO: further test it. +%%% +\cs_new_protected:Npn \__starray_set_from_keyvalTF:nn #1#2 { \bool_set_true:N \l__starray_rtn_bool \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1653,13 +1676,13 @@ { \prg_return_false: } } -\prg_new_conditional:Npnn \starray_set_from_keyval:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_set_from_keyval:nn #1#2 {T, F, TF} { \tl_set:Nn \l__starray_put_tl \prop_put:cnn \__starray_set_from_keyvalTF:nn {#1}{#2} } -\prg_new_conditional:Npnn \starray_gset_from_keyval:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_gset_from_keyval:nn #1#2 {T, F, TF} { \tl_set:Nn \l__starray_put_tl \prop_gput:cnn \__starray_set_from_keyvalTF:nn {#1}{#2} @@ -1680,7 +1703,7 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% -\prg_new_conditional:Npnn \__starray_term_parse_end:w #1 ] #2 \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_term_parse_end:w #1 ] #2 \q_stop { TF} { \quark_if_nil:nTF {#2} { \prg_return_false: } %% syntax ERR @@ -1691,7 +1714,7 @@ } -\prg_new_conditional:Npnn \__starray_term_parse_aux:w #1 [ \q_nil \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_term_parse_aux:w #1 [ \q_nil \q_stop { TF} { \__starray_term_parse_end:wTF #1 ] \q_nil\q_stop {\prg_return_true:} @@ -1699,7 +1722,7 @@ } -\prg_new_conditional:Npnn \__starray_term_parse_begin:w #1 [ #2 \q_stop { TF} +\prg_new_protected_conditional:Npnn \__starray_term_parse_begin:w #1 [ #2 \q_stop { TF} { \tl_set:Nn \l__starray_parsed_term_tl {#1} @@ -1717,9 +1740,9 @@ % verify #2 before going for #1 . . . -% if #2 isn't empty test for it return true/false +% if #2 isn't empty test for it, return true/false % if #2 is empty, test if #1 is valid, return true/false -\prg_new_conditional:Npnn \__starray_if_valid_idx:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \__starray_if_valid_idx:nn #1#2 {T, F, TF} { \prop_get:cnN {\l__starray_prefix_tl \l__starray_parsed_ref_tl _base_prop} {idx_hash} \l_tmpa_prop @@ -1738,9 +1761,13 @@ {\prg_return_false:} } -\prg_generate_conditional_variant:Nnn \__starray_if_valid_idx:nn {ee} {p, T, F, TF} +\prg_generate_conditional_variant:Nnn \__starray_if_valid_idx:nn {ee} {T, F, TF} + -\cs_new:Npn \__starray_ref_parse:w #1 . #2 \q_stop +%%% +%%% small surprise, it was possible to _protected this... TODO: further test it. +%%% +\cs_new_protected:Npn \__starray_ref_parse:w #1 . #2 \q_stop { \tl_put_right:Ne \l__starray_parsed_tl {#1} @@ -1846,7 +1873,7 @@ %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% -\prg_new_conditional:Npnn \__starray_parser:nn #1#2 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \__starray_parser:nn #1#2 {T, F, TF} { \bool_set_eq:NN \l__starray_parser_no_idx_ending_bool #1 \bool_set_true:N \l__starray_parser_OK_bool @@ -1874,7 +1901,7 @@ } -\prg_new_conditional:Npnn \starray_term_syntax:n #1 {p, T, F, TF} +\prg_new_protected_conditional:Npnn \starray_term_syntax:n #1 {T, F, TF} { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} {\prg_return_true:} @@ -1901,7 +1928,7 @@ %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_show_def_item:nnn #1#2#3 +\cs_new_protected:Npn \__starray_show_def_item:nnn #1#2#3 { \tl_gput_right:Nn \l__starray_tmpa_tl { @@ -1912,7 +1939,7 @@ } } -\cs_new:Npn \__starray_show_def:nnn #1#2#3 +\cs_new_protected:Npn \__starray_show_def:nnn #1#2#3 { \group_begin: \tl_gput_right:Nn \l__starray_tmpa_tl @@ -1951,7 +1978,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_show_def:n #1 +\cs_new_protected:Npn \starray_show_def:n #1 { \tl_clear:N \l__starray_tmpa_tl \tl_set:Nn \l__starray_showcmd_tl \iow_newline: @@ -1963,7 +1990,7 @@ { \tl_use:N \l__starray_tmpa_tl } } -\cs_new:Npn \starray_show_def_in_text:n #1 +\cs_new_protected:Npn \starray_show_def_in_text:n #1 { \tl_clear:N \l__starray_tmpa_tl \tl_set:Nn \l__starray_showcmd_tl \par @@ -1991,7 +2018,7 @@ %%%%%%%%%%%%%%% -\cs_new:Npn \__starray_show_term_item:nnnnn #1#2#3#4#5 +\cs_new_protected:Npn \__starray_show_term_item:nnnnn #1#2#3#4#5 { \group_begin: \tl_gput_right:Nn \l__starray_tmpa_tl @@ -2027,7 +2054,7 @@ -\cs_new:Npn \__starray_show_terms:nnn #1#2#3 +\cs_new_protected:Npn \__starray_show_terms:nnn #1#2#3 { \group_begin: \prop_get:cnc @@ -2049,7 +2076,7 @@ %%%% %%%%%%%%%%%%%%% -\cs_new:Npn \starray_show_terms:n #1 +\cs_new_protected:Npn \starray_show_terms:n #1 { \tl_clear:N \l__starray_tmpa_tl \tl_set:Nn \l__starray_showcmd_tl \iow_newline: @@ -2061,7 +2088,7 @@ { \tl_use:N \l__starray_tmpa_tl } } -\cs_new:Npn \starray_show_terms_in_text:n #1 +\cs_new_protected:Npn \starray_show_terms_in_text:n #1 { \tl_clear:N \l__starray_tmpa_tl \tl_set:Nn \l__starray_showcmd_tl \par diff --git a/macros/latex/contrib/tagpdf/README.md b/macros/latex/contrib/tagpdf/README.md index 334b394fcb..52a80b7f48 100644 --- a/macros/latex/contrib/tagpdf/README.md +++ b/macros/latex/contrib/tagpdf/README.md @@ -1,6 +1,6 @@ #tagpdf — A package to create tagged pdf -Packageversion: 0.98f -Packagedate: 2023/04/24 +Packageversion: 0.98g +Packagedate: 2023/05/16 Author: Ulrike Fischer ## License diff --git a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx index 7601935528..2f0e0fa8b9 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-backend.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-backend.dtx @@ -47,13 +47,13 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*luatex> -\ProvidesExplFile {tagpdf-luatex.def} {2023-04-24} {0.98f} +\ProvidesExplFile {tagpdf-luatex.def} {2023-05-16} {0.98g} {tagpdf~driver~for~luatex} % \end{macrocode} % \section{Loading the lua} @@ -158,8 +158,8 @@ local ProvidesLuaModule = { name = "tagpdf", - version = "0.98f", --TAGVERSION - date = "2023-04-24", --TAGDATE + version = "0.98g", --TAGVERSION + date = "2023-05-16", --TAGDATE description = "tagpdf lua code", license = "The LATEX Project Public License 1.3c" } diff --git a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx index acabf29f97..830e667b52 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-checks.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-checks.dtx @@ -48,7 +48,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \section{Commands} @@ -295,7 +295,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-checks-code} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-checks-code} {2023-05-16} {0.98g} {part of tagpdf - code related to checks, conditionals, debugging and messages} %</header> % \end{macrocode} @@ -441,7 +441,7 @@ % parent tags. % \begin{macrocode} \msg_new:nnn { tag } {role-parent-child} - { Rule~'#1'~-->~'#2'~is~#3} + { Rule~'#1'~-->~'#2'~is~#3~\msg_line_context:} % \end{macrocode} % \end{macro} % \begin{macro}{role-parent-child} @@ -633,7 +633,7 @@ \prop_get:cnNT {g_@@_struct_\@@_ref_value:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop} {P} - \l_tmpa_tl + \l_@@_tmpa_tl { \msg_warning:nnn { tag } {struct-used-twice} {#1} } diff --git a/macros/latex/contrib/tagpdf/tagpdf-code.pdf b/macros/latex/contrib/tagpdf/tagpdf-code.pdf Binary files differindex f37e06b89a..96903459f9 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-code.pdf +++ b/macros/latex/contrib/tagpdf/tagpdf-code.pdf diff --git a/macros/latex/contrib/tagpdf/tagpdf-data.dtx b/macros/latex/contrib/tagpdf/tagpdf-data.dtx index fbdf89360e..b2955c8a94 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-data.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-data.dtx @@ -47,7 +47,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % This files contains a various data files which are read in @@ -60,7 +60,7 @@ % It lists the new tag, the rolemap and the namespace of the rolemap. % \begin{macrocode} %<*ns-latex> -%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-ns-latex.def} {2023-05-16} {0.98g} %% {latex} {https://www.latex-project.org/ns/dflt/2022}{} title, Title, pdf2, part, Title, pdf2, @@ -92,7 +92,7 @@ text, P, pdf2, % It is bound to change % \begin{macrocode} %<*ns-latex-book> -%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-ns-latex-book.def} {2023-05-16} {0.98g} %% {latex-book} {https://www.latex-project.org/ns/book/2022}{} chapter, H1,pdf2, section, H2,pdf2, @@ -108,7 +108,7 @@ subparagraph, H6,pdf2, % It is bound to change a lot! % \begin{macrocode} %<*ns-latex-inline> -%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-ns-latex-inline.def} {2023-05-16} {0.98g} %% {latex-inline} {https://www.latex-project.org/ns/inline/2022}{} chapter, Span, pdf2, section, Span, pdf2, @@ -122,7 +122,7 @@ P, Span, pdf2, % \section{The pdf namespace data} % \begin{macrocode} %<*ns-pdf> -%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-ns-pdf.def} {2023-05-16} {0.98g} %% {pdf} {http://iso.org/pdf/ssn}{} StructTreeRoot,StructTreeRoot,pdf,D, Document,Document,pdf,D, @@ -190,7 +190,7 @@ Strong,Span,pdf,I, % \section{The pdf 2.0 namespace data} % \begin{macrocode} %<*ns-pdf2> -%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-05-16} {0.98g} %% {pdf2} {http://iso.org/pdf2/ssn}{} Document,Document,pdf2,D, Part,Part,pdf2,G, @@ -246,7 +246,7 @@ Strong,Strong,pdf2,I, % \section{The mathml namespace data} % \begin{macrocode} %<*ns-mathml> -%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-ns-mathml.def} {2023-05-16} {0.98g} % {mathml}{http://www.w3.org/1998/Math/MathML}{} abs,abs,mathml, and,and,mathml, @@ -481,7 +481,7 @@ xor,xor,mathml, % This will perhaps change in future. % \begin{macrocode} %<*parent-child> -%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-parent-child.csv} {2023-05-16} {0.98g} ,,,StructTreeRoot,Document,Art,Part,Div,Sect,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,MC Document,both,document level,1,0..n,∅,‡,‡,∅,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅ Art,1.7,grouping,∅,0..n,∅,‡,‡,0..n,0..n,‡,∅,∅,∅,0..n,∅,0..n,∅,∅,∅,0..1,0..1,∅,∅,∅,0..n,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅,∅,0..n,0..n,∅,∅,∅,0..n,0..n,∅,∅ @@ -536,7 +536,7 @@ MC,both,---,∅,∅,∅,∅,∅,∅,0..n,‡,∅,∅,∅,0..n,0..n,0..n,0..n,0.. % This will perhaps change in future. % \begin{macrocode} %<*parent-child-2> -%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-04-24} {0.98f} +%% \ProvidesExplFile {tagpdf-parent-child-2.csv} {2023-05-16} {0.98g} ,,,StructTreeRoot,Document,DocumentFragment,Art,Part,Div,Sect,Aside,BlockQuote,NonStruct,TOC,TOCI,Index,Private,Title,Sub,Quote,Note,Reference,BibEntry,P,Hn,H,Lbl,Code,Em,Strong,Span,Link,Annot,Form,Ruby,RB,RT,RP,Warichu,WT,WP,FENote,L,LI,LBody,Table,TR,TH,TD,THead,TBody,TFoot,Caption,Figure,Formula,math,mathml,Artifact,MC Document,both,document level,1,0..n,0..n,∅,‡,‡,∅,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,0..n,∅ DocumentFragment,2.0,document level,∅,0..n,0..n,0..n,‡,‡,0..n,0..n,0..n,‡,∅,∅,∅,0..n,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅*,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅*,∅,∅,∅,∅,0..n,∅ diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx index a7b129f2d3..68479088a5 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-mc-generic.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \end{documentation} @@ -55,11 +55,11 @@ % \begin{macrocode} %<@@=tag> %<*generic> -\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-mc-code-generic} {2023-05-16} {0.98g} {part of tagpdf - code related to marking chunks - generic mode} %</generic> %<*debug> -\ProvidesExplPackage {tagpdf-debug-generic} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-debug-generic} {2023-05-16} {0.98g} {part of tagpdf - debugging code related to marking chunks - generic mode} %</debug> % \end{macrocode} diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx index 08460ad418..a4f61192df 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-mc-luacode.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{implementation} % The code is splitted into three parts: code shared by all engines, @@ -86,7 +86,7 @@ % \begin{macrocode} %<@@=tag> %<*luamode> -\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-mc-code-lua} {2023-05-16} {0.98g} {tagpdf - mc code only for the luamode } %</luamode> % \end{macrocode} diff --git a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx index fb2dcb1996..cdc0aaa5a3 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-mc-shared.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -174,7 +174,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-mc-code-shared} {2023-05-16} {0.98g} {part of tagpdf - code related to marking chunks - code shared by generic and luamode } %</header> diff --git a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx index 89216c5f88..ce860d71fa 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-roles.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-roles.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \begin{function} @@ -98,7 +98,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-roles-code} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-roles-code} {2023-05-16} {0.98g} {part of tagpdf - code related to roles and structure names} %</header> % \end{macrocode} diff --git a/macros/latex/contrib/tagpdf/tagpdf-space.dtx b/macros/latex/contrib/tagpdf/tagpdf-space.dtx index 946887b06b..e8c1edfd5c 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-space.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-space.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \begin{function}{interwordspace (setup-key)} @@ -64,7 +64,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-space-code} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-space-code} {2023-05-16} {0.98g} {part of tagpdf - code related to real space chars} %</header> % \end{macrocode} diff --git a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx index 6d4d14fb89..81211bd445 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-struct.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-struct.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \section{Public Commands} @@ -247,7 +247,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-struct-code} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-struct-code} {2023-05-16} {0.98g} {part of tagpdf - code related to storing structure} %</header> % \end{macrocode} @@ -303,13 +303,6 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\g_@@_struct_tag_NS_prop} -% For the parent-child check, we need the tag and NS of every structure -% \begin{macrocode} -\prop_new:N\g_@@_struct_tag_NS_prop -% \end{macrocode} -% \end{variable} -% % % \begin{variable}{\g_@@_struct_stack_current_tl,\l_@@_struct_stack_parent_tmpa_tl} % The global variable will hold the current structure number. It is already @@ -516,16 +509,17 @@ { parentrole } { {StructTreeRoot}{pdf} } -\prop_gput:Nnn \g_@@_struct_tag_NS_prop {0}{{StructTreeRoot}{pdf}} % \end{macrocode} -% Namespaces are pdf 2.0 but it doesn't harm -% to have an empty entry. We could add a test, but if the code moves into -% the kernel, timing could get tricky. +% Namespaces are pdf 2.0. +% If the code moves into the kernel, the setting must be probably delayed. % \begin{macrocode} -\@@_prop_gput:cnx - { g_@@_struct_0_prop } - { Namespaces } - { \pdf_object_ref:n { @@/tree/namespaces } } +\pdf_version_compare:NnF < {2.0} + { + \@@_prop_gput:cnx + { g_@@_struct_0_prop } + { Namespaces } + { \pdf_object_ref:n { @@/tree/namespaces } } + } % \end{macrocode} % \end{variable} % @@ -562,7 +556,6 @@ { g_@@_struct_#1_prop } { S } { \pdf_name_from_unicode_e:n {#2} } % - \prop_gput:Nnn \g_@@_struct_tag_NS_prop {#1}{{#2}{#3}} } } { @@ -579,7 +572,6 @@ { NS } { \l_@@_get_tmpc_tl } % } - \prop_gput:Nnn \g_@@_struct_tag_NS_prop {#1}{{#2}{#3}} } } \cs_generate_variant:Nn \@@_struct_set_tag_info:nnn {eVV} @@ -1553,7 +1545,75 @@ %</package> % \end{macrocode} % \end{macro} -% +% \begin{macro}{\tag_struct_use_num:n} +% This command allows to use a stashed structure in another place. +% differently to the previous command it doesn't use a label but directly +% a structure number to find the parent. +% TODO: decide how it should be guarded. Probably by the struct-check. +% \begin{macrocode} +%<base>\cs_new_protected:Npn \tag_struct_use_num:n #1 {} +%<*package> +\cs_set_protected:Npn \tag_struct_use_num:n #1 %#1 is structure number + { + \@@_check_if_active_struct:T + { + \prop_if_exist:cTF + { g_@@_struct_#1_prop } % + { + \prop_get:cnNT + {g_@@_struct_#1_prop} + {P} + \l_@@_tmpa_tl + { + \msg_warning:nnn { tag } {struct-used-twice} {#1} + } + %add the label structure as kid to the current structure (can be the root) + \@@_struct_kid_struct_gput_right:xx + { \g_@@_struct_stack_current_tl } + { #1 } + %add the current structure to the labeled one as parents + \@@_prop_gput:cnx + { g_@@_struct_#1_prop } + { P } + { + \pdf_object_ref:e { @@/struct/\g_@@_struct_stack_current_tl } + } +% \end{macrocode} +% check if the tag is allowed as child. Here we have to retrieve the +% tag info for the child, while the data for the parent is in +% the global tl-vars: +% \begin{macrocode} + \@@_struct_get_parentrole:eNN + {#1} + \l_@@_tmpa_tl + \l_@@_tmpb_tl + \@@_check_parent_child:VVVVN + \g_@@_struct_tag_tl + \g_@@_struct_tag_NS_tl + \l_@@_tmpa_tl + \l_@@_tmpb_tl + \l_@@_parent_child_check_tl + \int_compare:nNnT {\l_@@_parent_child_check_tl}<0 + { + \cs_set_eq:NN \l_@@_role_remap_tag_tl \g_@@_struct_tag_tl + \cs_set_eq:NN \l_@@_role_remap_NS_tl \g_@@_struct_tag_NS_tl + \@@_role_remap: + \cs_gset_eq:NN \g_@@_struct_tag_tl \l_@@_role_remap_tag_tl + \cs_gset_eq:NN \g_@@_struct_tag_NS_tl \l_@@_role_remap_NS_tl + \@@_struct_set_tag_info:eVV + { \int_eval:n {\c@g_@@_struct_abs_int} } + \g_@@_struct_tag_tl + \g_@@_struct_tag_NS_tl + } + } + { + \msg_warning:nnn{ tag }{struct-label-unknown}{#1} + } + } + } +%</package> +% \end{macrocode} +% \end{macro} % \begin{macro}[EXP]{\tag_struct_object_ref:n} % This is a command that allows to reference a structure. The argument is the % number which can be get for the current structure with |\tag_get:n{struct_num}| @@ -1643,7 +1703,7 @@ % \section{Attributes and attribute classes} % \begin{macrocode} %<*header> -\ProvidesExplPackage {tagpdf-attr-code} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-attr-code} {2023-05-16} {0.98g} {part of tagpdf - code related to attributes and attribute classes} %</header> % \end{macrocode} diff --git a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx index 4692689ff3..decc64928f 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-tree.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-tree.dtx @@ -47,13 +47,13 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{implementation} % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-tree-code} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-tree-code} {2023-05-16} {0.98g} {part of tagpdf - code related to writing trees and dictionaries to the pdf} %</header> % \end{macrocode} @@ -310,7 +310,7 @@ % This is the main command to assemble the page related entries of the parent tree. % It wanders through the pages and the mcid numbers and collects all mcid of one page. % \begin{macrocode} - +\cs_new_protected:Npn \@@_tree_parenttree_rerun_msg: {} \cs_new_protected:Npn \@@_tree_fill_parenttree: { \int_step_inline:nnnn{1}{1}{\@@_ref_value_lastpage:nn{abspage}{-1}} %not quite clear if labels are needed. See lua code @@ -350,7 +350,10 @@ } } { - \msg_warning:nn { tag } {tree-mcid-index-wrong} + \cs_set_protected:Npn \@@_tree_parenttree_rerun_msg: + { + \msg_warning:nn { tag } {tree-mcid-index-wrong} + } } } \tl_put_right:Nn @@ -396,6 +399,7 @@ { \@@_tree_fill_parenttree: } + \@@_tree_parenttree_rerun_msg: \tl_put_right:NV \l_@@_parenttree_content_tl\g_@@_parenttree_objr_tl \pdf_object_write:nnx { @@/tree/parenttree }{dict} { diff --git a/macros/latex/contrib/tagpdf/tagpdf-user.dtx b/macros/latex/contrib/tagpdf/tagpdf-user.dtx index 9df99ecda2..36da045bba 100644 --- a/macros/latex/contrib/tagpdf/tagpdf-user.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf-user.dtx @@ -46,7 +46,7 @@ % }^^A % } % -% \date{Version 0.98f, released 2023-04-24} +% \date{Version 0.98g, released 2023-05-16} % \maketitle % \begin{documentation} % \section{Setup commands} @@ -250,7 +250,7 @@ % \begin{macrocode} %<@@=tag> %<*header> -\ProvidesExplPackage {tagpdf-user} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-user} {2023-05-16} {0.98g} {tagpdf - user commands} %</header> % \end{macrocode} @@ -513,28 +513,30 @@ % % \section{Commands to extend document commands} % The following commands and code parts are not core command of tagpdf. -% The either provide work arounds for missing functionality elsewhere, +% They either provide work-arounds for missing functionality elsewhere, % or do a first step to apply tagpdf commands to document commands. % This part should be regularly revisited to check if the code should go to a % better place or can be improved. % \subsection{Document structure} -% \begin{macro}{\@@_add_document_structure:n,activate (setup-key)} +% \begin{macro}{\g_@@_root_default_tl,activate (setup-key)} % \begin{macrocode} -\cs_new_protected:Npn \@@_add_document_structure:n #1 - { - \hook_gput_code:nnn{begindocument}{tagpdf}{\tagstructbegin{tag=#1}} - \hook_gput_code:nnn{tagpdf/finish/before}{tagpdf}{\tagstructend} - } +\tl_new:N\g_@@_root_default_tl +\tl_gset:Nn\g_@@_root_default_tl {Document} + +\hook_gput_code:nnn{begindocument}{tagpdf}{\tagstructbegin{tag=\g_@@_root_default_tl}} +\hook_gput_code:nnn{tagpdf/finish/before}{tagpdf}{\tagstructend} + \keys_define:nn { @@ / setup} - { - activate .code:n = + { + activate .code:n = { \keys_set:nn { @@ / setup } { activate-mc,activate-tree,activate-struct } - \@@_add_document_structure:n {#1} + \tl_gset:Nn\g_@@_root_default_tl {#1} }, - activate .default:n = Document + activate .default:n = Document } + % \end{macrocode} % \end{macro} % \subsection{Structure destinations} @@ -563,7 +565,7 @@ % \subsection{Fake space} % \begin{macro}{\pdffakespace} % We need a luatex variant for |\pdffakespace|. This should probably go into -% the kernel at some time. +% the kernel at some time. We also provide a no-op version for dvi mode % \begin{macrocode} \sys_if_engine_luatex:T { @@ -572,6 +574,7 @@ \@@_fakespace: } } +\providecommand\pdffakespace{} % \end{macrocode} % \end{macro} % @@ -697,26 +700,35 @@ } } } +% \end{macrocode} +% We check the para count at the end. If tagging is not active it is not a error, +% but we issue a warning as it perhaps indicates that the testphase code didn't guard +% everything correctly. +% \begin{macrocode} \AddToHook{enddocument/info} { - \int_compare:nNnF {\g_@@_para_main_begin_int}={\g_@@_para_main_end_int} + \tag_if_active:F { - \msg_error:nnxxx - {tag} - {para-hook-count-wrong} - {\int_use:N\g_@@_para_main_begin_int} - {\int_use:N\g_@@_para_main_end_int} - {text-unit} - } + \msg_redirect_name:nnn { tag } { para-hook-count-wrong } { warning } + } + \int_compare:nNnF {\g_@@_para_main_begin_int}={\g_@@_para_main_end_int} + { + \msg_error:nnxxx + {tag} + {para-hook-count-wrong} + {\int_use:N\g_@@_para_main_begin_int} + {\int_use:N\g_@@_para_main_end_int} + {text-unit} + } \int_compare:nNnF {\g_@@_para_begin_int}={\g_@@_para_end_int} - { - \msg_error:nnxxx - {tag} - {para-hook-count-wrong} - {\int_use:N\g_@@_para_begin_int} - {\int_use:N\g_@@_para_end_int} - {text} - } + { + \msg_error:nnxxx + {tag} + {para-hook-count-wrong} + {\int_use:N\g_@@_para_begin_int} + {\int_use:N\g_@@_para_end_int} + {text} + } } % \end{macrocode} % In generic mode we need the additional code from the ptagging tests. diff --git a/macros/latex/contrib/tagpdf/tagpdf.dtx b/macros/latex/contrib/tagpdf/tagpdf.dtx index 0ce62a8984..e9a394b5d4 100644 --- a/macros/latex/contrib/tagpdf/tagpdf.dtx +++ b/macros/latex/contrib/tagpdf/tagpdf.dtx @@ -36,7 +36,7 @@ % \begin{function}{ \tag_stop_group_begin:, \tag_stop_group_end:, % \tag_stop:, \tag_start: } % We need commands to stop tagging in some places. -% There simply switches the two local booleans. The grouping commands +% They simply switches the two local booleans. The grouping commands % can be used to group the effect. % \end{function} % @@ -92,7 +92,7 @@ % \begin{macrocode} %<@@=tag> %<*package> -\ProvidesExplPackage {tagpdf} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf} {2023-05-16} {0.98g} { A package to experiment with pdf tagging } \bool_if:nF @@ -118,7 +118,7 @@ % \end{macrocode} %<*debug> % \begin{macrocode} -\ProvidesExplPackage {tagpdf-debug} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-debug} {2023-05-16} {0.98g} { debug code for tagpdf } \@ifpackageloaded{tagpdf}{}{\PackageWarning{tagpdf-debug}{tagpdf~not~loaded,~quitting}\endinput} % \end{macrocode} @@ -141,7 +141,7 @@ % we define a base package with dummy functions % \begin{macrocode} %<*base> -\ProvidesExplPackage {tagpdf-base} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdf-base} {2023-05-16} {0.98g} {part of tagpdf - provide base, no-op versions of the user commands } %</base> % \end{macrocode} diff --git a/macros/latex/contrib/tagpdf/tagpdf.pdf b/macros/latex/contrib/tagpdf/tagpdf.pdf Binary files differindex 169a7cbb42..f5f890701e 100644 --- a/macros/latex/contrib/tagpdf/tagpdf.pdf +++ b/macros/latex/contrib/tagpdf/tagpdf.pdf diff --git a/macros/latex/contrib/tagpdf/tagpdf.tex b/macros/latex/contrib/tagpdf/tagpdf.tex index 89b0c73b0e..cc3295488e 100644 --- a/macros/latex/contrib/tagpdf/tagpdf.tex +++ b/macros/latex/contrib/tagpdf/tagpdf.tex @@ -15,8 +15,8 @@ } \DebugBlocksOff \makeatletter -\def\UlrikeFischer@package@version{0.98f} -\def\UlrikeFischer@package@date{2023-04-24} +\def\UlrikeFischer@package@version{0.98g} +\def\UlrikeFischer@package@date{2023-05-16} \makeatother \documentclass[DIV=12,parskip=half-,bibliography=totoc,a4paper]{article} @@ -558,6 +558,7 @@ command so that \pkg{tagpdf} can pick up the correct code path. { % testphase = phase-I, % tagging without paragraph tagging testphase = phase-II % tagging with paragraph tagging and other new stuff. + % testphase = phase-III % tagging with paragraph sec, toc, block tagging and more % pdfversion = 2.0 % pdfversion must be set here. } \documentclass{article} @@ -566,10 +567,26 @@ some text \end{document} \end{taglstlisting} -\minisec{Activation needed!} +\minisec{Deactivation} -It is not recommended anymore, but -the package can also be loaded normally with |\usepackage| (but it is +When loading \pkg{tagpdf} through the \texttt{testphase} keys, it is automatically activated. +To deactivate it while still retaining all the other new code from the latex-lab testphase files, +use in the preamble |\tagpdfsetup{activate-all=false}|. You can additionally also deactivate the +paratagging and the interword space code. +To suppress the loading of the package alltogether you can try + +\begin{taglstlisting} +\makeatletter +\disable@package@load{tagpdf}{} +\makeatother +\DocumentMetadata{...} +\end{taglstlisting} + + +\minisec{Loading as package needs activation!} + +It is not recommended anymore, but the package can also be loaded normally with |\usepackage| +(but it is still required to use \cs{DocumentMetadata} to load the \PDF\ management) but it will then -- apart from loading more packages and defining a lot of things -- not do much. You will have to \emph{activate} it with \verb+\tagpdfsetup+. @@ -1745,7 +1762,8 @@ These commands insert a structure previously stashed away as kid into the curren -A document should have at least one structure which contains the whole document. A suitable tag is \texttt{Document} or \texttt{Article}. I'm considering to automatically inserting it. +A document should have at least one structure which contains the whole document. A suitable tag is \texttt{Document}. +Such a root is now always added automatically. Its type can be changed with the key \texttt{activate}. diff --git a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty index 3590017267..527d7bec01 100644 --- a/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty +++ b/macros/latex/contrib/tagpdf/tagpdfdocu-patches.sty @@ -1,5 +1,5 @@ %\RequirePackage[enable-debug]{expl3}[2018/06/14] -\ProvidesExplPackage {tagpdfdocu-patches} {2023-04-24} {0.98f} +\ProvidesExplPackage {tagpdfdocu-patches} {2023-05-16} {0.98g} {patches/commands for the tagpdf documentation} \RequirePackage{etoolbox,xpatch} |