summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/csvsimple
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-06-09 03:03:06 +0000
committerNorbert Preining <norbert@preining.info>2021-06-09 03:03:06 +0000
commitf7fc4ad3995d7f6ebbed20c20bf06e3a9176ea04 (patch)
tree9c81426f705e4550bf9e6494f36ed2d417b28c9f /macros/latex/contrib/csvsimple
parent19ec3a90133b7827c16b0ffde16152fb4d566138 (diff)
CTAN sync 202106090303
Diffstat (limited to 'macros/latex/contrib/csvsimple')
-rw-r--r--macros/latex/contrib/csvsimple/CHANGES10
-rw-r--r--macros/latex/contrib/csvsimple/README4
-rw-r--r--macros/latex/contrib/csvsimple/csvsimple-example.pdfbin72195 -> 75627 bytes
-rw-r--r--macros/latex/contrib/csvsimple/csvsimple-example.tex4
-rw-r--r--macros/latex/contrib/csvsimple/csvsimple.pdfbin810437 -> 832329 bytes
-rw-r--r--macros/latex/contrib/csvsimple/csvsimple.sty24
-rw-r--r--macros/latex/contrib/csvsimple/csvsimple.tex40
7 files changed, 54 insertions, 28 deletions
diff --git a/macros/latex/contrib/csvsimple/CHANGES b/macros/latex/contrib/csvsimple/CHANGES
index 10a0bcd925..3e17f605c7 100644
--- a/macros/latex/contrib/csvsimple/CHANGES
+++ b/macros/latex/contrib/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/macros/latex/contrib/csvsimple/README b/macros/latex/contrib/csvsimple/README
index ee2f9c807e..58bc68766f 100644
--- a/macros/latex/contrib/csvsimple/README
+++ b/macros/latex/contrib/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/macros/latex/contrib/csvsimple/csvsimple-example.pdf b/macros/latex/contrib/csvsimple/csvsimple-example.pdf
index 0965f75e26..b6c4967de6 100644
--- a/macros/latex/contrib/csvsimple/csvsimple-example.pdf
+++ b/macros/latex/contrib/csvsimple/csvsimple-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/csvsimple/csvsimple-example.tex b/macros/latex/contrib/csvsimple/csvsimple-example.tex
index 87a327f300..030ad63878 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 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/macros/latex/contrib/csvsimple/csvsimple.pdf b/macros/latex/contrib/csvsimple/csvsimple.pdf
index 02f43bf81c..887cb48c39 100644
--- a/macros/latex/contrib/csvsimple/csvsimple.pdf
+++ b/macros/latex/contrib/csvsimple/csvsimple.pdf
Binary files differ
diff --git a/macros/latex/contrib/csvsimple/csvsimple.sty b/macros/latex/contrib/csvsimple/csvsimple.sty
index ed4b83b1c3..98d1a32866 100644
--- a/macros/latex/contrib/csvsimple/csvsimple.sty
+++ b/macros/latex/contrib/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=,
diff --git a/macros/latex/contrib/csvsimple/csvsimple.tex b/macros/latex/contrib/csvsimple/csvsimple.tex
index 73855697f6..924a819584 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 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,