summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3packages
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-11-22 23:37:49 +0000
committerKarl Berry <karl@freefriends.org>2012-11-22 23:37:49 +0000
commitd27c7eb7c70ce56b5ac1c6d7b5277f5c3fc888ee (patch)
tree4074a79e9d21cb85e640d8233f6b0fe5dce89416 /Master/texmf-dist/source/latex/l3packages
parent6348770c313c5104acd5b60d68377af2621c9a2d (diff)
l3 (22nov12)
git-svn-id: svn://tug.org/texlive/trunk@28333 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3packages')
-rw-r--r--Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx7
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx4
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx6
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx123
4 files changed, 94 insertions, 46 deletions
diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
index 8ea654af052..dd098c9ff6d 100644
--- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
@@ -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/09/29]
-%<package>\@ifpackagelater{expl3}{2012/09/29}
+\RequirePackage{expl3}[2012/11/21]
+%<package>\@ifpackagelater{expl3}{2012/11/21}
%<package> {}
%<package> {%
%<package> \PackageError{l3keys2e}{Support package l3kernel too old.}
@@ -49,8 +49,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\RequirePackage{xparse}
-\GetIdInfo$Id: l3keys2e.dtx 4249 2012-09-29 22:17:28Z joseph $
+\GetIdInfo$Id: l3keys2e.dtx 4332 2012-11-21 21:40:31Z joseph $
{LaTeX2e option processing using LaTeX3 keys}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
index 7a867b71117..0d3243c8dd8 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 3991 2012-07-16 19:00:35Z joseph $
+\GetIdInfo$Id: xfrac.dtx 4299 2012-11-09 18:48:51Z joseph $
{L3 Experimental split-level fractions}
%</driver|package>
%<*driver>
@@ -661,7 +661,7 @@
% (no argument required) or are functions taking one argument in the
% code.
% \begin{macrocode}
-\cs_new_nopar:Npn \@@_fontscale:
+\cs_new_nopar:Npn \@@_fontscale: { }
\cs_new:Npn \@@_math:n #1 { }
\cs_new_nopar:Npn \@@_denominator_font_change: { }
\cs_new:Npn \@@_denominator_format:n #1 { }
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index f5b5c56f129..8f9364f993f 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/09/29]
-%<package>\@ifpackagelater{expl3}{2012/09/29}
+\RequirePackage{expl3}[2012/11/21]
+%<package>\@ifpackagelater{expl3}{2012/11/21}
%<package> {}
%<package> {%
%<package> \PackageError{xparse}{Support package l3kernel too old.}
@@ -53,7 +53,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: xparse.dtx 4249 2012-09-29 22:17:28Z joseph $
+\GetIdInfo$Id: xparse.dtx 4332 2012-11-21 21:40:31Z joseph $
{L3 Experimental document command parser}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
index 6d9b5c418f4..8aa2fbde65e 100644
--- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.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/09/29]
-%<package>\@ifpackagelater{expl3}{2012/09/29}
+\RequirePackage{expl3}[2012/11/21]
+%<package>\@ifpackagelater{expl3}{2012/11/21}
%<package> {}
%<package> {%
%<package> \PackageError{xtemplate}{Support package l3kernel too old.}
@@ -53,7 +53,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: xtemplate.dtx 4249 2012-09-29 22:17:28Z joseph $
+\GetIdInfo$Id: xtemplate.dtx 4332 2012-11-21 21:40:31Z joseph $
{L3 Experimental prototype document functions}
%</driver|package>
%<*driver>
@@ -495,6 +495,14 @@
% the general idea of fixing some settings.
% \end{function}
%
+% \begin{function}[TF]{\IfInstanceExist}
+% \begin{syntax}
+% \cs{IfInstanceExistTF} \Arg{object type} \Arg{instance} \Arg{true code} \Arg{false code}
+% \end{syntax}
+% Tests if the named \meta{instance} of a \meta{object type} exists, and
+% then inserts the appropriate code into the input stream.
+% \end{function}
+%
% \section{Document interface}
%
% After the instances have been chosen, document commands must be
@@ -603,14 +611,6 @@
% \meta{object type} at the terminal.
% \end{function}
%
-% \begin{function}{\ShowCollectionInstanceValues}
-% \begin{syntax}
-% \cs{ShowInstanceValues} \Arg{collection} \Arg{object type} \Arg{instance}
-% \end{syntax}
-% Shows the \meta{values} for an \meta{instance} within
-% a \meta{collection} of the given \meta{object type} at the terminal.
-% \end{function}
-%
% \begin{function}{\ShowTemplateCode}
% \begin{syntax}
% \cs{ShowTemplateCode} \Arg{object type} \Arg{template}
@@ -656,6 +656,30 @@
% \texttt{a}, \texttt{b} and \texttt{c}, plus code for an \texttt{unknown}
% branch.
% \end{function}
+%
+% \section{Collections}
+%
+% The implementation of templates includes a concept termed
+% \enquote{collections}. The idea is that by activating a collection, a
+% set of instances can rapidly be set up. An example use case would be
+% collections for \texttt{frontmatter}, \texttt{mainmatter} and
+% \texttt{backmatter} in a book. This mechanism is currently implemented
+% by the commands \cs{DeclareCollectionInstance}, \cs{EditCollectionInstance}
+% and \cs{UseCollection}. However, while the idea of switchable instances is
+% a useful one, the team feel that collections are not the correct way to
+% achieve this, at least with the current approach. As such, the collection
+% functions should be regarded as deprecated: they remain available to support
+% existing code, but will be removed when a better mechanism is developed.
+%
+%
+% \begin{function}{\ShowCollectionInstanceValues}
+% \begin{syntax}
+% \cs{ShowInstanceValues} \Arg{collection} \Arg{object type} \Arg{instance}
+% \end{syntax}
+% Shows the \meta{values} for an \meta{instance} within
+% a \meta{collection} of the given \meta{object type} at the terminal.
+% As for other collection commands, this should be regarded as deprecated.
+% \end{function}
%
% \end{documentation}
%
@@ -947,17 +971,19 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_if_key_value:nT, \@@_if_key_value:oT}
+% \begin{macro}[TF]{\@@_if_key_value:n, \@@_if_key_value:o}
% Tests for the first token in a string being \cs{KeyValue}, where
% \cs{EvaluateNow} is not important.
% \begin{macrocode}
-\prg_new_conditional:Npnn \@@_if_key_value:n #1 { T }
+\prg_new_conditional:Npnn \@@_if_key_value:n #1 { T , F , TF }
{
\str_if_eq:noTF { \KeyValue } { \tl_head:w #1 \q_nil \q_stop }
- {\prg_return_true: }
+ { \prg_return_true: }
{ \prg_return_false: }
}
-\cs_generate_variant:Nn \@@_if_key_value:nT { o }
+\cs_generate_variant:Nn \@@_if_key_value:nT { o }
+\cs_generate_variant:Nn \@@_if_key_value:nF { o }
+\cs_generate_variant:Nn \@@_if_key_value:nTF { o }
% \end{macrocode}
% \end{macro}
%
@@ -2071,7 +2097,7 @@
{
\@@_if_key_value:oT \l_@@_value_tl
{ \@@_key_to_value: }
- \tl_put_left:Nx \l_@@_assignments_tl
+ \tl_put_right:Nx \l_@@_assignments_tl
{
\exp_not:c { #1 _ \l_@@_value_tl :N }
\exp_not:o \l_@@_var_tl
@@ -2125,7 +2151,7 @@
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_assign_code:
{
- \tl_put_left:Nx \l_@@_assignments_tl
+ \tl_put_right:Nx \l_@@_assignments_tl
{
\cs_set_protected:Npn \@@_assign_code:n \exp_not:n {##1}
{ \exp_not:o \l_@@_var_tl }
@@ -2149,7 +2175,7 @@
}
\cs_new_protected_nopar:Npn \@@_assign_function_aux:N #1
{
- \tl_put_left:Nx \l_@@_assignments_tl
+ \tl_put_right:Nx \l_@@_assignments_tl
{
\cs_generate_from_arg_count:NNnn
\exp_not:o \l_@@_var_tl
@@ -2176,7 +2202,7 @@
}
\cs_new_protected_nopar:Npn \@@_assign_instance_aux:N #1
{
- \tl_put_left:Nx \l_@@_assignments_tl
+ \tl_put_right:Nx \l_@@_assignments_tl
{
\exp_not:N #1 \exp_not:o \l_@@_var_tl
{
@@ -2236,24 +2262,34 @@
% \end{macro}
%
% \begin{macro}{\@@_assign_tokenlist:}
-% \begin{macro}[aux]{\@@_assign_tokenlist_aux:N}
-% Storing lists of tokens is easy: no complex calculations and no
-% need to worry about numbers of arguments.
+% \begin{macro}[aux]{\@@_assign_tokenlist_aux:NN}
+% Life would be easy here if it were not for \cs{KeyValue}. To deal
+% correctly with that, we need to allow for the recovery a a stored value
+% at point of use.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_assign_tokenlist:
{
\bool_if:NTF \l_@@_global_bool
- { \@@_assign_tokenlist_aux:N \tl_gset:Nn }
- { \@@_assign_tokenlist_aux:N \tl_set:Nn }
+ { \@@_assign_tokenlist_aux:NN \tl_gset:NV \tl_gset:Nn }
+ { \@@_assign_tokenlist_aux:NN \tl_set:NV \tl_set:Nn }
}
-\cs_new_protected_nopar:Npn \@@_assign_tokenlist_aux:N #1
+\cs_new_protected_nopar:Npn \@@_assign_tokenlist_aux:NN #1#2
{
- \@@_if_key_value:oT \l_@@_value_tl
- { \@@_key_to_value: }
- \tl_put_left:Nx \l_@@_assignments_tl
+ \@@_if_key_value:oTF \l_@@_value_tl
{
- #1 \exp_not:o \l_@@_var_tl
- { \exp_not:o \l_@@_value_tl }
+ \@@_key_to_value:
+ \tl_put_right:Nx \l_@@_assignments_tl
+ {
+ #1 \exp_not:o \l_@@_var_tl
+ \exp_not:o \l_@@_value_tl
+ }
+ }
+ {
+ \tl_put_right:Nx \l_@@_assignments_tl
+ {
+ #2 \exp_not:o \l_@@_var_tl
+ { \exp_not:o \l_@@_value_tl }
+ }
}
}
% \end{macrocode}
@@ -2266,8 +2302,8 @@
\cs_new_protected_nopar:Npn \@@_assign_commalist:
{
\bool_if:NTF \l_@@_global_bool
- { \@@_assign_tokenlist_aux:N \clist_gset:Nn }
- { \@@_assign_tokenlist_aux:N \clist_set:Nn }
+ { \@@_assign_tokenlist_aux:NN \clist_gset:NV \clist_gset:Nn }
+ { \@@_assign_tokenlist_aux:NN \clist_set:NV \clist_set:Nn }
}
% \end{macrocode}
% \end{macro}
@@ -2281,7 +2317,7 @@
{
\@@_if_key_value:oT \l_@@_value_tl
{ \@@_key_to_value: }
- \tl_put_left:Nx \l_@@_assignments_tl
+ \tl_put_right:Nx \l_@@_assignments_tl
{
#1 \exp_not:o \l_@@_var_tl
{ \exp_not:o \l_@@_value_tl }
@@ -2291,31 +2327,44 @@
% \end{macro}
%
% \begin{macro}{\@@_key_to_value:}
-% \begin{macro}[aux]{\@@_key_to_value_aux:w}
+% \begin{macro}[aux]{\@@_key_to_value_auxi:w}
+% \begin{macro}[aux]{\@@_key_to_value_auxii:w}
% The idea here is to recover the attribute value of another key. To
% do that, the marker is removed and a look up takes place. If this
% is successful, then the name of the variable of the attribute is
% returned. This assumes that the value will be used in context where
% it will be converted to a value, for example when setting a number.
+% There is also a need to check in case the copied value happens to be
+% \texttt{global}.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_key_to_value:
- { \exp_after:wN \@@_key_to_value_aux:w \l_@@_value_tl }
-\cs_new_protected:Npn \@@_key_to_value_aux:w \KeyValue #1
+ { \exp_after:wN \@@_key_to_value_auxi:w \l_@@_value_tl }
+\cs_new_protected:Npn \@@_key_to_value_auxi:w \KeyValue #1
{
\tl_set:Nx \l_@@_tmp_tl { \tl_to_str:n {#1} }
\tl_remove_all:Nn \l_@@_key_name_tl { ~ }
- \prop_get:NoNF
+ \prop_get:NoNTF
\l_@@_vars_prop
\l_@@_tmp_tl
\l_@@_value_tl
{
+ \exp_after:wN \@@_key_to_value_auxii:w \l_@@_value_tl
+ \q_mark global \q_nil \q_stop
+ }
+ {
\msg_error:nnx { xtemplate } { unknown-attribute }
{ \l_@@_tmp_tl }
}
}
+\cs_new_protected:Npn \@@_key_to_value_auxii:w #1 global #2#3 \q_stop
+ {
+ \quark_if_nil:NF #2
+ { \tl_set:Nn \l_@@_value_tl {#2} }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsection{Using instances}
%