diff options
author | Norbert Preining <norbert@preining.info> | 2024-01-20 03:01:12 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-01-20 03:01:12 +0000 |
commit | 2fd07558ccd8d3c8e354f8ea0b342ef7ac1e87a3 (patch) | |
tree | dfa08a4c648cc5f7b4c8e5a55fcae40546d96d7d /macros/latex/contrib/csvsimple | |
parent | 849336321485cc972b028c23f8276fa6bdf4818e (diff) |
CTAN sync 202401200301
Diffstat (limited to 'macros/latex/contrib/csvsimple')
-rw-r--r-- | macros/latex/contrib/csvsimple/CHANGES.md | 32 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/README.md | 4 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-doc.sty | 10 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-example.pdf | bin | 72044 -> 72044 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-example.tex | 4 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-l3.pdf | bin | 933300 -> 937516 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-l3.sty | 296 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-l3.tex | 459 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-legacy.pdf | bin | 690985 -> 690987 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-legacy.sty | 6 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-legacy.tex | 4 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple.pdf | bin | 295804 -> 295559 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple.sty | 17 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple.tex | 4 |
14 files changed, 477 insertions, 359 deletions
diff --git a/macros/latex/contrib/csvsimple/CHANGES.md b/macros/latex/contrib/csvsimple/CHANGES.md index 18e055de83..768f8f65cb 100644 --- a/macros/latex/contrib/csvsimple/CHANGES.md +++ b/macros/latex/contrib/csvsimple/CHANGES.md @@ -16,6 +16,38 @@ and this project adheres to ### Security + +## [2.6.0] - 2024-01-19 + +### Added +- `consume collected data` +- `\csvcollecte` (replacement for `\csvcollectx`) +- New CamelCase macro names for several existing string and number test macros + to adapt expl3 naming conventions (issue #34): + - `\IfCsvsimStrEqualTF` + - `\IfCsvsimTlEqualTF` + - `\IfCsvsimTlProtectedEqualTF` + - `\IfCsvsimFpCompareTF` + - `\IfCsvsimIntCompareTF` + +### Changed +- Default settings for `\csvautotabularray` and friends slightly changed + (line width and added uppercase setting) +- In documentation for `collect data`, `after first line` is + added to the list of collected keys (issue/pull request #31) +- Expl3 scratch variables like `\l_tmpa_tl` replaced by package variables like `\l__csvsim_tmpa_tl` +- Implementation of `\csvexpval` changed from `\exp_not:V` to `\exp_not:o` +- Implementation of `data collection` changed to piecewise token list constructions +- Implementation of `generic collected table` does not alter `after reading` anymore +- Implementation of `\ifcsvstrcmp` and `\ifcsvstrequal` changed +- Documentation of Section "String and Number Tests" updated (issue #33) +- Leading `/` removed from all l3keys inside the documentation +- `l3keys2e` removed from `csvsimple.sty` and code adapted +- Needed LaTeX version updated to 2023-11-01 +- Several minor changes + + + ## [2.5.0] - 2023-10-16 ### Added diff --git a/macros/latex/contrib/csvsimple/README.md b/macros/latex/contrib/csvsimple/README.md index d72e0a6cc7..d3e0860104 100644 --- a/macros/latex/contrib/csvsimple/README.md +++ b/macros/latex/contrib/csvsimple/README.md @@ -1,7 +1,7 @@ -# The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +# The LaTeX package csvsimple - version 2.6.0 (2024/01/19) -> Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +> Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> > This work may be distributed and/or modified under the > conditions of the LaTeX Project Public License, either version 1.3 diff --git a/macros/latex/contrib/csvsimple/csvsimple-doc.sty b/macros/latex/contrib/csvsimple/csvsimple-doc.sty index 36f052ac9b..2f507037fb 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-doc.sty +++ b/macros/latex/contrib/csvsimple/csvsimple-doc.sty @@ -1,9 +1,9 @@ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +%% The LaTeX package csvsimple - version 2.6.0 (2024/01/19) %% csvsimple-doc.sty: style file for the documentation %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -18,8 +18,8 @@ %% %% This work consists of all files listed in README.md %% -\def\version{2.5.0}% -\def\datum{2023/10/16}% +\def\version{2.6.0}% +\def\datum{2024/01/19}% \IfFileExists{csvsimple-doc.cfg}{\input{csvsimple-doc.cfg}}{}\providecommand\csvpkgprefix{} @@ -33,7 +33,7 @@ \RequirePackage[english]{babel} \RequirePackage{lmodern,parskip,array,ifthen,calc,makeidx} \RequirePackage{amsmath,amssymb} -\RequirePackage[svgnames,table,hyperref]{xcolor} +\RequirePackage[svgnames,table]{xcolor} \RequirePackage{tikz,siunitx,xfp,tabularray} \RequirePackage{varioref} \RequirePackage[pdftex,bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref} diff --git a/macros/latex/contrib/csvsimple/csvsimple-example.pdf b/macros/latex/contrib/csvsimple/csvsimple-example.pdf Binary files differindex 8915e27291..5485a99c1e 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-example.pdf +++ b/macros/latex/contrib/csvsimple/csvsimple-example.pdf diff --git a/macros/latex/contrib/csvsimple/csvsimple-example.tex b/macros/latex/contrib/csvsimple/csvsimple-example.tex index 5d872f5fb2..364596562a 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-example.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-example.tex @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +%% The LaTeX package csvsimple - version 2.6.0 (2024/01/19) %% csvsimple-example.tex: an example for csvsimple %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.pdf b/macros/latex/contrib/csvsimple/csvsimple-l3.pdf Binary files differindex 9bf62e2f40..bbef5c75a9 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-l3.pdf +++ b/macros/latex/contrib/csvsimple/csvsimple-l3.pdf diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.sty b/macros/latex/contrib/csvsimple/csvsimple-l3.sty index cb6a676054..9aa9b2c428 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-l3.sty +++ b/macros/latex/contrib/csvsimple/csvsimple-l3.sty @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +%% The LaTeX package csvsimple - version 2.6.0 (2024/01/19) %% csvsimple-l3.sty: Simple LaTeX CSV file processing (LaTeX3) %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -17,11 +17,11 @@ %% %% This work consists of all files listed in README.md %% -\ProvidesExplPackage{csvsimple-l3}{2023/10/16}{2.5.0} +\NeedsTeXFormat{LaTeX2e}[2023-11-01] +\ProvidesExplPackage{csvsimple-l3}{2024/01/19}{2.6.0} {LaTeX3 CSV file processing} - %---- check package \cs_if_exist:NT \c__csvsim_package_expl_bool @@ -42,10 +42,12 @@ \bool_new:N \g__csvsim_check_column_count_bool \bool_new:N \g__csvsim_collect_data_bool \bool_new:N \g__csvsim_colnames_detection_bool +\bool_new:N \g__csvsim_consume_collected_data_bool \bool_new:N \g__csvsim_head_bool \bool_new:N \g__csvsim_head_to_colnames_bool \bool_new:N \g__csvsim_line_accepted_bool \bool_new:N \g__csvsim_line_firstline_bool + \bool_new:N \l__csvsim_respect_and_bool \bool_new:N \l__csvsim_respect_backslash_bool \bool_new:N \l__csvsim_respect_circumflex_bool @@ -60,22 +62,30 @@ \int_new:N \g__csvsim_col_int \int_new:N \g__csvsim_colmax_int +\int_new:N \g_csvsim_columncount_int \int_new:N \g_csvsim_inputline_int \int_new:N \g_csvsim_row_int -\int_new:N \g_csvsim_columncount_int + +\int_new:N \l__csvsim_tmpa_int +\int_new:N \l__csvsim_tmpb_int \seq_new:N \g__csvsim_colname_seq \seq_new:N \g__csvsim_line_seq \seq_new:N \g__csvsim_range_seq +\seq_new:N \l__csvsim_tmpa_seq + \str_new:N \g__csvsim_curfilename_str \str_new:N \g__csvsim_filename_str + \str_new:N \l__csvsim_csvsorter_command_str \str_new:N \l__csvsim_csvsorter_configpath_str \str_new:N \l__csvsim_csvsorter_log_str \str_new:N \l__csvsim_csvsorter_token_str \str_new:N \l__csvsim_ppfilename_str \str_new:N \l__csvsim_temp_filename_str +\str_new:N \l__csvsim_tmpa_str +\str_new:N \l__csvsim_tmpb_str \tl_const:Nn \c__csvsim_par_tl { \par } @@ -104,16 +114,19 @@ \tl_new:N \g__csvsim_hook_late_after_first_line_tl \tl_new:N \g__csvsim_hook_late_after_head_tl \tl_new:N \g__csvsim_hook_late_after_last_line_tl -\tl_new:N \g__csvsim_hook_late_after_line_tl \tl_new:N \g__csvsim_hook_late_after_line_application_tl +\tl_new:N \g__csvsim_hook_late_after_line_tl \tl_new:N \g__csvsim_hook_table_begin_tl \tl_new:N \g__csvsim_hook_table_end_tl \tl_new:N \g__csvsim_preprocessor_tl \tl_new:N \g__csvsim_separator_tl \tl_new:N \g__csvsim_table_foot_tl \tl_new:N \g__csvsim_table_head_tl +\tl_new:N \g__csvsim_tmpa_tl \tl_new:N \l__csvsim_filter_condition_tl +\tl_new:N \l__csvsim_tmpa_tl +\tl_new:N \l__csvsim_tmpb_tl \group_begin: @@ -164,9 +177,9 @@ { \group_begin: \g__csvsim_catcode_tl - \ior_get:NNTF \g__csvsim_ior \l_tmpa_tl + \ior_get:NNTF \g__csvsim_ior \l__csvsim_tmpa_tl { - \tl_gset_eq:NN \csvline \l_tmpa_tl + \tl_gset_eq:NN \csvline \l__csvsim_tmpa_tl \int_gincr:N \g_csvsim_inputline_int } { @@ -199,13 +212,15 @@ \cs_new_protected_nopar:Npn \__csvsim_process_head_name:n #1 { - \tl_set:No \l_tmpa_tl {\cs:w csvcol\int_to_roman:n{#1} \cs_end:} - \exp_args:NnV \cs_set_nopar:cpn {__csvsim__/\l_tmpa_tl} \l_tmpa_tl + \tl_set:No \l__csvsim_tmpa_tl {\cs:w csvcol\int_to_roman:n{#1} \cs_end:} + \exp_args:NnV \cs_set_nopar:cpn {__csvsim__/\l__csvsim_tmpa_tl} \l__csvsim_tmpa_tl \bool_if:NT \g__csvsim_head_to_colnames_bool { - \tl_set:No \l_tmpb_tl {\cs:w \g__csvsim_headname_prefix_tl \l_tmpa_tl \cs_end:} - \tl_put_right:NV \l_tmpb_tl \l_tmpa_tl - \exp_args:NNV \seq_gput_right:Nn \g__csvsim_colname_seq \l_tmpb_tl + \exp_args:NNe \seq_gput_right:Nn \g__csvsim_colname_seq + { + \exp_not:o { \cs:w \g__csvsim_headname_prefix_tl \l__csvsim_tmpa_tl \cs_end: } + \exp_not:o { \l__csvsim_tmpa_tl } + } } } @@ -215,7 +230,7 @@ \__csvsim_read_line: \tl_if_eq:NNTF \csvline \c__csvsim_par_tl { - \msg_error:nnx { csvsimple }{ empty-head }{ \g__csvsim_filename_str } + \msg_error:nne { csvsimple }{ empty-head }{ \g__csvsim_filename_str } } { \int_gzero:N \g_csvsim_columncount_int @@ -232,20 +247,24 @@ { \cs_if_exist:cTF {__csvsim__/#1} { - \tl_set:Nv \l_tmpa_tl {__csvsim__/#1} - \tl_put_left:Nn \l_tmpa_tl {#2} - \exp_args:NNV \seq_gput_right:Nn \g__csvsim_colname_seq \l_tmpa_tl + \exp_args:NNe \seq_gput_right:Nn \g__csvsim_colname_seq + { + \exp_not:n { #2 } + \exp_not:v { __csvsim__/#1 } + } } { \regex_match:NnTF \c__csvsim_integer_regex {#1} { - \tl_set:No \l_tmpa_tl {\cs:w csvcol\int_to_roman:n{#1} \cs_end:} - \tl_put_left:Nn \l_tmpa_tl {#2} - \exp_args:NNV \seq_gput_right:Nn \g__csvsim_colname_seq \l_tmpa_tl + \exp_args:NNe \seq_gput_right:Nn \g__csvsim_colname_seq + { + \exp_not:n { #2 } + \exp_not:o { \cs:w csvcol\int_to_roman:n{#1} \cs_end: } + } } { - \str_set:Nn \l_tmpb_str {#2} - \msg_error:nnxx { csvsimple }{ column-name }{ #1 }{ \l_tmpb_str } + \str_set:Nn \l__csvsim_tmpb_str {#2} + \msg_error:nnee { csvsimple }{ column-name }{ #1 }{ \l__csvsim_tmpb_str } } } } @@ -284,7 +303,7 @@ \int_gset_eq:NN \g__csvsim_colmax_int \c_one_int \bool_if:NT \g__csvsim_collect_data_bool { - \__csvsim_collect_data: + \__csvsim_collect_data_begin: } % open file @@ -368,10 +387,10 @@ % clear macros \int_step_inline:nn \g__csvsim_colmax_int { - \tl_set:No \l_tmpa_tl {\cs:w csvcol\int_to_roman:n{##1} \cs_end:} - \use:x + \tl_set:No \l__csvsim_tmpa_tl {\cs:w csvcol\int_to_roman:n{##1} \cs_end:} + \use:e { - \exp_not:N\tl_gclear:N \exp_not:V\l_tmpa_tl + \exp_not:N\tl_gclear:N \exp_not:V\l__csvsim_tmpa_tl } } \__csvsim_set_colnames: @@ -384,8 +403,7 @@ \g__csvsim_hook_after_reading_tl \bool_if:NT \g__csvsim_collect_data_bool { - \exp_args:NV \tl_gset_eq:NN \g__csvsim_data_collection_tl \g__csvsim_collect_tl - \tl_gclear:N \g__csvsim_collect_tl + \__csvsim_collect_data_end: } } @@ -408,25 +426,6 @@ %---- auxiliary user macros -% \NewDocumentCommand \csvlinetotablerow { } - % { - % \tl_clear:N \l_tmpa_tl - % \bool_set_false:N \l_tmpa_bool - % \seq_map_inline:Nn \g__csvsim_line_seq - % { - % \bool_if:NTF \l_tmpa_bool - % { - % \tl_put_right:Nn \l_tmpa_tl { & ##1 } - % } - % { - % \tl_put_right:Nn \l_tmpa_tl { ##1 } - % \bool_set_true:N \l_tmpa_bool - % } - % } - % \l_tmpa_tl - % } - - \NewExpandableDocumentCommand \csvlinetotablerow { } { \seq_use:Nn \g__csvsim_line_seq { & } @@ -475,44 +474,50 @@ } -\NewExpandableDocumentCommand \ifcsvstrcmp { m m } +%---- String and Number Tests + + +\NewExpandableDocumentCommand \IfCsvsimStrEqualTF { } { - \str_compare:eNeTF {#1} = {#2} + \str_if_eq:eeTF } +\NewCommandCopy \ifcsvstrcmp \IfCsvsimStrEqualTF \NewExpandableDocumentCommand \ifcsvnotstrcmp { m m +m +m } { - \ifcsvstrcmp{#1}{#2}{#4}{#3} + \IfCsvsimStrEqualTF{#1}{#2}{#4}{#3} } -\NewDocumentCommand \ifcsvstrequal { m m } +\NewDocumentCommand \IfCsvsimTlEqualTF { } { - \tl_set:Nx \l_tmpa_tl {#1} - \tl_set:Nx \l_tmpb_tl {#2} - \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl + \tl_if_eq:eeTF } +\NewCommandCopy \ifcsvstrequal \IfCsvsimTlEqualTF -\NewDocumentCommand \ifcsvprostrequal { m m } +\NewDocumentCommand \IfCsvsimTlProtectedEqualTF { m m } { - \protected@edef \l_tmpa_tl {#1} - \protected@edef \l_tmpb_tl {#2} - \tl_if_eq:NNTF \l_tmpa_tl \l_tmpb_tl + \protected@edef \l__csvsim_tmpa_tl {#1} + \protected@edef \l__csvsim_tmpb_tl {#2} + \tl_if_eq:NNTF \l__csvsim_tmpa_tl \l__csvsim_tmpb_tl } +\NewCommandCopy \ifcsvprostrequal \IfCsvsimTlProtectedEqualTF -\NewExpandableDocumentCommand \ifcsvfpcmp { m } +\NewExpandableDocumentCommand \IfCsvsimFpCompareTF { m } { \fp_compare:nTF {#1} } +\NewCommandCopy \ifcsvfpcmp \IfCsvsimFpCompareTF -\NewExpandableDocumentCommand \ifcsvintcmp { m } +\NewExpandableDocumentCommand \IfCsvsimIntCompareTF { m } { \int_compare:nTF {#1} } +\NewCommandCopy \ifcsvintcmp \IfCsvsimIntCompareTF %---- filename functions @@ -525,15 +530,15 @@ \str_set:Nn \l__csvsim_temp_filename_str {#1} } { - \str_set:Nn \l_tmpa_str {#1} - \str_if_empty:NF \l_tmpa_str + \str_set:Nn \l__csvsim_tmpa_str {#1} + \str_if_empty:NF \l__csvsim_tmpa_str { - \str_compare:eNeF { \str_item:Nn \l_tmpa_str {-1} } = { / } + \str_compare:eNeF { \str_item:Nn \l__csvsim_tmpa_str {-1} } = { / } { - \str_put_right:Nn \l_tmpa_str {/} + \str_put_right:Nn \l__csvsim_tmpa_str {/} } \str_concat:NNN \l__csvsim_temp_filename_str - \l_tmpa_str \l__csvsim_temp_filename_str + \l__csvsim_tmpa_str \l__csvsim_temp_filename_str } } } @@ -635,7 +640,7 @@ no~check~column~count .meta:n = { check~column~count=false }, warn~on~column~count~error .meta:n = { on~column~count~error= { - \msg_warning:nnxxxx { csvsimple }{ column-wrong-count } + \msg_warning:nneeee { csvsimple }{ column-wrong-count } { \int_use:N\g__csvsim_col_int } { \int_use:N\g_csvsim_columncount_int } { \int_use:N\g_csvsim_inputline_int } @@ -840,51 +845,51 @@ { \tl_if_in:nnTF {#1}{-} { - \seq_set_split:Nnn \l_tmpa_seq {-} {#1} - \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl - \seq_pop_left:NN \l_tmpa_seq \l_tmpb_tl - \tl_if_empty:NTF \l_tmpa_tl + \seq_set_split:Nnn \l__csvsim_tmpa_seq {-} {#1} + \seq_pop_left:NN \l__csvsim_tmpa_seq \l__csvsim_tmpa_tl + \seq_pop_left:NN \l__csvsim_tmpa_seq \l__csvsim_tmpb_tl + \tl_if_empty:NTF \l__csvsim_tmpa_tl { - \int_set_eq:NN \l_tmpa_int \c_one_int + \int_set_eq:NN \l__csvsim_tmpa_int \c_one_int } { - \int_set:Nn \l_tmpa_int { \l_tmpa_tl } + \int_set:Nn \l__csvsim_tmpa_int { \l__csvsim_tmpa_tl } } - \tl_if_empty:NTF \l_tmpb_tl + \tl_if_empty:NTF \l__csvsim_tmpb_tl { - \int_set_eq:NN \l_tmpb_int \c_max_int + \int_set_eq:NN \l__csvsim_tmpb_int \c_max_int } { - \int_set:Nn \l_tmpb_int { \l_tmpb_tl } + \int_set:Nn \l__csvsim_tmpb_int { \l__csvsim_tmpb_tl } } } { \tl_if_in:nnTF {#1}{+} { - \seq_set_split:Nnn \l_tmpa_seq {+} {#1} - \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl - \seq_pop_left:NN \l_tmpa_seq \l_tmpb_tl - \tl_if_empty:NTF \l_tmpa_tl + \seq_set_split:Nnn \l__csvsim_tmpa_seq {+} {#1} + \seq_pop_left:NN \l__csvsim_tmpa_seq \l__csvsim_tmpa_tl + \seq_pop_left:NN \l__csvsim_tmpa_seq \l__csvsim_tmpb_tl + \tl_if_empty:NTF \l__csvsim_tmpa_tl { - \int_set:Nn \l_tmpa_int { 1 } + \int_set:Nn \l__csvsim_tmpa_int { 1 } } { - \int_set:Nn \l_tmpa_int { \l_tmpa_tl } + \int_set:Nn \l__csvsim_tmpa_int { \l__csvsim_tmpa_tl } } - \tl_if_empty:NTF \l_tmpb_tl + \tl_if_empty:NTF \l__csvsim_tmpb_tl { - \int_set_eq:NN \l_tmpb_int \l_tmpa_int + \int_set_eq:NN \l__csvsim_tmpb_int \l__csvsim_tmpa_int } { - \int_set:Nn \l_tmpb_int { \l_tmpa_int + \l_tmpb_tl - 1 } + \int_set:Nn \l__csvsim_tmpb_int { \l__csvsim_tmpa_int + \l__csvsim_tmpb_tl - 1 } } } { - \int_set:Nn \l_tmpa_int {#1} - \int_set_eq:NN \l_tmpb_int \l_tmpa_int + \int_set:Nn \l__csvsim_tmpa_int {#1} + \int_set_eq:NN \l__csvsim_tmpb_int \l__csvsim_tmpa_int } } - \seq_gput_right:Nx \g__csvsim_range_seq {{\int_use:N \l_tmpa_int}{\int_use:N \l_tmpb_int}} + \seq_gput_right:Ne \g__csvsim_range_seq {{\int_use:N \l__csvsim_tmpa_int}{\int_use:N \l__csvsim_tmpb_int}} } @@ -944,28 +949,29 @@ \cs_new_protected_nopar:Npn \__csvsim_gset_tl_to_collect:N #1 { - \tl_gset:Nx #1 + \tl_gset:Ne #1 { - \exp_not:N \tl_gput_right:Nn + \exp_not:N \tl_build_gput_right:Nn \exp_not:N \g__csvsim_collect_tl - {\exp_not:V #1} + { \exp_not:o { #1 } } } } \cs_new_protected_nopar:Npn \__csvsim_gset_tl_to_collect_expanded:N #1 { - \tl_gset:Nx #1 + \tl_gset:Ne #1 { - \exp_not:N \tl_gput_right:Nx + \exp_not:N \tl_build_gput_right:Ne \exp_not:N \g__csvsim_collect_tl - {\exp_not:V #1} + { \exp_not:o { #1 } } } } -\cs_new_protected_nopar:Npn \__csvsim_collect_data: +\cs_new_protected_nopar:Npn \__csvsim_collect_data_begin: { + \tl_build_gbegin:N \g__csvsim_collect_tl \__csvsim_gset_tl_to_collect:N \g__csvsim_hook_after_head_tl \__csvsim_gset_tl_to_collect:N \g__csvsim_hook_after_first_line_tl \__csvsim_gset_tl_to_collect:N \g__csvsim_hook_after_line_tl @@ -976,29 +982,50 @@ \__csvsim_gset_tl_to_collect:N \g__csvsim_hook_late_after_last_line_tl \__csvsim_gset_tl_to_collect:N \g__csvsim_hook_late_after_line_tl \__csvsim_gset_tl_to_collect_expanded:N \g__csvsim_body_tl + } + + +\cs_new_protected_nopar:Npn \__csvsim_collect_data_end: + { + \tl_build_gend:N \g__csvsim_collect_tl + \bool_if:NTF \g__csvsim_consume_collected_data_bool + { + \g__csvsim_collect_tl + \exp_args:NV \tl_gclear:N \g__csvsim_data_collection_tl + } + { + \exp_args:NV \tl_gset_eq:NN \g__csvsim_data_collection_tl \g__csvsim_collect_tl + } \tl_gclear:N \g__csvsim_collect_tl } -\cs_set_eq:NN \csvexpval \exp_not:V +\cs_set_eq:NN \csvexpval \exp_not:o \cs_set_eq:NN \csvexpnot \exp_not:N \NewDocumentCommand{ \csvcollectn }{ +m } { - \tl_gput_right:Nn \g__csvsim_collect_tl {#1} + \tl_build_gput_right:Nn \g__csvsim_collect_tl {#1} + } + + +\NewDocumentCommand{ \csvcollecte }{ +m } + { + \tl_build_gput_right:Ne \g__csvsim_collect_tl {#1} } +% alias for \csvcollecte \NewDocumentCommand{ \csvcollectx }{ +m } { - \tl_gput_right:Nx \g__csvsim_collect_tl {#1} + \tl_build_gput_right:Ne \g__csvsim_collect_tl {#1} } \NewDocumentCommand{ \csvcollectV }{ m } { - \tl_gput_right:NV \g__csvsim_collect_tl #1 + \tl_build_gput_right:Ne \g__csvsim_collect_tl { \exp_not:o { #1 } } } @@ -1006,6 +1033,7 @@ { collect~data .bool_gset:N = \g__csvsim_collect_data_bool, data~collection .tl_gset:N = \g__csvsim_data_collection_tl, + consume~collected~data .bool_gset:N = \g__csvsim_consume_collected_data_bool, } @@ -1139,9 +1167,9 @@ { \g__csvsim_begin_table_center_tl \g__csvsim_before_table_tl - \tl_gset:Nn \g_tmpa_tl {\begin{#1}} - \tl_gput_right:NV \g_tmpa_tl \g__csvsim_generic_table_options_tl - \g_tmpa_tl + \tl_gset:Nn \g__csvsim_tmpa_tl {\begin{#1}} + \tl_gput_right:NV \g__csvsim_tmpa_tl \g__csvsim_generic_table_options_tl + \g__csvsim_tmpa_tl \g__csvsim_table_head_tl } { @@ -1155,25 +1183,28 @@ generic~collected~table .meta:n = { collect~data, + consume~collected~data = true, _table_ = { - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_begin_table_center_tl - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_before_table_tl - \tl_gput_right:Nn \g__csvsim_collect_tl { \begin{#1} } - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_generic_table_options_tl - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_table_head_tl + \tl_build_gput_right:Ne \g__csvsim_collect_tl + { + \exp_not:o { \g__csvsim_begin_table_center_tl } + \exp_not:o { \g__csvsim_before_table_tl } + \exp_not:n { \begin{#1} } + \exp_not:o { \g__csvsim_generic_table_options_tl } + \exp_not:o { \g__csvsim_table_head_tl } + } } { - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_table_foot_tl - \tl_gput_right:Nn \g__csvsim_collect_tl { \end{#1} } - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_after_table_tl - \tl_gput_right:NV \g__csvsim_collect_tl \g__csvsim_end_table_center_tl + \tl_build_gput_right:Ne \g__csvsim_collect_tl + { + \exp_not:o { \g__csvsim_table_foot_tl } + \exp_not:n { \end{#1} } + \exp_not:o { \g__csvsim_after_table_tl } + \exp_not:o { \g__csvsim_end_table_center_tl } + } }, late~after~line = \\, - after~reading = - { - \tl_use:N \g__csvsim_collect_tl - }, }, } @@ -1338,9 +1369,9 @@ _autotabularray_ = {#1}, 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}, } } }, autotabularray* .meta:n = @@ -1348,7 +1379,7 @@ _autotabularray_ = {#1}, generic~table~options = { { - hline{1,Z} = {0.8pt}, + hline{1,Z} = {0.08em}, } } }, _autolongtabularray_ .meta:n = @@ -1363,9 +1394,9 @@ _autolongtabularray_ = {#1}, 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}, } } }, autolongtabularray* .meta:n = @@ -1373,7 +1404,7 @@ _autolongtabularray_ = {#1}, generic~table~options = { { - hline{1,Z} = {0.8pt}, + hline{1,Z} = {0.08em}, } } }, } @@ -1441,14 +1472,14 @@ { \keys_set:nn { csvsim } { autotabularray={#3}, #2} } - \IfNoValueF {#4} + \IfValueT {#4} { - \IfNoValueTF {#5} + \IfValueTF {#5} { - \keys_set:nn { csvsim } { generic~table~options = { { #4 } } } + \keys_set:nn { csvsim } { generic~table~options = { [ #4 ]{ #5 } } } } { - \keys_set:nn { csvsim } { generic~table~options = { [ #4 ]{ #5 } } } + \keys_set:nn { csvsim } { generic~table~options = { { #4 } } } } } \__csvsim_loop: @@ -1465,14 +1496,14 @@ { \keys_set:nn { csvsim } { autolongtabularray={#3}, #2} } - \IfNoValueF {#4} + \IfValueT {#4} { - \IfNoValueTF {#5} + \IfValueTF {#5} { - \keys_set:nn { csvsim } { generic~table~options = { { #4 } } } + \keys_set:nn { csvsim } { generic~table~options = { [ #4 ]{ #5 } } } } { - \keys_set:nn { csvsim } { generic~table~options = { [ #4 ]{ #5 } } } + \keys_set:nn { csvsim } { generic~table~options = { { #4 } } } } } \__csvsim_loop: @@ -1532,7 +1563,7 @@ \sys_if_shell_unrestricted:TF { \__csvsim_set_temp_filename:n { #1 } - \msg_note:nnxx { csvsimple }{ sort-info }{ #2 }{ \l__csvsim_temp_filename_str } + \msg_note:nnee { csvsimple }{ sort-info }{ #2 }{ \l__csvsim_temp_filename_str } \cs_if_exist:NF \g__csvsim_iow { \iow_new:N \g__csvsim_iow @@ -1540,7 +1571,7 @@ \iow_open:Nn \g__csvsim_iow { \l__csvsim_csvsorter_token_str } \iow_now:Nn \g__csvsim_iow { \ExplSyntaxOn \msg_error:nn { csvsimple }{ sort-error } \ExplSyntaxOff } \iow_close:N \g__csvsim_iow - \sys_shell_now:x + \sys_shell_now:e { "\l__csvsim_csvsorter_command_str" \c_space_tl -c~ "\l__csvsim_csvsorter_configpath_str/\l__csvsim_temp_filename_str" \c_space_tl @@ -1576,6 +1607,7 @@ head~to~column~names~prefix = , head~to~column~names = false, collect~data = false, + consume~collected~data = false, column~count = 0, on~column~count~error =, range =, 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 <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% 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} ] diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf b/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf Binary files differindex a2b995531c..7079052a74 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf +++ b/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.sty b/macros/latex/contrib/csvsimple/csvsimple-legacy.sty index f47d7540bd..28b5562b5d 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-legacy.sty +++ b/macros/latex/contrib/csvsimple/csvsimple-legacy.sty @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +%% The LaTeX package csvsimple - version 2.6.0 (2024/01/19) %% csvsimple-legacy.sty: Simple LaTeX CSV file processing (LaTeX2e) %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -18,7 +18,7 @@ %% This work consists of all files listed in README.md %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{csvsimple-legacy}[2023/10/16 version 2.5.0 LaTeX2e CSV file processing] +\ProvidesPackage{csvsimple-legacy}[2024/01/19 version 2.6.0 LaTeX2e CSV file processing] %---- check package diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.tex b/macros/latex/contrib/csvsimple/csvsimple-legacy.tex index 290d512fb5..caa65712ec 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-legacy.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-legacy.tex @@ -1,10 +1,10 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% 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 <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the diff --git a/macros/latex/contrib/csvsimple/csvsimple.pdf b/macros/latex/contrib/csvsimple/csvsimple.pdf Binary files differindex e4b5badc01..7f4023fd07 100644 --- a/macros/latex/contrib/csvsimple/csvsimple.pdf +++ b/macros/latex/contrib/csvsimple/csvsimple.pdf diff --git a/macros/latex/contrib/csvsimple/csvsimple.sty b/macros/latex/contrib/csvsimple/csvsimple.sty index 1d3840f1eb..60776f67ce 100644 --- a/macros/latex/contrib/csvsimple/csvsimple.sty +++ b/macros/latex/contrib/csvsimple/csvsimple.sty @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 2.5.0 (2023/10/16) +%% The LaTeX package csvsimple - version 2.6.0 (2024/01/19) %% csvsimple.sty: Simple LaTeX CSV file processing %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -17,9 +17,8 @@ %% %% This work consists of all files listed in README.md %% -\RequirePackage{l3keys2e} - -\ProvidesExplPackage{csvsimple}{2023/10/16}{2.5.0} +\NeedsTeXFormat{LaTeX2e}[2022-06-01] +\ProvidesExplPackage{csvsimple}{2024/01/19}{2.6.0} {LaTeX CSV file processing} \cs_if_exist:NT \c__csvsim_package_expl_bool @@ -36,14 +35,16 @@ \tex_endinput:D } -\keys_define:nn { csvsimple } +\tl_new:N \l__csvsim_package_expl_tl + +\DeclareKeys { l3 .code:n = \tl_set:Nn \l__csvsim_package_expl_tl { l3 }, legacy .code:n = \tl_set:Nn \l__csvsim_package_expl_tl { legacy }, } -\keys_set:nn { csvsimple } { legacy } +\SetKeys{ legacy } -\ProcessKeysPackageOptions { csvsimple } +\ProcessKeyOptions \RequirePackage{csvsimple-\l__csvsim_package_expl_tl} diff --git a/macros/latex/contrib/csvsimple/csvsimple.tex b/macros/latex/contrib/csvsimple/csvsimple.tex index 7e4e93d1ed..7d34586a42 100644 --- a/macros/latex/contrib/csvsimple/csvsimple.tex +++ b/macros/latex/contrib/csvsimple/csvsimple.tex @@ -1,10 +1,10 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% 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 <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the |