summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/datatool/datatool-base.sty')
-rw-r--r--Master/texmf-dist/tex/latex/datatool/datatool-base.sty55
1 files changed, 45 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
index 8ab7d44a1a4..81c32e0cb7b 100644
--- a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
+++ b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty
@@ -7,11 +7,11 @@
%% datatool.dtx (with options: `datatool-base.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-base}[2016/07/28 v2.27 (NLCT)]
+\ProvidesPackage{datatool-base}[2017/11/10 v2.28 (NLCT)]
\RequirePackage{etoolbox}
\RequirePackage{amsmath}
\RequirePackage{xkeyval}
@@ -363,17 +363,52 @@
}
\newif\if@dtl@insertdone
\newcount\dtl@sortresult
-\newcommand{\toks@gput@right@cx}[2]{%
- \def\@toks@name{#1}%
+\newcommand*{\DTLlistformatsep}{, }
+\newcommand*{\DTLlistformatoxford}{}
+\ifdef\andname
+{\newcommand*{\DTLandname}{\andname}}
+{\newcommand*{\DTLandname}{\&}}
+\newcommand*{\DTLlistformatlastsep}{ \DTLandname\space}
+\newcommand*{\DTLlistformatitem}[1]{#1}
+\newcommand*{\@dtl@formatlist@handler}[1]{%
+ \@dtl@formatlist@itemsep
+ \@dtl@formatlist@lastitem
+ \renewcommand{\@dtl@formatlist@lastitem}{%
+ \renewcommand{\@dtl@formatlist@itemsep}{%
+ \DTLlistformatsep
+ \renewcommand*{\@dtl@formatlist@prelastitemsep}{%
+ \DTLlistformatoxford}}%
+ \renewcommand{\@dtl@formatlist@prelastitem}{%
+ \@dtl@formatlist@prelastitemsep
+ \DTLlistformatlastsep}%
+ \DTLlistformatitem{#1}%
+ }%
+}%
+\newrobustcmd*{\DTLformatlist}{%
+ \@ifstar{\s@dtlformatlist}{\@dtlformatlist}%
+}
+\newcommand*{\s@dtlformatlist}[1]{%
+ \def\@dtl@formatlist@itemsep{}%
+ \def\@dtl@formatlist@lastitem{}%
+ \def\@dtl@formatlist@prelastitem{}%
+ \def\@dtl@formatlist@prelastitemsep{}%
+ \@for\@dtl@formatlist@item:=#1\do{%
+ \expandafter\@dtl@formatlist@handler\expandafter{\@dtl@formatlist@item}%
+ }%
+ \@dtl@formatlist@prelastitem\@dtl@formatlist@lastitem
+}
+\newcommand*{\@dtlformatlist}[1]{{\s@dtlformatlist{#1}}}
+\newcommand{\@dtl@toks@gput@right@cx}[2]{%
+ \def\@dtl@toks@name{#1}%
\edef\@dtl@stuff{#2}%
- \global\csname\@toks@name\endcsname\expandafter
+ \global\csname\@dtl@toks@name\endcsname\expandafter
\expandafter\expandafter{\expandafter\the
- \csname\expandafter\@toks@name\expandafter\endcsname\@dtl@stuff}%
+ \csname\expandafter\@dtl@toks@name\expandafter\endcsname\@dtl@stuff}%
}
-\newcommand{\toks@gconcat@middle@cx}[4]{%
- \def\@toks@name{#1}%
+\newcommand{\@dtl@toks@gconcat@middle@cx}[4]{%
+ \def\@dtl@toks@name{#1}%
\edef\@dtl@stuff{#3}%
- \global\csname\@toks@name\endcsname\expandafter\expandafter
+ \global\csname\@dtl@toks@name\endcsname\expandafter\expandafter
\expandafter\expandafter\expandafter
\expandafter\expandafter{\expandafter\expandafter\expandafter
\the\expandafter\expandafter\expandafter#2%