diff options
Diffstat (limited to 'macros/latex/contrib/csvsimple')
-rw-r--r-- | macros/latex/contrib/csvsimple/CHANGES.md | 22 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/README.md | 4 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-doc.sty | 8 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-example.pdf | bin | 75624 -> 72043 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-example.tex | 4 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-l3.pdf | bin | 1102361 -> 921414 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-l3.sty | 82 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-l3.tex | 168 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-legacy.pdf | bin | 828489 -> 690970 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-legacy.sty | 6 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple-legacy.tex | 6 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple.pdf | bin | 309282 -> 295749 bytes | |||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple.sty | 6 | ||||
-rw-r--r-- | macros/latex/contrib/csvsimple/csvsimple.tex | 6 |
14 files changed, 253 insertions, 59 deletions
diff --git a/macros/latex/contrib/csvsimple/CHANGES.md b/macros/latex/contrib/csvsimple/CHANGES.md index 0b6d22cbd6..769baa5b68 100644 --- a/macros/latex/contrib/csvsimple/CHANGES.md +++ b/macros/latex/contrib/csvsimple/CHANGES.md @@ -16,8 +16,28 @@ and this project adheres to ### Security +## [2.4.0] - 2023-05-09 -## [2.3.2 - 2022-09-20] +### Added +- New additive filter options (issue #24): + - `and filter bool` + - `and filter fp` + - `and filter strcmp` + - `and filter not strcmp` + - `or filter bool` + - `or filter fp` + - `or filter strcmp` + - `or filter not strcmp` +- Hook `csvsimple/csvline` added with example for doublequote replacement (issue #19) +- Option setting `separator = space` (issue #20) + +### Changed +- The content of `range` is now expanded before processing it +- Implementation of `filter bool`, `filter fp`, `filter strcmp`, `filter not strcmp` + + + +## [2.3.2] - 2022-09-20 ### Fixed - The `\ifcsvfirstrow` command doesn't work (issue #23) diff --git a/macros/latex/contrib/csvsimple/README.md b/macros/latex/contrib/csvsimple/README.md index aa8735dd43..f0c928fe02 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.3.2 (2022/09/20) +# The LaTeX package csvsimple - version 2.4.0 (2023/05/09) -> Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +> Copyright (c) 2008-2023 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 853462e22e..b30ec16b39 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple-doc.sty: style file for the documentation %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 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.3.2}% -\def\datum{2022/09/20}% +\def\version{2.4.0}% +\def\datum{2023/05/09}% \IfFileExists{csvsimple-doc.cfg}{\input{csvsimple-doc.cfg}}{}\providecommand\csvpkgprefix{} diff --git a/macros/latex/contrib/csvsimple/csvsimple-example.pdf b/macros/latex/contrib/csvsimple/csvsimple-example.pdf Binary files differindex cdf3523190..13485dc4d8 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 8db7e0cbee..3d0fdd0448 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple-example.tex: an example for csvsimple %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 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 fc2ade4296..460c0de9fb 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 96888cea1e..87e48bda79 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple-l3.sty: Simple LaTeX CSV file processing (LaTeX3) %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 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,7 +17,7 @@ %% %% This work consists of all files listed in README.md %% -\ProvidesExplPackage{csvsimple-l3}{2022/09/20}{2.3.2} +\ProvidesExplPackage{csvsimple-l3}{2023/05/09}{2.4.0} {LaTeX3 CSV file processing} @@ -79,7 +79,6 @@ \tl_const:Nn \c__csvsim_par_tl { \par } - \tl_new:N \g__csvsim_after_table_tl \tl_new:N \g__csvsim_before_table_tl \tl_new:N \g__csvsim_begin_table_center_tl @@ -114,6 +113,8 @@ \tl_new:N \g__csvsim_table_foot_tl \tl_new:N \g__csvsim_table_head_tl +\tl_new:N \l__csvsim_filter_condition_tl + \group_begin: \char_set_catcode_other:n { 9 } @@ -122,6 +123,7 @@ \regex_const:Nn \c__csvsim_integer_regex {\A\d+\Z} +\cs_generate_variant:Nn \bool_gset:Nn { NV } \cs_generate_variant:Nn \seq_gset_split:Nnn { NVV } @@ -156,6 +158,8 @@ %---- core loop processing +\NewHook{csvsimple/csvline} + \cs_new_protected_nopar:Npn \__csvsim_read_line: { \group_begin: @@ -169,6 +173,7 @@ \msg_error:nnx { csvsimple }{ file-error }{ \g__csvsim_curfilename_str } } \group_end: + \UseHook{csvsimple/csvline} } @@ -621,6 +626,10 @@ \tl_gset:NV \g__csvsim_separator_tl \c__csvsim_tab_str \csvset{respect~tab} }, + separator/space .code:n = + { + \tl_gset:Nn \g__csvsim_separator_tl {~} + }, every~csv .meta:n = {}, no~head .meta:n = { head=false }, no~check~column~count .meta:n = { check~column~count=false }, @@ -679,6 +688,16 @@ } +\cs_new_protected_nopar:Npn \__csvsim_set_filter_bool:n #1 + { + \tl_set:Nn \l__csvsim_filter_condition_tl { #1 } + \tl_gset:Nn \g__csvsim_filter_tl + { + \bool_gset:NV \g__csvsim_line_accepted_bool \l__csvsim_filter_condition_tl + } + } + + \NewDocumentCommand \csvfilteraccept { } { \__csvsim_set_filter:n @@ -723,20 +742,52 @@ }, filter~bool .code:n = { - \__csvsim_set_filter:n - { - \bool_gset:Nn \g__csvsim_line_accepted_bool { #1 } - } + \__csvsim_set_filter_bool:n { #1 } }, filter~fp .code:n = { - \__csvsim_set_filter:n - { - \bool_gset:Nn \g__csvsim_line_accepted_bool { \fp_compare_p:n{#1} } - } + \__csvsim_set_filter_bool:n { \fp_compare_p:n {#1} } + }, + filter~strcmp .code:n = + { + \__csvsim_set_filter_bool:n { \str_if_eq_p:ee #1 } + }, + filter~not~strcmp .code:n = + { + \__csvsim_set_filter_bool:n { !\str_if_eq_p:ee #1 } + }, + and~filter~bool .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { && #1 } + }, + and~filter~fp .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { && \fp_compare_p:n {#1} } + }, + and~filter~strcmp .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { && \str_if_eq_p:ee #1 } + }, + and~filter~not~strcmp .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { && !\str_if_eq_p:ee #1 } + }, + or~filter~bool .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { || #1 } + }, + or~filter~fp .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { || \fp_compare_p:n {#1} } + }, + or~filter~strcmp .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { || \str_if_eq_p:ee #1 } + }, + or~filter~not~strcmp .code:n = + { + \tl_put_right:Nn \l__csvsim_filter_condition_tl { || !\str_if_eq_p:ee #1 } }, - filter~strcmp .meta:n = { filter~test=\ifcsvstrcmp #1 }, - filter~not~strcmp .meta:n = { filter~test=\ifcsvnotstrcmp #1 }, } @@ -846,12 +897,13 @@ { #1 } } +\cs_generate_variant:Nn \__csvsim_set_range:n { e } \keys_define:nn { csvsim } { range .code:n = { - \__csvsim_set_range:n {#1} + \__csvsim_set_range:e {#1} }, } diff --git a/macros/latex/contrib/csvsimple/csvsimple-l3.tex b/macros/latex/contrib/csvsimple/csvsimple-l3.tex index d2cc219bf8..32595572b5 100644 --- a/macros/latex/contrib/csvsimple/csvsimple-l3.tex +++ b/macros/latex/contrib/csvsimple/csvsimple-l3.tex @@ -1,10 +1,10 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 2.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -51,7 +51,7 @@ \end{tcolorbox} {\large Thomas F.~Sturm% \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik, - Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany; + University of the Bundeswehr Munich, D-85577 Neubiberg, Germany; email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip \normalsize\url{https://www.ctan.org/pkg/csvsimple}\par \url{https://github.com/T-F-S/csvsimple} @@ -116,9 +116,10 @@ Mind the following restrictions: \item Values are expected to be comma separated, but the package provides support for other separators, see \Fullref{sec:separators}. \item Values are expected to be either not quoted or quoted with - curly braces |{}| of \TeX\ groups. Other quotes like doublequotes + curly braces |{}| of \TeX\ groups. Other quotes like double-quotes are not supported directly, but can be achieved with external tools, see \Fullref{sec:importeddata}. + For approximate patching see \Fullref{sec:hooks}. \item Every data line is expected to contain the same amount of values. Unfeasible data lines are silently ignored by default, but this can be configured, see \Fullref{sec:consistency}. @@ -209,7 +210,7 @@ way. \end{dispExample} \smallskip -An even more comfortable and preferrable way to create a table is setting +An even more comfortable and preferable way to create a table is setting appropriate option keys. Note, that this gives you the possibility to create a meta key (called style here) which contains the whole table creation using \refCom{csvstyle} or |keys_define:nn| from |l3keys|. @@ -741,7 +742,7 @@ purpose: \csvreader{grade.csv}{}{}% The last file consists of \thecsvcolumncount{} columns and \thecsvrow{} accepted data lines. The total number of lines -ist \thecsvinputline{}. +is \thecsvinputline{}. \end{dispExample} \end{docCommands} @@ -754,7 +755,7 @@ ist \thecsvinputline{}. current number of all data lines including the header line and all lines filtered out. Despite of the name, there is no associated \LaTeX\ counter |csvinputline|, - but \refCom{thecsvinputline} is an accessor the \LaTeX3 integer + but \refCom{thecsvinputline} accesses the \LaTeX3 integer \refCom{g_csvsim_inputline_int}. \begin{dispExample} \csvreader[ @@ -990,7 +991,7 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. \subsection{Consistency Check}\label{sec:consistency}% \begin{docCsvKey}{check column count}{\colOpt{=true\textbar false}}{default |true|, initially |true|} - This key defines, wether the number of entries in a data line is checked against + This key defines, whether the number of entries in a data line is checked against an expected value or not.\\ If |true|, every non consistent line is ignored without announcement.\\ If |false|, every line is accepted and may produce an error during @@ -1033,10 +1034,10 @@ 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. -\begin{docCsvKey}{filter strcmp}{=\marg{stringA}\marg{stringB}}{style, no default} +\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 are accepted. - The implementation is done with \refCom{ifcsvstrcmp}. + The implementation is done with \docAuxCommand*{str_if_eq_p:ee}. \begin{dispExample} % \usepackage{booktabs} \csvreader[ @@ -1052,28 +1053,28 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and \end{docCsvKey} -\begin{docCsvKey}{filter not strcmp}{=\marg{stringA}\marg{stringB}}{style, no default} +\begin{docCsvKey}[][doc updated=2022-10-21]{filter not strcmp}{=\marg{stringA}\marg{stringB}}{no default} Only lines where \meta{stringA} and \meta{stringB} are not equal after expansion are accepted. - The implementation is done with \refCom{ifcsvnotstrcmp}. + The implementation is done with \docAuxCommand*{str_if_eq_p:ee}. \end{docCsvKey} -\begin{docCsvKey}{filter equal}{=\marg{stringA}\marg{stringB}}{style, no default} +\begin{docCsvKey}{filter equal}{=\marg{stringA}\marg{stringB}}{no default} Only lines where \meta{stringA} and \meta{stringB} are equal after expansion are accepted. The implementation is done with the \ctanpkg{ifthen} package (loading required!). \end{docCsvKey} -\begin{docCsvKey}{filter not equal}{=\marg{stringA}\marg{stringB}}{style, no default} +\begin{docCsvKey}{filter not equal}{=\marg{stringA}\marg{stringB}}{no default} Only lines where \meta{stringA} and \meta{stringB} are not equal after expansion are accepted. The implementation is done with the \ctanpkg{ifthen} package (loading required!). \end{docCsvKey} -\begin{docCsvKey}[][doc new=2021-06-25]{filter fp}{=\meta{floating point expression}}{no default} +\begin{docCsvKey}[][doc new and updated={2021-06-25}{2022-10-21}]{filter fp}{=\marg{floating point expression}}{no default} Only data lines which fulfill a \LaTeX3 \meta{floating point expression} (|l3fp|, \ctanpkg{xfp}) are accepted. \begin{dispExample} @@ -1095,7 +1096,7 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and \clearpage -\begin{docCsvKey}[][doc new=2021-06-25]{filter bool}{=\meta{boolean expression}}{no default} +\begin{docCsvKey}[][doc new and updated={2021-06-25}{2022-10-21}]{filter bool}{=\marg{boolean expression}}{no default} 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}, @@ -1108,8 +1109,8 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and { filter~bool = { - \int_compare_p:n { \matriculation > 20000 } && - \str_compare_p:eNe { \gender } = { m } + \int_compare_p:n { \matriculation > 20000 } && + \str_if_eq_p:ee { \gender }{ m } } } \ExplSyntaxOff @@ -1136,8 +1137,8 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and %>> list only matriculation numbers greater than 20000, list only men << \csvfilterbool{myfilter} { - \int_compare_p:n { \matriculation > 20000 } && - \str_compare_p:eNe { \gender } = { m } + \int_compare_p:n { \matriculation > 20000 } && + \str_if_eq_p:ee { \gender }{ m } } \ExplSyntaxOff @@ -1154,6 +1155,85 @@ The following string compare filters \refKey{/csvsim/filter strcmp} and \end{docCommand} +\clearpage + +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} +\end{itemize} + +\begin{docCsvKeys}[ + doc parameter = {=\marg{stringA}\marg{stringB}}, + doc description = {no default}, + doc new = {2022-10-21} + ] + { + { doc name = and filter strcmp }, + { doc name = or filter strcmp }, + } + 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} +\csvreader[ + head to column names, + tabular = llll, + table head = \toprule & \bfseries Name & \bfseries Matr & \bfseries Grade\\\midrule, + table foot = \bottomrule, + filter fp = {\matriculation>20000}, + and filter strcmp = {\gender}{m}, + ]{grade.csv}{}{% + \thecsvrow & \slshape\name, \givenname & \matriculation & \grade + } +\end{dispExample} +\end{docCsvKeys} + + +\begin{docCsvKeys}[ + doc parameter = {=\marg{stringA}\marg{stringB}}, + doc description = {no default}, + doc new = {2022-10-21} + ] + { + { doc name = and filter not strcmp }, + { doc name = or filter not strcmp }, + } + 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} + + +\begin{docCsvKeys}[ + doc parameter = {=\marg{floating point expression}}, + doc description = {style,no default}, + doc new = {2022-10-21} + ] + { + { doc name = and filter fp }, + { doc name = or filter fp }, + } + 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} + + +\begin{docCsvKeys}[ + doc parameter = {=\marg{boolean expression}}, + doc description = {style,no default}, + doc new = {2022-10-21} + ] + { + { doc name = and filter bool }, + { doc name = or filter bool }, + } + 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} + \clearpage @@ -1291,7 +1371,7 @@ and 42 lines are accepted, a \emph{range} could select the first 20 of them or line 10 to 30 of the accepted lines. -\begin{docCsvKey}[][doc new=2021-06-29]{range}{=\brackets{\meta{range1},\meta{range2},\meta{range3},... }}{no default, initially empty} +\begin{docCsvKey}[][doc new and updated={2021-06-29}{2022-09-21}]{range}{=\brackets{\meta{range1},\meta{range2},\meta{range3},... }}{no default, initially empty} 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. @@ -1701,7 +1781,7 @@ as normal characters (|\catcode| 12, other), if one or more of the following opt \subsection{Separators}\label{sec:separators}% \begin{docCsvKey}{separator}{=\meta{sign}}{no default, initially |comma|} \catcode `|=12 - Sets the \meta{sign} which is treates as separator between the data values + Sets the \meta{sign} which is treated as separator between the data values of a data line. Feasible values are: \begin{itemize} \item\docValue{comma}: This is the initial value with '\texttt{,}' as separator. @@ -1737,6 +1817,23 @@ as normal characters (|\catcode| 12, other), if one or more of the following opt \item\docValue{tab}: Sets the separator to the tabulator sign. Automatically, \refKey{/csvsim/respect tab} is set also. + +\clearpage +\item\docValue{space}:\tcbdocmarginnote{\tcbdocnew{2023-05-08}} + Sets the separator to space(s). +\begin{dispExample} +% \usepackage{tcolorbox} for tcbverbatimwrite +\begin{tcbverbatimwrite}{space.csv} + name givenname matriculation gender grade + Maier Hans 12345 m 1.0 + Huber Anna 23456 f 2.3 + Weißbäck Werner 34567 m 5.0 +\end{tcbverbatimwrite} + +\csvautobooktabular[separator=space]{space.csv} +\end{dispExample} + Note that leading spaces are ignored and multiple spaces are treated as one space. + To denote an empty data cell insert \verb+{}+, e.g. \verb*+1 {} 3+. \end{itemize} \end{docCsvKey} @@ -2188,6 +2285,31 @@ The following number tests are wrappers for corresponding \LaTeX3 conditionals. \clearpage +\section{Hooks}\label{sec:hooks}% +The following hook(s) are present following \LaTeX's hook management. + +\begin{description} +\item[\textcolor{DarkViolet}{\ttfamily csvsimple/csvline}] + \tcbdocmarginnote{\tcbdocnew{2023-05-08}} + This hook adds code after reading + a line into \refCom{csvline} and before processing this line. + The token list \refCom{csvline} may be manipulated with a global assignment.\par + The following example replaces every \verb+"..."+ by \verb+{...}+ to + approximate double-quote processing within \LaTeX. Still, masking of double-quotes + or nesting will not work. +\begin{dispListing} +\AddToHook{csvsimple/csvline} + { + \tl_set_eq:NN \l_tmpa_tl \csvline + \regex_replace_all:nnN { "([^"]+)" } { {\1} } \l_tmpa_tl + \tl_gset_eq:NN \csvline \l_tmpa_tl + } +\end{dispListing} + +\end{description} + + +\clearpage \section{Examples}% \subsection{A Serial Letter}% @@ -2465,7 +2587,7 @@ tables generated by |csvsimple-l3| is the |\tablenum| macro from \clearpage -It is also possible to create on-the-fly tables using calcations of +It is also possible to create on-the-fly tables using calculations of the given data. The following example shows cat values bisected and dog values doubled. diff --git a/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf b/macros/latex/contrib/csvsimple/csvsimple-legacy.pdf Binary files differindex e68b2fc161..ebf97bfd4e 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 e586e36043..915d318c27 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple-legacy.sty: Simple LaTeX CSV file processing (LaTeX2e) %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 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}[2022/09/20 version 2.3.2 LaTeX2e CSV file processing] +\ProvidesPackage{csvsimple-legacy}[2023/05/09 version 2.4.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 e2df6cc2f4..1fe95b89b8 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -45,7 +45,7 @@ \end{tcolorbox} {\large Thomas F.~Sturm% \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik, - Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany; + University of the Bundeswehr Munich, D-85577 Neubiberg, Germany; email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip \normalsize\url{https://www.ctan.org/pkg/csvsimple}\par \url{https://github.com/T-F-S/csvsimple} diff --git a/macros/latex/contrib/csvsimple/csvsimple.pdf b/macros/latex/contrib/csvsimple/csvsimple.pdf Binary files differindex 1a75caa2ea..8a9fb039bb 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 aef303b402..ae9306a2a8 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple.sty: Simple LaTeX CSV file processing %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -19,7 +19,7 @@ %% \RequirePackage{l3keys2e} -\ProvidesExplPackage{csvsimple}{2022/09/20}{2.3.2} +\ProvidesExplPackage{csvsimple}{2023/05/09}{2.4.0} {LaTeX CSV file processing} \cs_if_exist:NT \c__csvsim_package_expl_bool diff --git a/macros/latex/contrib/csvsimple/csvsimple.tex b/macros/latex/contrib/csvsimple/csvsimple.tex index 450b45b4d3..5aa9e34ca7 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.3.2 (2022/09/20) +%% The LaTeX package csvsimple - version 2.4.0 (2023/05/09) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2022 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2023 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -43,7 +43,7 @@ \end{tcolorbox} {\large Thomas F.~Sturm% \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik, - Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany; + University of the Bundeswehr Munich, D-85577 Neubiberg, Germany; email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip \normalsize\url{https://www.ctan.org/pkg/csvsimple}\par \url{https://github.com/T-F-S/csvsimple} |