summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/listofitems
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-10-05 22:22:24 +0000
committerKarl Berry <karl@freefriends.org>2017-10-05 22:22:24 +0000
commit99288327b05a9ad4e27c5a4f75ad9b6b3789219f (patch)
treeb0e416422dbf8600c0b6cf362191fb4c7f128c76 /Master/texmf-dist/tex/generic/listofitems
parentfda5435ca272bab86872d2627667b5b259eb5423 (diff)
listofitems (5oct17)
git-svn-id: svn://tug.org/texlive/trunk@45478 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/listofitems')
-rw-r--r--Master/texmf-dist/tex/generic/listofitems/listofitems.sty2
-rw-r--r--Master/texmf-dist/tex/generic/listofitems/listofitems.tex77
2 files changed, 43 insertions, 36 deletions
diff --git a/Master/texmf-dist/tex/generic/listofitems/listofitems.sty b/Master/texmf-dist/tex/generic/listofitems/listofitems.sty
index fa8ebc36f3c..4625f5a4608 100644
--- a/Master/texmf-dist/tex/generic/listofitems/listofitems.sty
+++ b/Master/texmf-dist/tex/generic/listofitems/listofitems.sty
@@ -1,3 +1,3 @@
\input listofitems.tex
-\ProvidesPackage\loiname[\loidate\space v\loiver\space Grab items in lists using user-specified sep char]
+\ProvidesPackage\loiname[\loidate\space v\loiver\space Grab items in lists using user-specified sep char (CT)]
\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/generic/listofitems/listofitems.tex b/Master/texmf-dist/tex/generic/listofitems/listofitems.tex
index 726b75efb2e..9f787255a2f 100644
--- a/Master/texmf-dist/tex/generic/listofitems/listofitems.tex
+++ b/Master/texmf-dist/tex/generic/listofitems/listofitems.tex
@@ -3,35 +3,31 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
\def\loiname {listofitems} %
-\def\loiver {1.3} %
+\def\loiver {1.4} %
% %
-\def\loidate {2016/11/18} %
+\def\loidate {2017/10/05} %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% --------------------------------------------------------------------
-% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
-% 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
-% version 2005/12/01 or later.
-% --------------------------------------------------------------------
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Christian Tellechea
-% email: unbonpetit@openmailbox.org
-% Commentaires, suggestions et signalement de bugs bienvenus !
-% Comments, bug reports and suggestions are welcome.
-% --------------------------------------------------------------------
-% L'extension listofitems est compos\'ee des 7 fichiers suivants :
-% - code : listofitems (.tex et .sty)
-% - manuel en francais : listofitems-fr (.tex et .pdf)
-% - manuel en anglais : listofitems-en (.tex et .pdf)
-% - fichier lisezmoi : README
+% Author : Christian Tellechea, Steven B. Segletes
+% Status : Maintained
+% Maintainer : Christian Tellechea
+% Email : unbonpetit@netc.fr
+% steven.b.segletes.civ@mail.mil
+% Package URL: https://www.ctan.org/pkg/listofitems
+% Bug tracker: https://framagit.org/unbonpetit/listofitems/issues
+% Repository : https://framagit.org/unbonpetit/listofitems/tree/master
+% Copyright : Christian Tellechea 2017
+% Licence : Released under the LaTeX Project Public License v1.3c
+% or later, see http://www.latex-project.org/lppl.txt
+% Files : 1) listofitems.tex
+% 2) listofitems.sty
+% 3) listofitems-fr.tex
+% 4) listofitems-fr.pdf
+% 5) listofitems-en.tex
+% 6) listofitems-en.pdf
+% 7) README
% --------------------------------------------------------------------
\expandafter\edef\csname loi_restorecatcode\endcsname{\catcode\number`\_=\number\catcode`\_\relax}
\catcode`\_11
@@ -70,19 +66,21 @@
\long\def\loi_second#1#2{#2}
\long\def\loi_firsttonil#1#2\_nil{#1}
\long\def\loi_antefi#1#2\fi{#2\fi#1}
-\long\def\loi_swaparg#1#2{#2{#1}}
-\long\def\loi_exparg#1#2{\expandafter\loi_swaparg\expandafter{#2}{#1}}
-\long\def\loi_expafternil#1\_nil{\begingroup\def\loi_temp{\endgroup#1}\expandafter\loi_temp}
+\long\def\loi_exparg#1#2{\expandafter\loi_exparg_i\expandafter{#2}{#1}}% \loi_exparg{<a>}{<b>} devient <a>{<*b>}
+\long\def\loi_exparg_i#1#2{#2{#1}}
+\long\def\loi_expafter#1#2{\expandafter\loi_expafter_i\expandafter{#2}{#1}}% \loi_expafter{<a>}{<b>} devient <a><*b>
+\long\def\loi_expafter_i#1#2{#2#1}
\def\loi_macroname{\loi_ifinrange\escapechar[[0:255]]{\expandafter\loi_gobarg}{}\string}
-\def\loi_argcsname#1#{\begingroup\def\loi_temp{\endgroup#1}\loi_argcsname_i}
-\def\loi_argcsname_i#1{\expandafter\loi_temp\csname#1\endcsname}
+\def\loi_argcsname#1#{\loi_argcsname_i{#1}}
+\def\loi_argcsname_i#1#2{\loi_expafter{#1}{\csname#2\endcsname}}
%--- macros de test
-\def\loi_ifnum#1{\ifnum#1\expandafter\loi_first\else\expandafter\loi_second\fi}
+\long\def\loi_ifnum#1{\ifnum#1\expandafter\loi_first\else\expandafter\loi_second\fi}
\long\def\loi_ifx#1{\ifx#1\expandafter\loi_first\else\expandafter\loi_second\fi}
\long\def\loi_ifempty#1{\loi_exparg\loi_ifx{\expandafter\relax\detokenize{#1}\relax}}
\def\loi_ifstar#1#2{\def\loi_ifstar_i{\loi_ifx{*\loi_nxttok}{\loi_first{#1}}{#2}}\futurelet\loi_nxttok\loi_ifstar_i}
-\long\def\loi_ifcs#1{% #1 est-il une sc ?
+\long\def\loi_ifprimitive#1{\edef\loi_tempa{\meaning#1}\edef\loi_tempb{\string#1}\loi_ifx{\loi_tempa\loi_tempb}}
+\long\def\loi_ifcs#1{% #1 est-il une sc (n'\'etant pas une primitive) ?
\loi_ifempty{#1}
\loi_second% si #1 est vide, faux
{\loi_ifspacefirst{#1}
@@ -90,7 +88,9 @@
{\loi_exparg\loi_ifempty{\loi_gobarg#1}% 1 seul token ?
{\begingroup \escapechar`\_
\if\expandafter\loi_firsttonil\string#1\_nil\expandafter\loi_firsttonil\string\relax\_nil
- \endgroup\expandafter\loi_first
+ \loi_ifprimitive
+ {\endgroup\expandafter\loi_second}
+ {\endgroup\expandafter\loi_first}%
\else
\endgroup\expandafter\loi_second
\fi
@@ -106,7 +106,7 @@
% et pages 175 \`a 184 du livre "Apprendre \`a programmer en TeX"
\def\loi_fornum#1=#2to#3\do{%
\edef#1{\number\numexpr#2}\edef\loi_sgncmp{\ifnum#1<\numexpr#3\relax>+\else<-\fi}%
- \loi_argcsname\loi_fornum_i{loi_fornum_\string#1\expandafter}\expandafter{\number\numexpr#3\expandafter}\loi_sgncmp#1%
+ \expandafter\loi_fornum_i\csname loi_fornum_\string#1\expandafter\endcsname\expandafter{\number\numexpr#3\expandafter}\loi_sgncmp#1%
}
\long\def\loi_fornum_i#1#2#3#4#5#6{\def#1{\unless\ifnum#5#3#2\relax\loi_antefi{#6\edef#5{\number\numexpr#5#41\relax}#1}\fi}#1}
@@ -231,7 +231,7 @@
\advance\loi_nestcnt-1
\loi_argcsname\loi_let\loi_currentsep{loi_listofsep[\number\loi_nestcnt]}%
}
- {\loi_expafternil\readlist_vi{#2}{}\_nil\loi_currentsep||\loi_quark||#2\_nil{#1}}% aller isoler le 1er item
+ {\loi_expafter{\readlist_vi{#2}{}}\loi_currentsep||\loi_quark||#2\_nil{#1}}% aller isoler le 1er item
}
\long\def\readlist_v#1#2{\readlist_vi{#2}{}#1||\loi_quark||#2\_nil}% #1=liste s\'eparateurs (s\'ep=||) #2=chaine de tokens
\long\def\readlist_vi#1#2#3||{% #1=liste restante #2=dernier <sep utile> #3=<sep courant>
@@ -375,4 +375,11 @@ v1.2 22/10/2016
- macros \greadlist et \gitemtomacro pour la globalit\'e
v1.3 18/11/2016
- - bugs corrig\'es dans la gestion de la globalit\'e \ No newline at end of file
+ - bugs corrig\'es dans la gestion de la globalit\'e
+
+v1.4 05/10/2017
+ - test \loi_ifprimitive ajout\'e au test \loi_ifcs
+ - suppression de \loi_expafternil, cr\'eation de \loi_expafter,
+ modification de \loi_argcsname
+ - correction d'un bug : \setsepchar{\par} ne provoque plus
+ d'erreur. \loi_ifnum devient \long \ No newline at end of file