From 19b673bcbee6071004a25ead706b82caf7f20a0e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 27 Sep 2010 23:22:46 +0000 Subject: xpackages update git-svn-id: svn://tug.org/texlive/trunk@19922 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/xpackages/xbase/ldcsetup.pdf | Bin 339725 -> 339713 bytes .../doc/latex/xpackages/xbase/template-test.tex | 77 ------ .../doc/latex/xpackages/xbase/template-test2.tex | 110 -------- .../doc/latex/xpackages/xbase/template.pdf | Bin 498459 -> 498449 bytes .../doc/latex/xpackages/xbase/tprestrict-test.tex | 80 ------ .../doc/latex/xpackages/xbase/xparse-test.tex | 296 --------------------- .../doc/latex/xpackages/xbase/xparse.pdf | Bin 568149 -> 567604 bytes .../doc/latex/xpackages/xbase/xtemplate.pdf | Bin 632958 -> 632798 bytes .../doc/latex/xpackages/xtras/l3keys2e-demo.tex | 46 ---- .../doc/latex/xpackages/xtras/l3keys2e.pdf | Bin 390006 -> 390002 bytes .../source/latex/xpackages/xbase/template-test.tex | 77 ++++++ .../latex/xpackages/xbase/template-test2.tex | 110 ++++++++ .../latex/xpackages/xbase/tprestrict-test.tex | 80 ++++++ .../source/latex/xpackages/xbase/xparse.dtx | 83 +++--- .../source/latex/xpackages/xbase/xtemplate.dtx | 36 +-- .../source/latex/xpackages/xtras/l3keys2e-demo.tex | 46 ++++ .../source/latex/xpackages/xtras/l3keys2e.dtx | 2 +- .../tex/latex/xpackages/xbase/xparse.sty | 66 ++--- .../tex/latex/xpackages/xbase/xtemplate.sty | 34 +-- .../tex/latex/xpackages/xtras/l3keys2e.sty | 2 +- 20 files changed, 419 insertions(+), 726 deletions(-) delete mode 100644 Master/texmf-dist/doc/latex/xpackages/xbase/template-test.tex delete mode 100644 Master/texmf-dist/doc/latex/xpackages/xbase/template-test2.tex delete mode 100644 Master/texmf-dist/doc/latex/xpackages/xbase/tprestrict-test.tex delete mode 100644 Master/texmf-dist/doc/latex/xpackages/xbase/xparse-test.tex delete mode 100644 Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e-demo.tex create mode 100644 Master/texmf-dist/source/latex/xpackages/xbase/template-test.tex create mode 100644 Master/texmf-dist/source/latex/xpackages/xbase/template-test2.tex create mode 100644 Master/texmf-dist/source/latex/xpackages/xbase/tprestrict-test.tex create mode 100644 Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e-demo.tex (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf index db02bbe34ad..9a0e7bb6588 100644 Binary files a/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf and b/Master/texmf-dist/doc/latex/xpackages/xbase/ldcsetup.pdf differ diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/template-test.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/template-test.tex deleted file mode 100644 index 5684ce7a90f..00000000000 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/template-test.tex +++ /dev/null @@ -1,77 +0,0 @@ -% \iffalse -%% (C) Copyright 2000-2004 LaTeX3 Project -%% -%% It may be distributed and/or modified under the conditions of the -%% LaTeX Project Public License (LPPL), either version 1.3a of this -%% license or (at your option) any later version. The latest version -%% of this license is in the file -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This file is part of the ``xbase bundle'' (The Work in LPPL) -%% and all files in that bundle must be distributed together. -%% -%% The released version of this bundle is available from CTAN. -%% -%% ----------------------------------------------------------------------- -%% -%% The development version of the bundle can be found at -%% -%% http://www.latex-project.org/svnroot/experimental/trunk/ -%% -%% for those people who are interested. -%% -%%%%%%%%%%% -%% NOTE: %% -%%%%%%%%%%% -%% -%% Snapshots taken from the repository represent work in progress and may -%% not work or may contain conflicting material! We therefore ask -%% people _not_ to put them into distributions, archives, etc. without -%% prior consultation with the LaTeX Project Team. -%% -%% ----------------------------------------------------------------------- -%% -%% $Id: template-test.tex 1628 2009-10-25 09:54:34Z mittelba $ -%% -% \fi -% -\RequirePackage{template} - -\DeclareTemplateType{xxx}{0} - -\DeclareTemplate{xxx}{test}{0} - { - xkey=n \xkey, - key =i {yyy} \value - } - { - \DoParameterAssignments - \show\xkey - \show\value - \value - } - -\DeclareTemplateType{yyy}{0} - -\DeclareTemplate{yyy}{foo}{0} - { - keya =L \foo - } - { - \DoParameterAssignments - \show\foo - } - - -\DeclareInstance{xxx}{bar}{test} - { - xkey = \UseTemplate{yyy}{foo}{ keya = 20pt }, - key = \UseTemplate{yyy}{foo}{ keya = 10pt } - } - -\ShowInstance{xxx}{bar} - -\UseInstance{xxx}{bar} - -\stop diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/template-test2.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/template-test2.tex deleted file mode 100644 index 489e9f2304a..00000000000 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/template-test2.tex +++ /dev/null @@ -1,110 +0,0 @@ -% \iffalse -%% (C) Copyright 2000-2004 LaTeX3 Project -%% -%% It may be distributed and/or modified under the conditions of the -%% LaTeX Project Public License (LPPL), either version 1.3a of this -%% license or (at your option) any later version. The latest version -%% of this license is in the file -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This file is part of the ``xbase bundle'' (The Work in LPPL) -%% and all files in that bundle must be distributed together. -%% -%% The released version of this bundle is available from CTAN. -%% -%% ----------------------------------------------------------------------- -%% -%% The development version of the bundle can be found at -%% -%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ -%% -%% for those people who are interested. -%% -%%%%%%%%%%% -%% NOTE: %% -%%%%%%%%%%% -%% -%% Snapshots taken from the repository represent work in progress and may -%% not work or may contain conflicting material! We therefore ask -%% people _not_ to put them into distributions, archives, etc. without -%% prior consultation with the LaTeX Project Team. -%% -%% ----------------------------------------------------------------------- -%% -%% $Id: template-test2.tex 585 2006-12-12 17:31:48Z morten $ -%% -% \fi -% - - -\RequirePackage{template} -\RequirePackage{trace} - -\DeclareTemplateType{xxx}{0} - -\def\MultiSelection{\MultiSelectionError} -%\def\foo{bar} - -%\traceon - -\DeclareTemplate{xxx}{test}{0} - { - xkey=n [\foo] \xkey, - ykey=n [\DelayEvaluation\foo] \ykey, - zkey=n \zkey, - last=n [last] \lastkey, - set =i {xxx} \xxx - } - { - \DoParameterAssignments - \typeout{abc} - } -\ShowTemplate{xxx}{test} - - -\DeclareInstance{xxx}{bar}{test} - { - zkey = foo, - xkey = baz, - } - -\DeclareInstance{xxx}{baz}{test} - { - last = first, - set = \UseTemplate{xxx}{test}{zkey=rrr}, - zkey = foo - } - - -\ShowInstance{xxx}{bar} -\ShowInstance{xxx}{baz} - -\DeclareTemplateType{yyy}{0} - -\DeclareTemplate{yyy}{foo}{0} - { - keya =L \foo - } - { - \DoParameterAssignments - \show\foo - } - - -\DeclareInstance{xxx}{bar}{test} - { - xkey = \UseTemplate{yyy}{foo}{ keya = 20pt }, - key = \UseTemplate{yyy}{foo}{ keya = 10pt } - } - -\ShowInstance{xxx}{bar} - -\UseInstance{xxx}{bar} - -\stop - -%%% Local Variables: -%%% mode: plain-tex -%%% TeX-master: t -%%% End: diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf index 40153f38ca7..3dc2ec63c46 100644 Binary files a/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf and b/Master/texmf-dist/doc/latex/xpackages/xbase/template.pdf differ diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/tprestrict-test.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/tprestrict-test.tex deleted file mode 100644 index d981888d450..00000000000 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/tprestrict-test.tex +++ /dev/null @@ -1,80 +0,0 @@ -% \iffalse -%% (C) Copyright 2000-2004 LaTeX3 Project -%% -%% It may be distributed and/or modified under the conditions of the -%% LaTeX Project Public License (LPPL), either version 1.3a of this -%% license or (at your option) any later version. The latest version -%% of this license is in the file -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This file is part of the ``xbase bundle'' (The Work in LPPL) -%% and all files in that bundle must be distributed together. -%% -%% The released version of this bundle is available from CTAN. -%% -%% ----------------------------------------------------------------------- -%% -%% The development version of the bundle can be found at -%% -%% http://www.latex-project.org/svnroot/experimental/trunk/ -%% -%% for those people who are interested. -%% -%%%%%%%%%%% -%% NOTE: %% -%%%%%%%%%%% -%% -%% Snapshots taken from the repository represent work in progress and may -%% not work or may contain conflicting material! We therefore ask -%% people _not_ to put them into distributions, archives, etc. without -%% prior consultation with the LaTeX Project Team. -%% -%% ----------------------------------------------------------------------- -%% -%% $Id: tprestrict-test.tex 1628 2009-10-25 09:54:34Z mittelba $ -%% -% \fi -% - -\makeatletter -\RequirePackage{template} -\IgnoreWhiteSpace - -\newcount\ca -\newdimen\da - - -\DeclareTemplateType{type}{0} - -\DeclareTemplate{type}{Ta}{0}{ - one =l [2in] \da, - two =c [5] \ca} - {\DoParameterAssignments\typeout{\da=\the\da,\@spaces \ca=\the\ca}} - -\ShowTemplate{type}{Ta} - -\typeout{1^^J==} -\UseTemplate{type}{Ta}{} - -\typeout{2^^J==} -\UseTemplate{type}{Ta}{one=44pt, two=7} - - -\DeclareRestrictedTemplate{type}{Tb}{Ta}{one=33pt} - -\ShowTemplate{type}{Tb} - -\typeout{RESTRICT^^J3^^J==} - -\DeclareInstance{type}{foo}{Tb}{two=9} - -\ShowInstance{type}{foo} - -\UseInstance{type}{foo} - -\typeout{4^^J==} -\UseTemplate{type}{Tb}{two=7} - -\stop - diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/xparse-test.tex b/Master/texmf-dist/doc/latex/xpackages/xbase/xparse-test.tex deleted file mode 100644 index 8614c4ed06a..00000000000 --- a/Master/texmf-dist/doc/latex/xpackages/xbase/xparse-test.tex +++ /dev/null @@ -1,296 +0,0 @@ -% \iffalse -%% (C) Copyright 2000-2009 LaTeX3 Project -%% -%% It may be distributed and/or modified under the conditions of the -%% LaTeX Project Public License (LPPL), either version 1.3a of this -%% license or (at your option) any later version. The latest version -%% of this license is in the file -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This file is part of the ``xbase bundle'' (The Work in LPPL) -%% and all files in that bundle must be distributed together. -%% -%% The released version of this bundle is available from CTAN. -%% -%% ----------------------------------------------------------------------- -%% -%% The development version of the bundle can be found at -%% -%% http://www.latex-project.org/svnroot/experimental/trunk/ -%% -%% for those people who are interested. -%% -%%%%%%%%%%% -%% NOTE: %% -%%%%%%%%%%% -%% -%% Snapshots taken from the repository represent work in progress and may -%% not work or may contain conflicting material! We therefore ask -%% people _not_ to put them into distributions, archives, etc. without -%% prior consultation with the LaTeX Project Team. -%% -%% ----------------------------------------------------------------------- -%% -%% $Id: xparse-test.tex 1628 2009-10-25 09:54:34Z mittelba $ -%% -% \fi -% - -\documentclass{minimal} - -\usepackage{xparse,l3box} - - -\typeout{Testing the complicated makebox setup} -\typeout{*****************************} -\typeout{* look at dvi output for this part} -\typeout{*****************************} - -\ExplSyntaxOn -\makeatletter -% Let's just take the error messages for a ride: -\cs_set_nopar:Npn \makebox{} -% Here should be an error because it is defined -\NewDocumentCommand \makebox {m}{Gobbledygook} -\cs_gundefine:N \makebox -% And now one for being undefined -\RenewDocumentCommand \makebox {m}{More~gobbledygook} -\cs_set_eq:NN \makebox \scan_stop: -% Another one for being undefined -\RenewDocumentCommand \makebox {m}{Even~more~gobbledygook} -% Now it should work -\DeclareDocumentCommand \makebox - { >{\xparse_process_comma_split:n}d() o O{c} m} - {\IfNoValueTF{#1} - { \ltx@maketextbox{#2}{#3}{#4}\mbox } - { \ltx@makepicbox #1 {#2}{#4}\@firstofone } - } - -\DeclareDocumentCommand \framebox - { >{\xparse_process_comma_split:n} d() o O{c} m} - { - \IfNoValueTF{#1} - { \ltx@maketextbox{#2}{#3}{#4}\fbox } - { \ltx@makepicbox #1 {#2}{#4}\frame } - } - -\def\ltx@maketextbox#1#2#3#4{ - \IfNoValueTF{#1} - {#4{#3}} - { - \leavevmode - \@begin@tempboxa\hbox{#3} - \setlength\@tempdima{#1} - \if_meaning:w #4\fbox - \setbox\@tempboxa\hb@xt@\@tempdima{ - \kern\fboxsep - \use:c{bm@#2} - \kern\fboxsep - } - \@frameb@x{\kern-\fboxrule} - \else: - \hb@xt@\@tempdima{\use:c{bm@#2}} - \fi: - \@end@tempboxa - } -} - -\def\ltx@makepicbox#1#2#3#4#5{ - #5 - { - \vbox to#2\unitlength { - \cs_set_eq:NN \mb@b\vss \cs_set_eq:NN \mb@l\hss - \cs_set_eq:NN \mb@r\hss \cs_set_eq:NN \mb@t\vss - \IfNoValueF{#3}{ - \tl_map_variable:nNn {#3}\l_tmpa_tl { - \if:w s\l_tmpa_tl - \cs_set_eq:NN \mb@l \scan_stop: - \cs_set_eq:NN \mb@r \scan_stop: - \else: - \cs_set_eq:cN {mb@\l_tmpa_tl}\scan_stop: - \fi: - } - } - \mb@t - \hb@xt@ #1\unitlength{\mb@l #4\mb@r} - \mb@b - \kern\z@ - } - } -} - -\makeatother -\ExplSyntaxOff - -\begin{document} - - -\thicklines - -\makebox{A} -\makebox(1,2){B} -\makebox(0,0)[lt]{C} -\makebox[20pt]{D} -\makebox[30pt][r]{E} - -\vspace{1cm} - - -\framebox{A} -\framebox(1,2){B} -\framebox(0,0)[lt]{C} -\framebox[20pt]{D} -\framebox[30pt][r]{E} - - -\typeout{Testing optional coordinates} - -\DeclareDocumentCommand \foo { mmo } -{ \typeout{1:#1} - \typeout{2:#2} -} - -\show\foo - -\ExplSyntaxOn -\DeclareDocumentCommand \foo - { m >{\xparse_process_comma_split:n} D(){0,0} m } -{ \typeout{1:#1} - \typeout{2:#2} - \typeout{3:#3} -} -\ExplSyntaxOff - -\show\foo - -\foo A(1,2)B - -\foo A B - -\typeout{Testing mandatory coordinates (gives error on second examples)} - -\ExplSyntaxOn -\DeclareDocumentCommand \foo { m >{\xparse_process_comma_split:n} d() m } -{ \IfNoValueTF {#2} { - \ERROR - }{ - \typeout{1:#1} - \typeout{2:#2} - \typeout{3:#3} - } -} -\ExplSyntaxOff - -\show\foo - -\foo A(1,2)B - -\foo A B - -\typeout{Testing normal optional arguments} - - -\DeclareDocumentCommand \foo { mmmm o mm o } -{ \typeout{1:#1} - \typeout{2:#2} - \typeout{3:#3} - \typeout{4:#4} - \typeout{5:#5} - \typeout{6:#6} - \typeout{7:#7} - \typeout{8:#8} -} - -\foo 1234 [5]67[8] -\foo 1234 [5]67 [8] % 8 should not be picked up here -\foo 123467 - -\show\foo -\expandafter\show\csname\string\foo\endcsname - - -\typeout{Testing optional arguments with default} - -\DeclareDocumentCommand \baz { O{?}mmm o mm m } -{ \typeout{1:#1} - \typeout{2:#2} - \typeout{3:#3} - \typeout{4:#4} - \typeout{5:#5} - \typeout{6:#6} - \typeout{7:#7} - \typeout{8:#8} -} - -\show\baz -\expandafter\show\csname\string\baz\endcsname - -\baz [1]234[5]678 -\baz 234678 - -%\tracingall\tracingassigns=1 -\DeclareDocumentCommand \bar { mmmm mmmm m} -{ \typeout{1:#1} - \typeout{2:#2} - \typeout{3:#3} - \typeout{4:#4} - \typeout{5:#5} - \typeout{6:#6} - \typeout{7:#7} - \typeout{8:#8} - \typeout{9:#9} -} - -\show\bar -\expandafter\show\csname\string\bar\endcsname - -\bar 123456789 - -\DeclareDocumentCommand\chapter{soom} -{\typeout{a{#1}^^Jb{#2}^^Jc{#3}^^Jd{#4}^^Je}} - -\show\chapter -\expandafter\show\csname\string\chapter\endcsname - -\typeout{1:} -\chapter*[xxx][yyy]{zzz} - -\typeout{2:} -\chapter[xxx][yyy]{zzz} - -\typeout{3:} -\chapter*[xxx]{zzz} - -\typeout{4:} -\typeout{\chapter*[xxx][yyy]{zzz}} - - - - -\DeclareDocumentCommand\chapter{soom} -{\typeout{a{#1}^^Jb{#2}^^Jc{#3}^^Jd{#4}^^Je}} - -\DeclareDocumentEnvironment{hello}{ooo} - {\typeout{B1(#1)^^JB2(#2)^^JB3(#3)^^J}} - {\typeout{E1(#1)^^JE2(#2)^^JE3(#3)^^J}} - - -\show\hello -\expandafter\show\csname\string\hello\endcsname - -\show\endhello -\expandafter\show\csname end\string\\hello\endcsname - -\begin{hello}[abc][aabbcc] -\typeout{body} -\typeout{5:} -\chapter[xxx][yyy]{zzz} -\end{hello} - -\begin{hello}[1] -\typeout{outer body} -\hello[2]\typeout{inner body}\endhello -\end{hello} - -\stop diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf index 43b8a86025a..0666e2e57a9 100644 Binary files a/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf and b/Master/texmf-dist/doc/latex/xpackages/xbase/xparse.pdf differ diff --git a/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf b/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf index fd6a2a6c431..ad9cd8b7171 100644 Binary files a/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf and b/Master/texmf-dist/doc/latex/xpackages/xbase/xtemplate.pdf differ diff --git a/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e-demo.tex b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e-demo.tex deleted file mode 100644 index a00531e0741..00000000000 --- a/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e-demo.tex +++ /dev/null @@ -1,46 +0,0 @@ -% !TEX encoding = ISO-8859-1 -% !TEX program = pdflatex -% -% This file demonstrates the use of the l3keys2e module to allow -% LaTeX3 keyvals (created using l3keys) to be used as LaTeX2e -% package or class options. -% - -% First, create a class -\begin{filecontents}{l3keys2e-class.cls} - \LoadClass{article} - \RequirePackage{l3keys2e} - \ProvidesExplClass{l3keys2e-class}{0000/00/00}{0.0}{test} - \keys_define:nn { test1 } { - option1 .code:n = {\wlog{You~gave~`#1'~for~option1}} - } - \ProcessKeysOptions { test1 } -\end{filecontents} - -% Load the class with some options. -% The class itself recognises `option1', leaving `option2' and -% `option3' as global optons which are not yet used. -\documentclass[option1=check,option2=more stuff,option3=unused] - {l3keys2e-class} - -%Now create a package -\begin{filecontents}{l3keys2e-package.sty} - \RequirePackage{l3keys2e} - \ProvidesExplPackage{l3keys2e-package}{0000/00/00}{0.0}{test} - \keys_define:nn { test2 } { - option1 .code:n = {\wlog{You~gave~`#1'~for~option1~(again)}}, - option2 .code:n = {\wlog{You~gave~`#1'~for~option2}}, - option4 .code:n = {\wlog{You~gave~`#1'~for~option4}}, - } - \ProcessKeysOptions { test2 } -\end{filecontents} - -% Load the package. -\usepackage[option4={extra stuff},option5=undefined!] - {l3keys2e-package} - -\begin{document} -% The log should show that option3 is an unused global option, and that -% option5 is not known by the l3keys2e-demo package. Everything else -% should simply be listed in the log. -\end{document} diff --git a/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf index e10d40f7726..073d92a3318 100644 Binary files a/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf and b/Master/texmf-dist/doc/latex/xpackages/xtras/l3keys2e.pdf differ diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/template-test.tex b/Master/texmf-dist/source/latex/xpackages/xbase/template-test.tex new file mode 100644 index 00000000000..5684ce7a90f --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xbase/template-test.tex @@ -0,0 +1,77 @@ +% \iffalse +%% (C) Copyright 2000-2004 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3a of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xbase bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +%% $Id: template-test.tex 1628 2009-10-25 09:54:34Z mittelba $ +%% +% \fi +% +\RequirePackage{template} + +\DeclareTemplateType{xxx}{0} + +\DeclareTemplate{xxx}{test}{0} + { + xkey=n \xkey, + key =i {yyy} \value + } + { + \DoParameterAssignments + \show\xkey + \show\value + \value + } + +\DeclareTemplateType{yyy}{0} + +\DeclareTemplate{yyy}{foo}{0} + { + keya =L \foo + } + { + \DoParameterAssignments + \show\foo + } + + +\DeclareInstance{xxx}{bar}{test} + { + xkey = \UseTemplate{yyy}{foo}{ keya = 20pt }, + key = \UseTemplate{yyy}{foo}{ keya = 10pt } + } + +\ShowInstance{xxx}{bar} + +\UseInstance{xxx}{bar} + +\stop diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/template-test2.tex b/Master/texmf-dist/source/latex/xpackages/xbase/template-test2.tex new file mode 100644 index 00000000000..489e9f2304a --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xbase/template-test2.tex @@ -0,0 +1,110 @@ +% \iffalse +%% (C) Copyright 2000-2004 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3a of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xbase bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +%% $Id: template-test2.tex 585 2006-12-12 17:31:48Z morten $ +%% +% \fi +% + + +\RequirePackage{template} +\RequirePackage{trace} + +\DeclareTemplateType{xxx}{0} + +\def\MultiSelection{\MultiSelectionError} +%\def\foo{bar} + +%\traceon + +\DeclareTemplate{xxx}{test}{0} + { + xkey=n [\foo] \xkey, + ykey=n [\DelayEvaluation\foo] \ykey, + zkey=n \zkey, + last=n [last] \lastkey, + set =i {xxx} \xxx + } + { + \DoParameterAssignments + \typeout{abc} + } +\ShowTemplate{xxx}{test} + + +\DeclareInstance{xxx}{bar}{test} + { + zkey = foo, + xkey = baz, + } + +\DeclareInstance{xxx}{baz}{test} + { + last = first, + set = \UseTemplate{xxx}{test}{zkey=rrr}, + zkey = foo + } + + +\ShowInstance{xxx}{bar} +\ShowInstance{xxx}{baz} + +\DeclareTemplateType{yyy}{0} + +\DeclareTemplate{yyy}{foo}{0} + { + keya =L \foo + } + { + \DoParameterAssignments + \show\foo + } + + +\DeclareInstance{xxx}{bar}{test} + { + xkey = \UseTemplate{yyy}{foo}{ keya = 20pt }, + key = \UseTemplate{yyy}{foo}{ keya = 10pt } + } + +\ShowInstance{xxx}{bar} + +\UseInstance{xxx}{bar} + +\stop + +%%% Local Variables: +%%% mode: plain-tex +%%% TeX-master: t +%%% End: diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/tprestrict-test.tex b/Master/texmf-dist/source/latex/xpackages/xbase/tprestrict-test.tex new file mode 100644 index 00000000000..d981888d450 --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xbase/tprestrict-test.tex @@ -0,0 +1,80 @@ +% \iffalse +%% (C) Copyright 2000-2004 LaTeX3 Project +%% +%% It may be distributed and/or modified under the conditions of the +%% LaTeX Project Public License (LPPL), either version 1.3a of this +%% license or (at your option) any later version. The latest version +%% of this license is in the file +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This file is part of the ``xbase bundle'' (The Work in LPPL) +%% and all files in that bundle must be distributed together. +%% +%% The released version of this bundle is available from CTAN. +%% +%% ----------------------------------------------------------------------- +%% +%% The development version of the bundle can be found at +%% +%% http://www.latex-project.org/svnroot/experimental/trunk/ +%% +%% for those people who are interested. +%% +%%%%%%%%%%% +%% NOTE: %% +%%%%%%%%%%% +%% +%% Snapshots taken from the repository represent work in progress and may +%% not work or may contain conflicting material! We therefore ask +%% people _not_ to put them into distributions, archives, etc. without +%% prior consultation with the LaTeX Project Team. +%% +%% ----------------------------------------------------------------------- +%% +%% $Id: tprestrict-test.tex 1628 2009-10-25 09:54:34Z mittelba $ +%% +% \fi +% + +\makeatletter +\RequirePackage{template} +\IgnoreWhiteSpace + +\newcount\ca +\newdimen\da + + +\DeclareTemplateType{type}{0} + +\DeclareTemplate{type}{Ta}{0}{ + one =l [2in] \da, + two =c [5] \ca} + {\DoParameterAssignments\typeout{\da=\the\da,\@spaces \ca=\the\ca}} + +\ShowTemplate{type}{Ta} + +\typeout{1^^J==} +\UseTemplate{type}{Ta}{} + +\typeout{2^^J==} +\UseTemplate{type}{Ta}{one=44pt, two=7} + + +\DeclareRestrictedTemplate{type}{Tb}{Ta}{one=33pt} + +\ShowTemplate{type}{Tb} + +\typeout{RESTRICT^^J3^^J==} + +\DeclareInstance{type}{foo}{Tb}{two=9} + +\ShowInstance{type}{foo} + +\UseInstance{type}{foo} + +\typeout{4^^J==} +\UseTemplate{type}{Tb}{two=7} + +\stop + diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx index f1d6ebf872d..564907d4acb 100644 --- a/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx +++ b/Master/texmf-dist/source/latex/xpackages/xbase/xparse.dtx @@ -3,7 +3,7 @@ %% David Carlisle %% (C) Copyright 2004-2008 Frank Mittelbach, %% LaTeX3 Project -%% (C) Copyright 2009 LaTeX3 Project +%% (C) Copyright 2009-2010 LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +41,7 @@ \RequirePackage{l3names} % %\fi -\GetIdInfo$Id: xparse.dtx 1927 2010-05-23 11:00:21Z joseph $ +\GetIdInfo$Id: xparse.dtx 2037 2010-09-20 21:22:45Z joseph $ {Generic document command parser} %\iffalse %<*driver> @@ -640,10 +640,6 @@ % letters in the argument specification). %\end{variable} % -%\begin{variable}{\q_xparse_stop} -% A private delimiting quark: needed by the expandable function system. -%\end{variable} -% %\subsection{Internal functions} % %\begin{function}{ @@ -1077,14 +1073,6 @@ \int_new:N \l_xparse_total_args_int % \end{macrocode} %\end{macro} -% -%\begin{macro}{\q_xparse_stop} -% A private quark, used for delimiting arguments when making -% expandable functions. -% \begin{macrocode} -\quark_new:N \q_xparse_stop -% \end{macrocode} -%\end{macro} % %\subsection{Turning the argument specifier into grabbers} % @@ -1579,7 +1567,7 @@ % Tests for \cs{NoValue}. % \begin{macrocode} \prg_new_conditional:Nnn \xparse_if_no_value:n { TF,T,F } { - \tl_if_eq:nnTF {#1} { \NoValue } { + \str_if_eq:nnTF {#1} { \NoValue } { \prg_return_true: }{ \prg_return_false: @@ -1801,7 +1789,7 @@ %\begin{macro}[aux]{\xparse_grab_D_nested:NNnNn} %\begin{macro}{\_l_xparse_nesting_a_tl} %\begin{macro}{\_l_xparse_nesting_b_tl} -%\begin{macro}{\_q_xparse} +%\begin{macro}{\q_xparse} % Catching nested optional arguments means more work. The aim here is % to collect up each pair of optional tokens without \TeX\ helping out, % and without counting anything. The code above will already have @@ -1816,23 +1804,23 @@ % \begin{macrocode} \tl_new:N \_l_xparse_nesting_a_tl \tl_new:N \_l_xparse_nesting_b_tl -\quark_new:N \_q_xparse +\quark_new:N \q_xparse \cs_new_protected:Npn \xparse_grab_D_nested:NNNnn #1#2#3#4#5 { \tl_clear:N \_l_xparse_nesting_a_tl \tl_clear:N \_l_xparse_nesting_b_tl - #5 \xparse_grab_arg:w ##1 #1 ##2 \_q_xparse ##3 #2 + #5 \xparse_grab_arg:w ##1 #1 ##2 \q_xparse ##3 #2 { \tl_put_right:Nn \_l_xparse_nesting_a_tl { ##1 #1 } \tl_put_right:Nn \_l_xparse_nesting_b_tl { #2 ##3 } \tl_if_in:nnTF {##2} {#1} - { \xparse_grab_arg:w ##2 \_q_xparse } + { \xparse_grab_arg:w ##2 \q_xparse } { \tl_if_in:NnTF \_l_xparse_nesting_b_tl {#1} { \tl_set_eq:NN \l_xparse_tmp_tl \_l_xparse_nesting_b_tl \tl_clear:N \_l_xparse_nesting_b_tl \exp_last_unbraced:NV \xparse_grab_arg:w - \l_xparse_tmp_tl \_q_xparse + \l_xparse_tmp_tl \q_xparse } { \tl_put_right:Nn \_l_xparse_nesting_a_tl {##2} @@ -1843,7 +1831,7 @@ } } } - \xparse_grab_arg:w #3 \_q_xparse + \xparse_grab_arg:w #3 \q_xparse } % \end{macrocode} %\end{macro} @@ -2131,10 +2119,10 @@ \tl_replace_all_in:Nnn \_l_xparse_split_argument_tl { @ } {#2} } \cs_set_protected:Npn \_xparse_split_argument_aux_i:w - ##1 \q_nil ##2 #2 ##3 \q_stop + ##1 \q_mark ##2 #2 ##3 \q_stop { \tl_put_right:Nn \ProcessedArgument { {##2} } - ##1 \q_nil ##3 \q_stop + ##1 \q_mark ##3 \q_stop } \cs_set_protected:Npn \_xparse_split_argument_aux_iii:w ##1 #2 ##2 \q_stop @@ -2150,7 +2138,7 @@ \prg_replicate:nn { #1 + 1 } { \_xparse_split_argument_aux_i:w } \_xparse_split_argument_aux_ii:w - \exp_not:N \q_nil + \exp_not:N \q_mark \exp_not:V \_l_xparse_split_argument_tl \prg_replicate:nn {#1} { \exp_not:n {#2} \NoValue } \exp_not:n { #2 \q_stop } @@ -2160,7 +2148,7 @@ \group_end: \cs_set_protected:Npn \_xparse_split_argument_aux_i:w { } \cs_set_protected:Npn \_xparse_split_argument_aux_ii:w - #1 \q_nil #2 \q_stop + #1 \q_mark #2 \q_stop { \tl_if_empty:nF {#2} { \_xparse_split_argument_aux_iii:w #2 \q_stop } @@ -2220,7 +2208,7 @@ % The trick here is to pass each grabbed argument along a chain of % auxiliary functions. Each one ultimately calls the next in the chain, % so that all of the arguments are passed along delimited using -% \cs{q_xparse_stop}. At the end of the chain, the marker is removed +% \cs{q_xparse}. At the end of the chain, the marker is removed % so that the user-supplied code can be passed the correct number % of arguments. All of this is done by expansion! % @@ -2244,28 +2232,27 @@ % case, the second auxiliary function is called. It finds the closing % delimiter and so the optional argument (if any). The function then % calls the next one in the chain, passing along the argument(s) -% grabbed thus-far using \cs{q_xparse_stop} as a marker. +% grabbed thus-far using \cs{q_xparse} as a marker. % \begin{macrocode} \cs_new:Npn \xparse_exp_add_type_D:w #1#2#3 { \tl_set:Nx \l_xparse_tmp_tl { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int } - \xparse_exp_set:cpx { \l_xparse_tmp_tl } ##1 \q_xparse_stop ##2 { + \xparse_exp_set:cpx { \l_xparse_tmp_tl } ##1 \q_xparse ##2 { \exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 { \exp_not:c { \l_xparse_tmp_tl aux } - ##1 \exp_not:N \q_xparse_stop + ##1 \exp_not:N \q_xparse }{ \exp_not:c { \l_xparse_tmp_tl aux } - ##1 \exp_not:N \q_xparse_stop #3 #2 {##2} + ##1 \exp_not:N \q_xparse #3 #2 {##2} } } - \xparse_exp_set:cpx { \l_xparse_tmp_tl aux} - ##1 \q_xparse_stop ##2 #2 { + \xparse_exp_set:cpx { \l_xparse_tmp_tl aux} ##1 \q_xparse ##2 #2 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } - } ##1 {##2} \exp_not:N \q_xparse_stop + } ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -2283,12 +2270,12 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2## { + } ##1 \q_xparse ##2## { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } } - ##1 {##2} \exp_not:N \q_xparse_stop + ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -2297,12 +2284,12 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2 { + } ##1 \q_xparse ##2 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } } - ##1 {##2} \exp_not:N \q_xparse_stop + ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -2325,13 +2312,13 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2 { + } ##1 \q_xparse ##2 { \exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 { \exp_not:c { \l_xparse_tmp_tl } - ##1 \exp_not:n { { \BooleanTrue } \q_xparse_stop } + ##1 \exp_not:n { { \BooleanTrue } \q_xparse } }{ \exp_not:c { \l_xparse_tmp_tl } - ##1 \exp_not:n { { \BooleanFalse } \q_xparse_stop {##2} } + ##1 \exp_not:n { { \BooleanFalse } \q_xparse {##2} } } } \xparse_exp_prepare_function:N @@ -2349,12 +2336,12 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2 #1 { + } ##1 \q_xparse ##2 #1 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } } - ##1 {##2} \exp_not:N \q_xparse_stop + ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -2430,11 +2417,11 @@ } \cs_new:Npn \xparse_exp_declare_cmd_mixed_aux:Nn #1#2 { \cs_set_nopar:Npx #1 { - \exp_not:c { \token_to_str:N #1 1 } x \exp_not:N \q_xparse_stop + \exp_not:c { \token_to_str:N #1 1 } x \exp_not:N \q_xparse } \cs_set_nopar:cpx { \token_to_str:N #1 \intexpr_eval:n { \l_xparse_total_args_int + 1 } - } x ##1 \q_xparse_stop { + } x ##1 \q_xparse { \exp_not:c { \token_to_str:N #1 } ##1 } \cs_generate_from_arg_count:cNnn @@ -2506,7 +2493,7 @@ } \cs_new:Npn \xparse_exp_prepare_function_long:N #1 { \quark_if_nil:NF #1 { - \tl_if_eq:nnTF {#1} { + } { + \str_if_eq:nnTF {#1} { + } { \xparse_exp_prepare_function_short:N }{ \msg_kernel_error:nn { xparse } { expandable-inconsistent-long } @@ -2590,7 +2577,7 @@ } { The~arguments~for~an~expandable~command~must~either~all~be \\ - short~or~all~be~long.~You~have~tried~to mix~the~two~types. + short~or~all~be~long.~You~have~tried~to~mix~the~two~types. } \msg_kernel_new:nnnn { xparse } { grouped-in-expandable } {% @@ -2684,7 +2671,9 @@ } \cs_new_protected:Npn \RenewDocumentCommand #1#2#3 { \cs_if_exist:NTF #1 { - \xparse_declare_cmd:Nnn #1 {#2} {#3} + \xparse_declare_cmd_aux:Nnn #1 {#2} {#3} + \msg_kernel_info:nnxx { xparse } { redefine-command } + { \token_to_str:N #1 } { \exp_not:n {#2} } }{ \msg_kernel_error:nnx { xparse } { command-not-yet-defined } { \token_to_str:N #1 } diff --git a/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx b/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx index d6f317c1072..297291a3d7f 100644 --- a/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/xpackages/xbase/xtemplate.dtx @@ -38,7 +38,7 @@ \RequirePackage{l3names} % %\fi -\GetIdInfo$Id: xtemplate.dtx 1896 2010-04-14 17:40:38Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 2037 2010-09-20 21:22:45Z joseph $ {Prototype document functions} %\iffalse %<*driver> @@ -1576,10 +1576,10 @@ %\begin{macro}{\xtemplate_if_key_value:nT} %\begin{macro}{\xtemplate_if_key_value:VT} % Tests for the first token in a string being \cs{KeyValue}, where -% \cs{DelayEvaluation} is not important. +% \cs{EvaluateNow} is not important. % \begin{macrocode} \prg_set_conditional:Nnn \xtemplate_if_key_value:n { T } { - \tl_if_eq:noTF { \KeyValue } { \tl_head:w #1 \q_nil } { + \str_if_eq:noTF { \KeyValue } { \tl_head:w #1 \q_stop } { \prg_return_true: }{ \prg_return_false: @@ -1594,7 +1594,7 @@ % Tests for the first token in a string being \cs{EvaluateNow}. % \begin{macrocode} \prg_new_conditional:Nnn \xtemplate_if_eval_now:n { TF } { - \tl_if_eq:noTF { \EvaluateNow } { \tl_head:w #1 \q_nil } { + \str_if_eq:noTF { \EvaluateNow } { \tl_head:w #1 \q_stop } { \prg_return_true: }{ \prg_return_false: @@ -1620,7 +1620,7 @@ % Tests for the first token in a string being \cs{UseTemplate}. % \begin{macrocode} \prg_new_conditional:Nnn \xtemplate_if_use_template:n { TF } { - \tl_if_eq:noTF { \UseTemplate } { \tl_head:w #1 \q_nil } { + \str_if_eq:noTF { \UseTemplate } { \tl_head:w #1 \q_stop } { \prg_return_true: }{ \prg_return_false: @@ -1840,7 +1840,7 @@ } } \cs_new_nopar:Npn \xtemplate_parse_keys_elt_aux:n #1 { - \tl_if_eq:VnT \l_xtemplate_keytype_tl {#1} { + \str_if_eq:VnT \l_xtemplate_keytype_tl {#1} { \tl_if_empty:NT \l_xtemplate_keytype_arg_tl { \msg_kernel_error:nnx { xtemplate } { keytype-requires-argument } {#1} @@ -1857,7 +1857,7 @@ \prop_put:NVV \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl \l_xtemplate_tmp_tl \seq_put_right:NV \l_xtemplate_key_seq \l_xtemplate_key_name_tl - \tl_if_eq:VnT \l_xtemplate_keytype_tl { choice } { + \str_if_eq:VnT \l_xtemplate_keytype_tl { choice } { \clist_if_in:NnT \l_xtemplate_keytype_arg_tl { unknown } { \msg_kernel_error:nn { xtemplate } { choice-unknown-reserved } } @@ -1877,7 +1877,7 @@ % \begin{macrocode} \cs_new:Npn \xtemplate_parse_keys_elt:nn #1#2 { \xtemplate_parse_keys_elt:n {#1} - \tl_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { + \str_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { \xtemplate_store_value_choice_name:n {#2} }{ \use:c { xtemplate_store_value_ \l_xtemplate_keytype_tl :n } {#2} @@ -2225,16 +2225,16 @@ % there are a few related checks to make. % \begin{macrocode} \cs_new:Npn \xtemplate_parse_vars_elt_aux:n #1 { - \tl_if_eq:VnTF \l_xtemplate_keytype_tl { choice } + \str_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { \xtemplate_implement_choices:n {#1} } { - \tl_if_eq:VnTF \l_xtemplate_keytype_tl { code } + \str_if_eq:VnTF \l_xtemplate_keytype_tl { code } { \prop_put:NVn \l_xtemplate_vars_prop \l_xtemplate_key_name_tl {#1} } { - \tl_if_eq:noTF {#1} { \tl_head:w #1 \q_nil } + \str_if_eq:noTF {#1} { \tl_head:w #1 \q_stop } { \cs_if_exist:NTF #1 { @@ -2249,7 +2249,7 @@ } { \tl_if_in:nnTF {#1} { global } - { \xtemplate_parse_vars_elt_aux:w #1 \q_nil } + { \xtemplate_parse_vars_elt_aux:w #1 \q_stop } { \msg_kernel_error:nnx { xtemplate } { bad-variable } { \exp_not:n {#1} } @@ -2258,10 +2258,10 @@ } } } -\cs_new:Npn \xtemplate_parse_vars_elt_aux:w #1 global #2 \q_nil { +\cs_new:Npn \xtemplate_parse_vars_elt_aux:w #1 global #2 \q_stop { \tl_if_empty:nTF {#1} { - \tl_if_eq:noTF {#2} { \tl_head:w #2 \q_nil } + \str_if_eq:noTF {#2} { \tl_head:w #2 \q_stop } { \cs_if_exist:NTF #2 { @@ -2328,7 +2328,7 @@ % \begin{macrocode} \cs_new:Npn \xtemplate_implement_choice_elt:n #1 { \clist_if_empty:NTF \l_xtemplate_tmp_clist { - \tl_if_eq:nnF {#1} { unknown } { + \str_if_eq:nnF {#1} { unknown } { \prop_get:NVN \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl \l_xtemplate_tmp_tl \xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl @@ -2596,8 +2596,8 @@ \prop_get:NnN \l_xtemplate_values_prop {#1} \l_xtemplate_value_tl \prop_get:NnN \l_xtemplate_vars_prop {#1} \l_xtemplate_var_tl \xtemplate_split_keytype_arg:n {#2} - \tl_if_eq:VnF \l_xtemplate_keytype_tl { choice } { - \tl_if_eq:VnF \l_xtemplate_keytype_tl { code } { + \str_if_eq:VnF \l_xtemplate_keytype_tl { choice } { + \str_if_eq:VnF \l_xtemplate_keytype_tl { code } { \xtemplate_find_global: } } @@ -2885,7 +2885,7 @@ } } \cs_new:Npn \xtemplate_use_instance_aux:nNnnn #1#2#3#4#5 { - \tl_if_eq:nnTF {#1} {#3} { + \str_if_eq:nnTF {#1} {#3} { \xtemplate_use_template:nnn {#3} {#4} {#5} }{ \msg_kernel_error:nnxx { xtemplate } { type-mismatch } {#1} {#3} diff --git a/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e-demo.tex b/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e-demo.tex new file mode 100644 index 00000000000..a00531e0741 --- /dev/null +++ b/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e-demo.tex @@ -0,0 +1,46 @@ +% !TEX encoding = ISO-8859-1 +% !TEX program = pdflatex +% +% This file demonstrates the use of the l3keys2e module to allow +% LaTeX3 keyvals (created using l3keys) to be used as LaTeX2e +% package or class options. +% + +% First, create a class +\begin{filecontents}{l3keys2e-class.cls} + \LoadClass{article} + \RequirePackage{l3keys2e} + \ProvidesExplClass{l3keys2e-class}{0000/00/00}{0.0}{test} + \keys_define:nn { test1 } { + option1 .code:n = {\wlog{You~gave~`#1'~for~option1}} + } + \ProcessKeysOptions { test1 } +\end{filecontents} + +% Load the class with some options. +% The class itself recognises `option1', leaving `option2' and +% `option3' as global optons which are not yet used. +\documentclass[option1=check,option2=more stuff,option3=unused] + {l3keys2e-class} + +%Now create a package +\begin{filecontents}{l3keys2e-package.sty} + \RequirePackage{l3keys2e} + \ProvidesExplPackage{l3keys2e-package}{0000/00/00}{0.0}{test} + \keys_define:nn { test2 } { + option1 .code:n = {\wlog{You~gave~`#1'~for~option1~(again)}}, + option2 .code:n = {\wlog{You~gave~`#1'~for~option2}}, + option4 .code:n = {\wlog{You~gave~`#1'~for~option4}}, + } + \ProcessKeysOptions { test2 } +\end{filecontents} + +% Load the package. +\usepackage[option4={extra stuff},option5=undefined!] + {l3keys2e-package} + +\begin{document} +% The log should show that option3 is an unused global option, and that +% option5 is not known by the l3keys2e-demo package. Everything else +% should simply be listed in the log. +\end{document} diff --git a/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e.dtx b/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e.dtx index 0120127f93e..43eec9ceff8 100644 --- a/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/xpackages/xtras/l3keys2e.dtx @@ -222,7 +222,7 @@ \keys_if_exist:nnF {#1} { unknown } { \keys_define:nn {#1} { unknown .code:n = { - \msg_warning:nnxx { Option~Processing } { unknown-option } + \msg_error:nnxx { Option~Processing } { unknown-option } { \l_keys_key_tl } { \@currname } } } diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty index 2b3f8cd388b..5936b52059b 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xparse.sty @@ -23,7 +23,7 @@ %% David Carlisle %% (C) Copyright 2004-2008 Frank Mittelbach, %% LaTeX3 Project -%% (C) Copyright 2009 LaTeX3 Project +%% (C) Copyright 2009-2010 LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -57,7 +57,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xparse.dtx 1927 2010-05-23 11:00:21Z joseph $ +\GetIdInfo$Id: xparse.dtx 2037 2010-09-20 21:22:45Z joseph $ {Generic document command parser} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -82,7 +82,6 @@ \tl_new:N \l_xparse_signature_tl \tl_new:N \l_xparse_tmp_tl \int_new:N \l_xparse_total_args_int -\quark_new:N \q_xparse_stop \cs_new_nopar:Npn \xparse_add_grabber_mandatory:N #1 { \tl_put_right:Nx \l_xparse_signature_tl { \exp_not:c { @@ -346,7 +345,7 @@ \bool_set_false:N \l_xparse_m_only_bool } \prg_new_conditional:Nnn \xparse_if_no_value:n { TF,T,F } { - \tl_if_eq:nnTF {#1} { \NoValue } { + \str_if_eq:nnTF {#1} { \NoValue } { \prg_return_true: }{ \prg_return_false: @@ -468,23 +467,23 @@ } \tl_new:N \_l_xparse_nesting_a_tl \tl_new:N \_l_xparse_nesting_b_tl -\quark_new:N \_q_xparse +\quark_new:N \q_xparse \cs_new_protected:Npn \xparse_grab_D_nested:NNNnn #1#2#3#4#5 { \tl_clear:N \_l_xparse_nesting_a_tl \tl_clear:N \_l_xparse_nesting_b_tl - #5 \xparse_grab_arg:w ##1 #1 ##2 \_q_xparse ##3 #2 + #5 \xparse_grab_arg:w ##1 #1 ##2 \q_xparse ##3 #2 { \tl_put_right:Nn \_l_xparse_nesting_a_tl { ##1 #1 } \tl_put_right:Nn \_l_xparse_nesting_b_tl { #2 ##3 } \tl_if_in:nnTF {##2} {#1} - { \xparse_grab_arg:w ##2 \_q_xparse } + { \xparse_grab_arg:w ##2 \q_xparse } { \tl_if_in:NnTF \_l_xparse_nesting_b_tl {#1} { \tl_set_eq:NN \l_xparse_tmp_tl \_l_xparse_nesting_b_tl \tl_clear:N \_l_xparse_nesting_b_tl \exp_last_unbraced:NV \xparse_grab_arg:w - \l_xparse_tmp_tl \_q_xparse + \l_xparse_tmp_tl \q_xparse } { \tl_put_right:Nn \_l_xparse_nesting_a_tl {##2} @@ -495,7 +494,7 @@ } } } - \xparse_grab_arg:w #3 \_q_xparse + \xparse_grab_arg:w #3 \q_xparse } \cs_new:Npn \xparse_grab_G:w #1#2 \l_xparse_args_tl { \xparse_grab_G_aux:nnNn {#1} {#2} \cs_set_nopar:Npn { _ignore_spaces } @@ -673,10 +672,10 @@ \tl_replace_all_in:Nnn \_l_xparse_split_argument_tl { @ } {#2} } \cs_set_protected:Npn \_xparse_split_argument_aux_i:w - ##1 \q_nil ##2 #2 ##3 \q_stop + ##1 \q_mark ##2 #2 ##3 \q_stop { \tl_put_right:Nn \ProcessedArgument { {##2} } - ##1 \q_nil ##3 \q_stop + ##1 \q_mark ##3 \q_stop } \cs_set_protected:Npn \_xparse_split_argument_aux_iii:w ##1 #2 ##2 \q_stop @@ -692,7 +691,7 @@ \prg_replicate:nn { #1 + 1 } { \_xparse_split_argument_aux_i:w } \_xparse_split_argument_aux_ii:w - \exp_not:N \q_nil + \exp_not:N \q_mark \exp_not:V \_l_xparse_split_argument_tl \prg_replicate:nn {#1} { \exp_not:n {#2} \NoValue } \exp_not:n { #2 \q_stop } @@ -702,7 +701,7 @@ \group_end: \cs_set_protected:Npn \_xparse_split_argument_aux_i:w { } \cs_set_protected:Npn \_xparse_split_argument_aux_ii:w - #1 \q_nil #2 \q_stop + #1 \q_mark #2 \q_stop { \tl_if_empty:nF {#2} { \_xparse_split_argument_aux_iii:w #2 \q_stop } @@ -746,21 +745,20 @@ \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int } - \xparse_exp_set:cpx { \l_xparse_tmp_tl } ##1 \q_xparse_stop ##2 { + \xparse_exp_set:cpx { \l_xparse_tmp_tl } ##1 \q_xparse ##2 { \exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 { \exp_not:c { \l_xparse_tmp_tl aux } - ##1 \exp_not:N \q_xparse_stop + ##1 \exp_not:N \q_xparse }{ \exp_not:c { \l_xparse_tmp_tl aux } - ##1 \exp_not:N \q_xparse_stop #3 #2 {##2} + ##1 \exp_not:N \q_xparse #3 #2 {##2} } } - \xparse_exp_set:cpx { \l_xparse_tmp_tl aux} - ##1 \q_xparse_stop ##2 #2 { + \xparse_exp_set:cpx { \l_xparse_tmp_tl aux} ##1 \q_xparse ##2 #2 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } - } ##1 {##2} \exp_not:N \q_xparse_stop + } ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -768,12 +766,12 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2## { + } ##1 \q_xparse ##2## { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } } - ##1 {##2} \exp_not:N \q_xparse_stop + ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -782,12 +780,12 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2 { + } ##1 \q_xparse ##2 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } } - ##1 {##2} \exp_not:N \q_xparse_stop + ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -799,13 +797,13 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2 { + } ##1 \q_xparse ##2 { \exp_not:N \tl_if_head_eq_charcode:nNTF {##2} #1 { \exp_not:c { \l_xparse_tmp_tl } - ##1 \exp_not:n { { \BooleanTrue } \q_xparse_stop } + ##1 \exp_not:n { { \BooleanTrue } \q_xparse } }{ \exp_not:c { \l_xparse_tmp_tl } - ##1 \exp_not:n { { \BooleanFalse } \q_xparse_stop {##2} } + ##1 \exp_not:n { { \BooleanFalse } \q_xparse {##2} } } } \xparse_exp_prepare_function:N @@ -814,12 +812,12 @@ \xparse_exp_set:cpx { \exp_after:wN \token_to_str:N \l_xparse_function_tl \int_use:N \l_xparse_total_args_int - } ##1 \q_xparse_stop ##2 #1 { + } ##1 \q_xparse ##2 #1 { \exp_not:c { \exp_after:wN \token_to_str:N \l_xparse_function_tl \intexpr_eval:n { \l_xparse_total_args_int + 1 } } - ##1 {##2} \exp_not:N \q_xparse_stop + ##1 {##2} \exp_not:N \q_xparse } \xparse_exp_prepare_function:N } @@ -871,11 +869,11 @@ } \cs_new:Npn \xparse_exp_declare_cmd_mixed_aux:Nn #1#2 { \cs_set_nopar:Npx #1 { - \exp_not:c { \token_to_str:N #1 1 } x \exp_not:N \q_xparse_stop + \exp_not:c { \token_to_str:N #1 1 } x \exp_not:N \q_xparse } \cs_set_nopar:cpx { \token_to_str:N #1 \intexpr_eval:n { \l_xparse_total_args_int + 1 } - } x ##1 \q_xparse_stop { + } x ##1 \q_xparse { \exp_not:c { \token_to_str:N #1 } ##1 } \cs_generate_from_arg_count:cNnn @@ -922,7 +920,7 @@ } \cs_new:Npn \xparse_exp_prepare_function_long:N #1 { \quark_if_nil:NF #1 { - \tl_if_eq:nnTF {#1} { + } { + \str_if_eq:nnTF {#1} { + } { \xparse_exp_prepare_function_short:N }{ \msg_kernel_error:nn { xparse } { expandable-inconsistent-long } @@ -991,7 +989,7 @@ } { The~arguments~for~an~expandable~command~must~either~all~be \\ - short~or~all~be~long.~You~have~tried~to mix~the~two~types. + short~or~all~be~long.~You~have~tried~to~mix~the~two~types. } \msg_kernel_new:nnnn { xparse } { grouped-in-expandable } {% @@ -1060,7 +1058,9 @@ } \cs_new_protected:Npn \RenewDocumentCommand #1#2#3 { \cs_if_exist:NTF #1 { - \xparse_declare_cmd:Nnn #1 {#2} {#3} + \xparse_declare_cmd_aux:Nnn #1 {#2} {#3} + \msg_kernel_info:nnxx { xparse } { redefine-command } + { \token_to_str:N #1 } { \exp_not:n {#2} } }{ \msg_kernel_error:nnx { xparse } { command-not-yet-defined } { \token_to_str:N #1 } diff --git a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty index 6ff224fff23..c94419b3351 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xbase/xtemplate.sty @@ -54,7 +54,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{l3names} -\GetIdInfo$Id: xtemplate.dtx 1896 2010-04-14 17:40:38Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 2037 2010-09-20 21:22:45Z joseph $ {Prototype document functions} @@ -134,7 +134,7 @@ } } \prg_set_conditional:Nnn \xtemplate_if_key_value:n { T } { - \tl_if_eq:noTF { \KeyValue } { \tl_head:w #1 \q_nil } { + \str_if_eq:noTF { \KeyValue } { \tl_head:w #1 \q_stop } { \prg_return_true: }{ \prg_return_false: @@ -142,7 +142,7 @@ } \cs_generate_variant:Nn \xtemplate_if_key_value:nT { V } \prg_new_conditional:Nnn \xtemplate_if_eval_now:n { TF } { - \tl_if_eq:noTF { \EvaluateNow } { \tl_head:w #1 \q_nil } { + \str_if_eq:noTF { \EvaluateNow } { \tl_head:w #1 \q_stop } { \prg_return_true: }{ \prg_return_false: @@ -156,7 +156,7 @@ } } \prg_new_conditional:Nnn \xtemplate_if_use_template:n { TF } { - \tl_if_eq:noTF { \UseTemplate } { \tl_head:w #1 \q_nil } { + \str_if_eq:noTF { \UseTemplate } { \tl_head:w #1 \q_stop } { \prg_return_true: }{ \prg_return_false: @@ -293,7 +293,7 @@ } } \cs_new_nopar:Npn \xtemplate_parse_keys_elt_aux:n #1 { - \tl_if_eq:VnT \l_xtemplate_keytype_tl {#1} { + \str_if_eq:VnT \l_xtemplate_keytype_tl {#1} { \tl_if_empty:NT \l_xtemplate_keytype_arg_tl { \msg_kernel_error:nnx { xtemplate } { keytype-requires-argument } {#1} @@ -310,7 +310,7 @@ \prop_put:NVV \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl \l_xtemplate_tmp_tl \seq_put_right:NV \l_xtemplate_key_seq \l_xtemplate_key_name_tl - \tl_if_eq:VnT \l_xtemplate_keytype_tl { choice } { + \str_if_eq:VnT \l_xtemplate_keytype_tl { choice } { \clist_if_in:NnT \l_xtemplate_keytype_arg_tl { unknown } { \msg_kernel_error:nn { xtemplate } { choice-unknown-reserved } } @@ -318,7 +318,7 @@ } \cs_new:Npn \xtemplate_parse_keys_elt:nn #1#2 { \xtemplate_parse_keys_elt:n {#1} - \tl_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { + \str_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { \xtemplate_store_value_choice_name:n {#2} }{ \use:c { xtemplate_store_value_ \l_xtemplate_keytype_tl :n } {#2} @@ -511,16 +511,16 @@ } } \cs_new:Npn \xtemplate_parse_vars_elt_aux:n #1 { - \tl_if_eq:VnTF \l_xtemplate_keytype_tl { choice } + \str_if_eq:VnTF \l_xtemplate_keytype_tl { choice } { \xtemplate_implement_choices:n {#1} } { - \tl_if_eq:VnTF \l_xtemplate_keytype_tl { code } + \str_if_eq:VnTF \l_xtemplate_keytype_tl { code } { \prop_put:NVn \l_xtemplate_vars_prop \l_xtemplate_key_name_tl {#1} } { - \tl_if_eq:noTF {#1} { \tl_head:w #1 \q_nil } + \str_if_eq:noTF {#1} { \tl_head:w #1 \q_stop } { \cs_if_exist:NTF #1 { @@ -535,7 +535,7 @@ } { \tl_if_in:nnTF {#1} { global } - { \xtemplate_parse_vars_elt_aux:w #1 \q_nil } + { \xtemplate_parse_vars_elt_aux:w #1 \q_stop } { \msg_kernel_error:nnx { xtemplate } { bad-variable } { \exp_not:n {#1} } @@ -544,10 +544,10 @@ } } } -\cs_new:Npn \xtemplate_parse_vars_elt_aux:w #1 global #2 \q_nil { +\cs_new:Npn \xtemplate_parse_vars_elt_aux:w #1 global #2 \q_stop { \tl_if_empty:nTF {#1} { - \tl_if_eq:noTF {#2} { \tl_head:w #2 \q_nil } + \str_if_eq:noTF {#2} { \tl_head:w #2 \q_stop } { \cs_if_exist:NTF #2 { @@ -593,7 +593,7 @@ } \cs_new:Npn \xtemplate_implement_choice_elt:n #1 { \clist_if_empty:NTF \l_xtemplate_tmp_clist { - \tl_if_eq:nnF {#1} { unknown } { + \str_if_eq:nnF {#1} { unknown } { \prop_get:NVN \l_xtemplate_keytypes_prop \l_xtemplate_key_name_tl \l_xtemplate_tmp_tl \xtemplate_split_keytype_arg:V \l_xtemplate_tmp_tl @@ -752,8 +752,8 @@ \prop_get:NnN \l_xtemplate_values_prop {#1} \l_xtemplate_value_tl \prop_get:NnN \l_xtemplate_vars_prop {#1} \l_xtemplate_var_tl \xtemplate_split_keytype_arg:n {#2} - \tl_if_eq:VnF \l_xtemplate_keytype_tl { choice } { - \tl_if_eq:VnF \l_xtemplate_keytype_tl { code } { + \str_if_eq:VnF \l_xtemplate_keytype_tl { choice } { + \str_if_eq:VnF \l_xtemplate_keytype_tl { code } { \xtemplate_find_global: } } @@ -909,7 +909,7 @@ } } \cs_new:Npn \xtemplate_use_instance_aux:nNnnn #1#2#3#4#5 { - \tl_if_eq:nnTF {#1} {#3} { + \str_if_eq:nnTF {#1} {#3} { \xtemplate_use_template:nnn {#3} {#4} {#5} }{ \msg_kernel_error:nnxx { xtemplate } { type-mismatch } {#1} {#3} diff --git a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty index 6c18e8ba3f0..bae23bd05fd 100644 --- a/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty +++ b/Master/texmf-dist/tex/latex/xpackages/xtras/l3keys2e.sty @@ -59,7 +59,7 @@ \keys_if_exist:nnF {#1} { unknown } { \keys_define:nn {#1} { unknown .code:n = { - \msg_warning:nnxx { Option~Processing } { unknown-option } + \msg_error:nnxx { Option~Processing } { unknown-option } { \l_keys_key_tl } { \@currname } } } -- cgit v1.2.3