diff options
author | Karl Berry <karl@freefriends.org> | 2012-11-22 23:37:49 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-11-22 23:37:49 +0000 |
commit | d27c7eb7c70ce56b5ac1c6d7b5277f5c3fc888ee (patch) | |
tree | 4074a79e9d21cb85e640d8233f6b0fe5dce89416 /Master/texmf-dist/source | |
parent | 6348770c313c5104acd5b60d68377af2621c9a2d (diff) |
l3 (22nov12)
git-svn-id: svn://tug.org/texlive/trunk@28333 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
17 files changed, 530 insertions, 263 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx index 8a76d00cd01..9e0ecffb59a 100644 --- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx +++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx @@ -36,8 +36,8 @@ %% % %<*driver|package> -\RequirePackage{l3bootstrap} -\GetIdInfo$Id: xgalley.dtx 4155 2012-08-29 10:29:58Z joseph $ +\RequirePackage{expl3} +\GetIdInfo$Id: xgalley.dtx 4253 2012-11-01 21:01:54Z joseph $ {L3 Experimental galley} %</driver|package> %<*driver> diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index ccb816a9bf5..0b1c0fbef94 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -49,8 +49,8 @@ %<*driver|package> \def\ExplFileName{expl3} \def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2012/09/29} -\def\ExplFileVersion{4249} +\def\ExplFileDate{2012/11/21} +\def\ExplFileVersion{4332} %</driver|package> %<*driver> \documentclass[full]{l3doc} @@ -950,11 +950,21 @@ % purposes, as it means that there is a complete list of all functions % created by each module loaded (with the exceptions of a very small number % required by the bootstrap code for \LaTeX3). -% -% \DescribeOption{native-drivers} -% The \texttt{native-drivers} option instructs \LaTeX3 not to use the \LaTeXe{} -% graphics driver code. Setting this option \texttt{true} uses the -% driver code intended for a \LaTeX3 format. +% +% \DescribeOption{driver} +% Selects the driver to be used for color, graphics and related operations that +% are driver-dependent. Options available are +% \begin{itemize}[font = \texttt] +% \item[latex2e] Use the \pkg{graphics} package to select the driver, rather +% than \LaTeX3 code. This is the standard setting. +% \item[auto] Let \LaTeX3 determine the correct driver. With DVI output, this +% will select the \texttt{dvips} back-end. +% \item[dvips] Use the \texttt{dvips} driver. +% \item[dvipdfmx] Use the \texttt{dvipdfmx} driver. +% \item[pdfmode] Use the \texttt{pdfmode} driver (direct PDF output from +% \pdfTeX{} or \LuaTeX{}). +% \item[xdvipdfmx] Use the \texttt{xdvipdfmx} driver (\XeTeX{} only). +% \end{itemize} % % \section{The \LaTeX3 Project} % @@ -1035,12 +1045,14 @@ % \begin{variable}[int] % { % \l@expl@check@declarations@bool , -% \l@expl@log@functions@bool , -% \l@expl@native@drivers@bool +% \l@expl@log@functions@bool % } +% \begin{variable}[int]{\l@expl@options@clist} % Options to be set up. % These have to be done by hand as there is no \pkg{expl3} yet: the logging -% option is needed before loading \pkg{l3basics}! +% option is needed before loading \pkg{l3basics}! Only a minimal set of +% options are handled here: others are left for a proper key--value approach +% once the kernel is loaded. % \begin{macrocode} \newcommand \expl@create@bool@option [ 2 ] { @@ -1051,11 +1063,26 @@ } \expl@create@bool@option { check-declarations } \l@expl@check@declarations@bool \expl@create@bool@option { log-functions } \l@expl@log@functions@bool -\expl@create@bool@option { native-drivers } \l@expl@native@drivers@bool \let \expl@create@bool@option \@undefined +\newcommand* \l@expl@options@clist { } +\DeclareOption* + { + \ifx \l@expl@options@clist \@empty + \let \l@expl@options@clist \CurrentOption + \else + \edef \l@expl@options@clist + { + \unexpanded \expandafter \expandafter \expandafter + { + \expandafter \l@expl@options@clist \expandafter , \CurrentOption + } + } + \fi + } \ProcessOptions \relax % \end{macrocode} % \end{variable} +% \end{variable} % \end{macro} % % We already loaded \pkg{l3names} at the beginning of the \texttt{dtx} file. @@ -1252,23 +1279,127 @@ } % \end{macrocode} % \end{macro} -% -% If the native drivers are being used, they can be loaded now. +% +% \begin{variable}[int]{\l__expl_driver_tl} +% \begin{variable}[int]{\l__expl_native_drivers_bool} +% With the code now loaded, options can be handled using a real key--value +% interpreter. The \enquote{faked} options are also included so that any +% erroneous input will be mopped up (\emph{e.g.}~\texttt{log-function = +% foo}). The checks on driver choice are set up here, so when actually +% the driver it's a straight forward operation. % \begin{macrocode} -\bool_if:nTF { \l@expl@native@drivers@bool } +\RequirePackage{ifpdf} +\__msg_kernel_new:nnnn { expl } { wrong-driver } + { Driver~request~inconsistent~with~engine:~using~'#2'~driver. } + { + You~have~requested~driver~'#1',~but~this~is~not~suitable~for~use~with~the~ + active~engine.~LaTeX3~will~use~the~'#2'~driver~instead. + } +\tl_new:N \l__expl_driver_tl +\keys_define:nn { expl } { - \xetex_if_engine:TF - { \file_input:n { l3xdvipdfmx.def } } + driver .choice:, + driver / auto .code:n = { - \RequirePackage { ifpdf } - \ifpdf - \file_input:n { l3pdfmode.def } - \else - \file_input:n { l3dvips.def } - \fi - } + \xetex_if_engine:TF + { \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } } + { + \ifpdf + \tl_set:Nn \l__expl_driver_tl { pdfmode } + \else + \tl_set:Nn \l__expl_driver_tl { dvips } + \fi + } + }, + driver / dvipdfmx .code:n = + { + \tl_set:Nn \l__expl_driver_tl { dvipdfmx } + \xetex_if_engine:TF + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { dvipdfmx } { xdvipdfmx } + \tl_set:Nn \l__expl_driver_tl { xdvipdmx } + } + { + \ifpdf + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { dvipdfmx } { pdfmode } + \tl_set:Nn \l__expl_driver_tl { pdfmode } + \fi + } + }, + driver / dvips .code:n = + { + \tl_set:Nn \l__expl_driver_tl { dvips } + \xetex_if_engine:TF + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { dvips } { xdvipdfmx } + \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } + } + { + \ifpdf + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { dvips } { pdfmode } + \tl_set:Nn \l__expl_driver_tl { pdfmode } + \fi + } + }, + driver / latex2e .code:n = + { \tl_set:Nn \l__expl_driver_tl { latex2e } }, + driver / pdfmode .code:n = + { + \tl_set:Nn \l__expl_driver_tl { pdfmode } + \xetex_if_engine:TF + { + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { pdfmode } { xdvipdfmx } + \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } + } + { + \ifpdf + \else + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { pdfmode } { dvips } + \tl_set:Nn \l__expl_driver_tl { dvips } + \fi + } + }, + driver / xdvipdfmx .code:n = + { + \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } + \xetex_if_engine:F + { + \ifpdf + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { xdvipdfmx } { pdfmode } + \tl_set:Nn \l__expl_driver_tl { pdfmode } + \else + \__msg_kernel_error:nnnn { expl } { wrong-driver } + { xdvipdfmx } { dvips } + \tl_set:Nn \l__expl_driver_tl { dvips } + \fi + } + }, + driver .initial:n = { latex2e } , + native-drivers .choice:, + native-drivers .default:n = { true }, + native-drivers / false .meta:n = { driver = latex2e }, + native-drivers / true .meta:n = { driver = auto } + } +% \end{macrocode} +% Mop up any incorrect settings for the other options. +% \begin{macrocode} +\keys_define:nn { expl } + { + check-declarations .bool_set:N = \l@expl@check@declarations@bool, + log-functions .bool_set:N = \l@expl@log@functions@bool } +\keys_set:nV { expl } \l@expl@options@clist % \end{macrocode} +% \end{variable} +% \end{variable} +% % \begin{macro} % { % \box_rotate:Nn, @@ -1277,11 +1408,13 @@ % \box_resize_to_wd:Nn, % \box_scale:Nnn % } -% If not, alter various definitions to use the \pkg{graphics} package +% For the \LaTeXe{} drivers, +% alter various definitions to use the \pkg{graphics} package % instead. The package is loaded right at the start of the hook % as there is otherwise a potential issue with \pkg{(x)color}: see % \url{http://groups.google.com/group/comp.text.tex/msg/c9de8913c756ef4c}. % \begin{macrocode} +\str_if_eq:nVTF { latex2e } \l__expl_driver_tl { \tl_gput_left:Nn \@begindocumenthook { \RequirePackage { graphics } } \__msg_kernel_new:nnnn { box } { clipping-not-available } @@ -1335,6 +1468,15 @@ } % \end{macrocode} % \end{macro} +% \begin{variable}[int]{\c__expl_def_ext_tl} +% For native drivers, just load the appropriate file. +% \begin{macrocode} + { + \tl_const:Nn \c__expl_def_ext_tl { def } + \@onefilewithoptions { l3 \l__expl_driver_tl } [ ] [ ] \c__expl_def_ext_tl + } +% \end{macrocode} +% \end{variable} % % \begin{macro}{\ExplSyntaxOff, \ExplSyntaxOn} % These are redefined here to reduce unnecessary work when switching. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index ed3580db09f..b2e99f603d4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3alloc.dtx 4145 2012-08-27 20:30:30Z bruno $ +\GetIdInfo$Id: l3alloc.dtx 4274 2012-11-05 09:16:29Z joseph $ {L3 Register allocation} %</driver|package> %<*driver> @@ -101,7 +101,7 @@ % Register-based allocation is a low-level process, and is therefore % only to be used as part of kernel code. % -% \begin{function}[updated = 2011-09-05]{\__alloc_new:nnnN} +% \begin{function}[updated = 2012-11-09]{\__alloc_new:nnnN} % \begin{syntax} % \cs{__alloc_new:nnnN} \Arg{type} \Arg{min} \Arg{max} \meta{function} % \end{syntax} @@ -111,8 +111,6 @@ % the \meta{function}. This process will create two token lists, % \cs{g_\meta{type}_allocation_tl} and \cs{c_\meta{type}_allocation_max_tl}, % to store the current and maximum allocation numbers, respectively. -% It will also create \cs{g_\meta{type}_allocation_seq} to store allocation -% numbers which should not be used. % \end{function} % % \begin{function}[updated = 2011-09-05]{\__alloc_setup_type:nnn} @@ -153,7 +151,7 @@ \cs_new_protected:Npn \@@_new:nnnN #1#2#3#4 { \@@_setup_type:nnn {#1} {#2} {#3} - \cs_new:cpn { #1 _new:N } ##1 { \@@_reg:nNN {#1} #4 ##1 } + \cs_new_protected:cpn { #1 _new:N } ##1 { \@@_reg:nNN {#1} #4 ##1 } } % \end{macrocode} % \end{macro} @@ -161,15 +159,13 @@ % \begin{macro}[int]{\@@_setup_type:nnn} % For each type of register we need to \enquote{counters} that hold the % last allocated global register, plus a constant for the maximum -% allocation. We also need a sequence to store the \enquote{exceptions}. -% All of those variables are internal to the module |#1|. +% allocation. % \begin{macrocode} \cs_new_protected:Npn \@@_setup_type:nnn #1#2#3 { - \tl_new:c { g__ #1 _allocation_tl } - \tl_gset:cx { g__ #1 _allocation_tl } { \int_eval:n {#2} } + \tl_new:c { g__ #1 _allocation_tl } + \tl_set:cx { g__ #1 _allocation_tl } { \int_eval:n {#2} } \tl_const:cx { c__ #1 _allocation_max_tl } { \int_eval:n {#3} } - \seq_new:c { g__ #1 _allocation_seq } } % \end{macrocode} % \end{macro} @@ -200,38 +196,29 @@ % \end{macro} % % \begin{macro}{\insert_new:N} -% \begin{macro}[aux]{\@@_reserve_insert:n} % For inserts, there is a need to reserve space in various other registers. +% First, the basic allocation is done. % \begin{macrocode} \@@_new:nnnN { insert } { 221 } { 254 } \tex_chardef:D -\group_begin: - \cs_set_protected:Npn \@@_reserve_insert:n #1 - { - \tex_ifnum:D #1 > \c__insert_allocation_max_tl \scan_stop: - \exp_after:wN \use_none:n - \tex_else:D - \exp_after:wN \use:n - \tex_fi:D - { - \seq_put_right:Nn \g__box_allocation_seq {#1} - \seq_put_right:Nn \g__dim_allocation_seq {#1} - \seq_put_right:Nn \g__int_allocation_seq {#1} - \seq_put_right:Nn \g__skip_allocation_seq {#1} - \exp_args:No \@@_reserve_insert:n - { \tex_the:D \etex_numexpr:D #1 + 1 \scan_stop: } - } - } - \@@_reserve_insert:n { 221 } -\group_end: % \end{macrocode} -% \end{macro} -% \end{macro} -% -% Box $255$ is reserved by \TeX{} for output, so is protected here from -% use by the allocator. +% Reserve a gap in the \texttt{dim}, \texttt{int} and \texttt{skip} lists. +% (An inline token list mapping would read better here, but this does not +% work until \texttt{int} allocation is available!) % \begin{macrocode} -\seq_put_right:Nn \g__box_allocation_seq { 255 } +\tl_const:Nn \c__dim_allocation_reserve_begin_tl { 221 } +\tl_const:Nn \c__dim_allocation_reserve_end_tl { 255 } +\tl_const:Nn \c__int_allocation_reserve_begin_tl { 221 } +\tl_const:Nn \c__int_allocation_reserve_end_tl { 255 } +\tl_const:Nn \c__skip_allocation_reserve_begin_tl { 221 } +\tl_const:Nn \c__skip_allocation_reserve_end_tl { 255 } % \end{macrocode} +% Reserve a space in the \texttt{box} list: box~255 is special in addition +% to dealing with inserts, so the end point here is different. +% \begin{macrocode} +\tl_const:Nn \c__box_allocation_reserve_begin_tl { 221 } +\tl_const:Nn \c__box_allocation_reserve_end_tl { 255 } +% \end{macrocode} +% \end{macro} % % \begin{macro}[int]{\@@_reg:nNN} % This internal macro performs the actual allocation. @@ -239,36 +226,45 @@ \cs_new_protected:Npn \@@_reg:nNN #1#2#3 { \__chk_if_free_cs:N #3 - \tex_global:D #2 #3 \tl_use:c { g__ #1 _allocation_tl } \scan_stop: - \iow_log:x + \int_compare:nNnTF + { \tl_use:c { g__ #1 _allocation_tl } } + > { \tl_use:c { c__ #1 _allocation_max_tl } } + { \__msg_kernel_fatal:nnx { kernel } { out-of-registers } {#1} } { - \token_to_str:N #3 ~=~ #1 ~register~ - \tl_use:c { g__ #1 _allocation_tl } + \tex_global:D #2 #3 \tl_use:c { g__ #1 _allocation_tl } \scan_stop: + \iow_log:x + { + \token_to_str:N #3 ~=~ #1 ~register~ + \tl_use:c { g__ #1 _allocation_tl } + } + \@@_next:n {#1} } - \@@_next:n {#1} } % \end{macrocode} % \end{macro} % % \begin{macro}[aux]{\@@_next:n} -% Finding the next register to use is a question of doing an increment -% then a check: if we run out of registers then it is a fatal error, so -% there is no need to unwind the change. (The check could be done -% first but that needs an additional calculation.) There is a built-in -% loop to handle reserved allocation positions. +% Set up the next allocation by adding one to the current number, and if +% necessary skipping over a reserved block. % \begin{macrocode} \cs_new_protected:Npn \@@_next:n #1 { \tl_gset:cx { g__ #1 _allocation_tl } - { \int_eval:n { \tl_use:c { g__ #1 _allocation_tl } + 1 } } - \int_compare:nNnTF - { \tl_use:c { g__ #1 _allocation_tl } } - > { \tl_use:c { c__ #1 _allocation_max_tl } } - { \__msg_kernel_fatal:nnx { kernel } { out-of-registers } {#1} } { - \seq_if_in:cxT { g__ #1 _allocation_seq } - { \tl_use:c { g__ #1 _allocation_tl } } - { \@@_next:n {#1} } + \int_eval:n + { + \tl_if_exist:cTF { c__ #1 _allocation_reserve_begin_tl } + { + \int_compare:nNnTF + { \tl_use:c { g__ #1 _allocation_tl } + \c_one } + = + { \tl_use:c { c__ #1 _allocation_reserve_begin_tl } } + { \tl_use:c { c__ #1 _allocation_reserve_end_tl } } + { \tl_use:c { g__ #1 _allocation_tl } } + } + { \tl_use:c { g__ #1 _allocation_tl } } + + \c_one + } } } % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index d38807ba1f6..6eb1fb6b8ee 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3basics.dtx 4212 2012-09-09 12:24:04Z bruno $ +\GetIdInfo$Id: l3basics.dtx 4306 2012-11-10 12:57:20Z joseph $ {L3 Basic definitions} %</driver|package> %<*driver> @@ -720,6 +720,27 @@ % \abc % \end{verbatim} % after two expansions of \cs{use:c}. +% +% \begin{function}[TF, added = 2012-11-10] +% {\cs_if_exist_use:N,\cs_if_exist_use:c} +% \begin{syntax} +% \cs{cs_if_exist_use:N} \meta{control sequence} +% \end{syntax} +% Tests whether the \meta{control sequence} is currently defined +% (whether as a function or another control sequence type), and if it +% does inserts the \meta{control sequence} into the input stream. +% \end{function} +% +% \begin{function}[TF,EXP, added = 2012-11-10] +% {\cs_if_exist_use:N,\cs_if_exist_use:c} +% \begin{syntax} +% \cs{cs_if_exist_use:NTF} \meta{control sequence} \Arg{true code} \Arg{false code} +% \end{syntax} +% Tests whether the \meta{control sequence} is currently defined +% (whether as a function or another control sequence type), and if it +% does inserts the \meta{control sequence} into the input stream followed +% by the \meta{true code}. +% \end{function} % % \begin{function}[EXP]{\cs:w, \cs_end:} % \begin{syntax} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index 76c7bc04251..f37e6936f62 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3box.dtx 3991 2012-07-16 19:00:35Z joseph $ +\GetIdInfo$Id: l3box.dtx 4259 2012-11-04 17:15:11Z joseph $ {L3 Experimental boxes} %</driver|package> %<*driver> @@ -299,14 +299,14 @@ % % \section{Constant boxes} % -% \begin{variable}{\c_empty_box} +% \begin{variable}[updated = 2012-11-04]{\c_empty_box} % This is a permanently empty box, which is neither set as horizontal % nor vertical. % \end{variable} % % \section{Scratch boxes} % -% \begin{variable}{\l_tmpa_box, \l_tmpb_box} +% \begin{variable}[updated = 2012-11-04]{\l_tmpa_box, \l_tmpb_box} % Scratch boxes for local assignment. These are never used by % the kernel code, and so are safe for use with any \LaTeX3-defined % function. However, they may be overwritten by other non-kernel @@ -913,28 +913,19 @@ % % \subsection{Constant boxes} % -% \begin{variable}{\c_empty_box} +% \begin{variable}{\c_empty_box} +% A box we never use. % \begin{macrocode} -%<*package> -\cs_new_eq:NN \c_empty_box \voidb@x -%</package> -%<*initex> \box_new:N \c_empty_box -%</initex> % \end{macrocode} % \end{variable} % % \subsection{Scratch boxes} % % \begin{variable}{\l_tmpa_box, \l_tmpb_box, \g_tmpa_box, \g_tmpb_box} -% Reuse the \LaTeXe{} scratch box in package mode. +% Scratch boxes. % \begin{macrocode} -%<*package> -\cs_new_eq:NN \l_tmpa_box \@tempboxa -%</package> -%<*initex> \box_new:N \l_tmpa_box -%</initex> \box_new:N \l_tmpb_box \box_new:N \g_tmpa_box \box_new:N \g_tmpb_box diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 12da7598665..c86a1ebeef2 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3candidates.dtx 3633 2012-05-12 20:11:32Z joseph $ +\GetIdInfo$Id: l3candidates.dtx 4298 2012-11-09 13:34:43Z joseph $ {L3 Experimental additions to l3kernel} %</driver|package> %<*driver> @@ -210,9 +210,10 @@ % Material output of the bounding box will still be displayed in the output % unless \cs{box_clip:N} is subsequently applied. % The updated \meta{box} will be an -% hbox, irrespective of the nature of the \meta{box} before the viewport +% hbox, irrespective of the nature of the \meta{box} before the trim % operation is applied. The adjustment applies within the current \TeX{} -% group level. +% group level. The behavior of the operation where the trims requested is +% greater than the size of the box is undefined. % \end{function} % % \begin{function}{\box_viewport:Nnnnn, \box_viewport:cnnnn} @@ -1290,7 +1291,12 @@ } { \box_set_wd:Nn \l_@@_internal_box { \l_@@_right_new_dim } - \box_use:N \l_@@_internal_box + \hbox:n + { + \tex_kern:D \c_zero_dim + \box_use:N \l_@@_internal_box + \tex_hss:D + } } } % \end{macrocode} @@ -1308,67 +1314,114 @@ % \end{macro} % % \begin{macro}{\box_trim:Nnnnn, \box_trim:cnnnn} -% Trimming from the left- and right-hand edges of the box is easy. The total -% width is set to remove from the right, and a skip will shift the material -% to remove from the left. +% Trimming from the left- and right-hand edges of the box is easy: kern the +% appropriate parts off each side. % \begin{macrocode} \cs_new_protected:Npn \box_trim:Nnnnn #1#2#3#4#5 { - \box_set_wd:Nn #1 { \box_wd:N #1 - (#4) - (#2) } - \hbox_set:Nn #1 + \hbox_set:Nn \l_@@_internal_box { - \skip_horizontal:n { - \dim_eval:n {#2} } + \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end: \box_use:N #1 + \tex_kern:D -\__dim_eval:w #4 \__dim_eval_end: } % \end{macrocode} % For the height and depth, there is a need to watch the baseline is % respected. Material always has to stay on the correct side, so trimming -% has to check that there is enough material to trim. +% has to check that there is enough material to trim. First, the bottom +% edge. If there is enough depth, simply set the depth, or if not move +% down so the result is zero depth. \cs{box_move_down:nn} is used in both +% cases so the resulting box always contains a \tn{lower} primitive. +% The internal box is used here as it allows safe use of \cs{box_set_dp:Nn}. % \begin{macrocode} \dim_compare:nNnTF { \box_dp:N #1 } > {#3} - { \box_set_dp:Nn #1 { \box_dp:N #1 - (#3) } } { - \hbox_set:Nn #1 - { \box_move_down:nn { #3 - \box_dp:N #1 } { \box_use:N #1 } } - \box_set_dp:Nn #1 \c_zero_dim + \hbox_set:Nn \l_@@_internal_box + { + \box_move_down:nn \c_zero_dim + { \box_use:N \l_@@_internal_box } + } + \box_set_dp:Nn \l_@@_internal_box { \box_dp:N #1 - (#3) } + } + { + \hbox_set:Nn \l_@@_internal_box + { + \box_move_down:nn { #3 - \box_dp:N #1 } + { \box_use:N \l_@@_internal_box } + } + \box_set_dp:Nn \l_@@_internal_box \c_zero_dim + } +% \end{macrocode} +% Same thing, this time from the top of the box. +% \begin{macrocode} + \dim_compare:nNnTF { \box_ht:N \l_@@_internal_box } > {#5} + { + \hbox_set:Nn \l_@@_internal_box + { \box_move_up:nn \c_zero_dim { \box_use:N \l_@@_internal_box } } + \box_set_ht:Nn \l_@@_internal_box + { \box_ht:N \l_@@_internal_box - (#5) } } - \dim_compare:nNnTF { \box_ht:N #1 } > {#5} - { \box_set_ht:Nn #1 { \box_ht:N #1 - (#5) } } { - \hbox_set:Nn #1 - { \box_move_up:nn { #5 - \box_ht:N #1 } { \box_use:N #1 } } - \box_set_ht:Nn #1 \c_zero_dim + \hbox_set:Nn \l_@@_internal_box + { + \box_move_up:nn { #5 - \box_ht:N \l_@@_internal_box } + { \box_use:N \l_@@_internal_box } + } + \box_set_ht:Nn \l_@@_internal_box \c_zero_dim } + \box_set_eq:NN #1 \l_@@_internal_box } \cs_generate_variant:Nn \box_trim:Nnnnn { c } % \end{macrocode} % \end{macro} % % \begin{macro}{\box_viewport:Nnnnn, \box_viewport:cnnnn} -% The same general logic as for clipping, but with absolute dimensions. -% Thus again width is easy and height is harder. +% The same general logic as for the trim operation, but with absolute +% dimensions. As a result, there are some things to watch out for in the +% vertical direction. % \begin{macrocode} \cs_new_protected:Npn \box_viewport:Nnnnn #1#2#3#4#5 { - \box_set_wd:Nn #1 { (#4) - (#2) } - \hbox_set:Nn #1 + \hbox_set:Nn \l_@@_internal_box { - \skip_horizontal:n { - \dim_eval:n {#2} } + \tex_kern:D -\__dim_eval:w #2 \__dim_eval_end: \box_use:N #1 + \tex_kern:D \__dim_eval:w #4 - \box_wd:N #1 \__dim_eval_end: + } + \dim_compare:nNnTF {#3} < \c_zero_dim + { + \hbox_set:Nn \l_@@_internal_box + { + \box_move_down:nn \c_zero_dim + { \box_use:N \l_@@_internal_box } + } + \box_set_dp:Nn \l_@@_internal_box { -\dim_eval:n {#3} } } - \dim_compare:nNnTF {#3} > \c_zero_dim { - \hbox_set:Nn #1 { \box_move_down:nn {#3} { \box_use:N #1 } } - \box_set_dp:Nn #1 \c_zero_dim + \hbox_set:Nn \l_@@_internal_box + { \box_move_down:nn {#3} { \box_use:N \l_@@_internal_box } } + \box_set_dp:Nn \l_@@_internal_box \c_zero_dim } - { \box_set_dp:Nn #1 { - \dim_eval:n {#3} } } \dim_compare:nNnTF {#5} > \c_zero_dim - { \box_set_ht:Nn #1 {#5} } { - \hbox_set:Nn #1 - { \box_move_up:nn { -\dim_eval:n {#5} } { \box_use:N #1 } } - \box_set_ht:Nn #1 \c_zero_dim + \hbox_set:Nn \l_@@_internal_box + { \box_move_up:nn \c_zero_dim { \box_use:N \l_@@_internal_box } } + \box_set_ht:Nn \l_@@_internal_box + { + #5 + \dim_compare:nNnT {#3} > \c_zero_dim + { - (#3) } + } } + { + \hbox_set:Nn \l_@@_internal_box + { + \box_move_up:nn { -\dim_eval:n {#5} } + { \box_use:N \l_@@_internal_box } + } + \box_set_ht:Nn \l_@@_internal_box \c_zero_dim + } + \box_set_eq:NN #1 \l_@@_internal_box } \cs_generate_variant:Nn \box_viewport:Nnnnn { c } % \end{macrocode} @@ -1720,12 +1773,15 @@ % has the reference point at the bottom-left. The $x$-direction is % handled by moving the content by the difference in the positions of % the bounding box and the content left edge. The $y$-direction is -% dealt with by moving the box down by any depth it has acquired. +% dealt with by moving the box down by any depth it has acquired. The +% internal box is used here to allow for the next step. % \begin{macrocode} - \hbox_set:Nn #1 + \hbox_set:Nn \l_@@_internal_box { - \tex_kern:D \l_@@_bounding_shift_dim - \tex_kern:D -\l_@@_left_corner_dim + \tex_kern:D + \__dim_eval:w + \l_@@_bounding_shift_dim - \l_@@_left_corner_dim + \__dim_eval_end: \box_move_down:nn { \l_@@_bottom_corner_dim } { \box_use:N #1 } } @@ -1733,13 +1789,16 @@ % If there have been any previous rotations then the size of the % bounding box will be bigger than the contents. This can be corrected % easily by setting the size of the box to the height and width of the -% content. +% content. As this operation requires setting box dimensions and these +% transcend grouping, the safe way to do this is to use the internal box +% and to reset the result into the target box. % \begin{macrocode} - \box_set_ht:Nn #1 + \box_set_ht:Nn \l_@@_internal_box { \l_@@_top_corner_dim - \l_@@_bottom_corner_dim } - \box_set_dp:Nn #1 { 0 pt } - \box_set_wd:Nn #1 + \box_set_dp:Nn \l_@@_internal_box { 0 pt } + \box_set_wd:Nn \l_@@_internal_box { \l_@@_right_corner_dim - \l_@@_left_corner_dim } + \hbox_set:Nn #1 { \box_use:N \l_@@_internal_box } % \end{macrocode} % The final task is to move the poles and corners such that they are % back in alignment with the box reference point. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 1a77c975255..f6734d35f46 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -78,7 +78,7 @@ Do not distribute a modified version of this file. %</driver|class> % %<*driver|class> -\GetIdInfo$Id: l3doc.dtx 4230 2012-09-24 21:44:28Z joseph $ +\GetIdInfo$Id: l3doc.dtx 4267 2012-11-04 19:42:13Z joseph $ {L3 Experimental documentation class} %</driver|class> % @@ -1029,7 +1029,15 @@ Do not distribute a modified version of this file. \tl_gclear:N \g_@@_macro_tl % populate "\l_@@_functions_block_prop" with info on the functions present: - \clist_map_function:nN {#1} \@@_parse_functions:n + % with a hack as we don't currently read verbatim and that means that + % \q_recursion_tail is an issue! + \str_if_eq:nnTF {#1} { \q_recursion_tail } + { + \prop_put:Nxx \l_@@_functions_block_prop + { \cs_to_str:N \q_recursion_tail } + { { -1 } { } } + } + { \clist_map_function:nN {#1} \@@_parse_functions:n } \small\ttfamily \begin{tabular}{ @{} l @{} r @{} } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx index 6d6f17a4910..4696adddd6f 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3drivers.dtx 4156 2012-08-29 11:10:09Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 4280 2012-11-07 07:13:51Z joseph $ {L3 Experimental drivers} %</driver|package> %<*driver> @@ -76,8 +76,10 @@ % \item \texttt{pdfmode}: The \enquote{driver} for direct PDF output by % \emph{both} \pdfTeX{} and \LuaTeX{} (no separate driver is used in this % case: the engine deals with PDF creation itself). -% \item \texttt{dvips}: The dvips program, which works in conjugation with -% \pdfTeX{} or \LuaTeX{} in DVI mode. +% \item \texttt{dvips}: The \texttt{dvips} program, which works in +% conjugation with \pdfTeX{} or \LuaTeX{} in DVI mode. +% \item \texttt{dvipdfmx}: The \texttt{dvipdfmx} program, which works in +% conjugation with \pdfTeX{} or \LuaTeX{} in DVI mode. % \item \texttt{xdvipdfmx}: The driver used by \XeTeX{}. % \end{itemize} % @@ -161,17 +163,21 @@ % \begin{macrocode} %<*package> \ProvidesExplFile +%<*dvipdfmx> + {l3dvidpfmx.def}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental driver: dvipdfmx} +%</dvipdfmx> %<*dvips> - {l3pdfmode.def}{\ExplFileDate}{\ExplFileVersion} - {L3~Experimental~driver:~dvips} + {l3dvips.def}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental driver: dvips} %</dvips> %<*pdfmode> {l3pdfmode.def}{\ExplFileDate}{\ExplFileVersion} - {L3~Experimental~driver:~PDF~mode} + {L3 Experimental driver: PDF mode} %</pdfmode> %<*xdvipdfmx> - {l3pdfmode.def}{\ExplFileDate}{\ExplFileVersion} - {L3~Experimental~driver:~xdvipdfmx} + {l3xdvidpfmx.def}{\ExplFileDate}{\ExplFileVersion} + {L3 Experimental driver: xdvipdfmx} %</xdvipdfmx> \__expl_package_check: %</package> @@ -213,24 +219,24 @@ % \begin{macro}{\@@_graphic_state_save:, \@@_graphic_state_restore:} % All of the drivers have a stack for saving the graphic state. These % have slightly different interfaces. For both \texttt{dvips} and -% \texttt{xdvipdfmx} this is done using an appropriate special. +% \texttt{(x)dvipdfmx} this is done using an appropriate special. % \begin{macrocode} -%<*dvips|xdvipdfmx> +%<*!pdfmode> \cs_new_protected_nopar:Npn \@@_graphic_state_save: %<*dvips> { \tex_special:D { ps:gsave } } %</dvips> -%<*xdvipdfmx> +%<*dvipdfmx|xdvipdfmx> { \tex_special:D { pdf:bcontent } } -%</xdvipdfmx> +%</dvipdfmx|xdvipdfmx> \cs_new_protected_nopar:Npn \@@_graphic_state_restore: %<*dvips> { \tex_special:D { ps:grestore } } %</dvips> -%<*xdvipdfmx> +%<*dvipdfmx|xdvipdfmx> { \tex_special:D { pdf:econtent } } -%</xdvipdfmx> -%</dvips|xdvipdfmx> +%</dvipdfmx|xdvipdfmx> +%</!pdfmode> % \end{macrocode} % For direct PDF output there is also a need to worry about the version % of \pdfTeX{} in use: the \tn{pdfsave} primitive was only introduced @@ -257,22 +263,22 @@ % special insertion. These are slightly different in the two cases. % The |direct| versions do not save the current matrix. % \begin{macrocode} -%<*pdfmode|xdvipdfmx> +%<*!dvips> \cs_new_protected:Npn \@@_pdf_literal:n #1 %<*pdfmode> { \pdftex_pdfliteral:D {#1} } %</pdfmode> -%<*xdvipdfmx> +%<*dvipdfmx|xdvipdfmx> { \tex_special:D { pdf:content~ #1 } } -%</xdvipdfmx> +%</dvipdfmx|xdvipdfmx> \cs_new_protected:Npn \@@_pdf_literal_direct:n #1 %<*pdfmode> { \pdftex_pdfliteral:D direct~{#1} } %</pdfmode> -%<*xdvipdfmx> +%<*dvipdfmx|xdvipdfmx> { \tex_special:D { pdf:literal~direct~ #1 } } -%</xdvipdfmx> -%</pdfmode|xdvipdfmx> +%</dvipdfmx|xdvipdfmx> +%</!dvips> % \end{macrocode} % \end{macro} % @@ -336,7 +342,7 @@ % as the driver deals with the relationship between the \TeX{} and graphics % locations automatically. % \begin{macrocode} -%<*pdfmode|xdvipdfmx> +%<*!dvips> \@@_pdf_literal_direct:n { 0 ~ @@ -345,7 +351,7 @@ \__dim_strip_bp:n { \box_ht:N #1 + \box_dp:N #1 } ~ re~W~n } -%</pdfmode|xdvipdfmx> +%</!dvips> % \end{macrocode} % Insert the material in a box of no width, restore the graphic state % and then insert the necessary width. @@ -385,14 +391,14 @@ { currentpoint~ currentpoint~translate~ - \fp_compare:nTnTF \l__box_angle_fp = \c_zero_fp + \fp_compare:nNnTF \l__box_angle_fp = \c_zero_fp { 0 } { \fp_eval:n { round ( - \l__box_angle_fp , 5 ) } } - ~rotate~ + \c_space_tl rotate~ neg~exch~neg~exch~translate } %</dvips> -%<*pdfmode|xdvipdfmx> +%<*!dvips> \box_set_wd:Nn \l__box_internal_box \c_zero_dim \fp_set:Nn \l__box_cos_fp { @@ -414,7 +420,7 @@ \c_space_tl \fp_use:N \l__box_cos_fp } -%</pdfmode|xdvipdfmx> +%</!dvips> } % \end{macrocode} % The end of a rotation means tidying up the output grouping. @@ -442,14 +448,14 @@ neg~exch~neg~exch~translate } %</dvips> -%<*pdfmode|xdvipdfmx> +%<*!dvips> \@@_pdf_matrix:n { \fp_use:N \l__box_scale_x_fp \c_space_tl 0~0~ \fp_use:N \l__box_scale_y_fp } -%</pdfmode|xdvipdfmx> +%</!dvips> } \cs_new_eq:NN \@@_box_scale_end: \@@_graphic_state_restore: % \end{macrocode} @@ -474,10 +480,10 @@ { \@@_pdf_literal:n { #1 \c_space_tl 0~0~cm } } } %</pdfmode> -%<*xdvipdfmx> +%<*dvipdfmx|xdvipdfmx> \cs_new_protected:Npn \@@_pdf_matrix:n #1 { \@@_pdf_literal_direct:n { #1 \c_space_tl 0~0~cm } } -%</xdvipdfmx> +%</dvipdfmx|xdvipdfmx> % \end{macrocode} % \end{macro} % @@ -494,9 +500,9 @@ %<*pdfmode> \tl_set:Nn \l_@@_current_color_tl { 0~g~0~G } %</pdfmode> -%<*xdvipdfmx> +%<*dvipdfmx|xdvipdfmx> \tl_set:Nn \l_@@_current_color_tl { gray~0 } -%</xdvipdfmx> +%</dvipdfmx|xdvipdfmx> % \end{macrocode} % \end{variable} % @@ -516,7 +522,7 @@ % available. In all cases there is a need to reset the color after % the current group. % \begin{macrocode} -%<*dvips|xdvipdfmx> +%<*!pdfmode> \cs_new_protected_nopar:Npn \@@_color_ensure_current: { \tex_special:D { color~push~\l_@@_current_color_tl } @@ -524,7 +530,7 @@ } \cs_new_protected_nopar:Npn \@@_color_reset: { \tex_special:D { color~pop } } -%</dvips|xdvipdfmx> +%</!pdfmode> % \end{macrocode} % Once again there is a version switch for \pdfTeX{}, as the % \tn{pdfcolorstack} primitive was introduced in version~1.40.0. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx index 6eff317f94c..e531e62e54e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3fp.dtx 4234 2012-09-26 09:43:31Z bruno $ +\GetIdInfo$Id: l3fp.dtx 4305 2012-11-10 08:40:25Z joseph $ {L3 Floating points} %</driver|package> %<*driver> @@ -488,6 +488,10 @@ % \begin{variable}[added = 2012-05-08]{\c_zero_fp, \c_minus_zero_fp} % Zero, with either sign. % \end{variable} +% +% \begin{variable}[added = 2012-05-08]{\c_one_fp} +% One as an \texttt{fp}: useful for comparisons in some places. +% \end{variable} % % \begin{variable}[added = 2012-05-08]{\c_inf_fp, \c_minus_inf_fp} % Infinity, with either sign. These can be input directly in a @@ -1091,12 +1095,12 @@ % terms by taking $c = 2000/(\lfloor 200x\rfloor +1) \in [10,95]$ % instead of $c\in [1,10]$. Also, it would then be possible to % simplify the computation of $t$, using methods similar to -% \cs{@@_fixed_div_to_float:ww}. However, we would then have to +% \cs{__fp_fixed_div_to_float:ww}. However, we would then have to % hard-code the logarithms of $44$ small integers instead of $9$. % \item Improve notations in the explanations of the division % algorithm (\pkg{l3fp-basics}). -% \item Understand and document \cs{@@_basics_pack_weird_low:NNNNw} -% and \cs{@@_basics_pack_weird_high:NNNNNNNNw} better. Move the +% \item Understand and document \cs{__fp_basics_pack_weird_low:NNNNw} +% and \cs{__fp_basics_pack_weird_high:NNNNNNNNw} better. Move the % other \texttt{basics_pack} auxiliaries to \pkg{l3fp-aux} under a % better name. % \item Find out if underflow can really occur for trigonometric diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index c24027b488a..b6a4cafb577 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3keys.dtx 4248 2012-09-29 19:55:27Z joseph $ +\GetIdInfo$Id: l3keys.dtx 4256 2012-11-02 08:47:41Z joseph $ {L3 Experimental key-value interfaces} %</driver|package> %<*driver> @@ -734,7 +734,9 @@ % % \subsection{Low-level interface} % +% \begin{macrocode} %<@@=keyval> +% \end{macrocode} % % For historical reasons this code uses the `keyval' module prefix. % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx index 1abf6fa9693..c70b5137fa3 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3quark.dtx 4065 2012-08-08 21:37:44Z bruno $ +\GetIdInfo$Id: l3quark.dtx 4268 2012-11-04 22:19:48Z joseph $ {L3 Quarks} %</driver|package> %<*driver> @@ -200,12 +200,10 @@ % terminating loops as when one is doing tail recursion. The building % blocks follow below and an example is shown in Section~\ref{sec:quark-example}. % -% \begin{variable}{/q_recursion_tail} +% \begin{variable}{\q_recursion_tail} % This quark is appended to the data structure in question and % appears as a real element there. This means it gets any list % separators around it. -% Can you guess why the documentation for this quark requires us -% to write the control sequence with the wrong slash before it? % \end{variable} % % \begin{variable}{\q_recursion_stop} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index 24fd5bf3fe8..3eb3eb8c901 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3skip.dtx 4235 2012-09-26 09:48:18Z bruno $ +\GetIdInfo$Id: l3skip.dtx 4260 2012-11-04 17:20:25Z joseph $ {L3 Dimensions and skips} %</driver|package> %<*driver> @@ -211,7 +211,7 @@ % % \begin{function}[EXP,pTF]{\dim_compare:nNn} % \begin{syntax} -% \cs{@@_compare_p:nNn} \Arg{dimexpr_1} \meta{relation} \Arg{dimexpr_2} \\ +% \cs{dim_compare_p:nNn} \Arg{dimexpr_1} \meta{relation} \Arg{dimexpr_2} \\ % \cs{dim_compare:nNnTF} % ~~\Arg{dimexpr_1} \meta{relation} \Arg{dimexpr_2} % ~~\Arg{true code} \Arg{false code} @@ -230,7 +230,7 @@ % % \begin{function}[EXP,pTF]{\dim_compare:n} % \begin{syntax} -% \cs{@@_compare_p:n} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \\ +% \cs{dim_compare_p:n} \{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} \\ % \cs{dim_compare:nTF} % ~~\{ \meta{dimexpr_1} \meta{relation} \meta{dimexpr_2} \} % ~~\Arg{true code} \Arg{false code} @@ -431,12 +431,13 @@ % \section{Constant dimensions} % % \begin{variable}{\c_max_dim} -% The maximum value that can be stored as a dimension or skip (these -% are equivalent). +% The maximum value that can be stored as a dimension. This can also +% be used as a component of a skip. % \end{variable} % % \begin{variable}{\c_zero_dim} -% A zero length as a dimension or a skip (these are equivalent). +% A zero length as a dimension. This can also be used as a component +% of a skip. % \end{variable} % % \section{Scratch dimensions} @@ -618,13 +619,13 @@ % % \section{Constant skips} % -% \begin{variable}{\c_max_skip} -% The maximum value that can be stored as a dimension or skip (these -% are equivalent). +% \begin{variable}[updated = 2012-11-02]{\c_max_skip} +% The maximum value that can be stored as a skip (equal to +% \cs{c_max_dim} in length), with no stretch nor shrink component. % \end{variable} % -% \begin{variable}{\c_zero_skip} -% A zero length as a dimension or a skip (these are equivalent). +% \begin{variable}[updated = 2012-11-01]{\c_zero_skip} +% A zero length as a skip, with no stretch nor shrink component. % \end{variable} % % \section{Scratch skips} @@ -815,11 +816,12 @@ % \section{Constant muskips} % % \begin{variable}{\c_max_muskip} -% The maximum value that can be stored as a muskip. +% The maximum value that can be stored as a muskip, with no stretch +% nor shrink component. % \end{variable} % % \begin{variable}{\c_zero_muskip} -% A zero length as a muskip. +% A zero length as a muskip, with no stretch nor shrink component. % \end{variable} % % \section{Scratch muskips} @@ -1372,22 +1374,13 @@ % % \subsection{Constant dimensions} % -% \begin{variable}{\c_zero_dim} -% \begin{variable}{\c_max_dim} -% The source for these depends on whether we are in package mode. +% \begin{variable}{\c_zero_dim, \c_max_dim} +% Constant dimensions: in package mode, a couple of registers can be saved. % \begin{macrocode} -%<*initex> -\dim_new:N \c_zero_dim -\dim_new:N \c_max_dim -\dim_set:Nn \c_max_dim { 16383.99999 pt } -%</initex> -%<*package> -\cs_new_eq:NN \c_zero_dim \z@ -\cs_new_eq:NN \c_max_dim \maxdimen -%</package> +\dim_const:Nn \c_zero_dim { 0 pt } +\dim_const:Nn \c_max_dim { 16383.99999 pt } % \end{macrocode} % \end{variable} -% \end{variable} % % \subsection{Scratch dimensions} % @@ -1627,15 +1620,14 @@ % % \subsection{Constant skips} % -% \begin{macro}{\c_zero_skip} -% \begin{macro}{\c_max_skip} -% Skips with no rubber component are just dimensions +% \begin{macro}{\c_zero_skip, \c_max_skip} +% Skips with no rubber component are just dimensions but need to terminate +% correctly. % \begin{macrocode} -\cs_new_eq:NN \c_zero_skip \c_zero_dim -\cs_new_eq:NN \c_max_skip \c_max_dim +\skip_const:Nn \c_zero_skip { \c_zero_dim } +\skip_const:Nn \c_max_skip { \c_max_dim } % \end{macrocode} % \end{macro} -% \end{macro} % % \subsection{Scratch skips} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index 60feb350c81..e539f0bfcec 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3token.dtx 4069 2012-08-08 23:12:57Z bruno $ +\GetIdInfo$Id: l3token.dtx 4251 2012-11-01 16:30:06Z joseph $ {L3 Experimental token manipulation} %</driver|package> %<*driver> @@ -2079,7 +2079,7 @@ } \cs_set:Npn \@@_def:nnnnn #1#2#3#4#5 { - \cs_new_nopar:cpx { #1 #5 } + \cs_new_protected_nopar:cpx { #1 #5 } { \tl_if_empty:nF {#2} { \exp_not:n { \cs_set_eq:NN \@@_execute_branches: #2 } } 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} % |