From d2d088ff389655c2c3aad324760138895af2a9d3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 10 Oct 2011 21:53:05 +0000 Subject: l3packages 2900 (10oct11) git-svn-id: svn://tug.org/texlive/trunk@24257 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/l3packages/README | 132 +++++----- .../doc/latex/l3packages/l3keys2e/l3keys2e.pdf | Bin 472930 -> 471879 bytes .../doc/latex/l3packages/xfrac/xfrac.pdf | Bin 624855 -> 624515 bytes .../doc/latex/l3packages/xparse/xparse.pdf | Bin 403915 -> 427745 bytes .../doc/latex/l3packages/xtemplate/xtemplate.pdf | Bin 397726 -> 397002 bytes .../source/latex/l3packages/l3keys2e/l3keys2e.dtx | 4 +- .../source/latex/l3packages/xfrac/xfrac.dtx | 2 +- .../source/latex/l3packages/xparse/xparse.dtx | 270 +++++++++++++++------ .../latex/l3packages/xtemplate/xtemplate.dtx | 6 +- .../tex/latex/l3packages/l3keys2e/l3keys2e.sty | 4 +- .../tex/latex/l3packages/xfrac/xfrac.sty | 2 +- .../tex/latex/l3packages/xparse/xparse.sty | 95 ++++++-- .../tex/latex/l3packages/xtemplate/xtemplate.sty | 6 +- 13 files changed, 352 insertions(+), 169 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/l3packages/README b/Master/texmf-dist/doc/latex/l3packages/README index f926499e5d1..fe54217df41 100644 --- a/Master/texmf-dist/doc/latex/l3packages/README +++ b/Master/texmf-dist/doc/latex/l3packages/README @@ -1,80 +1,65 @@ +LaTeX3 High-Level Concepts +========================== - LaTeX3 High-Level Concepts - ========================== - - 2011/06/30 - - -WHERE TO GET IT ---------------- - -The files in this distribution represent a snapshot of selected files -from the Subversion (SVN) repository of the LaTeX3 Project. - -To obtain current versions of the files, visit - which contains further -instructions. - -OVERVIEW +Overview -------- -The l3packages collection is contains implementations for aspects of the -LaTeX3 kernel, dealing with higher-level ideas such as the Designer -Interface. The packages here are considered broadly stable (The LaTeX3 -Project does not expect the interfaces to alter radically). These -packages are build on LaTeX2e conventions at the interface level, and -so may not migrate in the current form to a stand-alone LaTeX3 format. +The `l3packages` collection is contains implementations for aspects of the +LaTeX3 kernel, dealing with higher-level ideas such as the Designer Interface. +The packages here are considered broadly stable (The LaTeX3 Project does not +expect the interfaces to alter radically). These packages are build on LaTeX2e +conventions at the interface level, and so may not migrate in the current form +to a stand-alone LaTeX3 format. -All of the material in the collection requires the LaTeX3 base layer -package [l3kernel](http://ctan.org/pkg/l3kernel). The two packages must -be installed in matching versions: if you update l3packages, make sure -that l3kernel is updated at the same time. +All of the material in the collection requires the LaTeX3 base layer package +[`l3kernel`](http://ctan.org/pkg/l3kernel). The two packages must be installed +in matching versions: if you update l3packages, make sure that `l3kernel` is +updated at the same time. -Currently included in the CTAN release of l3packages are the following +Currently included in the CTAN release of `l3packages` are the following bundles: - * l3keys2e - * xfrac - * xparse - * xtemplate + * `l3keys2e` + * `xfrac` + * `xparse` + * `xtemplate` -l3keys2e --------- +`l3keys2e` +---------- -The l3keys2e package allows keys defined using l3keys to be used -as package and class options with LaTeX2e. This is tied to the -method the existing kernel uses for processing options, and so it -is likely that a stand-alone LaTeX3 kernel will use a very different -approach. +The `l3keys2e` package allows keys defined using `l3keys` to be used as package +and class options with LaTeX2e. This is tied to the method the existing kernel +uses for processing options, and so it is likely that a stand-alone LaTeX3 +kernel will use a very different approach. -xfrac ------ +`xfrac` +------- -The xfrac package uses the interface defined by xtemplate to provide +The `xfrac` package uses the interface defined by `xtemplate` to provide flexible split-level fractions _via_ the `\sfrac` macro. This is both a -demonstration of the power of the template concept and also a useful -addition to the available functionality in LaTeX2e. +demonstration of the power of the template concept and also a useful addition +to the available functionality in LaTeX2e. -xparse ------ +`xparse` +------- -The xparse package provides a high-level interface for declaring -document commands, e.g., a uniform way to define commands taking -optional arguments, optional stars (and others), mandatory arguments -and more. +The `xparse` package provides a high-level interface for declaring document +commands, e.g., a uniform way to define commands taking optional arguments, +optional stars (and others), mandatory arguments and more. -xtemplate ------ +`xtemplate` +----------- -The xtemplate package provides an interface for defining generic +The `xtemplate` package provides an interface for defining generic functions using a key=val syntax. This is designed to be "self-documenting", with the key definitions providing information on how they are to be used. -DISCUSSION +Discussion ---------- Discussion concerning the approach, suggestions for improvements, -changes, additions, etc. should be addressed to the list LaTeX-L. +changes, additions, _etc._ should be addressed to the list +[LaTeX-L](http://news.gmane.org/group/gmane.comp.tex.latex.latex3). You can subscribe to this list by sending mail to @@ -84,7 +69,7 @@ with the body containing subscribe LATEX-L -BUGS +Bugs ---- The issue tracker for LaTeX3 bugs is currently located at @@ -94,5 +79,36 @@ The issue tracker for LaTeX3 bugs is currently located at Please report specific issues with LaTeX3 code there. More general discussion should be directed to the LaTeX-L lists. ---- Copyright 1998 -- 2011 - The LaTeX3 Project. All rights reserved --- +The LaTeX3 Project +------------------ + +Development of LaTeX3 is carried out by +[The LaTeX3 Project](http://www.latex-project.org/latex3.html). Currently, +the team members are + + * Johannes Braams + * David Carlisle + * Robin Fairbairns + * Morten Høgholm + * Bruno Le Floch + * Thomas Lotze + * Frank Mittelbach + * Will Robertson + * Chris Rowley + * Rainer Schöpf + * Joseph Wright + +Former members of The LaTeX3 Project team were + + * Michael Downes + * Denys Duchier + * Alan Jeffrey + * Martin Schröder + +The development team can be contacted +by e-mail: ; for general LaTeX3 discussion +the [LaTeX-L list](http://news.gmane.org/group/gmane.comp.tex.latex.latex3) +should be used. + +--- Copyright 1998-2011 + The LaTeX3 Project. All rights reserved --- \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf index 0e65fa8e91b..8ab14d30bb2 100644 Binary files a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf and b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf differ diff --git a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf index 706b90faab4..61081e0e329 100644 Binary files a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf and b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf differ diff --git a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf index c6c6b92e395..72961f51e53 100644 Binary files a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf and b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf differ diff --git a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf index 3d51074f037..453399c7f06 100644 Binary files a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf and b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf differ diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx index a716713b8e4..781758faed7 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{xparse} -\GetIdInfo$Id: l3keys2e.dtx 2828 2011-09-15 20:04:53Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 2900 2011-10-09 21:22:46Z joseph $ {LaTeX2e option processing using LaTeX3 keys} % %<*driver> @@ -137,7 +137,7 @@ % % A check to make sure that \pkg{expl3} is not too old % \begin{macrocode} -\@ifpackagelater { expl3 } { 2011/09/15 } +\@ifpackagelater { expl3 } { 2011/10/06 } { } { \PackageError { l3keys2e } { Support~package~l3kernel~too~old. } diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx index fa930a4d16e..9875bd8f030 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx @@ -37,7 +37,7 @@ % %<*driver|package> \RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate} -\GetIdInfo$Id: xfrac.dtx 2349 2011-05-11 18:44:37Z joseph $ +\GetIdInfo$Id: xfrac.dtx 2896 2011-10-09 20:36:50Z joseph $ {L3 Experimental split-level fractions} % %<*driver> diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx index 8ed92661c17..fd928f9f612 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx @@ -40,7 +40,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: xparse.dtx 2828 2011-09-15 20:04:53Z joseph $ +\GetIdInfo$Id: xparse.dtx 2900 2011-10-09 21:22:46Z joseph $ {L3 Experimental document command parser} % %<*driver> @@ -140,6 +140,7 @@ % of the \LaTeXe{} command \cs{verb}. Thus a \texttt{v}-type argument % is read between two matching tokens, which cannot be any of |%|, |\|, % |#|, |{|, |}|, |^| or \verb*| |. +% The verbatim argument can also be enclosed between braces, |{| and |}|. % A command with a verbatim % argument will not work when it appears within an argument of % another function. @@ -485,6 +486,30 @@ % Any category code $13$ (active) \meta{tokens} will be replaced % before the split takes place. % \end{function} +% +% \begin{function}{\TrimSpaces} +% \begin{syntax} +% \cs{TrimSpaces} +% \end{syntax} +% Removes any leading and trailing spaces (tokens with character code~$32$ +% and category code~$10$) for the ends of the argument. Thus for example +% declaring a function +% \begin{verbatim} +% \DeclareDocumentCommand \foo +% { > { \TrimSpaces } } +% { \showtokens {#1} } +% \end{verbatim} +% and using it in a document as +% \begin{verbatim} +% \foo{ hello world } +% \end{verbatim} +% will show \texttt{hello world} at the terminal, with the space at each +% end removed. \cs{TrimSpaces} will remove multiple spaces from the ends of +% the input in cases where these have been included such that the standard +% \TeX{} conversion of multiple spaces to a single space does not apply. +% +% \textbf{This function is experimental.} +% \end{function} % % \subsection{Separating interface and implementation} % @@ -623,7 +648,7 @@ % % A check to make sure that \pkg{expl3} is not too old % \begin{macrocode} -\@ifpackagelater { expl3 } { 2011/09/15 } +\@ifpackagelater { expl3 } { 2011/10/09 } { } { \PackageError { xparse } { Support~package~l3kernel~too~old. } @@ -1821,46 +1846,24 @@ % % \begin{macro}{\xparse_grab_v:w} % \begin{macro}{\xparse_grab_v_long:w} +% \begin{macro}{\xparse_grab_v_aux:w} +% \begin{macro}{\xparse_grab_v_group_end:} % \begin{variable}{\l_xparse_v_rest_of_signature_tl} % \begin{variable}{\l_xparse_v_arg_tl} -% \begin{macro}{\xparse_grab_v_aux:nw, \xparse_grab_v_aux_test:nN} -% \begin{macro} -% { -% \xparse_grab_v_aux_loop:N, -% \xparse_grab_v_aux_loop_ii:NN, -% \xparse_grab_v_aux_loop_end:, -% \xparse_grab_v_group_end: -% } -% \begin{macro}{\xparse_grab_v_aux_abort:, \xparse_grab_v_aux_abort_ii:w} -% The opening delimiter is never read verbatim: if the preceeding -% argument was optional and absent, then \TeX{} has already read +% The opening delimiter is never read verbatim, for consistency: if the +% preceeding argument was optional and absent, then \TeX{} has already read % that token when looking for the optional argument. The first thing -% to check is that this delimiter is a character. -% Then change category codes, and start reading tokens one by one. -% If the verbatim was not nested, we will be grabbing one character -% at each step. Unfortunately, it can happen that what follows the -% verbatim argument is already tokenized. Thus, we check at each step -% that the next token is indeed a \enquote{nice} -% character, \emph{i.e.}, is not a character with -% category code $1$ (begin-group), $2$ (end-group) -% or $6$ (macro parameter), nor the space character, -% with category code~$10$ and character code~$32$, -% nor a control sequence. -% The partially built argument is stored in \cs{g_xparse_v_arg_tl}. -% If we ever meet a token which we cannot grab (non-N-type), -% or which is not a character according to -% \cs{xparse_grab_v_token_if_char:NTF}, then we bail out with -% \cs{xparse_grab_v_aux_abort:}. Otherwise, we stop at the first -% character matching the delimiter. +% to check is that this delimiter is a character, and distinguish the +% case of a left brace (in that case, \cs{group_align_safe_end:} +% is needed to compensate for the begin-group character that was +% just seen). +% Then set verbatim catcodes with \cs{xparse_grab_v_aux_catcodes:}. % % The group keep catcode changes local, and % \cs{group_align_safe_begin/end:} allow to use a character % with category code $4$ (normally |&|) as the delimiter. -% -% The approach for short verbatim arguments is to make the end-line -% character a macro parameter character: this is forbidden by the -% rest of the code. Then the error branch can check what caused the -% bail out and give the appropriate error message. +% It is ended by \cs{xparse_grab_v_group_end:}, which smuggles +% the collected argument out of the group. % \begin{macrocode} \tl_new:N \l_xparse_v_rest_of_signature_tl \tl_new:N \l_xparse_v_arg_tl @@ -1876,33 +1879,72 @@ } \cs_new_protected:Npn \xparse_grab_v_aux:w #1 \l_xparse_args_tl { + \tl_set:Nn \l_xparse_v_rest_of_signature_tl {#1} \group_begin: \group_align_safe_begin: \tex_escapechar:D = 92 \scan_stop: - \tl_set:Nn \l_xparse_v_rest_of_signature_tl {#1} \tl_clear:N \l_xparse_v_arg_tl \peek_N_type:TF { \xparse_grab_v_aux_test:N } - { \xparse_grab_v_aux_abort: } + { + \peek_meaning_remove:NTF \c_group_begin_token + { + \group_align_safe_end: + \xparse_grab_v_bgroup: + } + { \xparse_grab_v_aux_abort: } + } } +\cs_new_protected_nopar:Npn \xparse_grab_v_group_end: + { + \tl_set:Nx \l_xparse_tmp_tl + { + \tl_set:Nn \exp_not:N \l_xparse_v_arg_tl + { \exp_not:o \l_xparse_v_arg_tl } + } + \exp_after:wN \group_align_safe_end: + \exp_after:wN \group_end: + \l_xparse_tmp_tl + } +% \end{macrocode} +% \end{variable} +% \end{variable} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\xparse_grab_v_aux_test:N} +% \begin{macro} +% { +% \xparse_grab_v_aux_loop:N, +% \xparse_grab_v_aux_loop_ii:NN, +% \xparse_grab_v_aux_loop_end: +% } +% Check that the opening delimiter is a character, setup category codes, +% then start reading tokens one by one, keeping the delimiter as an argument. +% If the verbatim was not nested, we will be grabbing one character +% at each step. Unfortunately, it can happen that what follows the +% verbatim argument is already tokenized. Thus, we check at each step +% that the next token is indeed a \enquote{nice} +% character, \emph{i.e.}, is not a character with +% category code $1$ (begin-group), $2$ (end-group) +% or $6$ (macro parameter), nor the space character, +% with category code~$10$ and character code~$32$, +% nor a control sequence. +% The partially built argument is stored in \cs{l_xparse_v_arg_tl}. +% If we ever meet a token which we cannot grab (non-N-type), +% or which is not a character according to +% \cs{xparse_grab_v_token_if_char:NTF}, then we bail out with +% \cs{xparse_grab_v_aux_abort:}. Otherwise, we stop at the first +% character matching the delimiter. +% \begin{macrocode} \cs_new_protected:Npn \xparse_grab_v_aux_test:N #1 { \tl_put_right:Nn \l_xparse_v_arg_tl {#1} \xparse_grab_v_token_if_char:NTF #1 { -%<*initex> - \seq_map_function:NN - \c_xparse_special_chars_seq - \char_set_catcode_other:N -% -%<*package> - \cs_set_eq:NN \do \char_set_catcode_other:N - \dospecials -% - \tex_endlinechar:D = `\^^M \scan_stop: - \bool_if:NTF \l_xparse_long_bool - { \char_set_catcode_other:n { \tex_endlinechar:D } } - { \char_set_catcode_parameter:n { \tex_endlinechar:D } } + \xparse_grab_v_aux_catcodes: \xparse_grab_v_aux_loop:N #1 } { \xparse_grab_v_aux_abort: } @@ -1933,6 +1975,97 @@ { \exp_args:No \str_tail:n { \l_xparse_v_arg_tl } } \l_xparse_v_rest_of_signature_tl \l_xparse_args_tl } +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\xparse_grab_v_bgroup:} +% \begin{macro} +% { +% \xparse_grab_v_bgroup_loop:, +% \xparse_grab_v_bgroup_loop_ii:N +% } +% \begin{variable}{\l_xparse_v_nesting_int} +% If the opening delimiter is a left brace, we keep track of +% how many left and right braces were encountered so far in +% \cs{l_xparse_v_nesting_int} (the methods used for optional +% arguments cannot apply here), and stop as soon as it reaches~$0$. +% +% Some care was needed when removing the opening delimiter, which +% has already been assigned category code~$1$: using +% \cs{peek_meaning_remove:NTF} in the \cs{xparse_grab_v_aux:w} +% function would break within alignments. Instead, we first +% convert that token to a string, and remove the result as a +% normal undelimited argument. +% \begin{macrocode} +\int_new:N \l_xparse_v_nesting_int +\cs_new_protected_nopar:Npn \xparse_grab_v_bgroup: + { + \xparse_grab_v_aux_catcodes: + \int_set_eq:NN \l_xparse_v_nesting_int \c_one + \tl_set:Nx \l_xparse_v_arg_tl { \iow_char:N \{ } + \xparse_grab_v_bgroup_loop: + } +\cs_new_protected:Npn \xparse_grab_v_bgroup_loop: + { + \peek_N_type:TF + { \xparse_grab_v_bgroup_loop_ii:N } + { \xparse_grab_v_aux_abort: } + } +\cs_new_protected:Npn \xparse_grab_v_bgroup_loop_ii:N #1 + { + \xparse_grab_v_token_if_char:NTF #1 + { + \token_if_eq_charcode:NNTF \c_group_end_token #1 + { + \int_decr:N \l_xparse_v_nesting_int + \int_compare:nNnTF \l_xparse_v_nesting_int > \c_zero + { + \tl_put_right:Nn \l_xparse_v_arg_tl { #1 } + \xparse_grab_v_bgroup_loop: + } + { \xparse_grab_v_aux_loop_end: } + } + { + \token_if_eq_charcode:NNT \c_group_begin_token #1 + { \int_incr:N \l_xparse_v_nesting_int } + \tl_put_right:Nn \l_xparse_v_arg_tl { #1 } + \xparse_grab_v_bgroup_loop: + } + } + { \xparse_grab_v_aux_abort: #1 } + } +% \end{macrocode} +% \end{variable} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\xparse_grab_v_aux_catcodes:} +% \begin{macro}{\xparse_grab_v_aux_abort:, \xparse_grab_v_aux_abort_ii:w} +% In a standalone format, the list of special characters is kept +% as a sequence, \cs{c_xparse_special_chars_seq}, and we use +% \tn{dospecials} in package mode. +% The approach for short verbatim arguments is to make the end-line +% character a macro parameter character: this is forbidden by the +% rest of the code. Then the error branch can check what caused the +% bail out and give the appropriate error message. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \xparse_grab_v_aux_catcodes: + { +%<*initex> + \seq_map_function:NN + \c_xparse_special_chars_seq + \char_set_catcode_other:N +% +%<*package> + \cs_set_eq:NN \do \char_set_catcode_other:N + \dospecials +% + \tex_endlinechar:D = `\^^M \scan_stop: + \bool_if:NTF \l_xparse_long_bool + { \char_set_catcode_other:n { \tex_endlinechar:D } } + { \char_set_catcode_parameter:n { \tex_endlinechar:D } } + } \cs_new_protected_nopar:Npn \xparse_grab_v_aux_abort: { \xparse_grab_v_group_end: @@ -1959,28 +2092,6 @@ } } % \end{macrocode} -% Two items need to be smuggled out of the group used by the code. -% \begin{macrocode} -\cs_new_protected_nopar:Npn \xparse_grab_v_group_end: - { - \tl_set:Nx \l_xparse_tmp_tl - { - \tl_set:Nn \exp_not:N \l_xparse_v_rest_of_signature_tl - { \exp_not:o \l_xparse_v_rest_of_signature_tl } - \tl_set:Nn \exp_not:N \l_xparse_v_arg_tl - { \exp_not:o \l_xparse_v_arg_tl } - } - \exp_after:wN \group_align_safe_end: - \exp_after:wN \group_end: - \l_xparse_tmp_tl - } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{variable} -% \end{variable} % \end{macro} % \end{macro} % @@ -2125,6 +2236,14 @@ % \end{macro} % \end{macro} % \end{macro} +% +% \begin{macro}{\xparse_trim_spaces:n} +% This one is almost trivial. +% \begin{macrocode} +\cs_new_protected:Npn \xparse_trim_spaces:n #1 + { \tl_set:Nx \ProcessedArgument { \tl_trim_spaces:n {#1} } } +% \end{macrocode} +% \end{macro} % % \subsection{Creating expandable functions} % @@ -2866,15 +2985,14 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\SplitArgument} -% \begin{macro}{\SplitList} -% Another simple copy. +% \begin{macro}{\SplitArgument, \SplitList, \TrimSpaces} +% Simple copies % \begin{macrocode} \cs_new_eq:NN \SplitArgument \xparse_split_argument:nnn \cs_new_eq:NN \SplitList \xparse_split_list:nn +\cs_new_eq:NN \TrimSpaces \xparse_trim_spaces:n % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{\GetDocumentCommandArgSpec} % \begin{macro}{\GetDocumentEnvironmentArgSpec} diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index 4f97e93aba4..f5ebf79de5e 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -40,7 +40,7 @@ % %<*driver|package> \RequirePackage{expl3} -\GetIdInfo$Id: xtemplate.dtx 2828 2011-09-15 20:04:53Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 2900 2011-10-09 21:22:46Z joseph $ {L3 Experimental prototype document functions} % %<*driver> @@ -661,7 +661,7 @@ % % A check to make sure that \pkg{expl3} is not too old % \begin{macrocode} -\@ifpackagelater { expl3 } { 2011/09/15 } +\@ifpackagelater { expl3 } { 2011/10/09 } { } { \PackageError { xtemplate } { Support~package~l3kernel~too~old. } @@ -2550,7 +2550,7 @@ You~asked~to~use~#2~arguments:~this~is~not~supported. } \msg_new:nnnn { xtemplate } { bad-variable } - { Incorrect~variable~description. } + { Incorrect~variable~description~'#1'. } { The~argument~'#1'~is~not~of~the~form \\ ~~''\\ diff --git a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty index 1066ded2139..976c9cbd4f9 100644 --- a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty +++ b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty @@ -47,11 +47,11 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{xparse} -\GetIdInfo$Id: l3keys2e.dtx 2828 2011-09-15 20:04:53Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 2900 2011-10-09 21:22:46Z joseph $ {LaTeX2e option processing using LaTeX3 keys} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\@ifpackagelater { expl3 } { 2011/09/15 } +\@ifpackagelater { expl3 } { 2011/10/06 } { } { \PackageError { l3keys2e } { Support~package~l3kernel~too~old. } diff --git a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty index 700218206ca..bb6844bc538 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty @@ -48,7 +48,7 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate} -\GetIdInfo$Id: xfrac.dtx 2349 2011-05-11 18:44:37Z joseph $ +\GetIdInfo$Id: xfrac.dtx 2896 2011-10-09 20:36:50Z joseph $ {L3 Experimental split-level fractions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index 79d2c8402d2..4686bf73d70 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty @@ -51,12 +51,12 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: xparse.dtx 2828 2011-09-15 20:04:53Z joseph $ +\GetIdInfo$Id: xparse.dtx 2900 2011-10-09 21:22:46Z joseph $ {L3 Experimental document command parser} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} \RequirePackage{expl3} -\@ifpackagelater { expl3 } { 2011/09/15 } +\@ifpackagelater { expl3 } { 2011/10/09 } { } { \PackageError { xparse } { Support~package~l3kernel~too~old. } @@ -716,26 +716,39 @@ } \cs_new_protected:Npn \xparse_grab_v_aux:w #1 \l_xparse_args_tl { + \tl_set:Nn \l_xparse_v_rest_of_signature_tl {#1} \group_begin: \group_align_safe_begin: \tex_escapechar:D = 92 \scan_stop: - \tl_set:Nn \l_xparse_v_rest_of_signature_tl {#1} \tl_clear:N \l_xparse_v_arg_tl \peek_N_type:TF { \xparse_grab_v_aux_test:N } - { \xparse_grab_v_aux_abort: } + { + \peek_meaning_remove:NTF \c_group_begin_token + { + \group_align_safe_end: + \xparse_grab_v_bgroup: + } + { \xparse_grab_v_aux_abort: } + } + } +\cs_new_protected_nopar:Npn \xparse_grab_v_group_end: + { + \tl_set:Nx \l_xparse_tmp_tl + { + \tl_set:Nn \exp_not:N \l_xparse_v_arg_tl + { \exp_not:o \l_xparse_v_arg_tl } + } + \exp_after:wN \group_align_safe_end: + \exp_after:wN \group_end: + \l_xparse_tmp_tl } \cs_new_protected:Npn \xparse_grab_v_aux_test:N #1 { \tl_put_right:Nn \l_xparse_v_arg_tl {#1} \xparse_grab_v_token_if_char:NTF #1 { - \cs_set_eq:NN \do \char_set_catcode_other:N - \dospecials - \tex_endlinechar:D = `\^^M \scan_stop: - \bool_if:NTF \l_xparse_long_bool - { \char_set_catcode_other:n { \tex_endlinechar:D } } - { \char_set_catcode_parameter:n { \tex_endlinechar:D } } + \xparse_grab_v_aux_catcodes: \xparse_grab_v_aux_loop:N #1 } { \xparse_grab_v_aux_abort: } @@ -766,6 +779,52 @@ { \exp_args:No \str_tail:n { \l_xparse_v_arg_tl } } \l_xparse_v_rest_of_signature_tl \l_xparse_args_tl } +\int_new:N \l_xparse_v_nesting_int +\cs_new_protected_nopar:Npn \xparse_grab_v_bgroup: + { + \xparse_grab_v_aux_catcodes: + \int_set_eq:NN \l_xparse_v_nesting_int \c_one + \tl_set:Nx \l_xparse_v_arg_tl { \iow_char:N \{ } + \xparse_grab_v_bgroup_loop: + } +\cs_new_protected:Npn \xparse_grab_v_bgroup_loop: + { + \peek_N_type:TF + { \xparse_grab_v_bgroup_loop_ii:N } + { \xparse_grab_v_aux_abort: } + } +\cs_new_protected:Npn \xparse_grab_v_bgroup_loop_ii:N #1 + { + \xparse_grab_v_token_if_char:NTF #1 + { + \token_if_eq_charcode:NNTF \c_group_end_token #1 + { + \int_decr:N \l_xparse_v_nesting_int + \int_compare:nNnTF \l_xparse_v_nesting_int > \c_zero + { + \tl_put_right:Nn \l_xparse_v_arg_tl { #1 } + \xparse_grab_v_bgroup_loop: + } + { \xparse_grab_v_aux_loop_end: } + } + { + \token_if_eq_charcode:NNT \c_group_begin_token #1 + { \int_incr:N \l_xparse_v_nesting_int } + \tl_put_right:Nn \l_xparse_v_arg_tl { #1 } + \xparse_grab_v_bgroup_loop: + } + } + { \xparse_grab_v_aux_abort: #1 } + } +\cs_new_protected_nopar:Npn \xparse_grab_v_aux_catcodes: + { + \cs_set_eq:NN \do \char_set_catcode_other:N + \dospecials + \tex_endlinechar:D = `\^^M \scan_stop: + \bool_if:NTF \l_xparse_long_bool + { \char_set_catcode_other:n { \tex_endlinechar:D } } + { \char_set_catcode_parameter:n { \tex_endlinechar:D } } + } \cs_new_protected_nopar:Npn \xparse_grab_v_aux_abort: { \xparse_grab_v_group_end: @@ -791,19 +850,6 @@ \l_xparse_v_rest_of_signature_tl \l_xparse_args_tl } } -\cs_new_protected_nopar:Npn \xparse_grab_v_group_end: - { - \tl_set:Nx \l_xparse_tmp_tl - { - \tl_set:Nn \exp_not:N \l_xparse_v_rest_of_signature_tl - { \exp_not:o \l_xparse_v_rest_of_signature_tl } - \tl_set:Nn \exp_not:N \l_xparse_v_arg_tl - { \exp_not:o \l_xparse_v_arg_tl } - } - \exp_after:wN \group_align_safe_end: - \exp_after:wN \group_end: - \l_xparse_tmp_tl - } \cs_new_protected:Npn \xparse_grab_v_token_if_char:NTF #1 { \str_if_eq:xxTF { } { \str_tail:n {#1} } } \cs_new_protected:Npn \xparse_process_to_str:n #1 @@ -894,6 +940,8 @@ } \group_end: \cs_new_protected:Npn \xparse_split_list_aux:w { } +\cs_new_protected:Npn \xparse_trim_spaces:n #1 + { \tl_set:Nx \ProcessedArgument { \tl_trim_spaces:n {#1} } } \cs_new_protected:Npn \xparse_exp_add_type_d:w #1#2 { \xparse_exp_add_type_D:w #1 #2 { \NoValue } } \cs_new_protected:Npn \xparse_exp_add_type_D:w #1#2#3 @@ -1395,6 +1443,7 @@ \cs_new_eq:NN \ReverseBoolean \xparse_bool_reverse:N \cs_new_eq:NN \SplitArgument \xparse_split_argument:nnn \cs_new_eq:NN \SplitList \xparse_split_list:nn +\cs_new_eq:NN \TrimSpaces \xparse_trim_spaces:n \cs_new_eq:NN \GetDocumentCommandArgSpec \xparse_get_arg_spec:N \cs_new_eq:NN \GetDocumentEnvironmmentArgSpec \xparse_get_arg_spec:n \cs_new_eq:NN \ShowDocumentCommandArgSpec \xparse_show_arg_spec:N diff --git a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty index a5de89e8606..252b59841ad 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty @@ -51,11 +51,11 @@ %% ----------------------------------------------------------------------- %% \RequirePackage{expl3} -\GetIdInfo$Id: xtemplate.dtx 2828 2011-09-15 20:04:53Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 2900 2011-10-09 21:22:46Z joseph $ {L3 Experimental prototype document functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\@ifpackagelater { expl3 } { 2011/09/15 } +\@ifpackagelater { expl3 } { 2011/10/09 } { } { \PackageError { xtemplate } { Support~package~l3kernel~too~old. } @@ -1147,7 +1147,7 @@ You~asked~to~use~#2~arguments:~this~is~not~supported. } \msg_new:nnnn { xtemplate } { bad-variable } - { Incorrect~variable~description. } + { Incorrect~variable~description~'#1'. } { The~argument~'#1'~is~not~of~the~form \\ ~~''\\ -- cgit v1.2.3