From 2fd07558ccd8d3c8e354f8ea0b342ef7ac1e87a3 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 20 Jan 2024 03:01:12 +0000 Subject: CTAN sync 202401200301 --- macros/latex/contrib/csvsimple/csvsimple-l3.tex | 459 +++++++++++++----------- 1 file changed, 256 insertions(+), 203 deletions(-) (limited to 'macros/latex/contrib/csvsimple/csvsimple-l3.tex') diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.tex b/macros/latex/contrib/csvsimple/csvsimple-l3.tex index 3377217755..9fad48644d 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-l3.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-l3.tex @@ -1,11 +1,11 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 % !TeX spellcheck=en_US -%% The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +%% The LaTeX package csvsimple - version 2.6.0 (2024/01/19) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -26,8 +26,8 @@ \usepackage{\csvpkgprefix csvsimple-l3} -\tcbmakedocSubKey{docCsvKey}{csvsim} -\tcbmakedocSubKeys{docCsvKeys}{csvsim} +\tcbmakedocSubKey[doc key prefix=]{docCsvKey}{csvsim} +\tcbmakedocSubKeys[doc key prefix=]{docCsvKeys}{csvsim} \hypersetup{ pdftitle={Manual for the csvsimple-l3 package}, @@ -143,7 +143,7 @@ Not automatically loaded, but used for many examples are the packages \clearpage \subsection{First Steps} Every line of a processable CSV file has to contain an identical amount of -comma\footnote{See \refKey{/csvsim/separator} for other separators than comma.} separated values. The curly braces |{}| of \TeX\ groups can be used +comma\footnote{See \refKey{csvsim/separator} for other separators than comma.} separated values. The curly braces |{}| of \TeX\ groups can be used to mask a block which may contain commas not to be processed as separators. The first line of such a CSV file is usually but not necessarily a header line @@ -193,7 +193,7 @@ assigned to \TeX\ macros which may be used deliberately. \clearpage |\csvreader| is controlled by a plenty of options. For example, for table applications line breaks are easily inserted by -\refKey{/csvsim/late after line}. This defines a macro execution just before +\refKey{csvsim/late after line}. This defines a macro execution just before the following line. Additionally, the assignment of columns to \TeX\ macros is shown in a non automated way. @@ -231,10 +231,10 @@ using \refCom{csvstyle} or |keys_define:nn| from |l3keys|. \clearpage The next example shows such a style definition with the convenience macro \refCom{csvstyle}. Here, we see again the automated assignment of header -entries to column names by \refKey{/csvsim/head to column names}. +entries to column names by \refKey{csvsim/head to column names}. For this, the header entries have to be without spaces and special characters. But you can always assign entries to canonical macro names manually like in the examples -above. Here, we also add a \refKey{/csvsim/head to column names prefix} to avoid +above. Here, we also add a \refKey{csvsim/head to column names prefix} to avoid macro name clashes. \begin{dispExample} @@ -344,7 +344,7 @@ a certificate is printed only for students with grade unequal to 5.0. ]{grade.csv} {1=\name,2=\firstname,3=\matnumber,4=\gender,5=\grade}{% \begin{center}\Large\bfseries Certificate in Mathematics\end{center} - \large\ifcsvstrcmp{\gender}{f}{Ms.}{Mr.} + \large\IfCsvsimStrEqualTF{\gender}{f}{Ms.}{Mr.} \firstname~\name, matriculation number \matnumber, has passed the test in mathematics with grade \grade.\par\ldots\par }% @@ -406,7 +406,7 @@ Mainly, the |\csvreader| command consists of a \refCom{csvloop} macro with following parameters:\par |\csvloop{|\meta{options}|, file=|\meta{file name}|, column names=|\meta{assignments}|,|\\ \hspace*{2cm} |command=|\meta{command list}|}|\par - Therefore, the application of the keys \refKey{/csvsim/file} and \refKey{/csvsim/command} + Therefore, the application of the keys \refKey{csvsim/file} and \refKey{csvsim/command} is useless for |\csvreader|. \end{docCommand} @@ -436,8 +436,8 @@ is useless for |\csvreader|. \refCom{csvreader} and \refCom{csvloop}. Note that most options are set to default values at the begin of these commands and therefore cannot be defined reasonable by \refCom{csvset}. - But it may be used for options like \refKey{/csvsim/csvsorter command} - to give global settings. Also see \refKey{/csvsim/every csv}. + But it may be used for options like \refKey{csvsim/csvsorter command} + to give global settings. Also see \refKey{csvsim/every csv}. \end{docCommand} @@ -575,12 +575,12 @@ purpose: \begin{docCommand}{csvfilteraccept}{} All following consistent data lines will be accepted and processed. This command overwrites all previous filter settings and may be used - inside \refKey{/csvsim/full filter} to implement + inside \refKey{csvsim/full filter} to implement an own filtering rule together with |\csvfilterreject|. \begin{dispExample} \csvreader[ autotabular, - full filter = \ifcsvstrcmp{\csvcoliv}{m}{\csvfilteraccept}{\csvfilterreject} + full filter = \IfCsvsimStrEqualTF{\csvcoliv}{m}{\csvfilteraccept}{\csvfilterreject} ]{grade.csv}{}{% \csvlinetotablerow } @@ -633,7 +633,7 @@ purpose: } Typesets the number of columns of the current CSV file. This number is either computed from the first valid line (header or data) or - given by \refKey{/csvsim/column count}. + given by \refKey{csvsim/column count}. Despite of the name, there is no associated \LaTeX\ counter |csvcolumncount|, but \refCom{thecsvcolumncount} accesses the \LaTeX3 integer \refCom{g_csvsim_columncount_int}. @@ -689,7 +689,7 @@ for the general table options in combination with \refCom{csvreader} and } |\csvautotabular| or |\csvautotabular*| is an abbreviation for the application of the option key - \refKey{/csvsim/autotabular} or \refKey{/csvsim/autotabular*} + \refKey{csvsim/autotabular} or \refKey{csvsim/autotabular*} together with other \meta{options} to \refCom{csvloop}. This macro reads the whole CSV file denoted by \meta{file name} with an automated formatting. @@ -713,7 +713,7 @@ for the general table options in combination with \refCom{csvreader} and } |\csvautolongtable| or |\csvautolongtable*| is an abbreviation for the application of the option key - \refKey{/csvsim/autolongtable} or \refKey{/csvsim/autolongtable*} + \refKey{csvsim/autolongtable} or \refKey{csvsim/autolongtable*} together with other \meta{options} to \refCom{csvloop}. This macro reads the whole CSV file denoted by \meta{file name} with an automated formatting. @@ -739,7 +739,7 @@ for the general table options in combination with \refCom{csvreader} and } |\csvautobooktabular| or |\csvautobooktabular*| is an abbreviation for the application of the option key - \refKey{/csvsim/autobooktabular} or \refKey{/csvsim/autobooktabular*} + \refKey{csvsim/autobooktabular} or \refKey{csvsim/autobooktabular*} together with other \meta{options} to \refCom{csvloop}. This macro reads the whole CSV file denoted by \meta{file name} with an automated formatting. @@ -761,7 +761,7 @@ for the general table options in combination with \refCom{csvreader} and } |\csvautobooklongtable| or |\csvautobooklongtable*| is an abbreviation for the application of the option key - \refKey{/csvsim/autobooklongtable} or \refKey{/csvsim/autobooklongtable*} + \refKey{csvsim/autobooklongtable} or \refKey{csvsim/autobooklongtable*} together with other \meta{options} to \refCom{csvloop}. This macro reads the whole CSV file denoted by \meta{file name} with an automated formatting. @@ -779,17 +779,16 @@ for the general table options in combination with \refCom{csvreader} and \begin{docCommands}[ doc parameter = \oarg{options}\marg{file name}\oarg{taboptions 1}\oarg{taboptions 2}, - doc new = 2023-10-13 ] { - { doc name = csvautotabularray }, + { doc name = csvautotabularray, doc new and updated={2023-10-13}{2023-10-17}, }, { doc name = csvautotabularray* }, { doc name = csvautolongtabularray }, { doc name = csvautolongtabularray* }, } These macros are abbreviations for the application of the option keys - \refKey{/csvsim/autotabularray}, \refKey{/csvsim/autotabularray*},\\ - \refKey{/csvsim/autolongtabularray}, or \refKey{/csvsim/autolongtabularray*} + \refKey{csvsim/autotabularray}, \refKey{csvsim/autotabularray*},\\ + \refKey{csvsim/autolongtabularray}, or \refKey{csvsim/autolongtabularray*} together with other \meta{options} to \refCom{csvloop}. These macros read the whole CSV file denoted by \meta{file name} with an automated formatting. @@ -799,22 +798,22 @@ for the general table options in combination with \refCom{csvreader} and \refCom{csvautolongtabularray} uses the \docAuxEnvironment*{longtblr} environment. The star variants treat the first line as data line and not as header line.\par Options to the table environments from \ctanpkg{tabularray} may be given - by either setting \refKey{/csvsim/generic table options} or + by either setting \refKey{csvsim/generic table options} or using \meta{taboptions 1} and \meta{taboptions 2}.\par The default setting is \begin{dispListing} generic table options = { { - row{1} = {font=\bfseries}, - hline{1,Z} = {0.8pt}, - hline{2} = {0.4pt}, + row{1} = {font=\bfseries,preto=\MakeUppercase}, + hline{1,Z} = {0.08em}, + hline{2} = {0.05em}, } } \end{dispListing} For the star variants, the default setting is \begin{dispListing} generic table options = { { - hline{1,Z} = {0.8pt}, + hline{1,Z} = {0.08em}, } } \end{dispListing} @@ -829,29 +828,34 @@ Examples: generic table options = {{ row{odd} = {red!85!gray!7}, - row{1} = {bg=red!85!gray, fg=white, font=\bfseries}, + row{1} = {bg=red!85!gray, fg=white, + font=\bfseries, preto=\MakeUppercase}, }} - ] - {grade.csv} + ] {grade.csv} \end{dispExample} \clearpage -Alternatively to \refKey{/csvsim/generic table options} +Alternatively to \refKey{csvsim/generic table options} (and overruling this option), one may give options to \docAuxEnvironment*{tblr} or \docAuxEnvironment*{longtblr} using \meta{taboptions 1} and \meta{taboptions 2}. If \meta{taboptions 2} is \emph{not present}, then \meta{taboptions 1} -is used as mandatory argument. -Otherwise, \meta{taboptions 1} is used as optional argument and -\meta{taboptions 2} as mandatory argument. +is used as +mandatory argument (\ctanpkg{tabularray} inner specification). +Otherwise, \meta{taboptions 1} is used as +optional argument (\ctanpkg{tabularray} outer specification) +and +\meta{taboptions 2} as +mandatory argument (\ctanpkg{tabularray} inner specification). \begin{dispExample} \csvautotabularray[table centered] {grade.csv} [ row{odd} = {red!85!gray!7}, - row{1} = {bg=red!85!gray, fg=white, font=\bfseries}, + row{1} = {bg=red!85!gray, fg=white, + font=\bfseries, preto=\MakeUppercase}, ] \end{dispExample} @@ -866,7 +870,8 @@ Otherwise, \meta{taboptions 1} is used as optional argument and ] [ row{odd} = {red!85!gray!7}, - row{1} = {bg=red!85!gray, fg=white, font=\bfseries}, + row{1} = {bg=red!85!gray, fg=white, + font=\bfseries, preto=\MakeUppercase}, ] \end{dispExample} @@ -877,7 +882,7 @@ Otherwise, \meta{taboptions 1} is used as optional argument and \clearpage \section{Option Keys}\label{sec:schluessel}% For the \meta{options} in \refCom{csvreader} respectively \refCom{csvloop} -the following |l3keys| keys can be applied. The \meta{module} name |/csvsim/| is not +the following |l3keys| keys can be applied. The \meta{module} name |csvsim| is not to be used inside these macros. @@ -895,15 +900,15 @@ to be used inside these macros. \begin{docCsvKey}{before filter}{=\meta{code}}{no default, initially empty} Sets the \meta{code} to be executed after reading and consistency checking of a data line. It is executed before any filter condition is checked, - see e.g. \refKey{/csvsim/filter ifthen} and - also see \refKey{/csvsim/full filter}. + see e.g. \refKey{csvsim/filter ifthen} and + also see \refKey{csvsim/full filter}. No additions to the input stream should be given here. All line entries are available. \end{docCsvKey} \begin{docCsvKey}[][doc new=2021-07-06]{after filter}{=\meta{code}}{no default, initially empty} Sets the \meta{code} to be executed for an accepted line after - \refKey{/csvsim/late after line} and before \refKey{/csvsim/before line}. + \refKey{csvsim/late after line} and before \refKey{csvsim/before line}. All line entries are available. No additions to the input stream should be given here. \meta{code} may contain processing of data content to generate new values. @@ -919,73 +924,73 @@ to be used inside these macros. \begin{docCsvKey}{late after line}{=\meta{code}}{no default, initially empty} Sets the \meta{code} to be executed after reading and disassembling - of the next accepted data line (after \refKey{/csvsim/before filter}). + of the next accepted data line (after \refKey{csvsim/before filter}). These operations are executed before further processing of this line. \meta{code} should not refer to any data content, but may be something like |\\|. - \refKey{/csvsim/late after line} overwrites - \refKey{/csvsim/late after first line} and - \refKey{/csvsim/late after last line}. - Note that table options like \refKey{/csvsim/tabular} set this key to |\\| + \refKey{csvsim/late after line} overwrites + \refKey{csvsim/late after first line} and + \refKey{csvsim/late after last line}. + Note that table options like \refKey{csvsim/tabular} set this key to |\\| automatically. \end{docCsvKey} \begin{docCsvKey}{late after first line}{=\meta{code}}{no default, initially empty} Sets the \meta{code} to be executed after reading and disassembling - of the second accepted data line instead of \refKey{/csvsim/late after line}. + of the second accepted data line instead of \refKey{csvsim/late after line}. \meta{code} should not refer to any data content. - This key has to be set after \refKey{/csvsim/late after line}. + This key has to be set after \refKey{csvsim/late after line}. \end{docCsvKey} \begin{docCsvKey}{late after last line}{=\meta{code}}{no default, initially empty} Sets the \meta{code} to be executed after processing of the last - accepted data line instead of \refKey{/csvsim/late after line}. + accepted data line instead of \refKey{csvsim/late after line}. \meta{code} should not refer to any data content. - This key has to be set after \refKey{/csvsim/late after line}. + This key has to be set after \refKey{csvsim/late after line}. \end{docCsvKey} \begin{docCsvKey}{before line}{=\meta{code}}{no default, initially empty} - Sets the \meta{code} to be executed after \refKey{/csvsim/after filter} - and before \refKey{/csvsim/command}. + Sets the \meta{code} to be executed after \refKey{csvsim/after filter} + and before \refKey{csvsim/command}. All line entries are available. - \refKey{/csvsim/before line} overwrites - \refKey{/csvsim/before first line}. + \refKey{csvsim/before line} overwrites + \refKey{csvsim/before first line}. \end{docCsvKey} \begin{docCsvKey}{before first line}{=\meta{code}}{no default, initially empty} - Sets the \meta{code} to be executed instead of \refKey{/csvsim/before line} + Sets the \meta{code} to be executed instead of \refKey{csvsim/before line} for the first accepted data line. All line entries are available. - This key has to be set after \refKey{/csvsim/before line}. + This key has to be set after \refKey{csvsim/before line}. \end{docCsvKey} \pagebreak \begin{docCsvKey}{command}{=\meta{code}}{no default, initially \cs{csvline}} Sets the \meta{code} to be executed for every accepted data line. - It is executed between \refKey{/csvsim/before line} and \refKey{/csvsim/after line}. - \refKey{/csvsim/command} describes the main processing of the line - entries. \refCom{csvreader} sets \refKey{/csvsim/command} as mandatory + It is executed between \refKey{csvsim/before line} and \refKey{csvsim/after line}. + \refKey{csvsim/command} describes the main processing of the line + entries. \refCom{csvreader} sets \refKey{csvsim/command} as mandatory parameter. \end{docCsvKey} \begin{docCsvKey}{after line}{=\meta{code}}{no default, initially empty} Sets the \meta{code} to be executed for every accepted data line - after \refKey{/csvsim/command}. + after \refKey{csvsim/command}. All line entries are still available. - \refKey{/csvsim/after line} overwrites \refKey{/csvsim/after first line}. + \refKey{csvsim/after line} overwrites \refKey{csvsim/after first line}. \end{docCsvKey} \begin{docCsvKey}{after first line}{=\meta{code}}{no default, initially empty} - Sets the \meta{code} to be executed instead of \refKey{/csvsim/after line} + Sets the \meta{code} to be executed instead of \refKey{csvsim/after line} for the first accepted data line. All line entries are still available. - This key has to be set after \refKey{/csvsim/after line}. + This key has to be set after \refKey{csvsim/after line}. \end{docCsvKey} \begin{docCsvKey}{after reading}{=\meta{code}}{no default, initially empty} @@ -995,7 +1000,7 @@ to be used inside these macros. \bigskip The following example illustrates the sequence of command execution. -Note that \refKey{/csvsim/command} is set by the mandatory last +Note that \refKey{csvsim/command} is set by the mandatory last parameter of \refCom{csvreader}. \begin{dispExample} @@ -1063,14 +1068,14 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. used as feasible \LaTeX\ macro names. Note that the macro definition is \emph{global} and may therefore override existing macros for the rest of the document. Adding - \refKey{/csvsim/head to column names prefix} may help to avoid unwanted + \refKey{csvsim/head to column names prefix} may help to avoid unwanted overrides. \end{docCsvKey} \begin{docCsvKey}[][doc new=2019-07-16]{head to column names prefix}{=\meta{text}}{no default, initially empty} The given \meta{text} is prefixed to the name of all macros generated by - \refKey{/csvsim/head to column names}. For example, if you use the settings + \refKey{csvsim/head to column names}. For example, if you use the settings \begin{dispListing} head to column names, head to column names prefix=MY, @@ -1082,7 +1087,7 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. \begin{docCsvKey}[][doc new=2022-02-01]{column names detection}{\colOpt{=true\textbar false}}{default |true|, initially |true|} If this key is set, the header line is detected for names which can be used - for \refKey{/csvsim/column names} and \refKey{/csvsim/head to column names}. + for \refKey{csvsim/column names} and \refKey{csvsim/head to column names}. Otherwise, these options are not functional.\\ This key can and should be set to |false|, if the header line contains macros or characters not allowed inside \LaTeX\ control sequences, because @@ -1109,10 +1114,10 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. \begin{docCsvKey}[][doc updated=2021-06-24]{column count}{=\meta{number}}{no default, initially |0|} Sets the \meta{number} of feasible entries per data line. - If \refKey{/csvsim/column count} is set to |0|, the number of entries of + If \refKey{csvsim/column count} is set to |0|, the number of entries of the first non-empty line determines the column count (automatic detection). - This setting is only useful in connection with \refKey{/csvsim/no head}, + This setting is only useful in connection with \refKey{csvsim/no head}, since \meta{number} would be replaced by the number of entries in the header line otherwise. \end{docCsvKey} @@ -1134,8 +1139,8 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. Applying a \emph{filter} means that data lines are only processed / displayed, if they fulfill a given \emph{condition}. -The following string compare filters \refKey{/csvsim/filter strcmp} and -\refKey{/csvsim/filter equal} are identical by logic, but differ in implementation. +The following string compare filters \refKey{csvsim/filter strcmp} and +\refKey{csvsim/filter equal} are identical by logic, but differ in implementation. \begin{docCsvKey}[][doc updated=2022-10-21]{filter strcmp}{=\marg{stringA}\marg{stringB}}{no default} Only lines where \meta{stringA} and \meta{stringB} are equal after expansion @@ -1203,7 +1208,7 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and Only data lines which fulfill a \LaTeX3 \meta{boolean expression} are accepted. Note that such an \meta{boolean expression} needs expl3 code. To preprocess the data line before testing the \meta{boolean expression}, - the option key \refKey{/csvsim/before filter} can be used. + the option key \refKey{csvsim/before filter} can be used. \begin{dispExample} % For convenience, we save the filter \ExplSyntaxOn @@ -1232,7 +1237,7 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and \medskip \begin{docCommand}[doc new=2021-06-25]{csvfilterbool}{\marg{key}\marg{boolean expression}} - Defines a new |l3keys| meta key which applies \refKey{/csvsim/filter bool} + Defines a new |l3keys| meta key which applies \refKey{csvsim/filter bool} with the given \meta{boolean expression}. \begin{dispExample} % For convenience, we save the filter @@ -1263,10 +1268,10 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and The following filter options are \emph{appendable} to the expl3 based filter options: \begin{itemize} -\item \refKey{/csvsim/filter strcmp} -\item \refKey{/csvsim/filter not strcmp} -\item \refKey{/csvsim/filter fp} -\item \refKey{/csvsim/filter bool} +\item \refKey{csvsim/filter strcmp} +\item \refKey{csvsim/filter not strcmp} +\item \refKey{csvsim/filter fp} +\item \refKey{csvsim/filter bool} \end{itemize} \begin{docCsvKeys}[ @@ -1278,7 +1283,7 @@ filter options: { doc name = and filter strcmp }, { doc name = or filter strcmp }, } - Like \refKey{/csvsim/filter strcmp}, but appended to a required existing + Like \refKey{csvsim/filter strcmp}, but appended to a required existing expl3 based filter with \emph{and} (|&&|) resp. \emph{or} (\texttt{\textbar\textbar}). \begin{dispExample} @@ -1305,7 +1310,7 @@ filter options: { doc name = and filter not strcmp }, { doc name = or filter not strcmp }, } - Like \refKey{/csvsim/filter not strcmp}, but appended to a required existing + Like \refKey{csvsim/filter not strcmp}, but appended to a required existing expl3 based filter with \emph{and} (|&&|) resp. \emph{or} (\texttt{\textbar\textbar}). \end{docCsvKeys} @@ -1319,7 +1324,7 @@ filter options: { doc name = and filter fp }, { doc name = or filter fp }, } - Like \refKey{/csvsim/filter fp}, but appended to a required existing + Like \refKey{csvsim/filter fp}, but appended to a required existing expl3 based filter with \emph{and} (|&&|) resp. \emph{or} (\texttt{\textbar\textbar}). \end{docCsvKeys} @@ -1333,7 +1338,7 @@ filter options: { doc name = and filter bool }, { doc name = or filter bool }, } - Like \refKey{/csvsim/filter bool}, but appended to a required existing + Like \refKey{csvsim/filter bool}, but appended to a required existing expl3 based filter with \emph{and} (|&&|) resp. \emph{or} (\texttt{\textbar\textbar}). \end{docCsvKeys} @@ -1375,7 +1380,7 @@ filter test=\iftest{some testing}, Every \meta{boolean expression} from the \ctanpkg{etoolbox} package is feasible (package loading required!). To preprocess the data line before testing the \meta{boolean expression}, - the option key \refKey{/csvsim/before filter} can be used. + the option key \refKey{csvsim/before filter} can be used. \begin{dispExample} % \usepackage{etoolbox,booktabs} \csvreader[ @@ -1400,7 +1405,7 @@ filter test=\iftest{some testing}, For the \meta{boolean expression}, every term from the \ctanpkg{ifthen} package is feasible (package loading required!). To preprocess the data line before testing the \meta{boolean expression}, - the option key \refKey{/csvsim/before filter} can be used. + the option key \refKey{csvsim/before filter} can be used. \begin{dispExample} % \usepackage{ifthen,booktabs} @@ -1434,9 +1439,9 @@ filter test=\iftest{some testing}, \begin{docCsvKey}[][doc new=2016-07-01]{full filter}{=\meta{code}}{no default} - Technically, this key is an alias for \refKey{/csvsim/before filter}. - Philosophically, \refKey{/csvsim/before filter} computes something before - a filter condition is set, but \refKey{/csvsim/full filter} should implement + Technically, this key is an alias for \refKey{csvsim/before filter}. + Philosophically, \refKey{csvsim/before filter} computes something before + a filter condition is set, but \refKey{csvsim/full filter} should implement the full filtering. Especially, \refCom{csvfilteraccept} or \refCom{csvfilterreject} \emph{should} be set inside the \meta{code}. \begin{dispExample} @@ -1478,7 +1483,7 @@ line 10 to 30 of the accepted lines. Defines a comma separated list of line ranges. If a line number \refCom{thecsvrow} satisfies one or more of the given \meta{range1}, \meta{range2}, \ldots, the corresponding line is processed and displayed. - If \refKey{/csvsim/range} is set to empty, all lines are accepted. + If \refKey{csvsim/range} is set to empty, all lines are accepted. Every \meta{range} can corresponds to one of the following variants: @@ -1579,58 +1584,58 @@ The following example displays the last three line numbers: Surrounds the CSV processing with |\begin{tabular}|\marg{table format} at begin and with |\end{tabular}| at end. Additionally, the commands defined by the key values of - \refKey{/csvsim/before table}, \refKey{/csvsim/table head}, \refKey{/csvsim/table foot}, - and \refKey{/csvsim/after table} are executed at the appropriate places. - \refKey{/csvsim/late after line} is set to \cs{}\cs{}. + \refKey{csvsim/before table}, \refKey{csvsim/table head}, \refKey{csvsim/table foot}, + and \refKey{csvsim/after table} are executed at the appropriate places. + \refKey{csvsim/late after line} is set to \cs{}\cs{}. \end{docCsvKey} \begin{docCsvKey}{centered tabular}{=\meta{table format}}{style, no default} - Like \refKey{/csvsim/tabular} but inside an additional |center| environment. + Like \refKey{csvsim/tabular} but inside an additional |center| environment. \end{docCsvKey} \begin{docCsvKey}{longtable}{=\meta{table format}}{style, no default} - Like \refKey{/csvsim/tabular} but for the |longtable| environment. + Like \refKey{csvsim/tabular} but for the |longtable| environment. This requires the package \ctanpkg{longtable} (not loaded automatically). \end{docCsvKey} \begin{docCsvKey}{tabbing}{}{style, no value} - Like \refKey{/csvsim/tabular} but for the |tabbing| environment. + Like \refKey{csvsim/tabular} but for the |tabbing| environment. \end{docCsvKey} \begin{docCsvKey}{centered tabbing}{}{style, no value} - Like \refKey{/csvsim/tabbing} but inside an additional |center| environment. + Like \refKey{csvsim/tabbing} but inside an additional |center| environment. \end{docCsvKey} \begin{docCsvKey}[][doc new=2021-07-06]{tabularray}{=\meta{table format}}{style, no default} - Like \refKey{/csvsim/tabular} but for the |tblr| environment. + Like \refKey{csvsim/tabular} but for the |tblr| environment. This requires the package \ctanpkg{tabularray} (not loaded automatically). - This also sets \refKey{/csvsim/collect data} since this kind of table + This also sets \refKey{csvsim/collect data} since this kind of table needs collected content, see \Fullref{sec:datacollection}. - Note that \refKey{/csvsim/after reading} is set to use the collected + Note that \refKey{csvsim/after reading} is set to use the collected data immediately. See \Fullref{sec:tabularray} for examples. \end{docCsvKey} \begin{docCsvKey}[][doc new=2021-07-23]{long tabularray}{=\meta{table format}}{style, no default} - Like \refKey{/csvsim/tabularray} but using the |longtblr| environment + Like \refKey{csvsim/tabularray} but using the |longtblr| environment from the package \ctanpkg{tabularray} (not loaded automatically). \end{docCsvKey} \begin{docCsvKey}[][doc new=2021-07-06]{centered tabularray}{=\meta{table format}}{style, no default} - Like \refKey{/csvsim/tabularray} but inside an additional |center| environment. + Like \refKey{csvsim/tabularray} but inside an additional |center| environment. \end{docCsvKey} \begin{docCsvKey}{no table}{}{style, no value} Deactivates |tabular|-like environments activated by - \refKey{/csvsim/tabular}, \refKey{/csvsim/longtable}, etc. - Note that not all settings of \refKey{/csvsim/tabularray} are reverted. + \refKey{csvsim/tabular}, \refKey{csvsim/longtable}, etc. + Note that not all settings of \refKey{csvsim/tabularray} are reverted. \end{docCsvKey} @@ -1663,8 +1668,8 @@ The following example displays the last three line numbers: \begin{docCsvKey}[][doc new=2021-09-09]{table centered}{\colOpt{=true\textbar false}}{default |true|, initially |false|} If |true|, the table is put inside an additional |center| environment. - This environment begins before \refKey{/csvsim/before table} - and ends after \refKey{/csvsim/after table}. The predefined |tabular|-like environments + This environment begins before \refKey{csvsim/before table} + and ends after \refKey{csvsim/after table}. The predefined |tabular|-like environments from Section~\fullref{subsubsec:table_predef} use this option internally, i.e. \mbox{|centered tabular={ccc}|} is identical to \mbox{|tabular={ccc}, table centered|}. @@ -1682,11 +1687,11 @@ are described with predefined keys. The following keys allow to use further Surrounds the CSV processing with \cs{begin}\marg{name} at begin and with \cs{end}\marg{name} at end. Additionally, the commands defined by the key values of - \refKey{/csvsim/before table}, \refKey{/csvsim/table head}, \refKey{/csvsim/table foot}, - and \refKey{/csvsim/after table} are executed at the appropriate places. - \refKey{/csvsim/late after line} is set to \cs{}\cs{}.\par + \refKey{csvsim/before table}, \refKey{csvsim/table head}, \refKey{csvsim/table foot}, + and \refKey{csvsim/after table} are executed at the appropriate places. + \refKey{csvsim/late after line} is set to \cs{}\cs{}.\par If the environment \meta{name} takes options, these have to be set using - \refKey{/csvsim/generic table options}. + \refKey{csvsim/generic table options}. \begin{dispListing} % The `tabular` environment would be used like the following example @@ -1698,11 +1703,11 @@ are described with predefined keys. The following keys allow to use further \end{docCsvKey} -\begin{docCsvKey}[][doc new=2021-09-09]{generic collected table}{=\meta{name}}{no default, initially empty} - Like \refKey{/csvsim/generic table} but for environments which need +\begin{docCsvKey}[][doc new and updated={2021-09-09}{2023-12-18}]{generic collected table}{=\meta{name}}{no default, initially empty} + Like \refKey{csvsim/generic table} but for environments which need collected content, e.g. |tblr| from package \ctanpkg{tabularray}, see \Fullref{sec:datacollection}. - Note that \refKey{/csvsim/after reading} is set to use the collected - data immediately. + Note that \refKey{csvsim/consume collected data} is set to |true| to + use the collected data immediately. \begin{dispListing} % The `tblr` environment from package `tabularray` would be used @@ -1717,7 +1722,7 @@ are described with predefined keys. The following keys allow to use further \begin{docCsvKey}[][doc new=2021-09-09]{generic table options}{=\marg{code}}{no default, initially empty} Places \meta{code} immediately after \cs{begin}\marg{name} set up with - \refKey{/csvsim/generic table} or \refKey{/csvsim/generic collected table}. + \refKey{csvsim/generic table} or \refKey{csvsim/generic collected table}. \meta{code} may contain any parameters the environment \meta{name} needs to have. \textbf{\color{red!50!black}You are strongly advised to use an extra pair of curly brackets \marg{code} around \meta{code}}, because the outer pair of braces is @@ -1812,8 +1817,8 @@ completeness, but are unlikely to be used directly. } Reads the whole CSV file denoted \meta{file name} with an automated formatting using the required |tabularray| package. - \refKey{/csvsim/autotabularray} uses the \docAuxEnvironment*{tblr} environment and - \refKey{/csvsim/autolongtabularray} uses the \docAuxEnvironment*{longtblr} environment. + \refKey{csvsim/autotabularray} uses the \docAuxEnvironment*{tblr} environment and + \refKey{csvsim/autolongtabularray} uses the \docAuxEnvironment*{longtblr} environment. The star variants treat the first line as data line and not as header line. \end{docCsvKeys} @@ -1939,7 +1944,7 @@ as normal characters (|\catcode| 12, other), if one or more of the following opt \medskip \item\docValue{tab}: Sets the separator to the tabulator sign. - Automatically, \refKey{/csvsim/respect tab} is set also. + Automatically, \refKey{csvsim/respect tab} is set also. \clearpage \item\docValue{space}:\tcbdocmarginnote{\tcbdocnew{2023-05-08}} @@ -1996,9 +2001,9 @@ as normal characters (|\catcode| 12, other), if one or more of the following opt \begin{docCsvKey}{preprocessor}{=\meta{macro}}{no default} Defines a preprocessor for the given CSV file. The \meta{macro} has to have two mandatory arguments. The first argument - is the original CSV file which is set by \refKey{/csvsim/file}. + is the original CSV file which is set by \refKey{csvsim/file}. The second argument is the preprocessed CSV file - which is set by \refKey{/csvsim/preprocessed file}.\par\smallskip + which is set by \refKey{csvsim/preprocessed file}.\par\smallskip Typically, the \meta{macro} may call an external program which preprocesses the original CSV file (e.\,g. sorting the file) and creates the preprocessed CSV file. The later file is used by \refCom{csvreader} @@ -2043,7 +2048,7 @@ First, one should consider the appropriate \emph{place} for sorting: \end{itemize} The first two methods are decoupled from anything concerning |csvsimple-l3|. -For the third method, the \refKey{/csvsim/preprocessor} option is made for. +For the third method, the \refKey{csvsim/preprocessor} option is made for. This allows to access an external tool for sorting. \emph{Which tool} is your choice. @@ -2112,10 +2117,10 @@ following options. \begin{itemize} \item \csvsorter\ uses the given CSV file as input file. \item \csvsorter\ uses \meta{file name} as configuration file. - \item The output CSV file is denoted by \refKey{/csvsim/preprocessed file} + \item The output CSV file is denoted by \refKey{csvsim/preprocessed file} which is by default \texttt{\textbackslash\detokenize{jobname_sorted.csv}}. This output file is this actual file processed by \refCom{csvreader} or \refCom{csvloop}. - \item \csvsorter\ also generates a log file denoted by \refKey{/csvsim/csvsorter log} which is by default |csvsorter.log|. + \item \csvsorter\ also generates a log file denoted by \refKey{csvsim/csvsorter log} which is by default |csvsorter.log|. \end{itemize} \par\medskip\textbf{First example:} @@ -2185,7 +2190,7 @@ following options. \clearpage \begin{docCsvKey}{new sorting rule}{=\marg{name}\marg{file name}}{style, initially unset} This is a convenience option to generate a new shortcut for often used -\refKey{/csvsim/sort by} applications. It also adds a more semantic touch. +\refKey{csvsim/sort by} applications. It also adds a more semantic touch. The new shortcut option is \tcbox[on line,size=small,colback=white,colframe=red]{|sort by| \meta{name}} which expands to \tcbox[on line,size=small,colback=white,colframe=red]{|sort by=|\marg{file name}}.\par\medskip @@ -2209,7 +2214,7 @@ Now, we can use the new rule: \begin{docCommand}[doc new=2021-06-28]{csvsortingrule}{\marg{name}\marg{file name}} - Identical in function to \refKey{/csvsim/new sorting rule}, see above. + Identical in function to \refKey{csvsim/new sorting rule}, see above. A good place for setting up a new sorting rule would be inside the preamble: \csvsortingrule{name}{namesort.xml} @@ -2235,29 +2240,31 @@ the \ctanpkg{tabularray} package, collecting the data from the CSV file into a m This macro can be given to the target application for further processing. -\begin{docCsvKey}[][doc new=2021-07-06]{collect data}{\colOpt{=true\textbar false}}{default |true|, initially |false|} +\begin{docCsvKey}[][doc new and updated={2021-07-06}{2023-10-17}]{collect data}{\colOpt{=true\textbar false}}{default |true|, initially |false|} |csvsimple-l3| provides limited and experimental support to collect the input data from the CSV file plus user additions into a macro named \refCom{csvdatacollection}. -Setting \refKey{/csvsim/collect data} adds the contents of the following keys +Setting \refKey{csvsim/collect data} adds the contents of the following keys to \refCom{csvdatacollection}: \begin{itemize} -\item\refKey{/csvsim/after head} -\item\refKey{/csvsim/after line} -\item\refKey{/csvsim/before first line} -\item\refKey{/csvsim/before line} -\item\refKey{/csvsim/late after first line} -\item\refKey{/csvsim/late after head} -\item\refKey{/csvsim/late after last line} -\item\refKey{/csvsim/late after line} +\item\refKey{csvsim/after head} +\item\refKey{csvsim/after first line} +\item\refKey{csvsim/after line} +\item\refKey{csvsim/before first line} +\item\refKey{csvsim/before line} +\item\refKey{csvsim/late after first line} +\item\refKey{csvsim/late after head} +\item\refKey{csvsim/late after last line} +\item\refKey{csvsim/late after line} \end{itemize} Also, the \emph{expanded} content of \begin{itemize} -\item\refKey{/csvsim/command} +\item\refKey{csvsim/command} \end{itemize} -is added to \docAuxCommand{csvdatacollection}. -Note that for \refKey{/csvsim/command} special care has to be taken +is added to \refCom{csvdatacollection} +(depending on \refKey{csvsim/consume collected data} and \refKey{csvsim/data collection}). +Note that for \refKey{csvsim/command} special care has to be taken \emph{what} should be protected from expansion and \emph{what not}. -Observe the following hints for \refKey{/csvsim/command}: +Observe the following hints for \refKey{csvsim/command}: \begin{itemize} \item For data macros like |\csvcoli| use |\csvexpval\csvcoli| to add the \emph{value} of this macro to \refCom{csvdatacollection}. @@ -2284,14 +2291,22 @@ Collected data:\par \end{dispExample} Note that data collection is \emph{limited} to some special cases and does not -allow to save all possible content. Table options like \refKey{/csvsim/longtable} -are generally not supported with the important exception of \refKey{/csvsim/tabularray} -which uses \refKey{/csvsim/collect data} automatically.\par +allow to save all possible content. Table options like \refKey{csvsim/longtable} +are generally not supported with the important exception of \refKey{csvsim/tabularray} +which uses \refKey{csvsim/collect data} automatically.\par See \Fullref{sec:tabularray} for examples. \end{docCsvKey} \clearpage +\begin{docCsvKey}[][doc new={2023-12-18}]{consume collected data}{\colOpt{=true\textbar false}}{default |true|, initially |false|} +If set to |false|, the collected data of a CSV file processed with +\refKey{csvsim/collect data} is saved into \refCom{csvdatacollection}.\par +Otherwise, if set to |true|, the collected data is not saved, but directly used +after reading the CSV file, see \refKey{csvsim/generic collected table}. +\end{docCsvKey} + + \begin{docCsvKey}[][doc new=2021-07-06]{data collection}{=\meta{macro}}{no default, initially \refCom{csvdatacollection}} Sets the collection macro to an alternative for \refCom{csvdatacollection}. \begin{dispListing} @@ -2302,14 +2317,14 @@ Sets the collection macro to an alternative for \refCom{csvdatacollection}. \begin{docCommand}[doc new=2021-07-06]{csvdatacollection}{} Macro which contains the collected data of a CSV file processed with - \refKey{/csvsim/collect data}. This macro name can be changed by - setting \refKey{/csvsim/data collection}. + \refKey{csvsim/collect data}. This macro name can be changed by + setting \refKey{csvsim/data collection}. \end{docCommand} -\begin{docCommand}[doc new=2021-07-06]{csvexpval}{\meta{macro}} +\begin{docCommand}[doc new and updated={2021-07-06}{2023-12-17}]{csvexpval}{\meta{macro}} Recovers the content of the given \meta{macro} and prevents further - expansion. This is a wrapper for \docAuxCommand*{exp_not:V}. + expansion. This is a wrapper for \docAuxCommand*{exp_not:o}. Alternatively, |\expandonce| from \ctanpkg{etoolbox} could be used. \end{docCommand} @@ -2321,90 +2336,128 @@ Sets the collection macro to an alternative for \refCom{csvdatacollection}. \end{docCommand} The following macros can only be used inside keys which are \emph{not} -collected to \refCom{csvdatacollection}, e.g. inside \refKey{/csvsim/after filter}. +collected to \refCom{csvdatacollection}, e.g. inside \refKey{csvsim/after filter}. -\begin{docCommand}[doc new=2021-07-06]{csvcollectn}{\marg{code}} +\begin{docCommand}[doc new and updated={2021-07-06}{2023-12-17}]{csvcollectn}{\marg{code}} Appends the given \meta{code} to \refCom{csvdatacollection}.\\ - This corresponds to \docAuxCommand*{tl_gput_right:Nn}. + This corresponds to \docAuxCommand*{tl_build_gput_right:Nn}. \end{docCommand} -\begin{docCommand}[doc new=2021-07-06]{csvcollectx}{\marg{code}} +\begin{docCommands}[ + doc parameter = \marg{code} + ] + { + { doc name = csvcollecte, doc new and updated = {2021-07-06}{2023-12-18} }, + { doc name = csvcollectx } + } Appends the expansion of the given \meta{code} to \refCom{csvdatacollection}.\\ - This corresponds to \docAuxCommand*{tl_gput_right:Nx}. -\end{docCommand} + This corresponds to \docAuxCommand*{tl_build_gput_right:Ne}.\\ + \refCom{csvcollectx} is an alias for \refCom{csvcollecte} and is kept for backward compatibility. +\end{docCommands} -\begin{docCommand}[doc new=2021-07-06]{csvcollectV}{\meta{macro}} +\begin{docCommand}[doc new and updated={2021-07-06}{2023-12-17}]{csvcollectV}{\meta{macro}} Appends the content of the given \meta{macro} to \refCom{csvdatacollection}.\\ - This corresponds to \docAuxCommand*{tl_gput_right:NV}. + This corresponds to \docAuxCommand*{tl_build_gput_right:Ne} and \docAuxCommand*{exp_not:o} for + \meta{macro}. \end{docCommand} \clearpage \section{String and Number Tests}\label{sec:stringtests}% -The following string tests are complementing the string tests -from packages like |etoolbox|. They all do the same, i.e., -comparing expanded strings for equality. To some extent, they are -provided for backward compatibility. -\begin{itemize} -\item\refCom{ifcsvstrcmp} may be the most efficient method, because it uses - the native compiler string comparison (if available). -\item\refCom{ifcsvstrequal} does not rely on a compiler. It also is the - fallback implementation for \refCom{ifcsvstrcmp}, if there is no - native comparison method. -\item\refCom{ifcsvprostrequal} is possibly more failsafe than the other two - string tests. It may be used, if strings contain dirty things like |\textbf{A}|. -\end{itemize} +The following string and number tests are, to some extent, provided for +backward compatibility. +Mainly, they are wrappers for corresponding |expl3| conditionals. +Therefore, you are encouraged to use the following CamelCase macros +like \refCom{IfCsvsimStrEqualTF} which provide by their name insight +to the underlying |expl3| functions. The lowercase variants are kept +for backward compatibility. \medskip -\begin{docCommand}[doc new and updated={2016-07-01}{2021-06-28}]{ifcsvstrcmp}{\marg{stringA}\marg{stringB}\marg{true}\marg{false}} + +\begin{docCommands}[ + doc parameter = \marg{string A}\marg{string B}\marg{true}\marg{false} + ] + { + { doc name = IfCsvsimStrEqualTF, doc new and updated = {2016-07-01}{2023-12-19} }, + { doc name = ifcsvstrcmp, color command=black } + } Compares two strings and executes \meta{true} if they are equal, and \meta{false} otherwise. - The comparison is done using |\str_compare:eNeTF|. - \refCom{ifcsvstrcmp} is expandable. -\end{docCommand} + The comparison is done using |\str_if_eq:eeTF|. + \refCom{IfCsvsimStrEqualTF} is expandable. + Typically, this is the preferred function for many use cases. +\end{docCommands} -\begin{docCommand}[doc new and updated={2016-07-01}{2021-06-28}]{ifcsvnotstrcmp}{\marg{stringA}\marg{stringB}\marg{true}\marg{false}} +\begin{docCommand}[doc new and updated={2016-07-01}{2021-06-28},color command=black]{ifcsvnotstrcmp}{\marg{string A}\marg{string B}\marg{true}\marg{false}} Compares two strings and executes \meta{true} if they are \emph{not} equal, and \meta{false} otherwise. - The implementation uses \refCom{ifcsvstrcmp}. - \refCom{ifcsvstrcmp} is expandable. + The implementation uses \refCom{IfCsvsimStrEqualTF}. + \refCom{ifcsvnotstrcmp} is expandable. + Consider using \refCom{IfCsvsimStrEqualTF} alternatively. \end{docCommand} -\begin{docCommand}[doc new and updated={2016-07-01}{2021-06-28}]{ifcsvstrequal}{\marg{stringA}\marg{stringB}\marg{true}\marg{false}} - Compares two strings and executes \meta{true} if they are equal, and \meta{false} otherwise. - The strings are expanded - and the comparison is done using |\tl_if_eq:NNTF|. - \refCom{ifcsvstrequal} is not expandable. -\end{docCommand} +\begin{docCommands}[ + doc parameter = \marg{token list A}\marg{token list B}\marg{true}\marg{false} + ] + { + { doc name = IfCsvsimTlEqualTF, doc new and updated = {2016-07-01}{2023-12-19} }, + { doc name = ifcsvstrequal, color command=black } + } + Compares two token lists and executes \meta{true} if they are equal, and \meta{false} otherwise. + The comparison is done using |\tl_if_eq:eeTF|. + \refCom{IfCsvsimTlEqualTF} is not expandable. + If you have no special reason for using a token list comparison, where + characters and category codes of those characters are compared, you may + rather choose \refCom{IfCsvsimStrEqualTF}. +\end{docCommands} -\begin{docCommand}[doc new and updated={2016-07-01}{2021-06-28}]{ifcsvprostrequal}{\marg{stringA}\marg{stringB}\marg{true}\marg{false}} - Compares two strings and executes \meta{true} if they are equal, and \meta{false} otherwise. - The strings are expanded with |\protected@edef| + +\begin{docCommands}[ + doc parameter = \marg{token list A}\marg{token list B}\marg{true}\marg{false} + ] + { + { doc name = IfCsvsimTlProtectedEqualTF, doc new and updated = {2016-07-01}{2023-12-19} }, + { doc name = ifcsvprostrequal, color command=black } + } + Compares two token lists and executes \meta{true} if they are equal, and \meta{false} otherwise. + The token lists are expanded with |\protected@edef| in the test, i.e. parts of the - strings which are protected stay unexpanded. + token lists which are protected stay unexpanded. The comparison is done using |\tl_if_eq:NNTF|. - \refCom{ifcsvprostrequal} is not expandable. -\end{docCommand} - + \refCom{IfCsvsimTlProtectedEqualTF} is not expandable. +\end{docCommands} -The following number tests are wrappers for corresponding \LaTeX3 conditionals. -\begin{docCommand}[doc new={2021-06-28}]{ifcsvfpcmp}{\marg{floating point expression}\marg{true}\marg{false}} +\begin{docCommands}[ + doc parameter = \marg{floating point expression}\marg{token list B}\marg{true}\marg{false} + ] + { + { doc name = IfCsvsimFpCompareTF, doc new and updated = {2021-06-28}{2023-12-19} }, + { doc name = ifcsvfpcmp, color command=black } + } Evaluates the given \meta{floating point expression} and executes \meta{true} or \meta{false} appropriately. The evaluation is done using |\fp_compare:nTF|. - \refCom{ifcsvfpcmp} is expandable. -\end{docCommand} + \refCom{IfCsvsimFpCompareTF} is expandable. +\end{docCommands} -\begin{docCommand}[doc new={2021-06-28}]{ifcsvintcmp}{\marg{integer expression}\marg{true}\marg{false}} + +\begin{docCommands}[ + doc parameter = \marg{integer expression}\marg{token list B}\marg{true}\marg{false} + ] + { + { doc name = IfCsvsimIntCompareTF, doc new and updated = {2021-06-28}{2023-12-19} }, + { doc name = ifcsvintcmp, color command=black } + } Evaluates the given \meta{integer expression} and executes \meta{true} or \meta{false} appropriately. The evaluation is done using |\int_compare:nTF|. - \refCom{ifcsvintcmp} is expandable. -\end{docCommand} + \refCom{IfCsvsimIntCompareTF} is expandable. +\end{docCommands} + \clearpage @@ -2472,13 +2525,13 @@ introduced. \begin{dispExample} % this example requires the tcolorbox package -\newcommand{\ifmale}[2]{\ifcsvstrcmp{\gender}{m}{#1}{#2}} +\newcommand{\ifmale}[2]{\IfCsvsimStrEqualTF{\gender}{m}{#1}{#2}} \csvreader[head to column names]{address.csv}{}{% \begin{tcolorbox}[colframe=DarkGray,colback=White,arc=0mm,width=(\linewidth-2pt)/2, equal height group=letter,before=,after=\hfill,fonttitle=\bfseries, adjusted title={Letter to \name}] - \ifcsvstrcmp{\degree}{}{\ifmale{Mr.}{Ms.}}{\degree}~\givenname~\name\\ + \IfCsvsimStrEqualTF{\degree}{}{\ifmale{Mr.}{Ms.}}{\degree}~\givenname~\name\\ \street\\\zip~\location \tcblower {\itshape Dear \ifmale{Sir}{Madam},}\\ @@ -2809,7 +2862,7 @@ Hessen,B,2100 \csvlisting{data_headless} -Note that you cannot use the \refKey{/csvsim/no head} option for the auto tabular +Note that you cannot use the \refKey{csvsim/no head} option for the auto tabular commands. If no options are given, the first line is interpreted as header line which gives an unpleasant result: @@ -2837,8 +2890,8 @@ This example can be extended to insert a table head for this headless data: \clearpage -For the normal \refCom{csvreader} command, the \refKey{/csvsim/no head} option -should be applied. Of course, we cannot use \refKey{/csvsim/head to column names} +For the normal \refCom{csvreader} command, the \refKey{csvsim/no head} option +should be applied. Of course, we cannot use \refKey{csvsim/head to column names} because there is no head, but the columns can be addressed by their numbers: \begin{dispExample} @@ -2858,11 +2911,11 @@ because there is no head, but the columns can be addressed by their numbers: \subsection{Tables with \texttt{tabularray}}\label{sec:tabularray}% The \ctanpkg{tabularray} package gives extended control for generating -tables. \refKey{/csvsim/tabularray} and \refKey{/csvsim/centered tabularray} +tables. \refKey{csvsim/tabularray} and \refKey{csvsim/centered tabularray} support such tables. A distinctiveness is that for \ctanpkg{tabularray} data from a CSV file has to be \emph{collected} first (into a macro) and applied afterwards. The process is hidden from the user view, but -has to be taken into account when \refKey{/csvsim/command} is set up, +has to be taken into account when \refKey{csvsim/command} is set up, see \Fullref{sec:datacollection}. The following examples uses |data.csv| from \Fullref{sec:examgrapghpres}. @@ -2882,7 +2935,7 @@ The following examples uses |data.csv| from \Fullref{sec:examgrapghpres}. }, table head = {\SetCell[c=4]{c} Important Data Table \\}, ]{data.csv}{}{ - \ifcsvstrcmp{\group}{A}{\csvexpnot\SetRow{brown7}}{} + \IfCsvsimStrEqualTF{\group}{A}{\csvexpnot\SetRow{brown7}}{} \csvexpnot\SetCell{bg=purple7} \csvexpval\land & \csvexpval\group @@ -2894,16 +2947,16 @@ The following examples uses |data.csv| from \Fullref{sec:examgrapghpres}. Note in the example above that \begin{itemize} -\item \refKey{/csvsim/table head} is \emph{collected} unexpanded, i.e. +\item \refKey{csvsim/table head} is \emph{collected} unexpanded, i.e. |\SetCell| has not to be protected. On the other hand, CSV data could not be used here. -\item \refKey{/csvsim/command} is \emph{collected} expanded. This is identical +\item \refKey{csvsim/command} is \emph{collected} expanded. This is identical to the mandatory last argument of \refCom{csvreader}. \begin{itemize} \item Therefore, expansion of |\SetRow|, |\SetCell|, etc. is prevented by \refCom{csvexpnot}. \item The \emph{values} (content) of |\land|, |\group|, etc. are recovered by \refCom{csvexpval}. - \item |\ifcsvstrcmp| and |\fpeval| are \emph{expandable} and therefore the + \item |\IfCsvsimStrEqualTF| and |\fpeval| are \emph{expandable} and therefore the results of these commands are \emph{collected}. \item |\tablenum| from \ctanpkg{siunitx} is a robust command and therefore needs no protection. If you are not sure, if a command is robust or not, it @@ -2973,7 +3026,7 @@ optional argument. \csvautotabularray[table centered]{data.csv} [ row{odd} = {blue!85!gray!7}, - row{1} = {blue!50!gray!25, font=\bfseries}, + row{1} = {blue!50!gray!25, font=\bfseries, preto=\MakeUppercase}, hline{1,Z} = {0.1em, blue!50!black}, hline{2} = {blue!50!black} ] -- cgit v1.2.3