diff options
author | Norbert Preining <norbert@preining.info> | 2023-11-30 03:00:54 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-11-30 03:00:54 +0000 |
commit | ff7e60f3d1af3d5bbcc9c125c01a063391a30cc5 (patch) | |
tree | fd310171798141fad998be0012bec3f6f580deb9 /macros | |
parent | 948069736e39240a1486f59e30fb094b4fd09b74 (diff) |
CTAN sync 202311300300
Diffstat (limited to 'macros')
19 files changed, 310 insertions, 57 deletions
diff --git a/macros/latex/contrib/affilauthor/README.txt b/macros/latex/contrib/affilauthor/README.txt index 8d9bdc2f8f..c303a70dfe 100644 --- a/macros/latex/contrib/affilauthor/README.txt +++ b/macros/latex/contrib/affilauthor/README.txt @@ -6,7 +6,7 @@ see http://www.latex-project.org/lppl.txt ---------------------------------------------------- -Customized fields(key-value style) to tag the author and affiliation informations in a structured format. Each field has a specific name within \author and \affil commands similar to bib format. We can customize the styles as per preferences for article.cls class layout. Instead of giving all information(author and affiliation) in single tag, we can split the information in a format of key-value style. +key-value style fields to tag the author and affiliation informations in a structured format. Each field has a specific name within \author and \affil commands similar to bib format. We can customize the styles as per preferences for article.cls class layout. Instead of giving all information(author and affiliation) in single tag, we can split the information in a format of key-value style. Sample author tag: diff --git a/macros/latex/contrib/affilauthor/affilauthor-doc.pdf b/macros/latex/contrib/affilauthor/affilauthor-doc.pdf Binary files differindex 2c806f8cf0..d2a2004022 100644 --- a/macros/latex/contrib/affilauthor/affilauthor-doc.pdf +++ b/macros/latex/contrib/affilauthor/affilauthor-doc.pdf diff --git a/macros/latex/contrib/affilauthor/affilauthor-doc.tex b/macros/latex/contrib/affilauthor/affilauthor-doc.tex index 97c07246c3..5e21853909 100644 --- a/macros/latex/contrib/affilauthor/affilauthor-doc.tex +++ b/macros/latex/contrib/affilauthor/affilauthor-doc.tex @@ -28,7 +28,7 @@ \section*{Introduction} -{\tt affilauthor} package provides customized fields(key-value style) to tag the author and affiliation informations in a structured format. Each field has a specific name within \textbackslash author\ and \textbackslash affil\ commands similar to bib format. We can customize the styles as per preferences for {\tt article.cls} class layouts. +{\tt affilauthor} package provides key-value style fields to tag the author and affiliation informations in a structured format. Each field has a specific name within \textbackslash author\ and \textbackslash affil\ commands similar to bib format. We can customize the styles as per preferences for {\tt article.cls} class layouts. Instead of giving all information(author and affiliation) in single tag {\textbackslash author\{...\}}, we can split the information in a format of key-value style. It will given control over the elements and later we can do changes/styles by given values. It is very simple package, lot more could be added in further improvements. @@ -60,13 +60,19 @@ Required to mention the affiliation ids for determine the affiliations those bel affil={af1,af2,af5} \end{lstlisting} -\noindent Sample author group output:\index{sample author output} +\subsection*{Sample output} -\noindent\includegraphics[width=\textwidth]{authorname_sampleimage.png} +\subsubsection*{Affiliation ID as numeric:}\index{sample output 1} -\noindent Sample Footer note output:\index{sample affiliation output} +\noindent\centerline{\includegraphics[width=.8\textwidth]{affilauthor-image1.pdf}} -\noindent\includegraphics[width=\textwidth]{affiliations_sampleimage.png} +\subsubsection*{Affiliation ID as alphabet:}\index{sample output 2} + +\noindent\centerline{\includegraphics[width=.8\textwidth]{affilauthor-image2.pdf}} + +\subsubsection*{Author's note as footnote:}\index{sample output 3} + +\noindent\centerline{\includegraphics[width=.8\textwidth]{affilauthor-image3.pdf}} Here, we get appropriate marker to the notes in sequence order and also we can change the format like alphabet or roman. diff --git a/macros/latex/contrib/affilauthor/affilauthor-image1.pdf b/macros/latex/contrib/affilauthor/affilauthor-image1.pdf Binary files differnew file mode 100644 index 0000000000..0d29cffa43 --- /dev/null +++ b/macros/latex/contrib/affilauthor/affilauthor-image1.pdf diff --git a/macros/latex/contrib/affilauthor/affilauthor-image2.pdf b/macros/latex/contrib/affilauthor/affilauthor-image2.pdf Binary files differnew file mode 100644 index 0000000000..7ed5741e80 --- /dev/null +++ b/macros/latex/contrib/affilauthor/affilauthor-image2.pdf diff --git a/macros/latex/contrib/affilauthor/affilauthor-image3.pdf b/macros/latex/contrib/affilauthor/affilauthor-image3.pdf Binary files differnew file mode 100644 index 0000000000..60c7b75c79 --- /dev/null +++ b/macros/latex/contrib/affilauthor/affilauthor-image3.pdf diff --git a/macros/latex/contrib/affilauthor/affilauthor.sty b/macros/latex/contrib/affilauthor/affilauthor.sty index 65fccd556e..525aa3fceb 100644 --- a/macros/latex/contrib/affilauthor/affilauthor.sty +++ b/macros/latex/contrib/affilauthor/affilauthor.sty @@ -1,5 +1,17 @@ +%%%%%%---------------------------------------------------- +%%%%%% Package: affilauthor +%%%%%% Author: Selvam P. +%%%%%% Mail: selvamittex@gmail.com +%%%%%% Version: 1.0.1 - 2023/11/29 +%%%%%% Licence: Released under the LaTeX Project Public License v1.3c or later, +%%%%%% see http://www.latex-project.org/lppl.txt +%%%%%% Description: key-value style fields to tag the author and affiliation informations in a structured format. +%%%%%% Each field has a specific name within \author and \affil commands similar to bib format. +%%%%%% We can customize the styles as per preferences for article.cls class layout. +%%%%%% Instead of giving all information(author and affiliation) in single tag, we can split the information in a format of key-value style. +%%%%%%---------------------------------------------------- \NeedsTeXFormat{LaTeX2e}[1995/06/01] -\ProvidesPackage{affilauthor}[2023/11/05 1.0.0] +\ProvidesPackage{affilauthor}[2023/11/29 1.0.1 key value style for author names] \RequirePackage{marvosym} @@ -47,6 +59,8 @@ \int_new:N \l__affauth_author_cnt_int \int_new:N \l__affauth_affil_cnt_int \int_new:N \l__affauth_author_note_int +\prop_new:N \l__affauth_author_note_prop +\prop_new:N \l__affauth_author_contact_prop \skip_new:N \__affauth_before_affil_skip \skip_new:N \__affauth_before_auth_skip @@ -87,6 +101,16 @@ urlfont .tl_set:N = \l__affauth_font_url_tl, phonefont .tl_set:N = \l__affauth_font_phone_tl, notefont .tl_set:N = \l__affauth_font_note_tl, + affilnum .choices:nn = { alpha, Alpha, roman, Roman } + { + \int_case:nn {\l_keys_choice_int} + { + {1}{\let\l__affauth_aff:n\@alph} + {2}{\let\l__affauth_aff:n\@Alph} + {3}{\let\l__affauth_aff:n\@roman} + {4}{\let\l__affauth_aff:n\@Roman} + } + }, notenum .choices:nn = { alpha, fnsym, roman } { \int_case:nn {\l_keys_choice_int} @@ -121,45 +145,51 @@ \int_compare:nNnTF {##1} < {##2} {\sort_return_same:}{\sort_return_swapped:} } - \textsuperscript{\seq_use:Nn \l__affauth_tmpb_seq {,}} + \seq_clear:N \l__affauth_tmpa_seq + \seq_map_inline:Nn \l__affauth_tmpb_seq + { + \seq_put_right:Ne \l__affauth_tmpa_seq {\l__affauth_aff:n{##1}} + } + \__affauth_sups:n{\seq_use:Nn \l__affauth_tmpa_seq {,}} \group_end: } \cs_set:Nn \__affauth_auth_sep:n {} +\cs_set:Nn \l__affauth_aff:n {#1} +\cs_set_protected:Nn \__affauth_sups:n {\textsuperscript{#1}} \cs_set_protected:Nn \__affauth_aff_number:n { \int_compare:nNnT {#1} > {1} {\par} - \textsuperscript{#1}\thinspace + \__affauth_sups:n{\l__affauth_aff:n{#1}}\thinspace } + \cs_set_protected:Nn \l__affauth_note:n {\ifcase#1\or *\or **\or***\or****\or\#\or\#\#\or\#\#\#\or\#\#\#\#\or\$\or\$\$\or\$\$\$\or\$\$\$\$ \or\dag\or\dag\dag\or\dag\dag\dag\or\dag\dag\dag\dag\or\ddag\or\ddag\ddag\or\ddag\ddag\ddag\or\ddag\ddag\ddag\ddag\fi} -\cs_set_protected:Nn \__affauth_auth_mail:nnnn +\cs_set_protected:Nn \__affauth_auth_mail:nnnnn { \group_begin: \seq_clear:N \l__affauth_tmpa_seq + \seq_clear:N \l__affauth_tmpb_seq + \seq_set_split:Nee \l__affauth_tmpb_seq {,} {#5} \tl_if_empty:nF {#1} {\seq_put_right:Nn \l__affauth_tmpa_seq {{\l__affauth_font_mail_tl\Letter\thinspace\exp_not:n{#1}}}} \tl_if_empty:nF {#2} {\seq_put_right:Nn \l__affauth_tmpa_seq {{\l__affauth_font_phone_tl\Telefon\thinspace\exp_not:n{#2}}}} \tl_if_empty:nF {#3} {\seq_put_right:Nn \l__affauth_tmpa_seq {{\l__affauth_font_url_tl\Mundus\thinspace\exp_not:n{#3}}}} \seq_if_empty:NF \l__affauth_tmpa_seq { \group_begin: - \int_gincr:N \l__affauth_author_note_int - \textsuperscript{,\l__affauth_note:n{\l__affauth_author_note_int}} - \cs_set:Npn \thefootnote {} - \footnotetext[0]{\leftskip-\parindent\l__affauth_note:n{\l__affauth_author_note_int}\thinspace\seq_use:Nn \l__affauth_tmpa_seq {,\space}} + \prop_gput:Nee \l__affauth_author_contact_prop {\seq_item:Nn \l__affauth_tmpb_seq {1}} {\seq_use:Nn \l__affauth_tmpa_seq {,\space}} \group_end: } \tl_if_empty:nF {#4} { \group_begin: \int_gincr:N \l__affauth_author_note_int - \textsuperscript{,\l__affauth_note:n{\l__affauth_author_note_int}} - \cs_set:Npn \thefootnote {} - \footnotetext[0]{\leftskip-\parindent{\l__affauth_font_note_tl\l__affauth_note:n{\l__affauth_author_note_int}\thinspace\exp_not:n{#4}}} + \__affauth_sups:n{,\l__affauth_note:n{\l__affauth_author_note_int}} + \prop_gput:Nee \l__affauth_author_note_prop {\seq_item:Nn \l__affauth_tmpb_seq {1}} {\l__affauth_note:n{\int_use:N \l__affauth_author_note_int}\exp_not:n{#4}} \group_end: } \group_end: @@ -174,7 +204,7 @@ { \l__affauth_name_tl \exp_args:NV \__affauth_aff_id:n \l__affauth_auth_affil_id_tl - \__affauth_auth_mail:nnnn {\l__affauth_auth_mail_tl} {\l__affauth_auth_phone_tl} {\l__affauth_auth_url_tl} {\l__affauth_auth_note_tl} + \__affauth_auth_mail:nnnnn {\l__affauth_auth_mail_tl} {\l__affauth_auth_phone_tl} {\l__affauth_auth_url_tl} {\l__affauth_auth_note_tl}{\l__affauth_auth_affil_id_tl} \exp_args:NV \__affauth_auth_sep:n \l__affauth_author_cnt_int } \group_end: @@ -186,6 +216,7 @@ \int_gincr:N \l__affauth_affil_cnt_int \keys_set:nn { affil-info } { #1 } \prop_gput:NVV \l__affauth_author_id_prop \l__affauth_aff_id_tl \l__affauth_affil_cnt_int + \prop_gput:NVV \l__affauth_author_id_prop \l__affauth_affil_cnt_int \l__affauth_aff_id_tl \seq_gput_right:Ne \l__affauth_affil_info_seq { \exp_args:NV \__affauth_aff_number:n \l__affauth_affil_cnt_int @@ -209,15 +240,46 @@ {\end{center}} \org@maketitle} } - + +\cs_set_protected:Npn \__show_affiliation: + { + \group_begin: + \int_zero:N \l__affauth_affil_cnt_int + \l__affauth_font_affil_tl + \seq_map_inline:Nn \l__affauth_affil_info_seq + { + \int_incr:N \l__affauth_affil_cnt_int + ##1\par + \prop_get:NVN \l__affauth_author_id_prop \l__affauth_affil_cnt_int \l__affauth_tmpa_tl + \prop_if_in:NVT \l__affauth_author_contact_prop \l__affauth_tmpa_tl + { + (\prop_item:NV \l__affauth_author_contact_prop \l__affauth_tmpa_tl) + } + \prop_if_in:NVT \l__affauth_author_note_prop \l__affauth_tmpa_tl + { + \footnotetext[0]{\kern-\parindent\prop_item:NV \l__affauth_author_note_prop \l__affauth_tmpa_tl} + } + } + \group_end: + } + +\cs_set_protected:Nn \__show_authors: + { + \group_begin: + \l__affauth_font_author_tl + \seq_use:Nnnn \l__affauth_author_info_seq {\space and\space}{,\space}{,\space and\space} + \group_end: + } + + \AtBeginDocument{ \gdef\@author { \group_begin: \vskip\__affauth_before_auth_skip - {\l__affauth_font_author_tl\seq_use:Nnnn \l__affauth_author_info_seq {\space and\space}{,\space}{,\space and\space}} - \par\vskip\__affauth_before_affil_skip - {\l__affauth_font_affil_tl\seq_use:Nn \l__affauth_affil_info_seq {\par}} + \__show_authors:\par + \vskip\__affauth_before_affil_skip + \__show_affiliation: \group_end: } } diff --git a/macros/latex/contrib/affilauthor/affiliations_sampleimage.png b/macros/latex/contrib/affilauthor/affiliations_sampleimage.png Binary files differdeleted file mode 100644 index 567b5e6995..0000000000 --- a/macros/latex/contrib/affilauthor/affiliations_sampleimage.png +++ /dev/null diff --git a/macros/latex/contrib/affilauthor/authorname_sampleimage.png b/macros/latex/contrib/affilauthor/authorname_sampleimage.png Binary files differdeleted file mode 100644 index 7112b166de..0000000000 --- a/macros/latex/contrib/affilauthor/authorname_sampleimage.png +++ /dev/null diff --git a/macros/latex/contrib/coolfn/README b/macros/latex/contrib/coolfn/README index 220cb4f4e8..5fae50ccf7 100644 --- a/macros/latex/contrib/coolfn/README +++ b/macros/latex/contrib/coolfn/README @@ -2,7 +2,7 @@ coolfn - a package for cool footnotes -version: 1.2.0 +version: 1.2.2 This package provides formatting for footnotes in long legal documents, using hanging indents to make them look nicer @@ -14,6 +14,8 @@ For suggestions, feature requests, and bug reports, please use the project's GitHub site: https://github.com/ezgranet/coolfn Version history: +29/11/2023; Issue with textwidth fixed +29/11/2023; Issue with memoir fixed 16/11/2023: Fixed issue with width of footnote block 27/02/2023 Update with bottom footnotes 06/10/2022 Package creation
\ No newline at end of file diff --git a/macros/latex/contrib/coolfn/coolfn.sty b/macros/latex/contrib/coolfn/coolfn.sty index dfe27d611c..f3f83b5889 100644 --- a/macros/latex/contrib/coolfn/coolfn.sty +++ b/macros/latex/contrib/coolfn/coolfn.sty @@ -1,4 +1,4 @@ -\def\coolfnversionnumber{1.2.0} +\def\coolfnversionnumber{1.2.2} \ProvidesPackage{coolfn} [2023/11/16\coolfnversionnumber\ A cool way to format footnotes] @@ -21,7 +21,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% -% from https://tex.stackexchange.com/questions/305033/is-there-a-latex-package-that-defines-an-environment-for-parskip-like-capabiliti +% from https://tex.stackexchange.com/questions/305033/ %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[bottom]{footmisc} @@ -62,12 +62,16 @@ \setlength{\lengtha}{\textwidth} \newlength{\lengthb}%maths again \newlength{\lengthc} + \setlength{\lengthc}{\fnindent} \setlength{\lengthb}{1.25\lengthc}%parblock -%\makeatletter -%\@ifclassloaded{memoir}{}{ + +\makeatletter +\@ifclassloaded{memoir}{ +}{ \usepackage{hanging} -%} +} +\makeatother % for hanging paragraphs \renewcommand\footnoterule{} % ^ no one wants a rule sep for FN! @@ -89,8 +93,9 @@ \begin{minipage}[t]{\lengthb}% \noindent\normalfont% \@thefnmark% + \end{minipage}% -\begin{minipage}[t]{\lengtha-\lengthb}% +\begin{minipage}[t]{\textwidth-\lengthb}% \begin{Parskip}\begin{hangparas}{\lengthc}{1} \noindent#1\end{hangparas}\end{Parskip}% \end{minipage}% diff --git a/macros/latex/contrib/coolfn/coolfndocumentation.pdf b/macros/latex/contrib/coolfn/coolfndocumentation.pdf Binary files differindex 1a67ebfce1..17cf43cd57 100644 --- a/macros/latex/contrib/coolfn/coolfndocumentation.pdf +++ b/macros/latex/contrib/coolfn/coolfndocumentation.pdf diff --git a/macros/latex/contrib/coolfn/coolfndocumentation.tex b/macros/latex/contrib/coolfn/coolfndocumentation.tex index 55239c143b..e811641ac0 100644 --- a/macros/latex/contrib/coolfn/coolfndocumentation.tex +++ b/macros/latex/contrib/coolfn/coolfndocumentation.tex @@ -51,17 +51,20 @@ Bugs, feature requests, \textit{etc}, should be submitted to the project's offic \clearpage \section{Implementation} \begin{minted}[ +frame=lines, framesep=2mm, baselinestretch=1.2, bgcolor=LightGray, fontsize=\footnotesize, +linenos, breaklines, firstnumber=last ] {latex} -\def\coolfnversionnumber{1.2.0} + +\def\coolfnversionnumber{1.2.2} \ProvidesPackage{coolfn} -[2023/11/16\coolfnversionnumber\ +[2023/11/29\coolfnversionnumber\ A cool way to format footnotes] % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -82,7 +85,8 @@ firstnumber=last %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% -% from https://tex.stackexchange.com/questions/305033/is-there-a-latex-package-that-defines-an-environment-for-parskip-like-capabiliti +% from +% https://tex.stackexchange.com/questions/305033/ %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[bottom]{footmisc} @@ -123,12 +127,15 @@ firstnumber=last \setlength{\lengtha}{\textwidth} \newlength{\lengthb}%maths again \newlength{\lengthc} + \setlength{\lengthc}{\fnindent} \setlength{\lengthb}{1.25\lengthc}%parblock -%\makeatletter -%\@ifclassloaded{memoir}{}{ + +\makeatletter +\@ifclassloaded{memoir}{ +}{ \usepackage{hanging} -%} +} % for hanging paragraphs \renewcommand\footnoterule{} % ^ no one wants a rule sep for FN! @@ -150,8 +157,9 @@ firstnumber=last \begin{minipage}[t]{\lengthb}% \noindent\normalfont% \@thefnmark% + \end{minipage}% -\begin{minipage}[t]{\lengtha-\lengthb}% +\begin{minipage}[t]{\textwidth-\lengthb}% \begin{Parskip}\begin{hangparas}{\lengthc}{1} \noindent#1\end{hangparas}\end{Parskip}% \end{minipage}% @@ -171,6 +179,11 @@ firstnumber=last \section{Version History} +\subsection*{\texttt{1.2.2}} +\ttfamily 29 November 2023: Fixed issue with textwidth + +\subsection*{\texttt{1.2.1}} +\ttfamily 29 November 2023: Fixed issue with memoir \subsection*{\texttt{1.2.0}} diff --git a/macros/latex/contrib/fvextra/fvextra.dtx b/macros/latex/contrib/fvextra/fvextra.dtx index edd5d3599e..ca5877ee0f 100644 --- a/macros/latex/contrib/fvextra/fvextra.dtx +++ b/macros/latex/contrib/fvextra/fvextra.dtx @@ -26,7 +26,7 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{fvextra} %<*package> - [2023/11/19 v1.6 fvextra - extensions and patches for fancyvrb] + [2023/11/28 v1.6.1 fvextra - extensions and patches for fancyvrb] %</package> % %<*driver> @@ -253,6 +253,10 @@ % \fi % % +% \begin{changelog}{v1.6.1}{2023/11/28} +% \item Fixed bug from v1.6 that caused a space following a comma to be lost (\#21). +% \end{changelog} +% % \begin{changelog}{v1.6}{2023/11/19} % \item Added new environment \Verb{VerbatimWrite}. This is similar to \Verb{fancyvrb}'s \Verb{VerbatimOut}, except that it allows for writing to a file multiple times and guarantees truly verbatim output via \Verb{\detokenize}. % \item Added new environment \Verb{VerbatimBuffer}. This stores the contents of an environment verbatim in a ``buffer,'' a sequence of numbered macros each of which contains one line of the environment. The ``buffered'' lines can then be looped over for further processing or later use. @@ -1549,7 +1553,7 @@ % \begin{macro}{\FV@SpaceCatTen} % Space with catcode 10. Used instead of \Verb[showspaces]{\ } and |\space| in some contexts to avoid issues in the event that these are redefined. % \begin{macrocode} -\edef\FV@SpaceCatTen{\detokenize{ }} +\edef\FV@SpaceCatTen{{\detokenize{ }}} % \end{macrocode} % \end{macro} % diff --git a/macros/latex/contrib/fvextra/fvextra.pdf b/macros/latex/contrib/fvextra/fvextra.pdf Binary files differindex 54b8e27fdd..9e1182bd63 100644 --- a/macros/latex/contrib/fvextra/fvextra.pdf +++ b/macros/latex/contrib/fvextra/fvextra.pdf diff --git a/macros/latex/contrib/starray/README.md b/macros/latex/contrib/starray/README.md index 5079dcbc3a..42e5c77afc 100644 --- a/macros/latex/contrib/starray/README.md +++ b/macros/latex/contrib/starray/README.md @@ -72,8 +72,10 @@ The Current Maintainer of this work is Alceu Frigeri ------------- ## Changelog +* Version 1.5 (this) + - added \starray_term_syntax:nNN variant and friends (\starray_parsed_ ... :NN ) the _parsed_ ones being expandable -* Version 1.4 (this) +* Version 1.4 - added a few functions _set_iter_from_hash:nn and _iterate_over:n. * Version 1.3 diff --git a/macros/latex/contrib/starray/doc/starray.pdf b/macros/latex/contrib/starray/doc/starray.pdf Binary files differindex b030731578..cf5a4f2d70 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 615d8fe92a..258b533417 100644 --- a/macros/latex/contrib/starray/doc/starray.tex +++ b/macros/latex/contrib/starray/doc/starray.tex @@ -15,7 +15,7 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.4 (2023/11/18) +%% This is version {1.5} {2023/11/28} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/starray @@ -484,6 +484,16 @@ A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-r This can be used after any command which 'parses a term', for instance \tsobj{\starray_term_syntax:n}, see section \ref{conditionals:terms}, but it only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed. \end{tsremark} +\begin{codedescribe}[code,EXP,new=2023/11/28]{\starray_parsed_get_iter:NN} +\begin{codesyntax}% +\tsmacro{\starray_parsed_get_iter:NN}{parsed-refA,parsed-refB} +\end{codesyntax} +\tsobj{\starray_parsed_get_iter:} will place in the current iterator's value associated with \tsobj[marg]{parsed-refA,parsed-refB}, using \tsobj{\int_use:N}, in the input stream. +\end{codedescribe} +\begin{tsremark}[\color{red}Warning:] +\tsobj[marg]{parsed-refA,parsed-refB} are the values returned by \tsobj{\starray_term_syntax:nNN}. +\end{tsremark} + \begin{codedescribe}{\starray_get_cnt:n,\starray_get_cnt:nN,\starray_get_cnt:nNTF} \begin{codesyntax}% @@ -507,6 +517,17 @@ A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-r This can be used after any command which 'parses a term', for instance \tsobj{\starray_term_syntax:n}, see section \ref{conditionals:terms}, but it only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed. \end{tsremark} +\begin{codedescribe}[code,EXP,new=2023/11/28]{\starray_parsed_get_cnt:NN} +\begin{codesyntax}% +\tsmacro{\starray_parsed_get_cnt:NN}{parsed-refA,parsed-refB} +\end{codesyntax} +\tsobj{\starray_parsed_get_cnt:} will place in the current number of terms associated with \tsobj[marg]{parsed-refA,parsed-refB}, using \tsobj{\int_use:N}, in the input stream. +\end{codedescribe} +\begin{tsremark}[\color{red}Warning:] +\tsobj[marg]{parsed-refA,parsed-refB} are the values returned by \tsobj{\starray_term_syntax:nNN}. +\end{tsremark} + + \begin{codedescribe}[code,new=2023/11/04]{\starray_iterate_over:nn,\starray_iterate_over:nnTF} \begin{codesyntax}% \tsmacro{\starray_iterate_over:nn}{starray-ref,code} @@ -619,7 +640,7 @@ A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-r \begin{codedescribe}[code,EXP,new=2023/05/20]{\starray_parsed_get_prop:n} \begin{codesyntax}% -\tsmacro{\starray_parsed_get_prop:nn}{key} +\tsmacro{\starray_parsed_get_prop:n}{key} \end{codesyntax} \tsmacro{\starray_parsed_get_prop:n}{key} places the value of \tsobj[marg]{key}, if it exists, from the last parsed term, in the input stream. \end{codedescribe} @@ -628,24 +649,51 @@ This can be used after any command which 'parses a term', for instance \tsobj{\s \end{tsremark} +\begin{codedescribe}[code,EXP,new=2023/11/28]{\starray_parsed_get_prop:NNn} +\begin{codesyntax}% +\tsmacro{\starray_parsed_get_prop:NNn}{parsed-refA,parsed-refB,key} +\end{codesyntax} +\tsobj{\starray_parsed_get_prop:NNn} places the value of \tsobj[marg]{key}, if it exists, associated with \tsobj[marg]{parsed-refA,parsed-refB}. +\end{codedescribe} +\begin{tsremark}[\color{red}Warning:] +\tsobj[marg]{parsed-refA,parsed-refB} are the values returned by \tsobj{\starray_term_syntax:nNN}. +\end{tsremark} + + \section{Additional Commands and Conditionals}\label{conditionals:terms} -\begin{codedescribe}{\starray_if_in:nnTF,\starray_term_syntax:nTF} +\begin{codedescribe}{\starray_if_in:nnTF} \begin{codesyntax}% \tsmacro{\starray_if_in:nnTF}{starray-ref,key,if-true,if-false} -\tsmacro{\starray_term_syntax:nTF}{starray-ref,if-true,if-false} \end{codesyntax} -The \tsmacro{\starray_if_in:nnTF}{starray-ref,key,\ldots,\ldots} tests if a given \tsobj[marg]{key} is present, whilst \tsmacro{\starray_term_syntax:nTF}{starray-ref,if-true,if-false} just verifies if the \tsobj[marg]{starray-ref} syntax is valid or not, branching accordly. +The \tsmacro{\starray_if_in:nnTF}{starray-ref,key,\ldots,\ldots} tests if a given \tsobj[marg]{key} is present. \end{codedescribe} -\begin{codedescribe}[code,new=2023/05/20]{\starray_term_syntax:n} +\begin{codedescribe}[code,new=2023/05/20]{\starray_term_syntax:n,\starray_term_syntax:nTF} \begin{codesyntax}% \tsmacro{\starray_term_syntax:n}{starray-ref} +\tsmacro{\starray_term_syntax:nTF}{starray-ref,if-true,if-false} \end{codesyntax} This will just parse a \tsobj[marg]{starray-ref} reference, and set interval variables so that commands like \tsobj{\starray_parsed_} can be used. \end{codedescribe} \begin{tsremark}[\color{red}Warning:] -The main idea is to allow some expandable commands, but be aware that all \tsobj{\starray_} commands that use a \tsobj[marg]{starray-ref} use the very same parser variables. +The main idea is to allow some expandable commands, but be aware that all \tsobj{\starray_} commands that use a \tsobj[marg]{starray-ref} use the very same parser variables. In case one needs are more permanent/resilient \tsobj[pkg]{starray} reference, one should use the \tsobj{\starray_term_syntax:nNN} variant. +\end{tsremark} +\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} + +\begin{codedescribe}[code,new=2023/11/28]{\starray_term_syntax:nNN,\starray_term_syntax:nNNTF} +\begin{codesyntax}% +\tsmacro{\starray_term_syntax:nNN}{starray-ref,parsed-refA,parsed-refB} +\tsmacro{\starray_term_syntax:nNNTF}{starray-ref,parsed-refA,parsed-refB,if-true,if-false} +\end{codesyntax} +Similar to the ones above (\tsobj{\starray_term_syntax:n}). \tsobj[marg]{parsed-refA,parsed-refB} (assumed to be two token list vars, \tsobj[meta]{tl-var}) will receive two 'internal references' that can be used in commands like \tsobj{\starray_parsed_...:NN} which expects such 'references', without having to worry about not using other \tsobj{\starray_} commands. +\end{codedescribe} +\begin{tsremark} +Once correctly parsed, \tsobj[marg]{parsed-refA,parsed-refB} can be used at 'any time' (by those few \tsobj{\starray_parsed_...:NN} associated commands).\end{tsremark} +\begin{tsremark} +A warning is raised (see \ref{pack:options}) in case of a \tsobj[marg]{starray-ref} syntax error (in which case \tsobj[marg]{parsed-refA,parsed-refB} will not hold a valid value). The branching version doesn't raise any warning. \end{tsremark} @@ -663,6 +711,22 @@ The predicate version, \tsobj{_p}, expands to either \tsobj{\prg_return_true:} o This can be used after any command which 'parses a term', for instance \tsobj{\starray_term_syntax:n}, but it only makes sense (and returns a reliable/meaningful result) IF the last parser operation was successfully executed. \end{tsremark} + +\begin{codedescribe}[code,EXP,new=2023/11/28]{\starray_parsed_if_in_p:NNn,\starray_parsed_if_in:NNnTF} +\begin{codesyntax}% +\tsmacro{\starray_parsed_if_in_p:nTF}{parsed-refA,parsed-refB,key} +\tsmacro{\starray_parsed_if_in:nTF}{parsed-refA,parsed-refB,key,if-true,if-false} +\end{codesyntax} +This will test if the given \tsobj[key]{key} is present/associated with \tsobj[marg]{parsed-refA,parsed-refB}. +\end{codedescribe} +\begin{tsremark} +The predicate version, \tsobj{_p}, expands to either \tsobj{\prg_return_true:} or \tsobj{\prg_return_false:}. +\end{tsremark} +\begin{tsremark}[\color{red}Warning:] +\tsobj[marg]{parsed-refA,parsed-refB} are the values returned by \tsobj{\starray_term_syntax:nNN}. +\end{tsremark} + + \section{Showing (debugging) starrays }\label{pack:show} \begin{codedescribe}{\starray_show_def:n,\starray_show_def_in_text:n} diff --git a/macros/latex/contrib/starray/latex/starray.sty b/macros/latex/contrib/starray/latex/starray.sty index fbbb668458..376302469b 100644 --- a/macros/latex/contrib/starray/latex/starray.sty +++ b/macros/latex/contrib/starray/latex/starray.sty @@ -12,20 +12,20 @@ %% %% The Current Maintainer of this work is Alceu Frigeri %% -%% This is version 1.4 (2023/11/18) +%% This is version {1.5} {2023/11/28} %% %% The list of files that compose this work can be found in the README.md file at %% https://ctan.org/pkg/starray %% %%%============================================================================== \NeedsTeXFormat{LaTeX2e}[2022/06/01] -\RequirePackage{ expl3 } + \ProvidesExplPackage {starray} - {2023/11/18} - {1.4} + {2023/11/28} + {1.5} {A structured array/hash of properties} %%%%%%% @@ -36,11 +36,11 @@ %%%%%%% \keys_define:nn { starray / pkg info} { - name .code:n = starray , - prefix .code:n = starray , - date .code:n = 2023/11/18, - version .code:n = 1.4 , - description .code:n = A~structured~array/hash~of~properties + name .code:n = {starray} , + prefix .code:n = {starray} , + date .code:n = {2023/11/28}, + version .code:n = {1.5} , + description .code:n = {A~structured~array/hash~of~properties} } \cs_if_exist:NF \__codedesc_pkg_info:nn { @@ -49,6 +49,13 @@ } \cs_if_exist:NF \PkgInfo { \NewDocumentCommand \PkgInfo {mm} { \keys_set:nn {#1 / pkg info}{#2} } } +\cs_if_exist:NF \PkgDescription + { + \NewDocumentCommand \PkgDescription {m} + { + \noindent Package~ \textbf{\PkgInfo{#1}{name}}~Version:~\PkgInfo{#1}{version}~ -~ \PkgInfo{#1}{date}\par \emph{\PkgInfo{#1}{description}}~\par + } + } %%%%%%% %%% End of cut-n-paste %%%%%%% @@ -1387,6 +1394,19 @@ \__starray_get_prop:ee {\l__starray_parsed_ref_tl}{#1} } + +%%%%%%%%%%%%%%%% +%%% +%%% WARNING: #1 should be \l__starray_parsed_ref_tl +%%% #2 should be \l__starray_parsed_ref_no_idx_ending_tl +%%% +%%%%%%%%%%%%%%%% +\cs_new:Npn \starray_parsed_get_prop:NNn #1#2#3 + { + \__starray_get_prop:ee {#1}{#3} + } + + \cs_new_protected:Npn \starray_get_prop:nnN #1#2#3 { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} @@ -1459,6 +1479,23 @@ { \prg_return_false: } } +%%%%%%%%%%%%%%%% +%%% +%%% WARNING: #1 should be \l__starray_parsed_ref_tl +%%% #2 should be \l__starray_parsed_ref_no_idx_ending_tl +%%% +%%%%%%%%%%%%%%%% +\prg_new_conditional:Npnn \starray_parsed_if_in:NNn #1#2#3 {p, T, F, TF} + { + \prop_if_in:cnTF + { \l__starray_prefix_tl #1 _term_prop } + {#3} + { \prg_return_true: } + { \prg_return_false: } + } + + + \cs_new_protected:Npn \starray_get_cnt:n #1 { @@ -1485,6 +1522,18 @@ \prop_item:cn { \l__starray_prefix_tl \l__starray_parsed_ref_no_idx_ending_tl _base_prop } {cnt} } +%%%%%%%%%%%%%%%% +%%% +%%% WARNING: #1 should be \l__starray_parsed_ref_tl +%%% #2 should be \l__starray_parsed_ref_no_idx_ending_tl +%%% +%%%%%%%%%%%%%%%% +\cs_new:Npn \starray_parsed_get_cnt:NN #1#2 + { + \int_use:N + \prop_item:cn { \l__starray_prefix_tl #2 _base_prop } {cnt} + } + \cs_new_protected:Npn \starray_get_cnt:nN #1#2 { @@ -1543,6 +1592,18 @@ } +%%%%%%%%%%%%%%%% +%%% +%%% WARNING: #1 should be \l__starray_parsed_ref_tl +%%% #2 should be \l__starray_parsed_ref_no_idx_ending_tl +%%% +%%%%%%%%%%%%%%%% +\cs_new:Npn \starray_parsed_get_iter:NN #1#2 + { + \int_use:N + \prop_item:cn { \l__starray_prefix_tl #2 _base_prop } {iter} + } + \cs_new_protected:Npn \starray_get_iter:nN #1#2 { \__starray_parser:nnTF {\c__starray_no_idx_ending_bool}{#1} @@ -2194,13 +2255,47 @@ } } -\cs_new:Npn \starray_term_syntax:n #1 +\prg_new_protected_conditional:Npnn \starray_term_syntax:nNN #1#2#3 {T, F, TF} + { + \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} + { + \tl_gset:Ne #2 {\l__starray_parsed_ref_tl} + \tl_gset:Ne #3 {\l__starray_parsed_ref_no_idx_ending_tl} + \prg_return_true: + } + { + \seq_clear:N \l__starray_msg_seq + \prg_return_false: + } + } + +\cs_new_protected:Npn \starray_term_syntax:n #1 { \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} {} - {} + { + \__starray_msg_dispatch: + \msg_warning:nnnn {starray} {syntax / prop} + {setkeyval:1} {#1} + } } +\cs_new_protected:Npn \starray_term_syntax:nNN #1#2#3 + { + \__starray_parser:nnTF {\c__starray_idx_ending_bool}{#1} + { + \tl_gset:Ne #2 {\l__starray_parsed_ref_tl} + \tl_gset:Ne #3 {\l__starray_parsed_ref_no_idx_ending_tl} + } + { + \__starray_msg_dispatch: + \msg_warning:nnnn {starray} {syntax / prop} + {setkeyval:1} {#1} + } + } + + + %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% %%%% |