diff options
author | Karl Berry <karl@freefriends.org> | 2021-06-08 20:36:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-06-08 20:36:09 +0000 |
commit | f286e2623a5a136eba00264aab46036673fcf310 (patch) | |
tree | fb22d4f03729edcc2e40ffa908a4728e3e10aecd /Master | |
parent | 086390933353ffdc45320ca8e967733bcd13a336 (diff) |
csvsimple (8jun21)
git-svn-id: svn://tug.org/texlive/trunk@59521 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/CHANGES | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/README | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.csv | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.pdf | bin | 72195 -> 75627 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/csvsimple.pdf | bin | 810437 -> 832329 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/csvsimple/csvsimple.tex | 40 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty | 24 |
8 files changed, 59 insertions, 28 deletions
diff --git a/Master/texmf-dist/doc/latex/csvsimple/CHANGES b/Master/texmf-dist/doc/latex/csvsimple/CHANGES index 10a0bcd925c..3e17f605c75 100644 --- a/Master/texmf-dist/doc/latex/csvsimple/CHANGES +++ b/Master/texmf-dist/doc/latex/csvsimple/CHANGES @@ -1,7 +1,7 @@ -%% The LaTeX package csvsimple - version 1.21 (2019/04/09) +%% The LaTeX package csvsimple - version 1.22 (2021/06/07) %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -107,3 +107,9 @@ version 1.21 (2019/04/09): - spurious blank in sorting code removed - package 'pgfrcs' added as required package - (#3): introduction augmented with additional hints for first time users + +version 1.22 (2021/06/07): +- (#7) new option 'head to column names prefix' +- (#11) Due to changes in the LaTeX kernel 2021-06-01, the empty line + detection of csvsimple had to be adapted. Updating csvsimple is + essential to avoid problems with kernel 2021-06-01. diff --git a/Master/texmf-dist/doc/latex/csvsimple/README b/Master/texmf-dist/doc/latex/csvsimple/README index ee2f9c807ef..58bc68766f8 100644 --- a/Master/texmf-dist/doc/latex/csvsimple/README +++ b/Master/texmf-dist/doc/latex/csvsimple/README @@ -1,7 +1,7 @@ -%% The LaTeX package csvsimple - version 1.21 (2019/04/09) +%% The LaTeX package csvsimple - version 1.22 (2021/06/07) %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2021 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/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.csv b/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.csv new file mode 100644 index 00000000000..9a988ac743b --- /dev/null +++ b/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.csv @@ -0,0 +1,5 @@ +last name,first name,address,zip,telephone,year of birth +Appleby,Anne,Shrimpsbury,SH-124,555-4455,1960 +Brown,Carl,Midsomer Garden,MD-945,555-2423,1982 +Smith,John,Shrimpsbury,SH-123,555-4584,1978 +Underwood,Mary,Oglsby,OG-345,555-3434,1956 diff --git a/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.pdf b/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.pdf Binary files differindex 0965f75e26f..b6c4967de6c 100644 --- a/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.pdf +++ b/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.pdf diff --git a/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.tex b/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.tex index 87a327f300c..030ad63878d 100644 --- a/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.tex +++ b/Master/texmf-dist/doc/latex/csvsimple/csvsimple-example.tex @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 1.21 (2019/04/09) +%% The LaTeX package csvsimple - version 1.22 (2021/06/07) %% csvsimple-example.tex: an example for csvsimple %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2021 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/Master/texmf-dist/doc/latex/csvsimple/csvsimple.pdf b/Master/texmf-dist/doc/latex/csvsimple/csvsimple.pdf Binary files differindex 02f43bf81cd..887cb48c39c 100644 --- a/Master/texmf-dist/doc/latex/csvsimple/csvsimple.pdf +++ b/Master/texmf-dist/doc/latex/csvsimple/csvsimple.pdf diff --git a/Master/texmf-dist/doc/latex/csvsimple/csvsimple.tex b/Master/texmf-dist/doc/latex/csvsimple/csvsimple.tex index 73855697f60..924a8195843 100644 --- a/Master/texmf-dist/doc/latex/csvsimple/csvsimple.tex +++ b/Master/texmf-dist/doc/latex/csvsimple/csvsimple.tex @@ -1,10 +1,10 @@ % \LaTeX-Main\ % !TeX encoding=UTF-8 -%% The LaTeX package csvsimple - version 1.21 (2019/04/09) +%% The LaTeX package csvsimple - version 1.22 (2021/06/07) %% csvsimple.tex: Manual %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> %% ------------------------------------------------------------------------------------------- %% %% This work may be distributed and/or modified under the @@ -124,8 +124,8 @@ pdfkeywords={csv file, comma separated values, key value syntax} } -\def\version{1.21}% -\def\datum{2019/04/09}% +\def\version{1.22}% +\def\datum{2021/06/07}% \makeindex @@ -143,7 +143,7 @@ \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; email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}}\par\medskip -\normalsize\url{http://www.ctan.org/pkg/csvsimple}\par +\normalsize\url{https://www.ctan.org/pkg/csvsimple}\par \url{https://github.com/T-F-S/csvsimple} } \end{center} @@ -181,7 +181,7 @@ Mind the following restrictions: with external tools, see \Fullref{sec:Sorting}. \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 not quoted or quoted with +\item Values are expected to be either not quoted or quoted with curly braces |{}| of \TeX\ groups. Other quotes like doublequotes are not supported directly, but can be achieved with external tools, see \Fullref{sec:importeddata}. @@ -290,16 +290,19 @@ The next example shows such a style definition with the convenience macro entries to column names by \refKey{/csv/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 by hand like in the examples -above. +above. Here, we also add a \refKey{/csv/head to column names prefix} to avoid +macro name clashes. \begin{dispExample} \csvstyle{myTableStyle}{tabular=|r|l|c|, table head=\hline & Person & Matr.~No.\\\hline\hline, late after line=\\\hline, - head to column names} + head to column names, + head to column names prefix=MY, + } \csvreader[myTableStyle]{grade.csv}{}% - {\thecsvrow & \givenname~\name & \matriculation}% + {\thecsvrow & \MYgivenname~\MYname & \MYmatriculation}% \end{dispExample} @@ -781,7 +784,7 @@ to be used inside these macros. Additional command definition keys are provided for the supported tables, see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. - +\clearpage \subsection{Header Processing and Column Name Assignment}% \begin{docCsvKey}{head}{\colOpt{=true\textbar false}}{default |true|, initially |true|} @@ -814,6 +817,22 @@ see Section~\ref{subsec:tabsupport} from page~\pageref{subsec:tabsupport}. as macro names for the columns. This option can be used only, if the header entries do not contain spaces and special characters to be 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{/csv/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{/csv/head to column names}. For example, if you use the settings +\begin{dispListing} + head to column names, + head to column names prefix=MY, +\end{dispListing} + a header entry |section| will generate the corresponding macro + |\MYsection| instead of destroying the standard \LaTeX\ |\section| macro. \end{docCsvKey} @@ -1798,7 +1817,6 @@ add an invisible dummy column with |c@{}| as first column: \end{dispExample} - \clearpage Now, the preceding table shall be sorted by the \emph{cats} values. If the \csvsorter\ program is properly installed, diff --git a/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty b/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty index ed4b83b1c37..98d1a328668 100644 --- a/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty +++ b/Master/texmf-dist/tex/latex/csvsimple/csvsimple.sty @@ -1,8 +1,8 @@ -%% The LaTeX package csvsimple - version 1.21 (2019/04/09) +%% The LaTeX package csvsimple - version 1.22 (2021/06/07) %% csvsimple.sty: Simple LaTeX CSV file processing %% %% ------------------------------------------------------------------------------------------- -%% Copyright (c) 2008-2019 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% Copyright (c) 2008-2021 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 %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{csvsimple}[2019/04/09 version 1.21 LaTeX CSV file processing] +\ProvidesPackage{csvsimple}[2021/06/07 version 1.22 LaTeX CSV file processing] \RequirePackage{pgfrcs,pgfkeys,ifthen,etoolbox,shellesc} @@ -182,9 +182,9 @@ % auto head names \def\set@csv@autohead{% - \toks0=\expandafter{\csname\csv@current@col\endcsname}% + \toks0=\expandafter{\csname\csv@headnameprefix\csv@current@col\endcsname}% \toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}% - \edef\csv@temp{\noexpand\gdef\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\noexpand\gdef\the\toks0{}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\gdef\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\noexpand\gdef\the\toks0{}}}% \csv@temp% } @@ -192,16 +192,16 @@ \def\set@csv@head{% \toks0={\gdef##1}% \toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}% - \edef\csv@temp{\noexpand\pgfkeysdef{/csv head/\csv@current@col}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\pgfkeysdef{/csv head/\csv@current@col}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% \csv@temp% - \edef\csv@temp{\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% \csv@temp% } % head line \def\csv@processheadline{% \csvreadnext% - \if\csv@par\csvline\relax% + \ifx\csv@par\csvline\relax% \csv@error{File '\csv@input@filename' starts with an empty line!}{}% \else\csv@escanline{\csvline}% \fi% @@ -222,7 +222,7 @@ \def\set@csv@nohead{% \toks0={\gdef##1}% \toks1=\expandafter{\csname csvcol\romannumeral\c@csvcol\endcsname}% - \edef\csv@temp{\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% + \begingroup\edef\csv@temp{\endgroup\noexpand\pgfkeysdef{/csv head/\thecsvcol}{\the\toks0{\the\toks1}\noexpand\csv@AtEndLoop{\the\toks0{}}}}% \csv@temp% } @@ -281,7 +281,7 @@ \stepcounter{csvinputline}% } -\let\csv@par=\par +\def\csv@par{\par} % reads and processes a CSV file \long\def\csvloop#1{% @@ -329,7 +329,7 @@ \global\let\csv@next=\csv@empty% \else% \global\let\csv@next=\csv@iterate% - \if\csv@par\csvline\relax% + \ifx\csv@par\csvline\relax% \else% \csv@escanline{\csvline}% % check and decide @@ -395,6 +395,7 @@ \pgfkeysalso{check column count}},% head/false/.code={\global\let\csv@opt@processheadline=\csv@noheadline% \pgfkeysalso{check column count=false,late after head=}},% + head to column names prefix/.store in=\csv@headnameprefix,% head to column names/.is choice,% head to column names/.default=true,% head to column names/true/.code={\global\let\csv@opt@headtocolumnames=\set@csv@autohead},% @@ -456,6 +457,7 @@ command=\csvline, column names reset, head, + head to column names prefix=, head to column names=false, column count=10, on column count error=, |