diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/datatool/datatool.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/datatool/datatool.sty | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty index 688f37a7312..ea7835d4dcb 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool.sty @@ -7,11 +7,11 @@ %% datatool.dtx (with options: `datatool.sty,package') %% %% datatool.dtx -%% Copyright 2016 Nicola Talbot +%% Copyright 2017 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 -%% of this license of (at your option) any later version. +%% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.3 or later is part of all distributions of LaTeX @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2016/07/28 v2.27 (NLCT)] +\ProvidesPackage{datatool}[2017/11/10 v2.28 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{ifthen} \RequirePackage{xfor} @@ -116,9 +116,14 @@ \renewcommand*\@dtl@mathprocessor{#1}% } \providecommand*{\@dtl@mathprocessor}{fp} +\newcommand*{\@dtl@set@options}{} +\define@choicekey{datatool.sty}{utf8}{true,false}[true]{% + \renewcommand*{\@dtl@set@options}{\setbool{@dtl@utf8}{#1}}% +} \ProcessOptionsX \@dtl@construct@lopoffs \RequirePackage{datatool-base} +\@dtl@set@options \DeclareRobustCommand{\DTLpar}{\par} \newcommand*{\DTLnewdb}[1]{% \DTLifdbexists{#1}% @@ -244,7 +249,7 @@ } \newcommand*{\@sDTLnewrow}[1]{% \global\advance\csname dtlrows@#1\endcsname by 1\relax - \toks@gput@right@cx{dtldb@#1}{% + \@dtl@toks@gput@right@cx{dtldb@#1}{% \noexpand\db@row@elt@w% \noexpand\db@row@id@w \number\csname dtlrows@#1\endcsname \noexpand\db@row@id@end@% @@ -462,7 +467,7 @@ }% \ifx\@dtl@oldtype\@dtl@type \else - \toks@gconcat@middle@cx{dtlkeys@#1}% + \@dtl@toks@gconcat@middle@cx{dtlkeys@#1}% {\@dtl@before}% {% \noexpand\db@plist@elt@w% start of key block @@ -495,7 +500,7 @@ \@dtl@checknumerical{#3}% \edef\@dtl@type{\number\@dtl@datatype}% }% - \toks@gput@right@cx{dtlkeys@#1}% + \@dtl@toks@gput@right@cx{dtlkeys@#1}% {% \noexpand\db@plist@elt@w \noexpand\db@col@id@w \the\dtlcolumnnum @@ -541,7 +546,7 @@ \@dtl@dogetprops \@dtl@colhead={#3}% \edef\@dtl@colnum{\number#2}\relax - \toks@gconcat@middle@cx{dtlkeys@#1}% + \@dtl@toks@gconcat@middle@cx{dtlkeys@#1}% {\@dtl@before}% {% \noexpand\db@plist@elt@w% start of block @@ -588,7 +593,7 @@ \dtl@dogetentry \ifx\dtl@entry\dtlnovalue \@dtl@setnewvalue{#3}% - \toks@gconcat@middle@cx{dtldb@#1}% + \@dtl@toks@gconcat@middle@cx{dtldb@#1}% {\dtlbeforerow}% {% \noexpand\db@row@elt@w% @@ -825,7 +830,7 @@ \@dtl@getrow#1\q@nil } \newcommand*{\dtlrecombine}{% - \toks@gconcat@middle@cx{dtldb@\dtldbname}% + \@dtl@toks@gconcat@middle@cx{dtldb@\dtldbname}% {\dtlbeforerow}% {% \noexpand\db@row@elt@w @@ -843,7 +848,7 @@ \newcommand{\dtlrecombineomitcurrent}{% \dtl@decrementrows{\dtlafterrow}{\dtlrownum} \csname dtldb@\dtldbname\endcsname=\dtlbeforerow - \toks@gput@right@cx{dtldb@\dtldbname}{\the\dtlafterrow}% + \@dtl@toks@gput@right@cx{dtldb@\dtldbname}{\the\dtlafterrow}% \dtl@message{Removed row \number\dtlrownum\space in database `\dtldbname'}% } @@ -936,7 +941,7 @@ \ifx\dtl@entry\dtlnovalue \protected@edef\@dtl@tmp{#2}% \expandafter\@dtl@toks\expandafter{\@dtl@tmp}% - \toks@gput@right@cx{dtlcurrentrow}% + \@dtl@toks@gput@right@cx{dtlcurrentrow}% {% \noexpand\db@col@id@w \number\dtlcolumnnum @@ -966,7 +971,7 @@ \ifx\dtl@entry\dtlnovalue \protected@edef\@dtl@tmp{#2}% \expandafter\@dtl@toks\expandafter{\@dtl@tmp}% - \toks@gput@right@cx{dtlcurrentrow}% + \@dtl@toks@gput@right@cx{dtlcurrentrow}% {% \noexpand\db@col@id@w \number\dtlcolumnnum @@ -1044,6 +1049,10 @@ \edef\dtl@dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{\the\toks@}}% \dtl@dogetrowindex } +\newcommand*{\xdtlgetrowindex}[4]{% + \protected@edef\dtl@dogetrowindex{\noexpand\@dtlgetrowindex{\noexpand#1}{#2}{\number#3}{#4}}% + \dtl@dogetrowindex +} \newcommand*{\@dtlgetrowindex}[4]{% \def\@dtl@getrowindex##1% stuff before value \db@col@elt@w #4\db@col@elt@end@% value @@ -1404,7 +1413,7 @@ \dtlforeachlevel\endcsname \@dtl@after=\csname @dtl@next\romannumeral \dtlforeachlevel\endcsname - \toks@gconcat@middle@cx{dtldb@#2}% + \@dtl@toks@gconcat@middle@cx{dtldb@#2}% {\@dtl@before}% {% \noexpand\db@row@elt@w% @@ -1566,7 +1575,7 @@ \ifx\dtl@entry\dtlnovalue \protected@edef\@dtl@tmp{#2}% \expandafter\@dtl@toks\expandafter{\@dtl@tmp}% - \toks@gput@right@cx{@dtl@cur\romannumeral\dtlforeachlevel}% + \@dtl@toks@gput@right@cx{@dtl@cur\romannumeral\dtlforeachlevel}% {% \noexpand\db@col@id@w \number\dtlcolumnnum \noexpand\db@col@id@end@ @@ -1682,7 +1691,7 @@ \expandafter\@dtl@toks\expandafter{\@dtl@tmp}% new value \expandafter\@dtl@before\expandafter{\dtl@pre}% \expandafter\@dtl@after\expandafter{\dtl@post}% - \toks@gconcat@middle@cx + \@dtl@toks@gconcat@middle@cx {@dtl@cur\romannumeral\dtlforeachlevel}% {\@dtl@before}% {% @@ -3248,10 +3257,18 @@ } \newcommand{\dtl@trim}[1]{% \def\@dtl@trmstr{}% - \expandafter\@dtl@starttrim#1\@nil + \if#1\par + \else + \expandafter\@dtl@start@trim#1\@dtl@end@trim + \fi \let#1=\@dtl@trmstr } +\def\@dtl@start@trim#1 \@dtl@end@trim{% + \def\@dtl@trmstr{#1}% +} \long\def\@dtl@starttrim#1#2{% +\def\tmpA{#1}\show\tmpA +\def\tmpB{#2}\show\tmpB \dtl@ifsingle{#2}% {% \def\@dtl@tmpB{#2}% @@ -3318,7 +3335,7 @@ \@dtl@doreadraw?1?2>>> \gdef\@dtl@doreadraw?1?2<\relax \read?1 to \tmp -\xdef?2<\tmp>\relax +\protected@xdef?2<\tmp>\relax > \endgroup \begingroup |