From b2941aa318c54c9d2acb00a560f456d35d90f888 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 27 May 2013 01:42:10 +0000 Subject: loops update 5/27 git-svn-id: svn://tug.org/texlive/trunk@30704 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/loops/loops.sty | 71 ++++++++++++++++++----------- 1 file changed, 44 insertions(+), 27 deletions(-) (limited to 'Master/texmf-dist/tex/latex/loops') diff --git a/Master/texmf-dist/tex/latex/loops/loops.sty b/Master/texmf-dist/tex/latex/loops/loops.sty index bd11a44a18f..3a356feb0bb 100644 --- a/Master/texmf-dist/tex/latex/loops/loops.sty +++ b/Master/texmf-dist/tex/latex/loops/loops.sty @@ -1,5 +1,5 @@ %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% -% This is file 'loops.sty', version 1.2, 2013/02/10. % +% This is file 'loops.sty', version 1.3, 2013/05/15. % % % % This package and accompanying files may be distributed and/or % % modified under the conditions of the LaTeX Project Public License, % @@ -15,6 +15,11 @@ % implied warranties of merchantability and fitness for a particular % % purpose. % % % +% The following files constitute the loops bundle and must be % +% distributed as a whole: % +% % +% README, loops.sty, loops-pokayoke1. % +% % % Copyright (c) 2012-2013 Ahmed Musa (amusa22@gmail.com). % %++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++% @@ -53,7 +58,7 @@ \do 032=10,033=12,036=03,038=04,040=12,041=12,042=12,043=12,% 059=12,045=12,047=12,058=12,063=12,091=12,093=12,126=13,\do=,% -\ProvidesPackage{loops}[2013/02/10 v1.2 Loops and list processors (AM)] +\ProvidesPackage{loops}[2013/05/15 v1.3 Loops and list processors (AM)] \NeedsTeXFormat{LaTeX2e}[2011/06/27] % This is the way to load 'skeyval-for-core' here, otherwise we @@ -446,7 +451,6 @@ % 7. The following are available here, as in \newforeach: % % \foreachcurrentitem, \foreachnextitem, \foreachitemcount, -% \foreachcurrentitem, \foreachnextitem, \foreachitemcount, % \foreachprevitem, \prependtobeginforeach, \appendtobeginforeach % (=\atbeginforeach), \prependtoendforeach, \appendtoendforeach % (=\atendforeach), \ifforeachlastitem, \foreachnestdepth, @@ -462,7 +466,7 @@ % Define \foreachfox keys. Name all the macros with 'foreach' prefix so % that we can avoid new command names and use the list auto-completion % scheme of \newforeach. -\quickkeys.define{loops/foreachfox}{% +\skvquickkeys.define{loops/foreachfox}{% parser/{,}/ \def\skv@foreach@parser{#1} \skvstripouterbraces{2}\skv@foreach@parser @@ -472,8 +476,8 @@ \edef\skv@foreach@paramlist{\unexpanded{#1}} \skvstripouterbraces{1}\skv@foreach@paramlist ; - list breaker/\skvlistbreaker/\def\skv@listbreakertoks{#1}; - list pauser/\skvlistpauser/\def\skv@listpausertoks{#1}; + list breaker/\foreachlistbreaker/\def\skv@listbreakertoks{#1}; + list pauser/\foreachlistpauser/\def\skv@listpausertoks{#1}; normalize list/true/ \edef\skv@foreach@normalizelist{0\skvifstrcmpTF{#1}{true}01} /true,false @@ -511,7 +515,7 @@ \skvstripouterbraces{2}\skv@foreach@processupto \fi ; - % This default value of 'link' is required by \skv@foreach@filllist: + % This default value of 'link' is required by \skvautocompletelist: .exec/\def\skv@foreach@link{\@nil}; link/\@nil/ \edef\skv@prova{\unexpanded{#1}} @@ -554,7 +558,7 @@ /true,false ; expand before fill,expand list before fill/true/ - \edef\skv@foreach@expandlistbeforefill{0\skvifstrcmpTF{true}{#1}01}% + \edef\skv@foreach@expandbeforefill{0\skvifstrcmpTF{true}{#1}01}% /true,false ; expand list once,*,list is a macro,macro list/true/ @@ -597,9 +601,9 @@ /true,false ; } -\quickkeys.preset{loops/foreachfox}{% +\skvquickkeys.preset{loops/foreachfox}{% parser={,},list type=csv,arg=#1,loop stopper, - list breaker=\skvlistbreaker,list pauser=\skvlistpauser, + list breaker=\foreachlistbreaker,list pauser=\foreachlistpauser, normalize list=true,use empty=false,keep decimals=true, keep high decimals=false,expand before fill=false, reverse list=false,expand list once=false,expand list twice=false, @@ -919,10 +923,11 @@ }% } \skvrobustdef*\skv@foreachfox@setkeys#1{% - \def\reserved@a{\quickkeys.set{loops/foreachfox}}% + \def\reserved@a{\skvquickkeys.set{loops/foreachfox}}% \expandafter\reserved@a\expandafter{\skv@foreachfox@kvlist,#1}% } \skvrobustdef*\foreachfox{% + \skv@inforeachtrue \skvifnextchar i{% \skv@foreachfox@prescan@a }{% @@ -952,7 +957,7 @@ }% } \skvrobustdef*\skv@foreachfox@a[#1]#2#3{% - \edef\skv@foreach@seenstar{0\ifskv@tempst0\else1\fi}% + \edef\skv@foreach@starform{0\ifskv@tempst0\else1\fi}% \skv@foreach@pushstate \skv@foreach@latehookerr \def\foreachitemcount{0}% @@ -962,7 +967,7 @@ \do\skv@foreach@precallback\do\skv@foreach@afterprecallback \do\skv@foreach@postcallback\do\skv@foreach@onlyinitially \skv@foreachfox@setkeys{#1}% - \if\skv@foreach@seenstar + \if\skv@foreach@starform \def\skv@foreach@expandlistonce{00}% \fi \ifcase0% @@ -1048,12 +1053,12 @@ }% \def\skv@foreach@lookahead@b{% \skvifxTF\skv@foreach@next[{% - \skv@foreach@parenthtrue\skv@foreach@lookahead@c + \skv@foreach@parenthesistrue\skv@foreach@lookahead@c }{% \skvifxTF\skv@foreach@next({% - \skv@foreach@parenthtrue\skv@foreach@lookahead@d + \skv@foreach@parenthesistrue\skv@foreach@lookahead@d }{% - \skv@foreach@parenthfalse\skv@foreach@picknext + \skv@foreach@parenthesisfalse\skv@foreach@picknext }% }% }% @@ -1072,9 +1077,20 @@ \skv@foreachfox@b{##1}{####2}{csv}% }% \skvifemptyTF\skv@foreach@userlist{}{% - \expandafter\skv@foreach@filllist\expandafter - {\skv@foreach@parser}\skv@foreach@userlist - \if\skv@foreach@reverselist\skvafterfi + \def\do####1{\if####1true\else false\fi}% + \skvexpandsecond{\skvautocompletelist*}{[% + % Note: the value of 'expand list once', etc., can't be + % transferred automatically to \skvautocompletelist since they + % have been used above. + parser={\skv@foreach@parser}, + link={\skvexpandonce\skv@foreach@link}, + grow left=\do\skv@foreach@growleft, + grow right=\do\skv@foreach@growright, + keep decimals=\do\skv@foreach@keepdecimals, + keep high decimals=\do\skv@foreach@keephighdecimals, + expand before fill=\do\skv@foreach@expandbeforefill + ]}\skv@foreach@userlist\skv@foreach@userlist + \if\skv@foreach@reverselist \expandafter\skv@foreach@doreverselist\expandafter {\skv@foreach@parser}\skv@foreach@userlist \fi @@ -1095,7 +1111,7 @@ }% \def\skv@foreach@do@b####1####2\skv@foreach@stop{% \let\bgroup\skv@orig@bgroup - \ifskv@foreach@parenth + \ifskv@foreach@parenthesis \edef\foreachcurrentitem{\unexpanded{####1}}% \else \skvifxTF\skv@foreach@next\bgroup{% @@ -1113,6 +1129,7 @@ \expandafter\reserved@a\expandafter{\skv@foreach@parser}% \skvcsuse{skv@foreach@atendhook@\romannumeral\foreachnestdepth}% \skv@foreach@popstate + \skv@inforeachfalse } % \skv@setupgetnextfox \skvrobustdef*\skv@setupgetnextfox#1{% @@ -1128,7 +1145,7 @@ }% \def\skv@foreach@g@tnext##1##2\skv@foreach@stop{% \let\bgroup\skv@orig@bgroup - \ifskv@foreach@parenth + \ifskv@foreach@parenthesis \edef\foreachnextitem{\unexpanded{##1}}% \else \skvifxTF\skv@foreach@next\bgroup{% @@ -1180,8 +1197,8 @@ \skv@foreach@callback\foreacheov \fi }{% - % Test for \skvlistpauser, in case the user decides to continue - % after \skvlistpauser has been picked: + % Test for \foreachlistpauser, in case the user decides to continue + % after \foreachlistpauser has been picked: \skvifxTF\foreachcurrentitem\skv@listpausertoks{}{% \skvifxTF\skv@foreach@paramlist\skv@simplearg{% \skvexpbracenext\skv@foreach@callback\foreachcurrentitem\foreacheov @@ -1226,7 +1243,7 @@ % 3. \ifskvbreakloop may be used as the conditional in <\if...>. % 5. The boolean \iflastcicada is available for accessing the last item % of the list. There are also the macros \currentcicada, \lastcicada, -% \cicadacount, and the counter \cicadaloopdepth. +% \cicadacount, and the counter \cicadanestdepth. % 6. \cicadaloop can be nested. % % Example: @@ -1248,7 +1265,7 @@ % }% % \ifnum\@tempcntb>\@ne % \@tempswatrue -% \skvcsedef{cmd@\romn\cicadaloopdepth}{\lastcicada,\cicadacount}% +% \skvcsedef{cmd@\romn\cicadanestdepth}{\lastcicada,\cicadacount}% % \fi % }% % } @@ -1269,7 +1286,7 @@ \skvrobustdef*\cicadaloop{\skv@teststopt\skv@cicadaloop,} \skvrobustdef*\skv@cicadaloop[#1]#2#3\fi#4{% \let\if@cicada@st\ifskv@tempst - \skvpushstate\skv@cicada@state\cicadaloopdepth + \skvpushstate\skv@cicada@state\cicadanestdepth \let\ifskv@tempst\if@cicada@st \skv@usetempst{#2}\skv@cicada@userlist \skv@foreach@normalize[#1]\skv@cicada@userlist @@ -1334,7 +1351,7 @@ \skvexpandnext{\skv@cicada@lookahead@a\skv@cicada@do}% \skv@cicada@userlist#1\skv@cicada@nil#1\skv@cicada@stop }% - \skvpopstate\skv@cicada@state\cicadaloopdepth + \skvpopstate\skv@cicada@state\cicadanestdepth } % \cicadiloop[]{}<\if...>\fi{}{<1.parameter.code>} -- cgit v1.2.3