diff options
author | Karl Berry <karl@freefriends.org> | 2012-02-28 00:40:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-02-28 00:40:31 +0000 |
commit | e20ea4bdd670e0418363a2a38a54b422a4d83231 (patch) | |
tree | e75e065101424a1535a03f6d071b8cc17d22eb2d /Master | |
parent | ed49b3dfe19b91f9fd96ab70fe95dcda8fba24c8 (diff) |
l3packages 3471 (26feb12)
git-svn-id: svn://tug.org/texlive/trunk@25524 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
13 files changed, 384 insertions, 383 deletions
diff --git a/Master/texmf-dist/doc/latex/l3packages/README b/Master/texmf-dist/doc/latex/l3packages/README index fe54217df41..05a0cda0a70 100644 --- a/Master/texmf-dist/doc/latex/l3packages/README +++ b/Master/texmf-dist/doc/latex/l3packages/README @@ -50,16 +50,16 @@ optional stars (and others), mandatory arguments and more. ----------- The `xtemplate` package provides an interface for defining generic -functions using a key=val syntax. This is designed to be +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 concerning the approach, suggestions for improvements, +Discussion concerning the approach, suggestions for improvements, changes, additions, _etc._ should be addressed to the list -[LaTeX-L](http://news.gmane.org/group/gmane.comp.tex.latex.latex3). +[LaTeX-L](http://news.gmane.org/group/gmane.comp.tex.latex.latex3). You can subscribe to this list by sending mail to @@ -75,7 +75,7 @@ Bugs The issue tracker for LaTeX3 bugs is currently located at https://github.com/latex3/svn-mirror/issues - + Please report specific issues with LaTeX3 code there. More general discussion should be directed to the LaTeX-L lists. @@ -97,14 +97,14 @@ the team members are * 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: <latex-team@latex-project.org>; for general LaTeX3 discussion the [LaTeX-L list](http://news.gmane.org/group/gmane.comp.tex.latex.latex3) diff --git a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf Binary files differindex ef4f17f7393..d2f4829af71 100644 --- a/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/l3keys2e/l3keys2e.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf Binary files differindex 2a43c4ab5fd..65fd95dabef 100644 --- a/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/xfrac/xfrac.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf Binary files differindex e7400ae1c87..74c535b7eb5 100644 --- a/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/xparse/xparse.pdf diff --git a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf Binary files differindex b89dacccf9e..a32b5a38629 100644 --- a/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf +++ b/Master/texmf-dist/doc/latex/l3packages/xtemplate/xtemplate.pdf diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx index de1850a183e..9d754ee9e80 100644 --- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx +++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% +% %% File: l3keys2e.dtx (C) Copyright 2009,2011,2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the @@ -37,8 +37,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2012/02/08] -%<package>\@ifpackagelater{expl3}{2012/02/08} +\RequirePackage{expl3}[2012/02/26] +%<package>\@ifpackagelater{expl3}{2012/02/26} %<package> {} %<package> { %<package> \PackageError{l3keys2e}{Support package l3kernel too old.} @@ -50,7 +50,7 @@ %<package> \endinput %<package> } \RequirePackage{xparse} -\GetIdInfo$Id: l3keys2e.dtx 3342 2012-02-08 19:34:51Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 3471 2012-02-26 20:12:23Z joseph $ {LaTeX2e option processing using LaTeX3 keys} %</driver|package> %<*driver> @@ -61,14 +61,14 @@ \end{document} %</driver> % \fi -% +% % \title{^^A % The \textsf{l3keys2e} package\\ % \LaTeXe{} option processing using \LaTeX3 keys^^A % \thanks{This file describes v\ExplFileVersion, % last revised \ExplFileDate.}^^A % } -% +% % \author{^^A % The \LaTeX3 Project\thanks % {^^A @@ -90,28 +90,28 @@ % base code includes the module \pkg{l3keys} for defining keys, but % to use these when loading \LaTeXe\ packages and classes requires % extra support. That support is provided by this small package, which -% is intended to enable \LaTeXe\ packages to benefit from the power of +% is intended to enable \LaTeXe\ packages to benefit from the power of % the \LaTeX3 key--value system. -% +% % \subsection{Creating and using keyval options} % % As with any key--value input, using key--value pairs as package or % class options has two parts. The first stage is to define one or -% more keys, using the \cs{keys_define:nn} function. For example, an +% more keys, using the \cs{keys_define:nn} function. For example, an % option which simply stores a value would be created using: -% \begin{verbatim} +% \begin{verbatim} % \keys_define:nn { module } % { option .set:N = \l_module_variable_tl } % \end{verbatim} % On its own, this will not make the key an option for the package or -% class containing the definition. The second stage is therefore to +% class containing the definition. The second stage is therefore to % process the current options, searching for applicable keys. -% +% % \begin{function}{\ProcessKeysOptions} % \begin{syntax} % \cs{ProcessKeysOptions} \Arg{module} % \end{syntax} -% The \cs{ProcessKeysOptions} function is used to check the current +% The \cs{ProcessKeysOptions} function is used to check the current % option list against the keys defined for \Arg{module}. Global (class) % options and local (package) options are checked when this function % is called in a package. Each option which does match a key name is @@ -130,12 +130,12 @@ % This function works in a similar manner to \cs{ProcessKeysOptions}. % When used in a \LaTeXe{} package, \cs{ProcessKeysPackageOptions} % will not examine any class options available. In contrast, -% \cs{ProcessKeysOptions} does parse class options (in common with the +% \cs{ProcessKeysOptions} does parse class options (in common with the % \LaTeXe{} kernel function \cs{ProcessOptions}). % \end{function} % %\end{documentation} -% +% %\begin{implementation} % %\subsection{\pkg{l3keys2e} Implementation} @@ -148,7 +148,7 @@ \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} % \end{macrocode} -% +% % \begin{macro}{\keys_latexe_options_clist} % A single list is used for all options, into which they are collected % before processing. @@ -167,10 +167,10 @@ % % \begin{macro}{\keys_latexe_options:n} % The main function calls functions to collect up the global and local -% options into \cs{keys_latexe_options_clist} before calling the +% options into \cs{keys_latexe_options_clist} before calling the % underlying functions to actually do the processing. So that a suitable -% message is produced if the option is unknown, the special -% \texttt{unknown} key is set if it does not already exist for the +% message is produced if the option is unknown, the special +% \texttt{unknown} key is set if it does not already exist for the % current module. % \begin{macrocode} \cs_new_protected:Npn \keys_latexe_options:n #1 @@ -180,10 +180,10 @@ \keys_latexe_options_local: \keys_if_exist:nnF {#1} { unknown } { - \keys_define:nn {#1} + \keys_define:nn {#1} { - unknown .code:n = - { + unknown .code:n = + { \msg_error:nnxx { keyvalue } { option-unknown } { \l_keys_key_tl } { \@currname } } @@ -203,9 +203,9 @@ % \begin{macrocode} \cs_new_protected:Npn \keys_latexe_options_global:n #1 { - \cs_if_eq:NNF \@classoptionslist \scan_stop: + \cs_if_eq:NNF \@classoptionslist \scan_stop: { - \cs_if_eq:NNTF \@currext \@clsextension + \cs_if_eq:NNTF \@currext \@clsextension { \keys_latexe_options_class:n {#1} } { \bool_if:NT \_l_keys_process_class_bool @@ -214,11 +214,11 @@ } } % \end{macrocode} -% \end{macro} -% +% \end{macro} +% % \begin{macro}{\keys_latexe_options_class:n} % For classes, each option (stripped of any content after |=|) -% is checked for existence as a key. If found, the option is added to +% is checked for existence as a key. If found, the option is added to % the combined list for processing. On the other hand, unused options % are stored up in \cs{@unusedoptionlist}. Before any of that, though, % there is a simple check to see if there is an |unknown| key. If there @@ -229,7 +229,7 @@ \keys_if_exist:nnTF {#1} { unknown } { \clist_put_right:No \keys_latexe_options_clist \@classoptionslist } { - \clist_map_inline:Nn \@classoptionslist + \clist_map_inline:Nn \@classoptionslist { \keys_if_exist:nnTF {#1} { \keys_latexe_remove_equals:n {##1} } { \clist_put_right:Nn \keys_latexe_options_clist {##1} } @@ -248,7 +248,7 @@ % \begin{macrocode} \cs_new_protected:Npn \keys_latexe_options_package:n #1 { - \clist_map_inline:Nn \@classoptionslist + \clist_map_inline:Nn \@classoptionslist { \keys_if_exist:nnT {#1} { \keys_latexe_remove_equals:n {##1} } { @@ -267,18 +267,18 @@ % \begin{macrocode} \cs_new_protected_nopar:Npn \keys_latexe_options_local: { - \cs_if_eq:NNF \@currext \@clsextension + \cs_if_eq:NNF \@currext \@clsextension { - \cs_if_exist:cT { opt@ \@currname . \@currext } + \cs_if_exist:cT { opt@ \@currname . \@currext } { - \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist + \exp_args:NNc \clist_put_right:NV \keys_latexe_options_clist { opt@ \@currname . \@currext } } } } % \end{macrocode} -% \end{macro} -% +% \end{macro} +% % \begin{macro}{\keys_latexe_remove_equals:n} % \begin{macro}{\keys_latexe_remove_equals:w} % As the name suggests, this is a simple function to remove an equals @@ -291,7 +291,7 @@ % \end{macrocode} % \end{macro} % \end{macro} -% +% % \begin{macro}{\ProcessKeysOptions} % \begin{macro}{\ProcessKeysOptions} % The user macro are simply wrappers around the internal process. In @@ -316,11 +316,11 @@ % % One message to give. % \begin{macrocode} -\msg_new:nnnn { keyvalue } { option-unknown } +\msg_new:nnnn { keyvalue } { option-unknown } { Unknown~option~'#1'~for~package~#2. } { LaTeX~has~been~asked~to~set~an~option~called~'#1'~ - but~the~#2~package~has~not~created~an~option~with~this~name. + but~the~#2~package~has~not~created~an~option~with~this~name. } % \end{macrocode} % @@ -329,5 +329,5 @@ % \end{macrocode} % % \end{implementation} -% +% % \PrintIndex diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx index a2b28d94bd8..ad2da510576 100644 --- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment -% +% %% File: xfrac.dtx Copyright (C) 2004, 2008-2010 Morten Hoegholm -%% (C) 2011 The LaTeX3 Project +%% (C) 2011 The 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 @@ -37,7 +37,7 @@ % %<*driver|package> \RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate} -\GetIdInfo$Id: xfrac.dtx 3341 2012-02-08 19:30:37Z joseph $ +\GetIdInfo$Id: xfrac.dtx 3465 2012-02-26 15:31:13Z bruno $ {L3 Experimental split-level fractions} %</driver|package> %<*driver> @@ -50,13 +50,13 @@ \end{document} %</driver> % \fi -% +% % \title{^^A % The \textsf{xfrac} package\\ Split-level fractions^^A % \thanks{This file describes v\ExplFileVersion, % last revised \ExplFileDate.}^^A % } -% +% % \author{^^A % The \LaTeX3 Project\thanks % {^^A @@ -71,7 +71,7 @@ % \maketitle % % \begin{documentation} -% +% % The \pkg{xfrac} package defines a document command \cs{sfrac} % with the following syntax: % \begin{quote} @@ -92,7 +92,7 @@ % You'll notice something interesting: not only does the \cs{sfrac} % command work as it should in math mode, it also gets the job done % for other fonts as well. -% +% % \section{A Bit of History} % % \subsection{The Past} @@ -106,7 +106,7 @@ % The proper symbol to use instead of the virgule is a \emph{solidus} % which does not exist in Computer Modern. It is however available in % the European Computer Modern fonts, but I'll get back to that. -% +% % \subsection{The Present} % % The most common way to produce split level fractions within \LaTeXe{} @@ -131,7 +131,7 @@ % quite well for Computer Modern which was pretty much what was widely % available at the time it was developed. Users these days, however, % have a choice of many fonts when they write their documents. -% +% % \subsection{The Future} % % Fonts are wildly different; one macro that works fine for Computer @@ -143,11 +143,11 @@ % totally generic interface for the fraction commands and then adjust % parameters depending on the current font. What you see in this % prototype implementation of \pkg{xfrac} is just that. -% +% % \section{Advanced User Interface} % % \subsection{Text mode} -% +% % The usual problem in text mode has a name: Computer Modern. The % solidi of all the Computer Modern fonts leave a lot to be desired, % although things are potentially looking better as the Latin Modern @@ -306,7 +306,7 @@ % $\sfrac{8}{13}$ and just typing |$8/13$| gives the same result: % $8/13$. % \endgroup -% +% % \section{The Template Interface} % % \begin{TemplateInterfaceDescription}{xfrac} @@ -526,16 +526,16 @@ % \begin{implementation} % % \section{\pkg{xfrac} Implementation} -% +% % \begin{macrocode} %<*package> % \end{macrocode} -% +% % \begin{macrocode} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} % \end{macrocode} -% +% % \begin{variable}{\l_xfrac_cm_std_bool} % There is one option to support. % \begin{macrocode} @@ -548,16 +548,16 @@ cm-recommended / true .code:n = { \bool_set_false:N \l_xfrac_cm_std_bool }, - cm-recommended .default:n = { true }, + cm-recommended .default:n = { true }, cm-standard .bool_set:N = \l_xfrac_cm_std_bool } \ProcessKeysOptions { xfrac } % \end{macrocode} % \end{variable} -% +% % \begin{variable}{\l_xfrac_slash_box} % \begin{variable}{\l_xfrac_tmp_box} -% In keeping with the \LaTeX3 philosophy, rather than use generic +% In keeping with the \LaTeX3 philosophy, rather than use generic % scratch boxes and get confused, \pkg{xfrac} reserves its own named % working space. % \begin{macrocode} @@ -566,7 +566,7 @@ % \end{macrocode} % \end{variable} % \end{variable} -% +% % \begin{macro}[aux]{\xfrac_tmp:w} % Used for the raised boxes: weird as it does not take an argument % but the \cs{raisebox} does. @@ -574,13 +574,13 @@ \cs_new:Npn \xfrac_tmp:w { } % \end{macrocode} % \end{macro} -% +% % % \subsection{Initialisation of variables} % % Variables used in templates have to be set up: there is not % much to say about these, other than that they must exist. -% +% % \begin{variable}{\l_xfrac_denominator_bot_sep_dim} % \begin{variable}{\l_xfrac_numerator_bot_sep_dim} % \begin{variable}{\l_xfrac_numerator_top_sep_dim} @@ -599,7 +599,7 @@ % \end{variable} % \end{variable} % \end{variable} -% +% % \begin{variable}{\l_xfrac_slash_left_muskip} % \begin{variable}{\l_xfrac_slash_right_muskip} % Math mode skips. @@ -609,7 +609,7 @@ % \end{macrocode} % \end{variable} % \end{variable} -% +% % \begin{variable}{\l_xfrac_hscale_fp} % \begin{variable}{\l_xfrac_scale_factor_fp} % \begin{variable}{\l_xfrac_vscale_fp} @@ -633,7 +633,7 @@ % \begin{macrocode} \tl_new:N \l_xfrac_denominator_font_tl \tl_new:N \l_xfrac_numerator_font_tl -\tl_new:N \l_xfrac_phantom_tl +\tl_new:N \l_xfrac_phantom_tl \tl_new:N \l_xfrac_slash_symbol_tl \tl_new:N \l_xfrac_slash_symbol_font_tl % \end{macrocode} @@ -678,7 +678,7 @@ % \end{macro} % \end{macro} % \end{macro} -% +% % \subsection{The template} % % There is only one object type in \pkg{xfrac}, rather unimaginatively @@ -719,10 +719,10 @@ } % \end{macrocode} % Most of the variable binding is quite simple: of course, the choices -% are a little more complicated. That is particularly true where -% these have to set up \enquote{on the fly} functions. +% are a little more complicated. That is particularly true where +% these have to set up \enquote{on the fly} functions. % \begin{macrocode} -\DeclareTemplateCode { xfrac } { text } { 3 } +\DeclareTemplateCode { xfrac } { text } { 3 } { denominator-bot-sep = \l_xfrac_denominator_bot_sep_dim , denominator-font = \l_xfrac_denominator_font_tl , @@ -741,26 +741,26 @@ scale-factor = \l_xfrac_scale_factor_fp , scale-relative = { - false = + false = \cs_set_nopar:Npn \xfrac_relscale: { - \dim_eval:w + \dim_eval:w \box_ht:N \l_xfrac_tmp_box + \box_dp:N \l_xfrac_tmp_box - \dim_eval_end: + \dim_eval_end: }, - true = - \cs_set_nopar:Npn \xfrac_relscale: + true = + \cs_set_nopar:Npn \xfrac_relscale: { \box_ht:N \l_xfrac_slash_box } }, scaling = { - false = \cs_set_eq:NN \xfrac_fontscale: \prg_do_nothing:, - true = + false = \cs_set_eq:NN \xfrac_fontscale: \prg_do_nothing:, + true = \cs_set_nopar:Npn \xfrac_fontscale: { \fontsize { \fp_use:N \l_xfrac_scale_factor_fp \xfrac_relscale: } - { \c_zero_dim } + { \c_zero_dim } \selectfont } }, @@ -771,7 +771,7 @@ slash-symbol = \l_xfrac_slash_symbol_tl , slash-symbol-font = \l_xfrac_slash_symbol_font_tl , slash-symbol-format = \xfrac_slash_symbol_format:n , - v-scale = \l_xfrac_vscale_fp + v-scale = \l_xfrac_vscale_fp } % \end{macrocode} % The implementation part starts with applying all of the settings @@ -793,17 +793,17 @@ { \cs_set_eq:NN \xfrac_text_or_math:n \mbox \cs_set_nopar:Npn \xfrac_denominator_font_change: - { + { \fontfamily { \l_xfrac_denominator_font_tl } \selectfont } \cs_set_nopar:Npn \xfrac_numerator_font_change: - { + { \fontfamily { \l_xfrac_numerator_font_tl } \selectfont } \cs_set_nopar:Npn \xfrac_slash_symbol_font_change: - { + { \fontfamily { \l_xfrac_slash_symbol_font_tl } \selectfont } @@ -812,21 +812,21 @@ % Everything is now either inside \cs{text} or an \cs{mbox}, depending % upon the surroundings. First, there are some boxes to set up. % \begin{macrocode} - \xfrac_text_or_math:n + \xfrac_text_or_math:n { \m@th - \hbox_set:Nn \l_xfrac_tmp_box + \hbox_set:Nn \l_xfrac_tmp_box { \xfrac_math:n { \vphantom { ( ) } } } - \hbox_set:Nn \l_xfrac_slash_box + \hbox_set:Nn \l_xfrac_slash_box { - \xfrac_math:n - { - \xfrac_slash_symbol_format:n + \xfrac_math:n + { + \xfrac_slash_symbol_format:n { - \xfrac_math:n + \xfrac_math:n { \xfrac_slash_symbol_font_change: - \IfNoValueTF {#2} + \IfNoValueTF {#2} { \l_xfrac_slash_symbol_tl } {#2} } } @@ -835,12 +835,12 @@ % \end{macrocode} % Check on the numerator separator dimensions. The code starts with the % assumption that neither has been given, as this can then be used to -% set up a default, which is also used when both values are set +% set up a default, which is also used when both values are set % erroneously. % \begin{macrocode} \cs_set_nopar:Npn \xfrac_tmp:w { - \raisebox + \raisebox { \dim_eval:w \box_ht:N \l_xfrac_slash_box @@ -849,37 +849,37 @@ \dim_eval_end: } } - \dim_compare:nNnTF + \dim_compare:nNnTF { \l_xfrac_numerator_top_sep_dim } = { \c_max_dim } { \dim_compare:nNnF - { \l_xfrac_numerator_bot_sep_dim } = { \c_max_dim } + { \l_xfrac_numerator_bot_sep_dim } = { \c_max_dim } { \cs_set_nopar:Npn \xfrac_tmp:w - { - \raisebox - { \dim_use:N \l_xfrac_numerator_bot_sep_dim } + { + \raisebox + { \dim_use:N \l_xfrac_numerator_bot_sep_dim } } } } { \dim_compare:nNnTF - { \l_xfrac_numerator_bot_sep_dim } = { \c_max_dim } - { + { \l_xfrac_numerator_bot_sep_dim } = { \c_max_dim } + { \cs_set_nopar:Npn \xfrac_tmp:w - { - \raisebox - { + { + \raisebox + { \dim_eval:w \box_ht:N \l_xfrac_slash_box - - \dim_use:N \l_xfrac_numerator_top_sep_dim + - \dim_use:N \l_xfrac_numerator_top_sep_dim - \height - \dim_eval_end: + \dim_eval_end: } } } - { - \msg_error:nn { xfrac } + { + \msg_error:nn { xfrac } { over-specified-numerator-sep } } } @@ -891,33 +891,33 @@ \xfrac_fontscale: \xfrac_numerator_format:n { - \scalebox + \scalebox { \fp_use:N \l_xfrac_hscale_fp } [ \fp_use:N \l_xfrac_vscale_fp ] - { - \xfrac_math:n - { + { + \xfrac_math:n + { \xfrac_numerator_font_change: { \vphantom { \l_xfrac_phantom_tl } #1 } - } + } } } } \xfrac_math:n - { % THIS IS JUST WRONG! + { % THIS IS JUST WRONG! \scan_align_safe_stop: \mode_if_math:TF { \tex_mskip:D \l_xfrac_slash_right_muskip } { \tex_hskip:D \l_xfrac_slash_right_sep_dim } - } + } % \end{macrocode} % Typeset the separator. % \begin{macrocode} \box_use:N \l_xfrac_slash_box - \xfrac_math:n + \xfrac_math:n { \mode_if_math:TF { \tex_mskip:D \l_xfrac_slash_left_muskip } @@ -926,43 +926,43 @@ % \end{macrocode} % Typeset the denominator. % \begin{macrocode} - \dim_compare:nNnTF + \dim_compare:nNnTF { \l_xfrac_denominator_bot_sep_dim } = { \c_max_dim } { \cs_set_nopar:Npn \xfrac_tmp:w - { \raisebox { - \box_dp:N \l_xfrac_slash_box } } + { \raisebox { - \box_dp:N \l_xfrac_slash_box } } } { \cs_set_nopar:Npn \xfrac_tmp:w - { - \raisebox + { + \raisebox { \dim_use:N \l_xfrac_denominator_bot_sep_dim } } - } + } \xfrac_tmp:w { \xfrac_fontscale: \xfrac_denominator_format:n { \scalebox - { \fp_use:N \l_xfrac_hscale_fp } + { \fp_use:N \l_xfrac_hscale_fp } [ \fp_use:N \l_xfrac_vscale_fp ] - { - \xfrac_math:n - { + { + \xfrac_math:n + { \xfrac_denominator_font_change: { \vphantom { \l_xfrac_phantom_tl } #3 } - } + } } } } - } + } } % \end{macrocode} -% +% % Since math(s) and text mode are wildly different entities we define a % separate template for each. You already saw the \enquote{text} % template, and here is the \enquote{math} template. @@ -982,17 +982,17 @@ phantom = ( % ) } % \end{macrocode} -% +% %\subsection{The standard instances} % % For the default instances we just use the relevant templates with % the default settings. -% +% % The default \enquote{text} instance. % \begin{macrocode} \DeclareInstance { xfrac } { default } { text } { } % \end{macrocode} -% +% % The default \enquote{math(s)} instance. % \begin{macrocode} \DeclareInstance { xfrac } { mathdefault } { math } { } @@ -1011,34 +1011,34 @@ slash-left-mkern = 0 mu } % \end{macrocode} -% +% % Default Computer Modern setup. Far from optimal, but better than % nothing. % \begin{macrocode} -\DeclareInstance { xfrac } { cmr } { text } +\DeclareInstance { xfrac } { cmr } { text } { denominator-bot-sep = 0 pt , numerator-top-sep = 0.2 ex , slash-left-kern = -0.1 em , - slash-right-kern = -0.1 em + slash-right-kern = -0.1 em } \DeclareInstance { xfrac } { cmss } { text } { denominator-bot-sep = 0 pt , numerator-top-sep = 0.2 ex , slash-left-kern = -0.1 em , - slash-right-kern = -0.1 em + slash-right-kern = -0.1 em } \DeclareInstance { xfrac } { cmtt } { text } { denominator-bot-sep = 0 pt , numerator-top-sep = 0.2 ex , slash-left-kern = -0.1 em , - slash-right-kern = -0.1 em + slash-right-kern = -0.1 em } % \end{macrocode} -% -% We can do better for the Computer Modern fonts. For cmr and cmss +% +% We can do better for the Computer Modern fonts. For cmr and cmss % we choose Times, and for cmtt use Palatino. % \begin{macrocode} \bool_if:NF \l_xfrac_cm_std_bool @@ -1051,7 +1051,7 @@ { slash-symbol-font = ppl } } % \end{macrocode} -% +% % Things works slightly better with Latin Modern. % \begin{macrocode} \DeclareInstance { xfrac } { lmr } { text } @@ -1059,24 +1059,24 @@ denominator-bot-sep = 0 pt , numerator-top-sep = 0.1 ex , slash-left-kern = -0.15 em , - slash-right-kern = -0.15 em + slash-right-kern = -0.15 em } \DeclareInstance { xfrac } { lmss } { text } { denominator-bot-sep = 0 pt , numerator-top-sep = 0 pt , slash-left-kern = -0.15 em , - slash-right-kern = -0.15 em + slash-right-kern = -0.15 em } \DeclareInstance { xfrac } { lmtt } { text } { denominator-bot-sep = 0 pt , numerator-top-sep = 0 pt , slash-left-kern = -0.15 em , - slash-right-kern = -0.15 em + slash-right-kern = -0.15 em } % \end{macrocode} -% +% % \subsection{The user command} % % \begin{macro}{\sfrac} @@ -1094,41 +1094,40 @@ % \begin{verbatim} % \sfrac[cmr2]{7}{12} % \end{verbatim} -% and get the settings from \enquote{cmr2} instead of the settings of +% and get the settings from \enquote{cmr2} instead of the settings of % the current font family. % \begin{macrocode} \NewDocumentCommand \sfrac { o m o m } { - \mode_if_math:TF + \mode_if_math:TF { \IfInstanceExistTF { xfrac } { mathfam \number \fam } { \UseInstance { xfrac } { mathfam \number \fam } } { \UseInstance { xfrac } { mathdefault } } - {#2} {#3} {#4} + {#2} {#3} {#4} } { \IfInstanceExistTF { xfrac } {#1} { \UseInstance { xfrac } {#1} } - { + { \IfInstanceExistTF { xfrac } { \f@family } { \UseInstance { xfrac } { \f@family } } { \UseInstance { xfrac } { default } } } - {#2} {#3} {#4} - } + {#2} {#3} {#4} + } } % \end{macrocode} % \end{macro} % % \subsection{Messages} % -% Just the one. +% Just the one. % \begin{macrocode} \msg_new:nnnn { xfrac } { over-specified-numerator-sep } { You have specified both numerator-top-sep and numerator-bot-sep} {I will pretend that you didn't specify either of them} -% \end{macrocode} - +% \end{macrocode} % % \begin{macrocode} %</package> diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx index bb1d17cac39..0c632a9179e 100644 --- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx @@ -41,8 +41,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2012/02/08] -%<package>\@ifpackagelater{expl3}{2012/02/08} +\RequirePackage{expl3}[2012/02/26] +%<package>\@ifpackagelater{expl3}{2012/02/26} %<package> {} %<package> { %<package> \PackageError{xparse}{Support package l3kernel too old.} @@ -53,7 +53,7 @@ %<package> } %<package> \endinput %<package> } -\GetIdInfo$Id: xparse.dtx 3342 2012-02-08 19:34:51Z joseph $ +\GetIdInfo$Id: xparse.dtx 3471 2012-02-26 20:12:23Z joseph $ {L3 Experimental document command parser} %</driver|package> %<*driver> @@ -231,10 +231,10 @@ % argument processors is a somewhat advanced topic, (or at least a less % commonly used feature) and is covered in Section~\ref{sec:processors}. % -% By default, an argument of type \texttt{v} must be at most one line. -% Prefixing with \texttt{+} allows line breaks within the argument. -% The argument is given as a string of characters with category code~$12$, -% except spaces, which have category code~$10$ (see \cs{tl_to_str:n}). +% By default, an argument of type~\texttt{v} must be at most one line. +% Prefixing with \texttt{+} allows line breaks within the argument. The +% argument is given as a string of characters with category codes~$12$ +% or~$13$, except spaces, which have category code~$10$. % % \subsection{Spacing and optional arguments} % @@ -277,16 +277,16 @@ % % \subsection{Verbatim arguments} % -% Arguments of type \enquote{\texttt{v}} are read in verbatim mode, which will -% result in the grabbed argument consisting of tokens of category code -% $12$~(\enquote{other}), except spaces, which are given category code -% $10$~(\enquote{space}). The argument will be +% Arguments of type~\texttt{v} are read in verbatim mode, which will +% result in the grabbed argument consisting of tokens of category codes +% $12$~(\enquote{other}) and $13$~(\enquote{active}), except spaces, +% which are given category code $10$~(\enquote{space}). The argument is % delimited in a similar manner to the \LaTeXe{} \cs{verb} function. % % Functions containing verbatim arguments cannot appear in the arguments % of other functions. The \texttt{v}~argument specifier includes code to check % this, and will raise an error if the grabbed argument has already been -% tokenized by \TeX{}. +% tokenized by \TeX{} in an irreversible way. % % Users should note that support for verbatim arguments is somewhat % experimental. Feedback is therefore very welcome on the \texttt{LaTeX-L} @@ -486,7 +486,7 @@ % \end{verbatim} % \end{function} % -% \begin{function}{\SplitArgument} +% \begin{function}[updated = 2012-02-12]{\SplitArgument} % \begin{syntax} % \cs{SplitArgument} \Arg{number} \Arg{token} % \end{syntax} @@ -505,7 +505,8 @@ % { \InternalFunctionOfThreeArguments #1 } % \end{verbatim} % Any category code $13$ (active) \meta{tokens} will be replaced -% before the split takes place. +% before the split takes place. Spaces are trimmed at each end of each +% item parsed. % \end{function} % % \begin{function}{\SplitList} @@ -907,7 +908,7 @@ % \end{macro} % \end{macro} % \end{macro} -% +% % \begin{macro}{\xparse_break_point:n} % A marker used to escape from creating a definition if necessary. % \begin{macrocode} @@ -1115,7 +1116,7 @@ % the rest are simply there to ensure the loop continues correctly. There are % no count functions for \texttt{l} or \texttt{v} argument types as they are % exactly the same as \texttt{m}, and so a little code can be saved. -% +% % The second thing that can be done here is to check that the signature is % actually valid, such that all of the various argument types have the % correct number of data items associated with them. If this fails to be @@ -1125,7 +1126,7 @@ % \begin{macrocode} \cs_new_protected:cpn { xparse_count_type_>:w } #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected_nopar:cpn { xparse_count_type_+:w } @@ -1134,21 +1135,21 @@ { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_D:w #1#2#3 { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected_nopar:Npn \xparse_count_type_g:w { \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_G:w #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected_nopar:Npn \xparse_count_type_m:w @@ -1160,7 +1161,7 @@ { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_arg_spec:wn } \int_incr:N \l_xparse_mandatory_args_int \xparse_count_mandatory:N } @@ -1168,25 +1169,25 @@ { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_arg_spec:wn } \int_incr:N \l_xparse_mandatory_args_int \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_t:w #1 { \xparse_single_token_check:n {#1} - \quark_if_recursion_tail_stop_do:Nn #1 { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:Nn #1 { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_u:w #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_arg_spec:wn } \int_incr:N \l_xparse_mandatory_args_int \xparse_count_mandatory:N } % \end{macrocode} % \end{macro} -% +% % \begin{macro}{\xparse_single_token_check:n} % \begin{macro}[aux]{\xparse_single_token_check_aux:nwn} % A spin-out function to check that what should be single tokens really @@ -1206,13 +1207,13 @@ % \end{macrocode} % \end{macro} % \end{macro} -% -% \begin{macro}{\xparse_bad_signature:wn} +% +% \begin{macro}{\xparse_bad_arg_spec:wn} % If the signature is wrong, this provides an escape from the entire % definition process. % \begin{macrocode} -\cs_new_protected:Npn \xparse_bad_signature:wn #1 \xparse_break_point:n #2 - { \msg_kernel_error:nnx { xparse } { bad-signature } { \tl_to_str:n {#2} } } +\cs_new_protected:Npn \xparse_bad_arg_spec:wn #1 \xparse_break_point:n #2 + { \msg_kernel_error:nnx { xparse } { bad-arg-spec } { \tl_to_str:n {#2} } } % \end{macrocode} % \end{macro} % @@ -2149,7 +2150,7 @@ % \end{macro} % \end{macro} % \end{macro} -%\end{macro} +% \end{macro} % \end{macro} % \end{macro} % \end{macro} @@ -2300,14 +2301,10 @@ } \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 + \group_align_safe_end: + \exp_args:NNNo + \group_end: + \tl_set:Nn \l_xparse_v_arg_tl { \l_xparse_v_arg_tl } } % \end{macrocode} % \end{variable} @@ -2344,7 +2341,7 @@ % \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_aux_put:N #1 \xparse_grab_v_token_if_char:NTF #1 { \xparse_grab_v_aux_catcodes: @@ -2365,7 +2362,7 @@ \token_if_eq_charcode:NNTF #1 #2 { \xparse_grab_v_aux_loop_end: } { - \tl_put_right:Nn \l_xparse_v_arg_tl { #2 } + \xparse_grab_v_aux_put:N #2 \xparse_grab_v_aux_loop:N #1 } } @@ -2374,8 +2371,7 @@ \cs_new_protected_nopar:Npn \xparse_grab_v_aux_loop_end: { \xparse_grab_v_group_end: - \exp_args:Nx \xparse_add_arg:n - { \exp_args:No \str_tail:n { \l_xparse_v_arg_tl } } + \exp_args:Nx \xparse_add_arg:n { \tl_tail:N \l_xparse_v_arg_tl } \l_xparse_v_rest_of_signature_tl \l_xparse_args_tl } % \end{macrocode} @@ -2399,12 +2395,12 @@ % normal undelimited argument. % \begin{macrocode} \int_new:N \l_xparse_v_nesting_int -\cs_new_protected_nopar:Npn \xparse_grab_v_bgroup: +\cs_new_protected_nopar:Npx \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: + \exp_not:N \xparse_grab_v_aux_catcodes: + \exp_not:n { \int_set_eq:NN \l_xparse_v_nesting_int \c_one } + \exp_not:N \xparse_grab_v_aux_put:N \iow_char:N \{ + \exp_not:N \xparse_grab_v_bgroup_loop: } \cs_new_protected:Npn \xparse_grab_v_bgroup_loop: { @@ -2421,7 +2417,7 @@ \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_aux_put:N #1 \xparse_grab_v_bgroup_loop: } { \xparse_grab_v_aux_loop_end: } @@ -2429,7 +2425,7 @@ { \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_aux_put:N #1 \xparse_grab_v_bgroup_loop: } } @@ -2498,6 +2494,22 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\xparse_grab_v_aux_put:N} +% Storing one token in the collected argument. Most tokens are +% converted to category code $12$, with the exception of active +% characters, and spaces (not sure what should be done for those). +% \begin{macrocode} +\cs_new_protected:Npn \xparse_grab_v_aux_put:N #1 + { + \tl_put_right:Nx \l_xparse_v_arg_tl + { + \token_if_active:NTF #1 + { \exp_not:N #1 } { \token_to_str:N #1 } + } + } +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\xparse_grab_v_token_if_char:NTF} % This function assumes that the escape character is printable. % Then the string representation of control sequences is at least @@ -2794,7 +2806,7 @@ % \begin{macrocode} \cs_new:Npn \xparse_grab_expandable_end:wN #1 \q_xparse #2 {#1} % \end{macrocode} -%\end{macro} +% \end{macro} % % \subsection{Argument processors} % @@ -2816,7 +2828,7 @@ \cs_new_protected:Npn \xparse_process_to_str:n #1 { \tl_set:Nx \ProcessedArgument { \tl_to_str:n {#1} } } % \end{macrocode} -%\end{macro} +% \end{macro} % % \begin{macro}{\xparse_bool_reverse:N} % A simple reversal. @@ -2830,71 +2842,6 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\l_xparse_split_argument_tl} -% \begin{macro}{\xparse_split_argument:nnn} -% \begin{macro}[aux]{\xparse_split_argument_aux_i:w} -% \begin{macro}[aux]{\xparse_split_argument_aux_ii:w} -% \begin{macro}[aux]{\xparse_split_argument_aux_iii:w} -% The idea of this function is to split the input $n + 1$ times using -% a given token. -% \begin{macrocode} -\tl_new:N \l_xparse_split_argument_tl -\group_begin: - \char_set_catcode_active:N \@ - \cs_new_protected:Npn \xparse_split_argument:nnn #1#2#3 - { - \tl_set:Nn \l_xparse_split_argument_tl {#3} - \group_begin: - \char_set_lccode:nn { `\@ } { `#2} - \tl_to_lowercase:n - { - \group_end: - \tl_replace_all:Nnn \l_xparse_split_argument_tl { @ } {#2} - } - \cs_set_protected:Npn \xparse_split_argument_aux_i:w - ##1 \q_mark ##2 #2 ##3 \q_stop - { - \tl_put_right:Nn \ProcessedArgument { {##2} } - ##1 \q_mark ##3 \q_stop - } - \cs_set_protected:Npn \xparse_split_argument_aux_iii:w - ##1 #2 ##2 \q_stop - { - \IfNoValueF {##1} - { - \msg_kernel_error:nnxxx { xparse } { split-excess-tokens } - { \tl_to_str:n {#2} } { \tl_to_str:n {#1} } - { \tl_to_str:n {#3} } - } - } - \tl_set:Nx \l_xparse_tmp_tl - { - \prg_replicate:nn { #1 + 1 } - { \xparse_split_argument_aux_i:w } - \xparse_split_argument_aux_ii:w - \exp_not:N \q_mark - \exp_not:o \l_xparse_split_argument_tl - \prg_replicate:nn {#1} { \exp_not:n {#2} \NoValue } - \exp_not:n { #2 \q_stop } - } - \l_xparse_tmp_tl - } -\group_end: -\cs_new_protected:Npn \xparse_split_argument_aux_i:w { } -\cs_new_protected:Npn \xparse_split_argument_aux_ii:w - #1 \q_mark #2 \q_stop - { - \tl_if_empty:nF {#2} - { \xparse_split_argument_aux_iii:w #2 \q_stop } - } -\cs_new_protected:Npn \xparse_split_argument_aux_iii:w { } -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% % \begin{variable}{\l_xparse_split_list_seq, \l_xparse_split_list_tl} % \begin{macro}{\xparse_split_list:nn} % \begin{macro}[aux]{\xparse_split_list_multi:nn, \xparse_split_list_multi:nV} @@ -2910,7 +2857,7 @@ \bool_if:nTF { \tl_if_single_p:n {#1} && - ! (\token_if_cs_p:N #1 ) + ! ( \token_if_cs_p:N #1 ) } { \xparse_split_list_single:Nn #1 {#2} } { \xparse_split_list_multi:nn {#1} {#2} } @@ -2944,6 +2891,68 @@ % \end{macro} % \end{variable} % +% \begin{macro}{\xparse_split_argument:nnn} +% \begin{macro}[aux]{\xparse_split_argument_aux:nnnn} +% \begin{macro}[aux, EXP]{\xparse_split_argument_aux:n} +% \begin{macro}[aux, EXP]{\xparse_split_argument_aux:wn} +% Splitting to a known number of items is a special version of splitting +% a list, in which the limit is hard-coded and where there will always be +% exactly the correct number of output items. An auxiliary function is +% used to save on working out the token list length several times. +% \begin{macrocode} +\cs_new_protected:Npn \xparse_split_argument:nnn #1#2#3 + { + \xparse_split_list:nn {#2} {#3} + \exp_args:Nf \xparse_split_argument_aux:nnnn + { \tl_length:N \ProcessedArgument } + {#1} {#2} {#3} + } +\cs_new_protected:Npn \xparse_split_argument_aux:nnnn #1#2#3#4 + { + \int_compare:nNnF {#1} = { #2 + \c_one } + { + \int_compare:nNnTF {#1} > { #2 + \c_one } + { + \tl_set:Nx \ProcessedArgument + { + \exp_last_unbraced:NnNo + \xparse_split_argument_aux:n + { #2 + \c_one } + \use_none_delimit_by_q_stop:w + \ProcessedArgument + \q_stop + } + \msg_kernel_error:nnxxx { xparse } { split-excess-tokens } + { \tl_to_str:n {#3} } { \int_eval:n { #2 + \c_one } } + { \tl_to_str:n {#4} } + } + { + \tl_put_right:Nx \ProcessedArgument + { + \prg_replicate:nn { #2 + \c_one - (#1) } + { { \exp_not:n { \NoValue } } } + } + } + } + } +% \end{macrocode} +% Auxiliaries to leave exactly the correct number of arguments in +% \cs{ProcessedArgument}. +% \begin{macrocode} +\cs_new:Npn \xparse_split_argument_aux:n #1 + { \prg_replicate:nn {#1} { \xparse_split_argument_aux:wn } } +\cs_new:Npn \xparse_split_argument_aux:wn #1 \use_none_delimit_by_q_stop:w #2 + { + \exp_not:n { {#2} } + #1 + \use_none_delimit_by_q_stop:w + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macro}{\xparse_trim_spaces:n} % This one is almost trivial. % \begin{macrocode} @@ -2987,11 +2996,10 @@ % \begin{macro}{\xparse_show_arg_spec:N} % \begin{macro}{\xparse_show_arg_spec:n} % Showing the argument specification simply means finding it and then -% calling the \cs{tl_show:c} function. +% calling the \cs{tl_show:N} function. % \begin{macrocode} \cs_new_protected:Npn \xparse_show_arg_spec:N #1 { - \tl_set:Nx \l_xparse_function_tl { \cs_to_str:N #1 } \prop_get:NnNTF \l_xparse_command_arg_specs_prop {#1} \ArgumentSpecification { \tl_show:N \ArgumentSpecification } @@ -3026,16 +3034,16 @@ % % \subsection{Messages} % -%\subsection{Messages} +% \subsection{Messages} % % Some messages intended as errors. % \begin{macrocode} -\msg_kernel_new:nnnn { xparse } { bad-signature } - { Bad~signature~'#1'. } +\msg_kernel_new:nnnn { xparse } { bad-arg-spec } + { Bad~argument~specification~'#1'. } { \c_msg_coding_error_text_tl - The~signature~provided~was~not~valid:~one~or~more~mandatory~pieces~ - of~information~were~missing. \\ \\ + The~argument~specification~provided~was~not~valid:~ + one~or~more~mandatory~pieces~of~information~were~missing. \\ \\ LaTeX~will~ignore~this~entire~definition. } \msg_kernel_new:nnnn { xparse } { command-already-defined } @@ -3080,7 +3088,7 @@ The~command~will~be~ignored. } \msg_kernel_new:nnnn { xparse } { expandable-ending-optional } - { Signature~for~expandable~command~ends~with~optional~argument. } + { Argument~specification~for~expandable~command~ends~with~optional~argument. } { \c_msg_coding_error_text_tl Expandable~commands~must~have~a~final~mandatory~argument~ @@ -3114,8 +3122,8 @@ { Argument~delimiter~should~be~a~single~token:~'#1'. } { \c_msg_coding_error_text_tl - The~signature~provided~was~not~valid:~in~a~place~where~a~single~token~is~ - required,~LaTeX~found~'#1'. \\ \\ + The~argument~specification~provided~was~not~valid:~ + in~a~place~where~a~single~token~is~required,~LaTeX~found~'#1'. \\ \\ LaTeX~will~ignore~this~entire~definition. } \msg_kernel_new:nnnn { xparse } { processor-in-expandable } @@ -3314,7 +3322,7 @@ % \begin{macrocode} \cs_new_protected:Npn \NoValue { -NoValue- } % \end{macrocode} -%\end{variable} +% \end{variable} % % \begin{macro}{\ProcessedArgument} % Processed arguments are returned using this name, which is reserved diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx index 7377ad5e3fd..e0698c916dd 100644 --- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx +++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx @@ -1,5 +1,5 @@ % \iffalse meta-comment -% +% %% File: xtemplate.dtx (C) Copyright 1999 Frank Mittelbach, Chris Rowley, %% David Carlisle %% (C) Copyright 2004-2010 Frank Mittelbach, @@ -41,8 +41,8 @@ %<*driver|package> % The version of expl3 required is tested as early as possible, as % some really old versions do not define \ProvidesExplPackage. -\RequirePackage{expl3}[2012/02/08] -%<package>\@ifpackagelater{expl3}{2012/02/08} +\RequirePackage{expl3}[2012/02/26] +%<package>\@ifpackagelater{expl3}{2012/02/26} %<package> {} %<package> { %<package> \PackageError{xtemplate}{Support package l3kernel too old.} @@ -53,7 +53,7 @@ %<package> } %<package> \endinput %<package> } -\GetIdInfo$Id: xtemplate.dtx 3342 2012-02-08 19:34:51Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 3471 2012-02-26 20:12:23Z joseph $ {L3 Experimental prototype document functions} %</driver|package> %<*driver> diff --git a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty index ec58cbfdeeb..7f763196531 100644 --- a/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty +++ b/Master/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty @@ -46,8 +46,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/02/08] -\@ifpackagelater{expl3}{2012/02/08} +\RequirePackage{expl3}[2012/02/26] +\@ifpackagelater{expl3}{2012/02/26} {} { \PackageError{l3keys2e}{Support package l3kernel too old.} @@ -59,7 +59,7 @@ \endinput } \RequirePackage{xparse} -\GetIdInfo$Id: l3keys2e.dtx 3342 2012-02-08 19:34:51Z joseph $ +\GetIdInfo$Id: l3keys2e.dtx 3471 2012-02-26 20:12:23Z joseph $ {LaTeX2e option processing using LaTeX3 keys} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} diff --git a/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty b/Master/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty index 000fe4fa209..b9bee5a0762 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 3341 2012-02-08 19:30:37Z joseph $ +\GetIdInfo$Id: xfrac.dtx 3465 2012-02-26 15:31:13Z bruno $ {L3 Experimental split-level fractions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -437,7 +437,6 @@ \msg_new:nnnn { xfrac } { over-specified-numerator-sep } { You have specified both numerator-top-sep and numerator-bot-sep} {I will pretend that you didn't specify either of them} - %% %% %% End of file `xfrac.sty'. diff --git a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty index 045016b235a..f346bb55be1 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xparse/xparse.sty @@ -50,8 +50,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/02/08] -\@ifpackagelater{expl3}{2012/02/08} +\RequirePackage{expl3}[2012/02/26] +\@ifpackagelater{expl3}{2012/02/26} {} { \PackageError{xparse}{Support package l3kernel too old.} @@ -62,7 +62,7 @@ } \endinput } -\GetIdInfo$Id: xparse.dtx 3342 2012-02-08 19:34:51Z joseph $ +\GetIdInfo$Id: xparse.dtx 3471 2012-02-26 20:12:23Z joseph $ {L3 Experimental document command parser} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} @@ -254,7 +254,7 @@ } \cs_new_protected:cpn { xparse_count_type_>:w } #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected_nopar:cpn { xparse_count_type_+:w } @@ -263,21 +263,21 @@ { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_D:w #1#2#3 { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected_nopar:Npn \xparse_count_type_g:w { \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_G:w #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected_nopar:Npn \xparse_count_type_m:w @@ -289,7 +289,7 @@ { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:Nn #2 { \xparse_bad_arg_spec:wn } \int_incr:N \l_xparse_mandatory_args_int \xparse_count_mandatory:N } @@ -297,19 +297,19 @@ { \xparse_single_token_check:n {#1} \xparse_single_token_check:n {#2} - \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#3} { \xparse_bad_arg_spec:wn } \int_incr:N \l_xparse_mandatory_args_int \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_t:w #1 { \xparse_single_token_check:n {#1} - \quark_if_recursion_tail_stop_do:Nn #1 { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:Nn #1 { \xparse_bad_arg_spec:wn } \xparse_count_mandatory:N } \cs_new_protected:Npn \xparse_count_type_u:w #1 { - \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_signature:wn } + \quark_if_recursion_tail_stop_do:nn {#1} { \xparse_bad_arg_spec:wn } \int_incr:N \l_xparse_mandatory_args_int \xparse_count_mandatory:N } @@ -324,8 +324,8 @@ \msg_kernel_error:nnx { xparse } { not-single-token } { \tl_to_str:n {#1} } { \tl_to_str:n {#3} } } -\cs_new_protected:Npn \xparse_bad_signature:wn #1 \xparse_break_point:n #2 - { \msg_kernel_error:nnx { xparse } { bad-signature } { \tl_to_str:n {#2} } } +\cs_new_protected:Npn \xparse_bad_arg_spec:wn #1 \xparse_break_point:n #2 + { \msg_kernel_error:nnx { xparse } { bad-arg-spec } { \tl_to_str:n {#2} } } \cs_new_protected:Npn \xparse_prepare_signature:n #1 { \bool_set_false:N \l_xparse_all_long_bool @@ -953,18 +953,14 @@ } \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 + \group_align_safe_end: + \exp_args:NNNo + \group_end: + \tl_set:Nn \l_xparse_v_arg_tl { \l_xparse_v_arg_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_aux_put:N #1 \xparse_grab_v_token_if_char:NTF #1 { \xparse_grab_v_aux_catcodes: @@ -985,7 +981,7 @@ \token_if_eq_charcode:NNTF #1 #2 { \xparse_grab_v_aux_loop_end: } { - \tl_put_right:Nn \l_xparse_v_arg_tl { #2 } + \xparse_grab_v_aux_put:N #2 \xparse_grab_v_aux_loop:N #1 } } @@ -994,17 +990,16 @@ \cs_new_protected_nopar:Npn \xparse_grab_v_aux_loop_end: { \xparse_grab_v_group_end: - \exp_args:Nx \xparse_add_arg:n - { \exp_args:No \str_tail:n { \l_xparse_v_arg_tl } } + \exp_args:Nx \xparse_add_arg:n { \tl_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: +\cs_new_protected_nopar:Npx \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: + \exp_not:N \xparse_grab_v_aux_catcodes: + \exp_not:n { \int_set_eq:NN \l_xparse_v_nesting_int \c_one } + \exp_not:N \xparse_grab_v_aux_put:N \iow_char:N \{ + \exp_not:N \xparse_grab_v_bgroup_loop: } \cs_new_protected:Npn \xparse_grab_v_bgroup_loop: { @@ -1021,7 +1016,7 @@ \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_aux_put:N #1 \xparse_grab_v_bgroup_loop: } { \xparse_grab_v_aux_loop_end: } @@ -1029,7 +1024,7 @@ { \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_aux_put:N #1 \xparse_grab_v_bgroup_loop: } } @@ -1069,6 +1064,14 @@ \l_xparse_v_rest_of_signature_tl \l_xparse_args_tl } } +\cs_new_protected:Npn \xparse_grab_v_aux_put:N #1 + { + \tl_put_right:Nx \l_xparse_v_arg_tl + { + \token_if_active:NTF #1 + { \exp_not:N #1 } { \token_to_str:N #1 } + } + } \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_add_arg:n #1 @@ -1215,56 +1218,6 @@ { \tl_set:Nn \ProcessedArgument { \c_false_bool } } { \tl_set:Nn \ProcessedArgument { \c_true_bool } } } -\tl_new:N \l_xparse_split_argument_tl -\group_begin: - \char_set_catcode_active:N \@ - \cs_new_protected:Npn \xparse_split_argument:nnn #1#2#3 - { - \tl_set:Nn \l_xparse_split_argument_tl {#3} - \group_begin: - \char_set_lccode:nn { `\@ } { `#2} - \tl_to_lowercase:n - { - \group_end: - \tl_replace_all:Nnn \l_xparse_split_argument_tl { @ } {#2} - } - \cs_set_protected:Npn \xparse_split_argument_aux_i:w - ##1 \q_mark ##2 #2 ##3 \q_stop - { - \tl_put_right:Nn \ProcessedArgument { {##2} } - ##1 \q_mark ##3 \q_stop - } - \cs_set_protected:Npn \xparse_split_argument_aux_iii:w - ##1 #2 ##2 \q_stop - { - \IfNoValueF {##1} - { - \msg_kernel_error:nnxxx { xparse } { split-excess-tokens } - { \tl_to_str:n {#2} } { \tl_to_str:n {#1} } - { \tl_to_str:n {#3} } - } - } - \tl_set:Nx \l_xparse_tmp_tl - { - \prg_replicate:nn { #1 + 1 } - { \xparse_split_argument_aux_i:w } - \xparse_split_argument_aux_ii:w - \exp_not:N \q_mark - \exp_not:o \l_xparse_split_argument_tl - \prg_replicate:nn {#1} { \exp_not:n {#2} \NoValue } - \exp_not:n { #2 \q_stop } - } - \l_xparse_tmp_tl - } -\group_end: -\cs_new_protected:Npn \xparse_split_argument_aux_i:w { } -\cs_new_protected:Npn \xparse_split_argument_aux_ii:w - #1 \q_mark #2 \q_stop - { - \tl_if_empty:nF {#2} - { \xparse_split_argument_aux_iii:w #2 \q_stop } - } -\cs_new_protected:Npn \xparse_split_argument_aux_iii:w { } \seq_new:N \l_xparse_split_list_seq \tl_new:N \l_xparse_split_list_tl \cs_new_protected:Npn \xparse_split_list:nn #1#2 @@ -1272,7 +1225,7 @@ \bool_if:nTF { \tl_if_single_p:n {#1} && - ! (\token_if_cs_p:N #1 ) + ! ( \token_if_cs_p:N #1 ) } { \xparse_split_list_single:Nn #1 {#2} } { \xparse_split_list_multi:nn {#1} {#2} } @@ -1300,6 +1253,49 @@ \xparse_split_list_multi:nV {#1} \l_xparse_split_list_tl } \group_end: +\cs_new_protected:Npn \xparse_split_argument:nnn #1#2#3 + { + \xparse_split_list:nn {#2} {#3} + \exp_args:Nf \xparse_split_argument_aux:nnnn + { \tl_length:N \ProcessedArgument } + {#1} {#2} {#3} + } +\cs_new_protected:Npn \xparse_split_argument_aux:nnnn #1#2#3#4 + { + \int_compare:nNnF {#1} = { #2 + \c_one } + { + \int_compare:nNnTF {#1} > { #2 + \c_one } + { + \tl_set:Nx \ProcessedArgument + { + \exp_last_unbraced:NnNo + \xparse_split_argument_aux:n + { #2 + \c_one } + \use_none_delimit_by_q_stop:w + \ProcessedArgument + \q_stop + } + \msg_kernel_error:nnxxx { xparse } { split-excess-tokens } + { \tl_to_str:n {#3} } { \int_eval:n { #2 + \c_one } } + { \tl_to_str:n {#4} } + } + { + \tl_put_right:Nx \ProcessedArgument + { + \prg_replicate:nn { #2 + \c_one - (#1) } + { { \exp_not:n { \NoValue } } } + } + } + } + } +\cs_new:Npn \xparse_split_argument_aux:n #1 + { \prg_replicate:nn {#1} { \xparse_split_argument_aux:wn } } +\cs_new:Npn \xparse_split_argument_aux:wn #1 \use_none_delimit_by_q_stop:w #2 + { + \exp_not:n { {#2} } + #1 + \use_none_delimit_by_q_stop:w + } \cs_new_protected:Npn \xparse_trim_spaces:n #1 { \tl_set:Nx \ProcessedArgument { \tl_trim_spaces:n {#1} } } \cs_new_protected:Npn \xparse_get_arg_spec:N #1 @@ -1323,7 +1319,6 @@ \tl_new:N \ArgumentSpecification \cs_new_protected:Npn \xparse_show_arg_spec:N #1 { - \tl_set:Nx \l_xparse_function_tl { \cs_to_str:N #1 } \prop_get:NnNTF \l_xparse_command_arg_specs_prop {#1} \ArgumentSpecification { \tl_show:N \ArgumentSpecification } @@ -1344,12 +1339,12 @@ } \prg_new_conditional:Npnn \xparse_if_no_value:n #1 { T , F , TF } { \str_if_eq:nnTF {#1} { \NoValue } \prg_return_true: \prg_return_false: } -\msg_kernel_new:nnnn { xparse } { bad-signature } - { Bad~signature~'#1'. } +\msg_kernel_new:nnnn { xparse } { bad-arg-spec } + { Bad~argument~specification~'#1'. } { \c_msg_coding_error_text_tl - The~signature~provided~was~not~valid:~one~or~more~mandatory~pieces~ - of~information~were~missing. \\ \\ + The~argument~specification~provided~was~not~valid:~ + one~or~more~mandatory~pieces~of~information~were~missing. \\ \\ LaTeX~will~ignore~this~entire~definition. } \msg_kernel_new:nnnn { xparse } { command-already-defined } @@ -1394,7 +1389,7 @@ The~command~will~be~ignored. } \msg_kernel_new:nnnn { xparse } { expandable-ending-optional } - { Signature~for~expandable~command~ends~with~optional~argument. } + { Argument~specification~for~expandable~command~ends~with~optional~argument. } { \c_msg_coding_error_text_tl Expandable~commands~must~have~a~final~mandatory~argument~ @@ -1428,8 +1423,8 @@ { Argument~delimiter~should~be~a~single~token:~'#1'. } { \c_msg_coding_error_text_tl - The~signature~provided~was~not~valid:~in~a~place~where~a~single~token~is~ - required,~LaTeX~found~'#1'. \\ \\ + The~argument~specification~provided~was~not~valid:~ + in~a~place~where~a~single~token~is~required,~LaTeX~found~'#1'. \\ \\ LaTeX~will~ignore~this~entire~definition. } \msg_kernel_new:nnnn { xparse } { processor-in-expandable } diff --git a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty index 57b3af26f0c..1ee3d75ff08 100644 --- a/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty +++ b/Master/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty @@ -50,8 +50,8 @@ %% %% ----------------------------------------------------------------------- %% -\RequirePackage{expl3}[2012/02/08] -\@ifpackagelater{expl3}{2012/02/08} +\RequirePackage{expl3}[2012/02/26] +\@ifpackagelater{expl3}{2012/02/26} {} { \PackageError{xtemplate}{Support package l3kernel too old.} @@ -62,7 +62,7 @@ } \endinput } -\GetIdInfo$Id: xtemplate.dtx 3342 2012-02-08 19:34:51Z joseph $ +\GetIdInfo$Id: xtemplate.dtx 3471 2012-02-26 20:12:23Z joseph $ {L3 Experimental prototype document functions} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} |