summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx618
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.ins28
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx55
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx59
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx55
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx53
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins28
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx59
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx55
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx82
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.ins28
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx69
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.ins28
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/expl3.dtx53
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3.ins26
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx69
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3basics.dtx86
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx51
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3box.dtx53
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx341
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3clist.dtx76
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx52
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3color.dtx52
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx93
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx52
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3expan.dtx53
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3file.dtx89
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3final.dtx51
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3format.ins26
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx52
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx52
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx60
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx143
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx230
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx331
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx52
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx54
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3fp.dtx104
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3int.dtx75
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3keys.dtx287
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx51
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx57
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3names.dtx64
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx51
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prg.dtx62
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3prop.dtx51
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3quark.dtx53
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3seq.dtx68
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx71
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3str.dtx65
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3sys.dtx86
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3tl.dtx72
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3token.dtx73
-rw-r--r--Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx62
-rw-r--r--Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins13
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx61
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins13
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx58
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins13
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx58
-rw-r--r--Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins28
67 files changed, 2693 insertions, 2641 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx b/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx
index e94691c1f4e..f3f31911d5c 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.dtx
@@ -1,44 +1,30 @@
% \iffalse
%
%% File l3sort.dtx (C) Copyright 2012,2014-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3sort}{Support package l3kernel too old}
@@ -50,7 +36,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3sort.dtx 6760 2016-11-21 20:35:31Z joseph $
+\GetIdInfo$Id: l3sort.dtx 6829 2017-01-28 08:52:51Z joseph $
{L3 Experimental sorting functions}
%</driver|package>
%<*driver>
@@ -82,6 +68,7 @@
% \maketitle
%
% \begin{documentation}
+% ^^A todo: ask list about ltplain, mkpattern.tex, GFnotation.tex, texinfo.tex, lollipop-plain, etex-mac.tex,
%
% \section{\pkg{l3sort} documentation}
%
@@ -114,10 +101,11 @@
% inefficient way).
%
% \begin{texnote}
-% Internally, the code from \pkg{l3sort} stores items in \tn{toks}.
-% Thus, the \meta{comparison code} should not alter the
-% contents of any \tn{toks}, nor assume that they hold a
-% given value.
+% Internally, the code from \pkg{l3sort} stores items in \tn{toks}
+% registers allocated locally. Thus, the \meta{comparison code}
+% should not call \tn{newtoks} or other commands that allocate new
+% \tn{toks} registers. On the other hand, altering the value of a
+% previously allocated \tn{toks} register is not a problem.
% \end{texnote}
%
% \begin{function}{\seq_sort:Nn, \seq_gsort:Nn}
@@ -189,26 +177,25 @@
%
% \subsection{Variables}
%
-% \begin{variable}{\c_@@_max_length_int}
-% The maximum length of a sequence which will not overflow
-% the available registers depends on which engine is in use.
-% For $2^{N}$ registers, it is $3\cdot 2^{N-2}$: for that number
-% of items, at the last step the block size will be $2^{N-1}$,
-% and the two blocks to merge will be of sizes $2^{N-1}$ and
-% $2^{N-2}$ respectively. When merging, one of the blocks must
-% be copied to temporary registers; here, the smallest block,
-% of size $2^{N-2}$, will fill up exactly the $2^{N-2}$ free
-% registers, totalling $2^{N-1}+2^{N-2}+2^{N-2}=2^{N}$ registers.
-% \begin{macrocode}
-\int_const:Nn \c_@@_max_length_int
- { \sys_if_engine_luatex:TF { 49152 } { 24576 } }
-% \end{macrocode}
-% \end{variable}
-%
-% \begin{variable}{\l_@@_length_int}
-% Length of the sequence which is being sorted.
+% \begin{variable}
+% {
+% \l_@@_length_int, \l_@@_min_int, \l_@@_top_int, \l_@@_max_int,
+% \l_@@_true_max_int
+% }
+% The sequence has \cs{l_@@_length_int} items and is stored from
+% \cs{l_@@_min_int} to $\cs{l_@@_top_int}-1$. While reading the
+% sequence in memory, we check that \cs{l_@@_top_int} remains at most
+% \cs{l_@@_max_int}, precomputed by \cs{@@_compute_range:}. That
+% bound is such that the merge sort will only use \tn{toks} registers
+% less than \cs{l_@@_true_max_int}, namely those that have not been
+% allocated for use in other code: the user's comparison code could
+% alter these.
% \begin{macrocode}
\int_new:N \l_@@_length_int
+\int_new:N \l_@@_min_int
+\int_new:N \l_@@_top_int
+\int_new:N \l_@@_max_int
+\int_new:N \l_@@_true_max_int
% \end{macrocode}
% \end{variable}
%
@@ -254,34 +241,168 @@
% \end{variable}
% \end{variable}
%
+% \subsection{Finding available \tn{toks} registers}
+%
+% \begin{macro}[int]{\@@_shrink_range:}
+% \begin{macro}[aux]{\@@_shrink_range_loop:}
+% After \cs{@@_compute_range:} (defined below) determines that
+% \tn{toks} registers between \cs{l_@@_min_int} (included) and
+% \cs{l_@@_true_max_int} (excluded) have not yet been assigned,
+% \cs{@@_shrink_range:} computes \cs{l_@@_max_int} to reflect the need
+% for a buffer when merging blocks in the merge sort. Given
+% $2^{n}\leq A\leq 2^{n}+2^{n-1}$ registers we can sort $\lfloor
+% A/2\rfloor+2^{n-2}$ items while if we have $2^{n}+2^{n-1}\leq A\leq
+% 2^{n+1}$ registers we can sort $A-2^{n-1}$ items. We first find out
+% a power $2^{n}$ such that $2^{n}\leq A\leq 2^{n+1}$ by repeatedly
+% halving \cs{l_@@_block_int}, starting at $2^{15}$ or $2^{14}$ namely
+% half the total number of registers, then we use the formulas and set
+% \cs{l_@@_max_int}.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_shrink_range:
+ {
+ \int_set:Nn \l_@@_A_int
+ { \l_@@_true_max_int - \l_@@_min_int + \c_one }
+ \int_set:Nn \l_@@_block_int { \c_max_register_int / \c_two }
+ \@@_shrink_range_loop:
+ \int_set:Nn \l_@@_max_int
+ {
+ \int_compare:nNnTF
+ { \l_@@_block_int * \c_three / \c_two } > \l_@@_A_int
+ {
+ \l_@@_min_int
+ + ( \l_@@_A_int - \c_one ) / \c_two
+ + \l_@@_block_int / \c_four
+ - \c_one
+ }
+ { \l_@@_true_max_int - \l_@@_block_int / \c_two }
+ }
+ }
+\cs_new_protected:Npn \@@_shrink_range_loop:
+ {
+ \if_int_compare:w \l_@@_A_int < \l_@@_block_int
+ \tex_divide:D \l_@@_block_int \c_two
+ \exp_after:wN \@@_shrink_range_loop:
+ \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}[int]{\@@_compute_range:, \@@_redefine_compute_range:}
+% \begin{variable}{\c_@@_max_length_int}
+% First find out what \tn{toks} have not yet been assigned. There are
+% many cases. In \LaTeXe{} with no package, available \tn{toks} range
+% from $\tn{count}15+1$ to \cs{c_max_register_int} included (this was
+% not altered despite the 2015 changes). When \tn{loctoks} is
+% defined, namely in plain (e)\TeX{}, or when the package \pkg{etex}
+% is loaded in \LaTeXe{}, redefine \cs{@@_compute_range:} to use the
+% range $\tn{count}265$ to $\tn{count}275-1$. The \pkg{elocalloc}
+% package also defines \tn{loctoks} but uses yet another number for
+% the upper bound, namely \cs{e@alloc@top} (minus one). We must check
+% for \tn{loctoks} every time a sorting function is called, as
+% \pkg{etex} or \pkg{elocalloc} could be loaded.
+%
+% In Con\TeX{}t MkIV the range is from
+% $|\c_syst_last_allocated_toks|+1$ to \cs{c_max_register_int}, and in
+% MkII it is from $|\lastallocatedtoks|+1$ to \cs{c_max_register_int}.
+% In all these cases, call \cs{@@_shrink_range:}. The \LaTeX3 format
+% mode is easiest: no \tn{toks} are ever allocated so available
+% \tn{toks} range from $0$ to \cs{c_max_register_int} and we
+% precompute the result of \cs{@@_shrink_range:}.
+% \begin{macrocode}
+%<*package>
+\cs_new_protected:Npn \@@_compute_range:
+ {
+ \int_set:Nn \l_@@_min_int { \tex_count:D 15 + \c_one }
+ \int_set:Nn \l_@@_true_max_int { \c_max_register_int + \c_one }
+ \@@_shrink_range:
+ \if_meaning:w \loctoks \tex_undefined:D \else:
+ \if_meaning:w \loctoks \scan_stop: \else:
+ \@@_redefine_compute_range:
+ \@@_compute_range:
+ \fi:
+ \fi:
+ }
+\cs_new_protected:Npn \@@_redefine_compute_range:
+ {
+ \cs_if_exist:cTF { ver@elocalloc.sty }
+ {
+ \cs_gset_protected:Npn \@@_compute_range:
+ {
+ \int_set:Nn \l_@@_min_int { \tex_count:D 265 }
+ \int_set_eq:NN \l_@@_true_max_int \e@alloc@top
+ \@@_shrink_range:
+ }
+ }
+ {
+ \cs_gset_protected:Npn \@@_compute_range:
+ {
+ \int_set:Nn \l_@@_min_int { \tex_count:D 265 }
+ \int_set:Nn \l_@@_true_max_int { \tex_count:D 275 }
+ \@@_shrink_range:
+ }
+ }
+ }
+\cs_if_exist:NT \loctoks { \@@_redefine_compute_range: }
+\tl_map_inline:nn { \lastallocatedtoks \c_syst_last_allocated_toks }
+ {
+ \cs_if_exist:NT #1
+ {
+ \cs_gset_protected:Npn \@@_compute_range:
+ {
+ \int_set:Nn \l_@@_min_int { #1 + \c_one }
+ \int_set:Nn \l_@@_true_max_int { \c_max_register_int + \c_one }
+ \@@_shrink_range:
+ }
+ }
+ }
+%</package>
+%<*initex>
+\int_const:Nn \c_@@_max_length_int
+ { ( \c_max_register_int + 1 ) * 3 / 4 }
+\cs_new_protected:Npn \@@_compute_range:
+ {
+ \int_set_eq:NN \l_@@_min_int \c_zero
+ \int_set:Nn \l_@@_true_max_int { \c_max_register_int + \c_one }
+ \int_set_eq:NN \l_@@_max_int \c_@@_max_length_int
+ }
+%</initex>
+% \end{macrocode}
+% \end{variable}
+% \end{macro}
+%
% \subsection{Protected user commands}
%
% \begin{macro}[int]{\@@_main:NNNnNn}
-% Sorting happens in three steps. First store items
-% in \tn{toks} registers ranging from $0$ to the length
-% of the list, while checking that the list is not too
+% Sorting happens in three steps. First store items in \tn{toks}
+% registers ranging from \cs{l_@@_min_int} to $\cs{l_@@_top_int}-1$,
+% while checking that the list is not too
% long. If we reach the maximum length, all further
% items are entirely ignored after raising an error.
% Secondly, sort the array of \tn{toks} registers,
-% using the user-defined sorting function, |#5|.
+% using the user-defined sorting function, |#6|.
% Finally, unpack the \tn{toks} registers (now sorted)
% into a variable of the right type, by \texttt{x}-expanding
-% the code in |#3|, specific to each type of list.
+% the code in |#4|, specific to each type of list.
% \begin{macrocode}
\cs_new_protected:Npn \@@_main:NNNnNn #1#2#3#4#5#6
{
\group_begin:
- \l_@@_length_int \c_zero
+%<package> \@@_disable_toksdef:
+ \@@_compute_range:
+ \int_set_eq:NN \l_@@_top_int \l_@@_min_int
#2 #5
{
- \if_int_compare:w \l_@@_length_int = \c_@@_max_length_int
+ \if_int_compare:w \l_@@_top_int = \l_@@_max_int
\@@_too_long_error:NNw #3 #5
\fi:
- \tex_toks:D \l_@@_length_int {##1}
- \tex_advance:D \l_@@_length_int \c_one
+ \tex_toks:D \l_@@_top_int {##1}
+ \tex_advance:D \l_@@_top_int \c_one
}
- \cs_set:Npn \sort_compare:nn ##1 ##2 { #6 }
- \l_@@_block_int \c_one
+ \int_set:Nn \l_@@_length_int
+ { \l_@@_top_int - \l_@@_min_int }
+ \cs_set:Npn \@@_compare:nn ##1 ##2 { #6 }
+ \int_set_eq:NN \l_@@_block_int \c_one
\@@_level:
\use:x
{
@@ -307,14 +428,14 @@
\cs_new_protected:Npn \seq_sort:Nn
{
\@@_main:NNNnNn \tl_set:Nn
- \seq_map_inline:Nn \seq_map_break:
- { \s__seq \@@_toks:NNw \exp_not:N \__seq_item:n 0 ; }
+ \seq_map_inline:Nn \seq_map_break:n
+ { \s__seq \@@_toks:NN \exp_not:N \__seq_item:n }
}
\cs_new_protected:Npn \seq_gsort:Nn
{
\@@_main:NNNnNn \tl_gset:Nn
- \seq_map_inline:Nn \seq_map_break:
- { \s__seq \@@_toks:NNw \exp_not:N \__seq_item:n 0 ; }
+ \seq_map_inline:Nn \seq_map_break:n
+ { \s__seq \@@_toks:NN \exp_not:N \__seq_item:n }
}
% \end{macrocode}
% \end{macro}
@@ -324,19 +445,19 @@
% the scope of the assignment. Mapping through the token
% list is done with \cs{tl_map_inline:Nn}, and producing
% the token list is very similar to sequences, removing
-% \cs{seq_item:Nn}.
+% \cs{__seq_item:n}.
% \begin{macrocode}
\cs_new_protected:Npn \tl_sort:Nn
{
\@@_main:NNNnNn \tl_set:Nn
- \tl_map_inline:Nn \tl_map_break:
- { \@@_toks:NNw \prg_do_nothing: \prg_do_nothing: 0 ; }
+ \tl_map_inline:Nn \tl_map_break:n
+ { \@@_toks:NN \prg_do_nothing: \prg_do_nothing: }
}
\cs_new_protected:Npn \tl_gsort:Nn
{
\@@_main:NNNnNn \tl_gset:Nn
- \tl_map_inline:Nn \tl_map_break:
- { \@@_toks:NNw \prg_do_nothing: \prg_do_nothing: 0 ; }
+ \tl_map_inline:Nn \tl_map_break:n
+ { \@@_toks:NN \prg_do_nothing: \prg_do_nothing: }
}
% \end{macrocode}
% \end{macro}
@@ -350,7 +471,7 @@
% for sequences and token lists. The first comma must be removed.
% An item must be wrapped in an extra set of braces if it contains
% either the space or the comma characters. This is taken care of
-% by \cs{clist_wrap_item:n}, but \cs{@@_toks:NNw} would simply
+% by \cs{clist_wrap_item:n}, but \cs{@@_toks:NN} would simply
% feed \cs{tex_the:D} \cs{tex_toks:D} \meta{number} as an
% argument to that function; hence we need to expand this argument
% once to unpack the register.
@@ -364,10 +485,10 @@
\clist_if_empty:NF #2
{
\@@_main:NNNnNn #1
- \clist_map_inline:Nn \clist_map_break:
+ \clist_map_inline:Nn \clist_map_break:n
{
\exp_last_unbraced:Nf \use_none:n
- { \@@_toks:NNw \exp_args:No \__clist_wrap_item:n 0 ; }
+ { \@@_toks:NN \exp_args:No \__clist_wrap_item:n }
}
#2 {#3}
}
@@ -376,10 +497,10 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_toks:NNw}
-% Unpack the various \tn{toks} registers, from $0$ to the length
-% of the list. The functions |#1| and |#2| allow us to treat the
-% three data structures in a unified way:
+% \begin{macro}{\@@_toks:NN, \@@_toks:NNw}
+% Unpack the various \tn{toks} registers, from \cs{l_@@_min_int} to
+% $\cs{l_@@_top_int}-1$. The functions |#1| and |#2| allow us to treat
+% the three data structures in a unified way:
% \begin{itemize}
% \item for sequences, they are \cs{exp_not:N} \cs{__seq_item:n},
% expanding to the \cs{__seq_item:n} separator, as expected;
@@ -391,9 +512,11 @@
% braces.
% \end{itemize}
% \begin{macrocode}
+\cs_new:Npn \@@_toks:NN #1#2
+ { \@@_toks:NNw #1 #2 \l_@@_min_int ; }
\cs_new:Npn \@@_toks:NNw #1#2#3 ;
{
- \if_int_compare:w #3 < \l_@@_length_int
+ \if_int_compare:w #3 < \l_@@_top_int
#1 #2 { \tex_the:D \tex_toks:D #3 }
\exp_after:wN \@@_toks:NNw \exp_after:wN #1 \exp_after:wN #2
\__int_value:w \__int_eval:w #3 + \c_one \exp_after:wN ;
@@ -402,7 +525,7 @@
% \end{macrocode}
% \end{macro}
%
-% \subsection{Sorting itself}
+% \subsection{Merge sort}
%
% \begin{macro}[int]{\@@_level:}
% This function is called once blocks of size \cs{l_@@_block_int}
@@ -414,9 +537,9 @@
\cs_new_protected:Npn \@@_level:
{
\if_int_compare:w \l_@@_block_int < \l_@@_length_int
- \l_@@_end_int \c_zero
+ \l_@@_end_int \l_@@_min_int
\@@_merge_blocks:
- \tex_multiply:D \l_@@_block_int \c_two
+ \tex_advance:D \l_@@_block_int \l_@@_block_int
\exp_after:wN \@@_level:
\fi:
}
@@ -427,14 +550,14 @@
% This function is called to merge a pair of blocks, starting at
% the last value of \cs{l_@@_end_int} (end-point of the previous
% pair of blocks). If shifting by one block to the right we reach
-% the end of the list, then this pass has ended: this end of the
-% list is sorted already. Store the result of that shift in $A$,
+% the end of the list, then this pass has ended: the end of the
+% list is sorted already. Otherwise, store the result of that shift in $A$,
% which will index the first block starting from the top end.
-% Then locate the end-point (maximum) of the upper block: shift
-% \texttt{end} upwards by one more block, checking that we don't
-% go beyond the length of the list. Copy this upper block of \tn{toks}
+% Then locate the end-point (maximum) of the second block: shift
+% \texttt{end} upwards by one more block, but keeping it
+% $\leq\texttt{top}$. Copy this upper block of \tn{toks}
% registers in registers above \texttt{length}, indexed by $C$:
-% this is covered by \cs{sort_copy_block:}. Once this is done we
+% this is covered by \cs{@@_copy_block:}. Once this is done we
% are ready to do the actual merger using \cs{@@_merge_blocks_aux:},
% after shifting $A$, $B$ and $C$ so that they point to the largest
% index in their respective ranges rather than pointing just beyond
@@ -445,33 +568,33 @@
{
\l_@@_begin_int \l_@@_end_int
\tex_advance:D \l_@@_end_int \l_@@_block_int
- \if_int_compare:w \__int_eval:w \l_@@_end_int < \l_@@_length_int
+ \if_int_compare:w \l_@@_end_int < \l_@@_top_int
\l_@@_A_int \l_@@_end_int
\tex_advance:D \l_@@_end_int \l_@@_block_int
- \if_int_compare:w \l_@@_end_int > \l_@@_length_int
- \l_@@_end_int \l_@@_length_int
+ \if_int_compare:w \l_@@_end_int > \l_@@_top_int
+ \l_@@_end_int \l_@@_top_int
\fi:
\l_@@_B_int \l_@@_A_int
- \l_@@_C_int \l_@@_length_int
- \sort_copy_block:
- \tex_advance:D \l_@@_A_int \c_minus_one
- \tex_advance:D \l_@@_B_int \c_minus_one
- \tex_advance:D \l_@@_C_int \c_minus_one
- \@@_merge_blocks_aux:
+ \l_@@_C_int \l_@@_top_int
+ \@@_copy_block:
+ \tex_advance:D \l_@@_A_int - \c_one
+ \tex_advance:D \l_@@_B_int - \c_one
+ \tex_advance:D \l_@@_C_int - \c_one
+ \exp_after:wN \@@_merge_blocks_aux:
\exp_after:wN \@@_merge_blocks:
\fi:
}
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[int]{\sort_copy_block:}
+% \begin{macro}[int]{\@@_copy_block:}
% We wish to store a copy of the \enquote{upper} block of
% \tn{toks} registers, ranging between the initial value of
% \cs{l_@@_B_int} (included) and \cs{l_@@_end_int}
% (excluded) into a new range starting at the initial value
-% of \cs{l_@@_C_int}, namely \cs{l_@@_length_int}.
+% of \cs{l_@@_C_int}, namely \cs{l_@@_top_int}.
% \begin{macrocode}
-\cs_new_protected:Npn \sort_copy_block:
+\cs_new_protected:Npn \@@_copy_block:
{
\tex_toks:D \l_@@_C_int \tex_toks:D \l_@@_B_int
\tex_advance:D \l_@@_C_int \c_one
@@ -479,7 +602,7 @@
\if_int_compare:w \l_@@_B_int = \l_@@_end_int
\use_i:nn
\fi:
- \sort_copy_block:
+ \@@_copy_block:
}
% \end{macrocode}
% \end{macro}
@@ -487,7 +610,7 @@
% \begin{macro}[aux]{\@@_merge_blocks_aux:}
% At this stage, the first block starts at \cs{l_@@_begin_int},
% and ends at \cs{l_@@_A_int}, and the second block starts at
-% \cs{l_@@_length_int} and ends at \cs{l_@@_C_int}. The result
+% \cs{l_@@_top_int} and ends at \cs{l_@@_C_int}. The result
% of the merger is stored at positions indexed by \cs{l_@@_B_int},
% which starts at $\cs{l_@@_end_int}-1$ and decreases down to
% \cs{l_@@_begin_int}, covering the full range of the two blocks.
@@ -500,39 +623,72 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_merge_blocks_aux:
{
- \exp_after:wN \sort_compare:nn \exp_after:wN
+ \exp_after:wN \@@_compare:nn \exp_after:wN
{ \tex_the:D \tex_toks:D \exp_after:wN \l_@@_A_int \exp_after:wN }
\exp_after:wN { \tex_the:D \tex_toks:D \l_@@_C_int }
+ \prg_do_nothing:
+ \@@_return_mark:N
+ \@@_return_mark:N
+ \@@_return_none_error:
+ }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\sort_ordered:, \sort_reversed:}
+% \begin{macro}[aux]{\@@_return_mark:N}
+% \begin{macro}[aux]{\@@_return_none_error:, \@@_return_two_error:w}
+% The marker removes one token. Each comparison should call
+% \cs{sort_ordered:} or \cs{sort_reversed:} exactly
+% once. If neither is called, \cs{@@_return_none_error:} is called.
+% \begin{macrocode}
+\cs_new_protected:Npn \sort_ordered: #1 \@@_return_mark:N
+ { #1 \@@_return_mark:N \@@_return_two_error:w \@@_ordered: }
+\cs_new_protected:Npn \sort_reversed: #1 \@@_return_mark:N
+ { #1 \@@_return_mark:N \@@_return_two_error:w \@@_return_reversed: }
+\cs_new_protected:Npn \@@_return_mark:N #1 { }
+\cs_new_protected:Npn \@@_return_none_error:
+ {
+ \__msg_kernel_error:nnxx { sort } { return-none }
+ { \tex_the:D \tex_toks:D \l_@@_A_int }
+ { \tex_the:D \tex_toks:D \l_@@_C_int }
+ \@@_ordered:
}
+\cs_new_protected:Npn \@@_return_two_error:w
+ #1 \@@_return_none_error:
+ { \__msg_kernel_error:nn { sort } { return-two } }
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}[aux]{\sort_ordered:}
+% \begin{macro}[aux]{\@@_ordered:}
% If the comparison function returns \texttt{ordered},
-% then the second argument fed to \cs{sort_compare:nn}
+% then the second argument fed to \cs{@@_compare:nn}
% should remain to the right of the other one. Since
% we build the merger starting from the right, we copy
% that \tn{toks} register into the allotted range, then
% shift the pointers $B$ and $C$, and go on to do one
% more step in the merger, unless the second block has
% been exhausted: then the remainder of the first block
-% is already in the correct register and we are done
+% is already in the correct registers and we are done
% with merging those two blocks.
% \begin{macrocode}
-\cs_new_protected:Npn \sort_ordered:
+\cs_new_protected:Npn \@@_ordered:
{
\tex_toks:D \l_@@_B_int \tex_toks:D \l_@@_C_int
- \tex_advance:D \l_@@_B_int \c_minus_one
- \tex_advance:D \l_@@_C_int \c_minus_one
- \if_int_compare:w \l_@@_C_int < \l_@@_length_int
+ \tex_advance:D \l_@@_B_int - \c_one
+ \tex_advance:D \l_@@_C_int - \c_one
+ \if_int_compare:w \l_@@_C_int < \l_@@_top_int
\use_i:nn
\fi:
\@@_merge_blocks_aux:
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
-% \begin{macro}[aux]{\sort_reversed:}
+% \begin{macro}[aux]{\@@_return_reversed:}
% If the comparison function returns \texttt{reversed},
% then the next item to add to the merger is the first
% argument, contents of the \tn{toks} register $A$.
@@ -540,14 +696,14 @@
% go for one more step for the merger, unless the left
% block was exhausted ($A$ goes below the threshold).
% In that case, all remaining \tn{toks} registers in
-% the second block, indexed by $C$, should be copied
-% to the merger (see \cs{@@_merge_blocks_end:}).
+% the second block, indexed by $C$, are copied
+% to the merger by \cs{@@_merge_blocks_end:}.
% \begin{macrocode}
-\cs_new_protected:Npn \sort_reversed:
+\cs_new_protected:Npn \@@_return_reversed:
{
\tex_toks:D \l_@@_B_int \tex_toks:D \l_@@_A_int
- \tex_advance:D \l_@@_B_int \c_minus_one
- \tex_advance:D \l_@@_A_int \c_minus_one
+ \tex_advance:D \l_@@_B_int - \c_one
+ \tex_advance:D \l_@@_A_int - \c_one
\if_int_compare:w \l_@@_A_int < \l_@@_begin_int
\@@_merge_blocks_end: \use_i:nn
\fi:
@@ -561,13 +717,13 @@
% in the block indexed by $C$ to the merger indexed by $B$.
% The end can equally be detected by checking when $B$ reaches
% the threshold \texttt{begin}, or when $C$ reaches
-% \texttt{length}.
+% \texttt{top}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_merge_blocks_end:
{
\tex_toks:D \l_@@_B_int \tex_toks:D \l_@@_C_int
- \tex_advance:D \l_@@_B_int \c_minus_one
- \tex_advance:D \l_@@_C_int \c_minus_one
+ \tex_advance:D \l_@@_B_int - \c_one
+ \tex_advance:D \l_@@_C_int - \c_one
\if_int_compare:w \l_@@_B_int < \l_@@_begin_int
\use_i:nn
\fi:
@@ -586,8 +742,8 @@
%
% A prototypical version of expandable quicksort is as follows. If the
% argument has no item, return nothing, otherwise partition, using the
-% first item as a pivot (argument |#4| of |\__sort:nnNnn|). The
-% arguments of |\__sort:nnNnn| are 1.~items less than |#4|, 2.~items
+% first item as a pivot (argument |#4| of \cs{@@:nnNnn}). The
+% arguments of \cs{@@:nnNnn} are 1.~items less than |#4|, 2.~items
% greater or equal to |#4|, 3.~comparison, 4.~pivot, 5.~next item to
% test. If |#5| is the tail of the list, call \cs{tl_sort:nN} on |#1|
% and on |#2|, placing |#4| in between; |\use:ff| expands the parts to
@@ -617,41 +773,41 @@
% There are quite a few optimizations available here: the code below is
% less legible, but more than twice as fast.
%
-% In the simple version of the code, |\__sort:nnNnn| is called
+% In the simple version of the code, \cs{@@:nnNnn} is called
% \(O(n\ln n)\) times on average (the number of comparisons required by
% the quicksort algorithm). Hence most of our focus will be on
% optimizing that function.
%
% The first speed up is to avoid testing for the end of the list at
-% every call to |\__sort:nnNnn|. For this, the list is prepared by
+% every call to \cs{@@:nnNnn}. For this, the list is prepared by
% changing each \meta{item} of the original token list into
% \meta{command} \Arg{item}, just like sequences are stored. We arrange
% things such that the \meta{command} is the \meta{conditional} provided
% by the user: the loop over the \meta{prepared tokens} then looks like
% \begin{quote}
% \ttfamily
-% \cs{cs_new:Npn}~|\__sort_loop:wNn|~\ldots{}~|#6#7|\\
+% \cs{cs_new:Npn}~\cs{@@_loop:wNn}~\ldots{}~|#6#7|\\
% ~~|{|\\
% ~~~~|#6|~\Arg{pivot}~|{#7}|~\meta{loop big}~\meta{loop small}\\
% ~~~~~~\meta{extra arguments}\\
% ~~|}|\\
-% |\__sort_loop:wNn|~\ldots{}~\meta{prepared tokens}\\
+% \cs{@@_loop:wNn}~\ldots{}~\meta{prepared tokens}\\
% ~~\meta{end-loop}~|{}|~|\q_stop|
% \end{quote}
% In this example, which matches the structure of
-% \cs{__sort_quick_split_i:NnnnnNn} and a few other functions below, the
-% |\__sort_loop:wNn| auxiliary normally receives the user's
+% \cs{@@_quick_split_i:NnnnnNn} and a few other functions below, the
+% \cs{@@_loop:wNn} auxiliary normally receives the user's
% \meta{conditional} as~|#6| and an \meta{item} as~|#7|. This is
% compared to the \meta{pivot} (the argument~|#5|, not shown here), and
% the \meta{conditional} leaves the \meta{loop big} or \meta{loop small}
-% auxiliary, which both have the same form as |\__sort_loop:wNn|,
+% auxiliary, which both have the same form as \cs{@@_loop:wNn},
% receiving the next pair \meta{conditional} \Arg{item} as |#6|
% and~|#7|. At the end, |#6| is the \meta{end-loop} function, which
% terminates the loop.
%
% The second speed up is to minimize the duplicated tokens between the
% \texttt{true} and \texttt{false} branches of the conditional. For
-% this, we introduce two versions of |\__sort:nnNnn|, which receive
+% this, we introduce two versions of \cs{@@:nnNnn}, which receive
% the new item as~|#1| and place it either into the list~|#2| of items
% less than the pivot~|#4| or into the list~|#3| of items greater or
% equal to the pivot.
@@ -667,7 +823,7 @@
% {#6} {#2} { #3 {#1} } {#4}
% }
% \end{verbatim}
-% Note that the two functions have the form of |\__sort_loop:wNn| above,
+% Note that the two functions have the form of \cs{@@_loop:wNn} above,
% receiving as~|#5| the conditional or a function to end the loop. In
% fact, the lists~|#2| and~|#3| must be made of pairs \meta{conditional}
% \Arg{item}, so we have to replace~|{#6}| above by |{|~|#5|~|{#6}|~|}|,
@@ -675,14 +831,14 @@
% all argument numbers are shifted compared to this code.
%
% The third speed up is to avoid |\use:ff| using a continuation-passing
-% style: \cs{__sort_quick_split:NnNn} expects a list followed by
+% style: \cs{@@_quick_split:NnNn} expects a list followed by
% \cs{q_mark} \Arg{code}, and expands to \meta{code} \meta{sorted list}.
% Sorting the two parts of the list around the pivot is done with
% \begin{quote}
% \ttfamily
-% \cs{__sort_quick_split:NnNn} |#2| \ldots{} \cs{q_mark}\\
+% \cs{@@_quick_split:NnNn} |#2| \ldots{} \cs{q_mark}\\
% ~~|{|\\
-% ~~~~\cs{__sort_quick_split:NnNn} |#1| \ldots{} \cs{q_mark} \Arg{code}\\
+% ~~~~\cs{@@_quick_split:NnNn} |#1| \ldots{} \cs{q_mark} \Arg{code}\\
% ~~~~\Arg{pivot}\\
% ~~|}|
% \end{quote}
@@ -692,10 +848,10 @@
%
% The fourth speed up is avoid the recursive call to \cs{tl_sort:nN}
% with an empty first argument. For this, we introduce functions
-% similar to the |\__sort_i:nnnnNn| of the last example, but aware of
+% similar to the \cs{@@_i:nnnnNn} of the last example, but aware of
% whether the list of \meta{conditional} \Arg{item} read so far that are
% less than the pivot, and the list of those greater or equal, are empty
-% or not: see \cs{__sort_quick_split:NnNn} and functions defined below.
+% or not: see \cs{@@_quick_split:NnNn} and functions defined below.
% Knowing whether the lists are empty or not is useless if we do not use
% distinct ending codes as appropriate. The splitting auxiliaries
% communicate to the \meta{end-loop} function (that is initially placed
@@ -724,9 +880,9 @@
% \begin{macro}[EXP]{\tl_sort:nN}
% \begin{macro}[aux, EXP]
% {
-% \__sort_quick_prepare:Nnnn,
-% \__sort_quick_prepare_end:NNNnw,
-% \__sort_quick_cleanup:w
+% \@@_quick_prepare:Nnnn,
+% \@@_quick_prepare_end:NNNnw,
+% \@@_quick_cleanup:w
% }
% The code within the \cs{exp_not:f} sorts the list, leaving in most
% cases a leading \cs{exp_not:f}, which stops the expansion, letting
@@ -738,7 +894,7 @@
% item as~|#3|, and the item after that as~|#4|. The loop ends
% when~|#4| contains \cs{__prg_break_point:}, then the
% \texttt{prepare_end} auxiliary finds the prepared token list
-% as~|#4|. The scene is then set up for \cs{__sort_quick_split:NnNn},
+% as~|#4|. The scene is then set up for \cs{@@_quick_split:NnNn},
% which will sort the prepared list and perform the post action placed
% after \cs{q_mark}, namely removing the trailing \cs{s__stop} and
% \cs{q_stop} and leaving \cs{exp_stop_f:} to stop
@@ -750,36 +906,36 @@
{
\tl_if_blank:nF {#1}
{
- \__sort_quick_prepare:Nnnn #2 { } { }
+ \@@_quick_prepare:Nnnn #2 { } { }
#1
- { \__prg_break_point: \__sort_quick_prepare_end:NNNnw }
+ { \__prg_break_point: \@@_quick_prepare_end:NNNnw }
\q_stop
}
}
}
-\cs_new:Npn \__sort_quick_prepare:Nnnn #1#2#3#4
+\cs_new:Npn \@@_quick_prepare:Nnnn #1#2#3#4
{
\__prg_break: #4 \__prg_break_point:
- \__sort_quick_prepare:Nnnn #1 { #2 #3 } { #1 {#4} }
+ \@@_quick_prepare:Nnnn #1 { #2 #3 } { #1 {#4} }
}
-\cs_new:Npn \__sort_quick_prepare_end:NNNnw #1#2#3#4#5 \q_stop
+\cs_new:Npn \@@_quick_prepare_end:NNNnw #1#2#3#4#5 \q_stop
{
- \__sort_quick_split:NnNn #4 \__sort_quick_end:nnTFNn { }
- \q_mark { \__sort_quick_cleanup:w \exp_stop_f: }
+ \@@_quick_split:NnNn #4 \@@_quick_end:nnTFNn { }
+ \q_mark { \@@_quick_cleanup:w \exp_stop_f: }
\s__stop \q_stop
}
-\cs_new:Npn \__sort_quick_cleanup:w #1 \s__stop \q_stop {#1}
+\cs_new:Npn \@@_quick_cleanup:w #1 \s__stop \q_stop {#1}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}[EXP, aux]
% {
-% \__sort_quick_split:NnNn,
-% \__sort_quick_only_i:NnnnnNn,
-% \__sort_quick_only_ii:NnnnnNn,
-% \__sort_quick_split_i:NnnnnNn,
-% \__sort_quick_split_ii:NnnnnNn
+% \@@_quick_split:NnNn,
+% \@@_quick_only_i:NnnnnNn,
+% \@@_quick_only_ii:NnnnnNn,
+% \@@_quick_split_i:NnnnnNn,
+% \@@_quick_split_ii:NnnnnNn
% }
% The \texttt{only_i}, \texttt{only_ii}, \texttt{split_i} and
% \texttt{split_ii} auxiliaries receive a useless first argument, the
@@ -788,7 +944,7 @@
% items~|#4|, the pivot~|#5|, a \meta{function}~|#6|, and an
% item~|#7|. The \meta{function} is the user's \meta{conditional}
% except at the end of the list where it is
-% \cs{__sort_quick_end:nnTFNn}. The comparison is applied to the
+% \cs{@@_quick_end:nnTFNn}. The comparison is applied to the
% \meta{pivot} and the \meta{item}, and calls the \texttt{only_i} or
% \texttt{split_i} auxiliaries if the \meta{item} is smaller, and the
% \texttt{only_ii} or \texttt{split_ii} auxiliaries otherwise. In
@@ -802,34 +958,34 @@
% argument is always the user's \meta{conditional} rather than an
% ending function.
% \begin{macrocode}
-\cs_new:Npn \__sort_quick_split:NnNn #1#2#3#4
+\cs_new:Npn \@@_quick_split:NnNn #1#2#3#4
{
- #3 {#2} {#4} \__sort_quick_only_ii:NnnnnNn \__sort_quick_only_i:NnnnnNn
- \__sort_quick_single_end:nnnwnw
+ #3 {#2} {#4} \@@_quick_only_ii:NnnnnNn \@@_quick_only_i:NnnnnNn
+ \@@_quick_single_end:nnnwnw
{ #3 {#4} } { } { } {#2}
}
-\cs_new:Npn \__sort_quick_only_i:NnnnnNn #1#2#3#4#5#6#7
+\cs_new:Npn \@@_quick_only_i:NnnnnNn #1#2#3#4#5#6#7
{
- #6 {#5} {#7} \__sort_quick_split_ii:NnnnnNn \__sort_quick_only_i:NnnnnNn
- \__sort_quick_only_i_end:nnnwnw
+ #6 {#5} {#7} \@@_quick_split_ii:NnnnnNn \@@_quick_only_i:NnnnnNn
+ \@@_quick_only_i_end:nnnwnw
{ #6 {#7} } { #3 #2 } { } {#5}
}
-\cs_new:Npn \__sort_quick_only_ii:NnnnnNn #1#2#3#4#5#6#7
+\cs_new:Npn \@@_quick_only_ii:NnnnnNn #1#2#3#4#5#6#7
{
- #6 {#5} {#7} \__sort_quick_only_ii:NnnnnNn \__sort_quick_split_i:NnnnnNn
- \__sort_quick_only_ii_end:nnnwnw
+ #6 {#5} {#7} \@@_quick_only_ii:NnnnnNn \@@_quick_split_i:NnnnnNn
+ \@@_quick_only_ii_end:nnnwnw
{ #6 {#7} } { } { #4 #2 } {#5}
}
-\cs_new:Npn \__sort_quick_split_i:NnnnnNn #1#2#3#4#5#6#7
+\cs_new:Npn \@@_quick_split_i:NnnnnNn #1#2#3#4#5#6#7
{
- #6 {#5} {#7} \__sort_quick_split_ii:NnnnnNn \__sort_quick_split_i:NnnnnNn
- \__sort_quick_split_end:nnnwnw
+ #6 {#5} {#7} \@@_quick_split_ii:NnnnnNn \@@_quick_split_i:NnnnnNn
+ \@@_quick_split_end:nnnwnw
{ #6 {#7} } { #3 #2 } {#4} {#5}
}
-\cs_new:Npn \__sort_quick_split_ii:NnnnnNn #1#2#3#4#5#6#7
+\cs_new:Npn \@@_quick_split_ii:NnnnnNn #1#2#3#4#5#6#7
{
- #6 {#5} {#7} \__sort_quick_split_ii:NnnnnNn \__sort_quick_split_i:NnnnnNn
- \__sort_quick_split_end:nnnwnw
+ #6 {#5} {#7} \@@_quick_split_ii:NnnnnNn \@@_quick_split_i:NnnnnNn
+ \@@_quick_split_end:nnnwnw
{ #6 {#7} } {#3} { #4 #2 } {#5}
}
% \end{macrocode}
@@ -837,13 +993,13 @@
%
% \begin{macro}[EXP, aux]
% {
-% \__sort_quick_end:nnTFNn,
-% \__sort_quick_single_end:nnnwnw,
-% \__sort_quick_only_i_end:nnnwnw,
-% \__sort_quick_only_ii_end:nnnwnw,
-% \__sort_quick_split_end:nnnwnw,
+% \@@_quick_end:nnTFNn,
+% \@@_quick_single_end:nnnwnw,
+% \@@_quick_only_i_end:nnnwnw,
+% \@@_quick_only_ii_end:nnnwnw,
+% \@@_quick_split_end:nnnwnw,
% }
-% The \cs{__sort_quick_end:nnTFNn} appears instead of the user's
+% The \cs{@@_quick_end:nnTFNn} appears instead of the user's
% conditional, and receives as its arguments the pivot~|#1|, a fake
% item~|#2|, a \texttt{true} and a \texttt{false} branches |#3|
% and~|#4|, followed by an ending function~|#5| (one of the four
@@ -864,28 +1020,28 @@
% the pivot are sorted, then items less than the pivot, and the
% continuations are done in such a way to place the pivot in between.
% \begin{macrocode}
-\cs_new:Npn \__sort_quick_end:nnTFNn #1#2#3#4#5#6 {#5}
-\cs_new:Npn \__sort_quick_single_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_end:nnTFNn #1#2#3#4#5#6 {#5}
+\cs_new:Npn \@@_quick_single_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
{ #5 {#3} #6 \q_stop }
-\cs_new:Npn \__sort_quick_only_i_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_only_i_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
{
- \__sort_quick_split:NnNn #1
- \__sort_quick_end:nnTFNn { } \q_mark {#5}
+ \@@_quick_split:NnNn #1
+ \@@_quick_end:nnTFNn { } \q_mark {#5}
{#3}
#6 \q_stop
}
-\cs_new:Npn \__sort_quick_only_ii_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_only_ii_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
{
- \__sort_quick_split:NnNn #2
- \__sort_quick_end:nnTFNn { } \q_mark { #5 {#3} }
+ \@@_quick_split:NnNn #2
+ \@@_quick_end:nnTFNn { } \q_mark { #5 {#3} }
#6 \q_stop
}
-\cs_new:Npn \__sort_quick_split_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
+\cs_new:Npn \@@_quick_split_end:nnnwnw #1#2#3#4 \q_mark #5#6 \q_stop
{
- \__sort_quick_split:NnNn #2 \__sort_quick_end:nnTFNn { } \q_mark
+ \@@_quick_split:NnNn #2 \@@_quick_end:nnTFNn { } \q_mark
{
- \__sort_quick_split:NnNn #1
- \__sort_quick_end:nnTFNn { } \q_mark {#5}
+ \@@_quick_split:NnNn #1
+ \@@_quick_end:nnTFNn { } \q_mark {#5}
{#3}
}
#6 \q_stop
@@ -895,7 +1051,50 @@
%
% \subsection{Messages}
%
-% \begin{macro}{\@@_too_long_error:NNw}
+% \begin{macro}[aux]{\@@_error:}
+% Bailing out of the sorting code is a bit tricky. It may not be safe
+% to use a delimited argument, so instead we redefine many
+% \pkg{l3sort} commands to be trivial, with \cs{@@_level:} getting rid
+% of the final assignment. This error recovery won't work in a group.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_error:
+ {
+ \cs_set_eq:NN \@@_merge_blocks_aux: \prg_do_nothing:
+ \cs_set_eq:NN \@@_merge_blocks: \prg_do_nothing:
+ \cs_set_protected:Npn \@@_level: \use:x ##1 { \group_end: }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\@@_disable_toksdef:, \@@_disabled_toksdef:n}
+% While sorting, \tn{toksdef} is locally disabled to prevent users
+% from using \tn{newtoks} or similar commands in their comparison
+% code: the \tn{toks} registers that would be assigned are in use by
+% \pkg{l3sort}. In format mode, none of this is needed since there is
+% no \tn{toks} allocator.
+% \begin{macrocode}
+%<*package>
+\cs_new_protected:Npn \@@_disable_toksdef:
+ { \cs_set_eq:NN \toksdef \@@_disabled_toksdef:n }
+\cs_new_protected:Npn \@@_disabled_toksdef:n #1
+ {
+ \__msg_kernel_error:nnx { sort } { toksdef }
+ { \token_to_str:N #1 }
+ \@@_error:
+ \tex_toksdef:D #1
+ }
+\__msg_kernel_new:nnnn { sort } { toksdef }
+ { Allocation~of~\iow_char:N\\toks~registers~impossible~while~sorting. }
+ {
+ The~comparison~code~used~for~sorting~a~list~has~attempted~to~
+ define~#1~as~a~new~\iow_char:N\\toks~register~using~\iow_char:N\\newtoks~
+ or~a~similar~command.~The~list~will~not~be~sorted.
+ }
+%</package>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\@@_too_long_error:NNw}
% When there are too many items in a sequence, this is an error, and
% we clean up properly the mapping over items in the list: break using
% the type-specific breaking function |#1|.
@@ -903,20 +1102,43 @@
\cs_new_protected:Npn \@@_too_long_error:NNw #1#2 \fi:
{
\fi:
- \__msg_kernel_error:nnx { sort } { too-large } { \token_to_str:N #2 }
- #1
+ \__msg_kernel_error:nnxxx { sort } { too-large }
+ { \token_to_str:N #2 }
+ { \int_eval:n { \l_@@_true_max_int - \l_@@_min_int } }
+ { \int_eval:n { \l_@@_top_int - \l_@@_min_int } }
+ #1 \@@_error:
}
\__msg_kernel_new:nnnn { sort } { too-large }
{ The~list~#1~is~too~long~to~be~sorted~by~TeX. }
{
- TeX~has~\int_eval:n { \c_max_register_int + 1 }~registers~available:~
- this~only~allows~to~sorts~with~up~to~\int_use:N \c_@@_max_length_int
- \ items.~All~extra~items~will~be~ignored.
+ TeX~has~#2~toks~registers~still~available:~
+ this~only~allows~to~sort~with~up~to~#3~
+ items.~All~extra~items~will~be~deleted.
}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
+\__msg_kernel_new:nnnn { sort } { return-none }
+ { The~comparison~code~did~not~return. }
+ {
+ When~sorting~a~list,~the~code~to~compare~items~#1~and~#2~
+ did~not~call~
+ \iow_char:N\\sort_ordered: ~nor~
+ \iow_char:N\\sort_reversed: .~
+ Exactly~one~of~these~should~be~called.
+ }
+\__msg_kernel_new:nnnn { sort } { return-two }
+ { The~comparison~code~returned~multiple~times. }
+ {
+ When~sorting~a~list,~the~code~to~compare~items~called~
+ \iow_char:N\\sort_ordered: ~or~
+ \iow_char:N\\sort_reversed: ~multiple~times.~
+ Exactly~one~of~these~should~be~called.
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
%</initex|package>
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.ins b/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.ins
index db6f7f2b5d0..b6165791b96 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.ins
+++ b/Master/texmf-dist/source/latex/l3experimental/l3sort/l3sort.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-File l3sort.ins Copyright (C) 2012 The LaTeX3 Project
+File l3sort.ins Copyright (C) 2012,2106 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
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3experimental bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -21,12 +32,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2012-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3experimental bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx
index e3890c04222..4fc1e4ad543 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3flag.dtx Copyright (C) 2011-2012,2014-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3flag}{Support package l3kernel too old}
@@ -49,7 +36,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3flag.dtx 6760 2016-11-21 20:35:31Z joseph $
+\GetIdInfo$Id: l3flag.dtx 6829 2017-01-28 08:52:51Z joseph $
{L3 Experimental flags}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx
index c70b9f7c558..18b0be30f7e 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3regex.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3regex}{Support package l3kernel too old}
@@ -49,7 +36,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3regex.dtx 6760 2016-11-21 20:35:31Z joseph $
+\GetIdInfo$Id: l3regex.dtx 6829 2017-01-28 08:52:51Z joseph $
{L3 Experimental regular expressions}
%</driver|package>
%<*driver>
@@ -3812,7 +3799,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_group_submatches:nNN #1#2#3
{
- \if_int_compare:w #1 > \c_minus_one
+ \if_int_compare:w #1 > - \c_one
\@@_toks_put_left:Nx #2 { \@@_action_submatch:n { #1 < } }
\@@_toks_put_left:Nx #3 { \@@_action_submatch:n { #1 > } }
\fi:
@@ -5578,7 +5565,7 @@
}
\prop_map_inline:Nn \l_@@_success_submatches_prop
{
- \if_int_compare:w ##1 \c_minus_one
+ \if_int_compare:w ##1 - \c_one
\exp_after:wN \@@_extract_e:wn \__int_value:w
\else:
\exp_after:wN \@@_extract_b:wn \__int_value:w
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx
index 2412dead14b..7e43d73d790 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx
@@ -1,41 +1,28 @@
% \iffalse meta-comment
%
%% File: l3str-convert.dtx Copyright (C) 2013-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3str-convert.dtx 6699 2016-09-07 16:03:15Z bruno $
+\GetIdInfo$Id: l3str-convert.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental string encoding conversions}
%</driver|package>
%<*driver>
@@ -1949,14 +1936,14 @@
% step: use the quotient of |#1| by $64$, and |#1| as arguments for
% the looping auxiliary, and output the continuation byte
% corresponding to the remainder $|#2|-64|#1|+128$. The bizarre
-% construction |\c_minus_one + \c_zero *| removes the spurious initial
+% construction |- \c_one + \c_zero *| removes the spurious initial
% continuation byte (better methods welcome).
% \begin{macrocode}
\cs_new_protected:cpn { @@_convert_encode_utf8: }
{ \@@_convert_gmap_internal:N \@@_encode_utf_viii_char:n }
\cs_new:Npn \@@_encode_utf_viii_char:n #1
{
- \@@_encode_utf_viii_loop:wwnnw #1 ; \c_minus_one + \c_zero * ;
+ \@@_encode_utf_viii_loop:wwnnw #1 ; - \c_one + \c_zero * ;
{ 128 } { \c_zero }
{ 32 } { 192 }
{ 16 } { 224 }
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx
index 309c57a0f2e..c8dd27cd1e4 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx
@@ -1,41 +1,28 @@
% \iffalse meta-comment
%
-%% File: l3str-format.dtx Copyright (C) 2012-2013,2015 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3str-format.dtx Copyright (C) 2012-2013,2015,2016 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3str-format.dtx 6589 2016-06-13 11:11:55Z joseph $
+\GetIdInfo$Id: l3str-format.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental string formatting}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins
index e69aafec338..524d98947e3 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-File l3str.ins Copyright (C) 2011, 2013, 2015 The LaTeX3 Project
+File l3str.ins Copyright (C) 2011,2013,2015,2016 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
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3experimental bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -21,12 +32,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2011-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3experimental bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
index 838da42e278..340125f1313 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
@@ -1,41 +1,28 @@
% \iffalse meta-comment
%
%% File: l3tl-analysis.dtx Copyright (C) 2011-2012,2015,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3tl-analysis.dtx 6589 2016-06-13 11:11:55Z joseph $
+\GetIdInfo$Id: l3tl-analysis.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental token lists analysis}
%</driver|package>
%<*driver>
@@ -412,7 +399,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_setup:n #1
{
- \int_set_eq:NN \tex_escapechar:D \c_minus_one
+ \int_set:Nn \tex_escapechar:D { - \c_one }
\exp_after:wN \@@_disable_loop:N
\tl_to_str:n {#1} { ~ } { ? ~ \__prg_break: }
\__prg_break_point:
@@ -520,7 +507,7 @@
\c_one
\else:
\if_catcode:w \exp_not:N \l_@@_token \c_group_end_token
- \c_minus_one
+ - \c_one
\else:
\c_two
\fi:
@@ -670,7 +657,7 @@
= \l_@@_normal_int sp plus \l_@@_type_int sp \scan_stop:
\int_incr:N \l_@@_index_int
\int_zero:N \l_@@_normal_int
- \if_int_compare:w \l_@@_nesting_int = \c_minus_one
+ \if_int_compare:w \l_@@_nesting_int = - \c_one
\cs_set_eq:NN \@@_a_loop:w \scan_stop:
\fi:
}
@@ -815,7 +802,7 @@
\exp_not:n { \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: }
\exp_not:N \__int_value:w `#1 \s__tl
\exp_not:N \exp_after:wN \exp_not:N \@@_b_normals:ww
- \exp_not:N \__int_value:w \exp_not:N \__int_eval:w \c_minus_one +
+ \exp_not:N \__int_value:w \exp_not:N \__int_eval:w - \c_one +
}
% \end{macrocode}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx
index 5dbea913085..7b566c75df3 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3tl-build.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3tl-build}{Support package l3kernel too old}
@@ -49,7 +36,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3tl-build.dtx 6760 2016-11-21 20:35:31Z joseph $
+\GetIdInfo$Id: l3tl-build.dtx 6829 2017-01-28 08:52:51Z joseph $
{L3 Experimental token list construction}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
index 8efec4fc252..116912675d2 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
-%% File: xcoffins.dtx Copyright(C) 2010-2012,2014 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%% File: xcoffins.dtx Copyright(C) 2010-2012,2014,2016,2017 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
\RequirePackage{xparse}
-\GetIdInfo$Id: xcoffins.dtx 4728 2014-05-04 13:25:37Z joseph $
+\GetIdInfo$Id: xcoffins.dtx 6833 2017-01-28 20:01:31Z joseph $
{L3 Experimental design-level coffins}
%</driver|package>
%<*driver>
@@ -715,20 +701,20 @@
% \begin{macrocode}
\keys_define:nn { coffin }
{
- coffin1-hpole .tl_set:N = \l_@@_A_hpole_tl ,
- coffin1-hpole .value_required: ,
- coffin1-vpole .tl_set:N = \l_@@_A_vpole_tl ,
- coffin1-vpole .value_required: ,
- coffin2-hpole .tl_set:N = \l_@@_B_hpole_tl ,
- coffin2-hpole .value_required: ,
- coffin2-vpole .tl_set:N = \l_@@_B_vpole_tl ,
- coffin2-vpole .value_required: ,
- grow-bounding-box .bool_set:N = \l_@@_bound_box_grow_bool ,
- grow-bounding-box .default:n = true ,
- hoffset .dim_set:N = \l_@@_hoffset_dim ,
- hoffset .value_required: ,
- voffset .dim_set:N = \l_@@_voffset_dim ,
- voffset .value_required:
+ coffin1-hpole .tl_set:N = \l_@@_A_hpole_tl ,
+ coffin1-hpole .value_required:n = true ,
+ coffin1-vpole .tl_set:N = \l_@@_A_vpole_tl ,
+ coffin1-vpole .value_required:n = true ,
+ coffin2-hpole .tl_set:N = \l_@@_B_hpole_tl ,
+ coffin2-hpole .value_required:n = true ,
+ coffin2-vpole .tl_set:N = \l_@@_B_vpole_tl ,
+ coffin2-vpole .value_required:n = true ,
+ grow-bounding-box .bool_set:N = \l_@@_bound_box_grow_bool ,
+ grow-bounding-box .default:n = true ,
+ hoffset .dim_set:N = \l_@@_hoffset_dim ,
+ hoffset .value_required:n = true ,
+ voffset .dim_set:N = \l_@@_voffset_dim ,
+ voffset .value_required:n = true
}
\keys_set:nn { coffin }
{
diff --git a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.ins b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.ins
index f4289cf66fc..c3791a3ebd6 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.ins
+++ b/Master/texmf-dist/source/latex/l3experimental/xcoffins/xcoffins.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-File xcoffins.ins Copyright (C) 2010,2011 The LaTeX3 Project
+File xcoffins.ins Copyright (C) 2010,2011,2016 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
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3experimental bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -21,12 +32,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2010-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3experimental bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
index e96b5b65cdd..ae956e6e333 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
@@ -2,44 +2,30 @@
%
%% File: l3galley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
%% (C) 2010-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3galley}{Support package l3kernel too old}
@@ -51,7 +37,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3galley.dtx 6760 2016-11-21 20:35:31Z joseph $
+\GetIdInfo$Id: l3galley.dtx 6829 2017-01-28 08:52:51Z joseph $
{L3 Experimental galley code}
%</driver|package>
%<*driver>
@@ -1949,11 +1935,8 @@
{
\seq_gset_eq:Nc \g_@@_tmpa_seq { g_@@_cutout_ #1 _seq }
\seq_gset_eq:Nc \g_@@_tmpb_seq { l_@@_parshape_ #1 _indent_seq }
- \tl_set:Nx \l_@@_tmp_tl
- {
- \seq_item:Nn \g_@@_tmpb_seq
- { \seq_count:N \g_@@_tmpb_seq }
- }
+ \seq_get_right:NNF \g_@@_tmpb_seq \l_@@_tmp_tl
+ { \tl_clear:N \l_@@_tmp_tl }
\tl_if_empty:NT \l_@@_tmp_tl
{ \tl_set:Nn \l_@@_tmp_tl { 0pt } }
\int_set:Nn \l_@@_tmp_int
@@ -1978,8 +1961,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_parshape_set_cutouts:N #1
{
- \tl_set:Nx \l_@@_tmp_tl
- { \seq_item:Nn #1 { \seq_count:N #1 } }
+ \seq_get_right:NNF #1 \l_@@_tmp_tl
+ { \tl_clear:N \l_@@_tmp_tl }
\tl_if_empty:NT \l_@@_tmp_tl
{ \tl_set:Nn \l_@@_tmp_tl { 0pt } }
\prg_replicate:nn { \int_abs:n \l_@@_tmp_int }
@@ -2540,7 +2523,7 @@
{
\mode_if_vertical:T
{
- \int_compare:nNnT \@dbltopnum = \c_minus_one
+ \int_compare:nNnT \@dbltopnum = { - \c_one }
{
\dim_compare:nNnT \tex_pagetotal:D < \topskip
{ \tex_hbox:D { } }
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
index 23d50b46d5f..d86baef3497 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
@@ -1,43 +1,29 @@
% \iffalse
%
%% File: xgalley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2012,2014 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3experimental bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%% (C) 2010-2012,2014,2106 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3experimental bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
\RequirePackage{xparse}
-\GetIdInfo$Id: xgalley.dtx 5375 2014-08-25 10:17:29Z joseph $
+\GetIdInfo$Id: xgalley.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental galley}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.ins b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.ins
index d29df2ffb2f..1d10cd47277 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.ins
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-File xgalley.ins Copyright (C) 2010-2012 The LaTeX3 Project
+File xgalley.ins Copyright (C) 2010-2012,2016 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
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3experimental bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -21,12 +32,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2010-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3experimental bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
index 0c1b6727074..5a2661885c0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: expl3.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|generic|package>
\def\ExplFileName{expl3}%
\def\ExplFileDescription{L3 programming layer}%
-\def\ExplFileDate{2016/11/21}%
-\def\ExplFileVersion{6760}%
+\def\ExplFileDate{2017/01/28}%
+\def\ExplFileVersion{6834}%
%</driver|generic|package>
%<*driver>
\documentclass[full]{l3doc}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins
index a60eb19398c..c86f611940c 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3.ins
+++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3kernel bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -22,12 +33,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 1990-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3kernel bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
index 16009950b33..8d783bd018f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx
@@ -1,41 +1,28 @@
% \iffalse meta-comment
%
-%% File: l3alloc.dtx Copyright (C) 1990-2012,2014,2015 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3alloc.dtx Copyright (C) 1990-2012,2014-2016 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3alloc.dtx 5952 2015-09-08 16:10:05Z joseph $
+\GetIdInfo$Id: l3alloc.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Register allocation}
\begin{document}
\DocInput{\jobname.dtx}
@@ -185,12 +172,12 @@
% makes sense to collect most of them together here.
% \begin{macrocode}
\cs_if_exist:NTF \luatex_luatexversion:D
- { \@@_new:nnnN { box } \c_zero \c_max_register_int \tex_chardef:D }
- { \@@_new:nnnN { box } \c_zero \c_max_register_int \tex_mathchardef:D }
-\@@_new:nnnN { dim } \c_zero \c_max_register_int \tex_dimendef:D
-\@@_new:nnnN { int } { 11 } \c_max_register_int \tex_countdef:D
-\@@_new:nnnN { muskip } \c_zero \c_max_register_int \tex_muskipdef:D
-\@@_new:nnnN { skip } \c_zero \c_max_register_int \tex_skipdef:D
+ { \@@_new:nnnN { box } { 0 } \c_max_register_int \tex_chardef:D }
+ { \@@_new:nnnN { box } { 0 } \c_max_register_int \tex_mathchardef:D }
+\@@_new:nnnN { dim } { 0 } \c_max_register_int \tex_dimendef:D
+\@@_new:nnnN { int } { 10 } \c_max_register_int \tex_countdef:D
+\@@_new:nnnN { muskip } { 0 } \c_max_register_int \tex_muskipdef:D
+\@@_new:nnnN { skip } { 0 } \c_max_register_int \tex_skipdef:D
% \end{macrocode}
% \end{macro}
%
@@ -254,14 +241,14 @@
\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 { g__ #1 _allocation_tl } + 1 }
=
{ \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
+ + 1
}
}
}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
index 84e6a2c9086..6337bf9c86f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3basics.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3basics.dtx 6696 2016-09-01 16:09:52Z bruno $
+\GetIdInfo$Id: l3basics.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Basic definitions}
%</driver|package>
%<*driver>
@@ -558,7 +545,7 @@
% \cs_gset_nopar:Nx, \cs_gset_nopar:cx
% }
% \begin{syntax}
-% \cs{cs_git cogset_nopar:Nn} \meta{function} \Arg{code}
+% \cs{cs_gset_nopar:Nn} \meta{function} \Arg{code}
% \end{syntax}
% Sets \meta{function} to expand to \meta{code} as replacement text.
% Within the \meta{code}, the number of \meta{parameters} is detected
@@ -1435,26 +1422,15 @@
%
% \subsection{Defining some constants}
%
-% \begin{variable}{\c_minus_one, \c_zero, \c_sixteen}
-% We need the constants \cs{c_minus_one} and \cs{c_sixteen} now for
-% writing information to the log and the terminal and \cs{c_zero}
-% which is used by some functions in the \textsf{l3alloc} module. The
-% rest are defined in the \textsf{l3int} module -- at least for the
-% ones that can be defined with \cs{tex_chardef:D} or
-% \cs{tex_mathchardef:D}. For other constants the \textsf{l3int} module is
-% required but it can't be used until the allocation has been set
-% up properly! The actual allocation mechanism is in
-% \pkg{l3alloc}, and works such that the first available count register
-% is $10$.
+% \begin{variable}{\c_zero}
+% We need the constant \cs{c_zero}
+% which is used by some functions in the \textsf{l3alloc} module. The
+% rest are defined in the \textsf{l3int} module -- at least for the
+% ones that can be defined with \cs{tex_chardef:D} or
+% \cs{tex_mathchardef:D}. For other constants the \textsf{l3int} module is
+% required but it can't be used until the allocation has been set
+% up properly!
% \begin{macrocode}
-%<*package>
-\tex_let:D \c_minus_one \m@ne
-%</package>
-%<*initex>
-\tex_countdef:D \c_minus_one = 10 ~
-\c_minus_one = -1 ~
-%</initex>
-\tex_chardef:D \c_sixteen = 16 ~
\tex_chardef:D \c_zero = 0 ~
% \end{macrocode}
% \end{variable}
@@ -2293,9 +2269,9 @@
% These will be redefined later by \pkg{l3io}.
% \begin{macrocode}
\cs_set_protected:Npn \iow_log:x
- { \tex_immediate:D \tex_write:D \c_minus_one }
+ { \tex_immediate:D \tex_write:D -1 }
\cs_set_protected:Npn \iow_term:x
- { \tex_immediate:D \tex_write:D \c_sixteen }
+ { \tex_immediate:D \tex_write:D 16 }
% \end{macrocode}
% \end{macro}
%
@@ -2692,7 +2668,7 @@
\if_meaning:w \c_true_bool #3
\tl_count:n {#2}
\else:
- \c_minus_one
+ -1
\fi:
}
\cs_new:Npn \__cs_count_signature:c
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
index 903202b7da2..0d9512296ff 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx
@@ -1,37 +1,24 @@
% \iffalse meta-comment
%
%% File: l3bootstrap.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% \begin{macro}{\GetIdInfo}
@@ -145,7 +132,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
-\GetIdInfo$Id: l3bootstrap.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3bootstrap.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Bootstrap code}%
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index 8bca5327b64..239228d0917 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3box.dtx Copyright (C) 2005-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3box.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3box.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental boxes}
%</driver|package>
%<*driver>
@@ -976,7 +963,7 @@
\int_set:Nn \tex_showboxbreadth:D {#3}
\int_set:Nn \tex_showboxdepth:D {#4}
\int_set_eq:NN \tex_tracingonline:D #1
- \int_set_eq:NN \tex_errorcontextlines:D \c_minus_one
+ \int_set:Nn \tex_errorcontextlines:D { - \c_one }
\box_if_exist:NTF #2
{ \tex_showbox:D \use:n {#2} }
{
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
index d3ef2708afc..62a21ee09ea 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
@@ -1,44 +1,30 @@
% \iffalse meta-comment
%
%% File: l3candidates.dtx Copyright (C) 2012-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3candidates.dtx 6688 2016-08-19 19:21:48Z bruno $
+\GetIdInfo$Id: l3candidates.dtx 6809 2017-01-01 06:33:13Z bruno $
{L3 Experimental additions to l3kernel}
%</driver|package>
%<*driver>
@@ -317,6 +303,23 @@
% \cs{clist_show:n} which displays the result in the terminal.
% \end{function}
%
+% \begin{function}[EXP, added = 2016-12-06]
+% {\clist_rand_item:N, \clist_rand_item:n, \clist_rand_item:c}
+% \begin{syntax}
+% \cs{clist_rand_item:N} \meta{clist~var}
+% \cs{clist_rand_item:n} \Arg{comma list}
+% \end{syntax}
+% Selects a pseudo-random item of the \meta{comma list}. If the
+% \meta{comma list} has no item, the result is empty. This is only
+% available in \pdfTeX{} and \LuaTeX{}.
+% \begin{texnote}
+% The result is returned within the \tn{unexpanded}
+% primitive (\cs{exp_not:n}), which means that the \meta{item}
+% will not expand further when appearing in an \texttt{x}-type
+% argument expansion.
+% \end{texnote}
+% \end{function}
+%
% \section{Additions to \pkg{l3coffins}}
%
% \begin{function}{\coffin_resize:Nnn, \coffin_resize:cnn}
@@ -495,6 +498,15 @@
% in the log file.
% \end{function}
%
+% \begin{function}[EXP, added = 2016-12-06]{\int_rand:nn}
+% \begin{syntax}
+% \cs{int_rand:nn} \Arg{intexpr_1} \Arg{intexpr_2}
+% \end{syntax}
+% Evaluates the two \meta{integer expressions} and produces a
+% pseudo-random number between the two (with bounds included). This
+% is only available in \pdfTeX{} and \LuaTeX{}.
+% \end{function}
+%
% \section{Additions to \pkg{l3keys}}
%
% \begin{function}[added = 2014-08-22]{\keys_log:nn}
@@ -673,6 +685,51 @@
% Writes the entries in the \meta{property list} in the log file.
% \end{function}
%
+% \begin{function}[EXP, added = 2016-12-06]
+% {\prop_rand_key:N, \prop_rand_key:c}
+% \begin{syntax}
+% \cs{prop_rand_key:N} \meta{prop~var}
+% \end{syntax}
+% Selects a pseudo-random key--value pair in the \meta{property list}
+% and returns the \meta{key}. If the \meta{property list} is empty
+% the result is empty. This is only available in \pdfTeX{} and
+% \LuaTeX{}.
+% \end{function}
+%
+% \begin{function}[EXP, added = 2016-12-06]
+% {\prop_rand_value:N, \prop_rand_value:c}
+% \begin{syntax}
+% \cs{prop_rand_value:N} \meta{prop~var}
+% \end{syntax}
+% Selects a pseudo-random key--value pair in the \meta{property list}
+% and returns the \meta{value}. If the \meta{property list} is empty
+% the result is empty. This is only available in \pdfTeX{} and
+% \LuaTeX{}.
+% \begin{texnote}
+% The result is returned within the \tn{unexpanded}
+% primitive (\cs{exp_not:n}), which means that the \meta{value}
+% will not expand further when appearing in an \texttt{x}-type
+% argument expansion.
+% \end{texnote}
+% \end{function}
+%
+% \begin{function}[EXP, added = 2016-12-06]
+% {\prop_rand_key_value:N, \prop_rand_key_value:c}
+% \begin{syntax}
+% \cs{prop_rand_key_value:N} \meta{prop~var}
+% \end{syntax}
+% Selects a pseudo-random key--value pair in the \meta{property list}
+% and returns \Arg{key}\Arg{value}. If the \meta{property list} is
+% empty the result is empty. This is only available in \pdfTeX{} and
+% \LuaTeX{}.
+% \begin{texnote}
+% The result is returned within the \tn{unexpanded}
+% primitive (\cs{exp_not:n}), which means that the \meta{value}
+% will not expand further when appearing in an \texttt{x}-type
+% argument expansion.
+% \end{texnote}
+% \end{function}
+%
% \section{Additions to \pkg{l3seq}}
%
% \begin{function}[rEXP]
@@ -733,6 +790,21 @@
% Writes the entries in the \meta{sequence} in the log file.
% \end{function}
%
+% \begin{function}[EXP, added = 2016-12-06]{\seq_rand_item:N, \seq_rand_item:c}
+% \begin{syntax}
+% \cs{seq_rand_item:N} \meta{seq~var}
+% \end{syntax}
+% Selects a pseudo-random item of the \meta{sequence}. If the
+% \meta{sequence} is empty the result is empty. This is only
+% available in \pdfTeX{} and \LuaTeX{}.
+% \begin{texnote}
+% The result is returned within the \tn{unexpanded}
+% primitive (\cs{exp_not:n}), which means that the \meta{item}
+% will not expand further when appearing in an \texttt{x}-type
+% argument expansion.
+% \end{texnote}
+% \end{function}
+%
% \section{Additions to \pkg{l3skip}}
%
% \begin{function}{\skip_split_finite_else_action:nnNN}
@@ -1069,12 +1141,29 @@
%
% \begin{function}[added = 2014-08-22]{\tl_log:n}
% \begin{syntax}
-% \cs{tl_log:n} \meta{token list}
+% \cs{tl_log:n} \Arg{token list}
% \end{syntax}
% Writes the \meta{token list} in the log file. See also
% \cs{tl_show:n} which displays the result in the terminal.
% \end{function}
%
+% \begin{function}[EXP, added = 2016-12-06]
+% {\tl_rand_item:N, \tl_rand_item:c, \tl_rand_item:n}
+% \begin{syntax}
+% \cs{tl_rand_item:N} \meta{tl~var}
+% \cs{tl_rand_item:n} \Arg{token list}
+% \end{syntax}
+% Selects a pseudo-random item of the \meta{token list}. If the
+% \meta{token list} is blank, the result is empty. This is only
+% available in \pdfTeX{} and \LuaTeX{}.
+% \begin{texnote}
+% The result is returned within the \tn{unexpanded}
+% primitive (\cs{exp_not:n}), which means that the \meta{item}
+% will not expand further when appearing in an \texttt{x}-type
+% argument expansion.
+% \end{texnote}
+% \end{function}
+%
% \section{Additions to \pkg{l3tokens}}
%
% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:}
@@ -1799,6 +1888,33 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\clist_rand_item:n, \clist_rand_item:N, \clist_rand_item:c}
+% \begin{macro}[aux]{\@@_rand_item:nn}
+% The |N|-type function is not implemented through the |n|-type
+% function for efficiency: for instance comma-list variables do not
+% require space-trimming of their items. Even testing for emptyness
+% of an |n|-type comma-list is slow, so we count items first and use
+% that both for the emptyness test and the pseudo-random integer.
+% Importantly, \cs{clist_item:Nn} and \cs{clist_item:nn} only evaluate
+% their argument once.
+% \begin{macrocode}
+\cs_new:Npn \clist_rand_item:n #1
+ { \exp_args:Nf \@@_rand_item:nn { \clist_count:n {#1} } {#1} }
+\cs_new:Npn \@@_rand_item:nn #1#2
+ {
+ \int_compare:nNnF {#1} = \c_zero
+ { \clist_item:nn {#2} { \int_rand:nn { 1 } {#1} } }
+ }
+\cs_new:Npn \clist_rand_item:N #1
+ {
+ \clist_if_empty:NF #1
+ { \clist_item:Nn #1 { \int_rand:nn { 1 } { \clist_count:N #1 } } }
+ }
+\cs_generate_variant:Nn \clist_rand_item:N { c }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Additions to \pkg{l3coffins}}
%
% \begin{macrocode}
@@ -2338,7 +2454,7 @@
\cs_new_protected:Npn \ior_map_inline:Nn
{ \@@_map_inline:NNn \ior_get:NN }
\cs_new_protected:Npn \ior_str_map_inline:Nn
- { \@@_map_inline:NNn \ior_get_str:NN }
+ { \@@_map_inline:NNn \ior_str_get:NN }
\cs_new_protected:Npn \@@_map_inline:NNn
{
\int_gincr:N \g__prg_map_int
@@ -2408,6 +2524,10 @@
%
% \subsection{Additions to \pkg{l3int}}
%
+% \begin{macrocode}
+%<@@=int>
+% \end{macrocode}
+%
% \begin{macro}{\int_log:N, \int_log:c}
% Redirect output of \cs{int_show:N} to the log. This is not just a
% copy of \cs{__kernel_register_log:N} because of subtleties
@@ -2428,6 +2548,89 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[EXP]{\int_rand:nn}
+% \begin{macro}[aux, EXP]
+% {
+% \@@_rand:ww, \@@_rand_narrow:n,
+% \@@_rand_narrow:nnn, \@@_rand_narrow:nnnn
+% }
+% Evaluate the argument and filter out the case where the lower
+% bound~|#1| is more than the upper bound~|#2|. Then determine
+% whether the range is narrower than \cs{c__fp_rand_size_int}; |#2-#1|
+% may overflow for very large positive~|#2| and negative~|#1|. If the
+% range is wide, use slower code from \pkg{l3fp}. If the range is
+% narrow, call \cs{@@_rand_narrow:nn} \Arg{choices} |{#1}| where
+% \meta{choices} is the number of possible outcomes. Then
+% \cs{@@_rand_narrow:nnnn} receives a random number reduced modulo
+% \meta{choices}, the random number itself, \meta{choices} and |#1|.
+% To avoid bias, throw away the random number if it lies in the last,
+% incomplete, interval of size \meta{choices} in
+% $[0,\cs{c__fp_rand_size_int}-1]$, and try again.
+% \begin{macrocode}
+\cs_if_exist:NTF \pdftex_uniformdeviate:D
+ {
+ \cs_new:Npn \int_rand:nn #1#2
+ {
+ \exp_after:wN \@@_rand:ww
+ \__int_value:w \__int_eval:w #1 \exp_after:wN ;
+ \__int_value:w \__int_eval:w #2 ;
+ }
+ \cs_new:Npn \@@_rand:ww #1; #2;
+ {
+ \int_compare:nNnTF {#1} > {#2}
+ {
+ \__msg_kernel_expandable_error:nnnn
+ { kernel } { backward-range } {#1} {#2}
+ \@@_rand:ww #2; #1;
+ }
+ {
+ \int_compare:nNnTF {#1} > \c_zero
+ { \int_compare:nNnTF { #2 - #1 } < \c__fp_rand_size_int }
+ { \int_compare:nNnTF {#2} < { #1 + \c__fp_rand_size_int } }
+ {
+ \exp_args:Nf \@@_rand_narrow:nn
+ { \int_eval:n { #2 - #1 + \c_one } } {#1}
+ }
+ { \fp_to_int:n { randint(#1,#2) } }
+ }
+ }
+ \cs_new:Npn \@@_rand_narrow:nn
+ {
+ \exp_args:No \@@_rand_narrow:nnn
+ { \pdftex_uniformdeviate:D \c__fp_rand_size_int }
+ }
+ \cs_new:Npn \@@_rand_narrow:nnn #1#2
+ {
+ \exp_args:Nf \@@_rand_narrow:nnnn
+ { \int_mod:nn {#1} {#2} } {#1} {#2}
+ }
+ \cs_new:Npn \@@_rand_narrow:nnnn #1#2#3#4
+ {
+ \int_compare:nNnTF { #2 - #1 + #3 } > \c__fp_rand_size_int
+ { \@@_rand_narrow:nn {#3} {#4} }
+ { \int_eval:n { #4 + #1 } }
+ }
+ }
+ {
+ \cs_new:Npn \int_rand:nn #1#2
+ {
+ \__msg_kernel_expandable_error:nn { kernel } { fp-no-random }
+ \int_eval:n {#1}
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The following must be added to \pkg{l3msg}.
+% \begin{macrocode}
+\cs_if_exist:NT \pdftex_uniformdeviate:D
+ {
+ \__msg_kernel_new:nnn { kernel } { backward-range }
+ { Bounds~ordered~backwards~in~\int_rand:nn {#1}~{#2}. }
+ }
+% \end{macrocode}
+%
% \subsection{Additions to \pkg{l3keys}}
%
% \begin{macrocode}
@@ -2638,6 +2841,47 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[EXP]
+% {
+% \prop_rand_key:N, \prop_rand_key:c,
+% \prop_rand_value:N, \prop_rand_value:c,
+% \prop_rand_key_value:N, \prop_rand_key_value:c
+% }
+% \begin{macro}[aux, EXP]{\@@_rand:NN, \@@_rand_item:Nw}
+% Contrarily to |clist|, |seq| and |tl|, there is no function to get
+% an item of a |prop| given an integer between $1$ and the number of
+% items, so we write the appropriate code. There is no bounds
+% checking because \cs{int_rand:nn} is always within bounds. At the
+% end, leave either the key |#3| or the value |#4| in the input
+% stream.
+% \begin{macrocode}
+\cs_new:Npn \prop_rand_key:N { \@@_rand:NN \use_i:nnn }
+\cs_new:Npn \prop_rand_value:N { \@@_rand:NN \use_none:n }
+\cs_new:Npn \prop_rand_key_value:N { \@@_rand:NN \@@_rand:nNn }
+\cs_new:Npn \@@_rand:nNn #1#2#3 { \exp_not:n { {#1} {#3} } }
+\cs_new:Npn \@@_rand:NN #1#2
+ {
+ \prop_if_empty:NTF #2 { }
+ {
+ \exp_after:wN \@@_rand_item:Nw \exp_after:wN #1
+ \__int_value:w \int_rand:nn { 1 } { \prop_count:N #2 } #2
+ \q_stop
+ }
+ }
+\cs_new:Npn \@@_rand_item:Nw #1#2 \s_@@ \@@_pair:wn #3 \s_@@ #4
+ {
+ \int_compare:nNnF {#2} > \c_one
+ { \use_i_delimit_by_q_stop:nw { #1 {#3} \exp_not:n {#4} } }
+ \exp_after:wN \@@_rand_item:Nw \exp_after:wN #1
+ \__int_value:w \int_eval:n { #2 - \c_one } \s_@@
+ }
+\cs_generate_variant:Nn \prop_rand_key:N { c }
+\cs_generate_variant:Nn \prop_rand_value:N { c }
+\cs_generate_variant:Nn \prop_rand_key_value:N { c }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \subsection{Additions to \pkg{l3seq}}
%
% \begin{macrocode}
@@ -2745,6 +2989,18 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\seq_rand_item:N, \seq_rand_item:c}
+% Importantly, \cs{seq_item:Nn} only evaluates its argument once.
+% \begin{macrocode}
+\cs_new:Npn \seq_rand_item:N #1
+ {
+ \seq_if_empty:NF #1
+ { \seq_item:Nn #1 { \int_rand:nn { 1 } { \seq_count:N #1 } } }
+ }
+\cs_generate_variant:Nn \seq_rand_item:N { c }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Additions to \pkg{l3skip}}
%
% \begin{macrocode}
@@ -2937,7 +3193,7 @@
}
}
\exp_args:Nno \use:nn
- { \cs_set_protected:Npn \@@_from_file_do:w #1 }
+ { \cs_new_protected:Npn \@@_from_file_do:w #1 }
{ \c_@@_rescan_marker_tl }
{ \tl_set:No \l_@@_internal_a_tl {#1} }
% \end{macrocode}
@@ -4442,6 +4698,19 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tl_rand_item:n, \tl_rand_item:N, \tl_rand_item:c}
+% Importantly \cs{tl_item:nn} only evaluates its argument once.
+% \begin{macrocode}
+\cs_new:Npn \tl_rand_item:n #1
+ {
+ \tl_if_blank:nF {#1}
+ { \tl_item:nn {#1} { \int_rand:nn { 1 } { \tl_count:n {#1} } } }
+ }
+\cs_new:Npn \tl_rand_item:N { \exp_args:No \tl_rand_item:n }
+\cs_generate_variant:Nn \tl_rand_item:N { c }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Additions to \pkg{l3tokens}}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
index b9987de422b..b7364894e39 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3clist.dtx
@@ -3,43 +3,30 @@
%% File: l3clist.dtx Copyright (C) 2004-2011 Frank Mittelbach,
%% The LaTeX3 project
%% (C) 2012-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3clist.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3clist.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Comma separated lists}
%</driver|package>
%<*driver>
@@ -1720,7 +1707,7 @@
% \subsection{Using a single item}
%
% \begin{macro}{\clist_item:Nn, \clist_item:cn}
-% \begin{macro}[aux]{\@@_item:nnNn}
+% \begin{macro}[aux]{\@@_item:nnnN, \@@_item:ffoN, \@@_item:ffnN}
% \begin{macro}[aux]{\@@_item_N_loop:nw}
% To avoid needing to test the end of the list at each step,
% we first compute the \meta{length} of the list. If the item number
@@ -1732,27 +1719,28 @@
% \begin{macrocode}
\cs_new:Npn \clist_item:Nn #1#2
{
- \exp_args:Nfo \@@_item:nnNn
+ \@@_item:ffoN
{ \clist_count:N #1 }
+ { \int_eval:n {#2} }
#1
\@@_item_N_loop:nw
- {#2}
}
-\cs_new:Npn \@@_item:nnNn #1#2#3#4
+\cs_new:Npn \@@_item:nnnN #1#2#3#4
{
- \int_compare:nNnTF {#4} < \c_zero
+ \int_compare:nNnTF {#2} < \c_zero
{
- \int_compare:nNnTF {#4} < { - #1 }
+ \int_compare:nNnTF {#2} < { - #1 }
{ \use_none_delimit_by_q_stop:w }
- { \exp_args:Nf #3 { \int_eval:n { #4 + \c_one + #1 } } }
+ { \exp_args:Nf #4 { \int_eval:n { #2 + \c_one + #1 } } }
}
{
- \int_compare:nNnTF {#4} > {#1}
+ \int_compare:nNnTF {#2} > {#1}
{ \use_none_delimit_by_q_stop:w }
- { #3 {#4} }
+ { #4 {#2} }
}
- { } , #2 , \q_stop
+ { } , #3 , \q_stop
}
+\cs_generate_variant:Nn \@@_item:nnnN { ffo, ff }
\cs_new:Npn \@@_item_N_loop:nw #1 #2,
{
\int_compare:nNnTF {#1} = \c_zero
@@ -1778,11 +1766,11 @@
% \begin{macrocode}
\cs_new:Npn \clist_item:nn #1#2
{
- \exp_args:Nf \@@_item:nnNn
+ \@@_item:ffnN
{ \clist_count:n {#1} }
+ { \int_eval:n {#2} }
{#1}
\@@_item_n:nw
- {#2}
}
\cs_new:Npn \@@_item_n:nw #1
{ \@@_item_n_loop:nw {#1} \prg_do_nothing: }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
index 6a19c51d7ee..848eeefaa71 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx
@@ -1,44 +1,30 @@
% \iffalse meta-comment
%
%% File: l3coffins.dtx Copyright(C) 2010-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3coffins.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3coffins.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Coffin code layer}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
index 731789745b2..4512d174154 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3color.dtx
@@ -1,44 +1,30 @@
% \iffalse meta-comment
%
%% File: l3color.dtx Copyright(C) 2011,2012,2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3color.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3color.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental color support}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index c4638af4fc2..fc4319207fb 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -1,37 +1,24 @@
% \iffalse meta-comment
%
%% File: l3doc.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\def\nameofplainTeX{plain}
@@ -75,7 +62,7 @@ Do not distribute a modified version of this file.
%
%<*driver|class>
\RequirePackage{expl3,xparse,calc}
-\GetIdInfo$Id: l3doc.dtx 6701 2016-09-08 13:56:52Z qinglee $
+\GetIdInfo$Id: l3doc.dtx 6809 2017-01-01 06:33:13Z bruno $
{L3 Experimental documentation class}
%</driver|class>
%
@@ -3715,8 +3702,8 @@ Do not distribute a modified version of this file.
\use:x
{
\@@_special_index_module:nnnnN
- { \quotechar #1 }
- { \quotechar \bslash \quotechar #1 }
+ {#1}
+ { \bslash #1 }
{ }
{ }
\c_false_bool
@@ -3758,6 +3745,7 @@ Do not distribute a modified version of this file.
% a construct such as |\meta{...}|.
% \begin{macrocode}
\tl_new:N \l_@@_index_escaped_macro_tl
+\tl_new:N \l_@@_index_escaped_key_tl
\cs_new_protected:Npn \@@_special_index_module:nnnnN #1#2#3#4#5
{
\use:x
@@ -3783,6 +3771,8 @@ Do not distribute a modified version of this file.
\cs_generate_variant:Nn \@@_special_index_module:nnnnN { ooo }
\cs_new_protected:Npn \@@_special_index_aux:nnnnnn #1#2#3#4#5#6
{
+ \tl_set:Nn \l_@@_index_escaped_key_tl {#1}
+ \@@_quote_special_char:N \l_@@_index_escaped_key_tl
\@@_special_index_set:Nn \l_@@_index_escaped_macro_tl {#2}
\str_if_eq:onTF { \@currenvir } { macrocode }
{ \codeline@wrindex }
@@ -3797,7 +3787,7 @@ Do not distribute a modified version of this file.
{
\tl_if_empty:nF { #3 #4 #5 }
{ #3 #5 \actualchar #4 #5 \levelchar }
- #1
+ \l_@@_index_escaped_key_tl
\actualchar
{
\token_to_str:N \verbatim@font \c_space_tl
@@ -3812,23 +3802,24 @@ Do not distribute a modified version of this file.
\tl_set:Nx #1 { \tl_to_str:n {#2} }
\@@_if_almost_str:nTF {#2}
{
+ \tl_replace_all:Non #1 { \tl_to_str:n { __ } }
+ {
+ \verbatimchar
+ \token_to_str:N \_ \token_to_str:N \_
+ \token_to_str:N \verb * \verbatimchar
+ }
\exp_args:Nx \tl_map_inline:nn
{ \tl_to_str:N \verbatimchar \token_to_str:N _ }
{
\tl_replace_all:Nnn #1 {##1}
{
\verbatimchar \c_@@_backslash_tl ##1
- \token_to_str:N \verb \quotechar * \verbatimchar
+ \token_to_str:N \verb * \verbatimchar
}
}
- \tl_map_inline:nn { \actualchar \encapchar \levelchar }
- {
- \tl_replace_all:Nxn #1
- { \tl_to_str:N ##1 } { \quotechar \tl_to_str:N ##1 }
- }
\tl_set:Nx #1
{
- \token_to_str:N \verb \quotechar * \verbatimchar
+ \token_to_str:N \verb * \verbatimchar
#1 \verbatimchar
}
}
@@ -3838,6 +3829,21 @@ Do not distribute a modified version of this file.
{ \c_@@_backslash_tl }
{ \token_to_str:N \bslash \c_space_tl }
}
+ \@@_quote_special_char:N #1
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\@@_quote_special_char:N}
+% Quote some special characters.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_quote_special_char:N #1
+ {
+ \tl_map_inline:nn { \quotechar \actualchar \encapchar \levelchar }
+ {
+ \tl_replace_all:Nxn #1
+ { \tl_to_str:N ##1 } { \quotechar \tl_to_str:N ##1 }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -3895,7 +3901,7 @@ Do not distribute a modified version of this file.
% the first occurence of |#1|. Helper that removes any leading
% underscore from \cs{l_@@_index_key_tl}.
% \begin{macrocode}
-\cs_set:Npn \@@_key_trim_module:n #1
+\cs_new_protected:Npn \@@_key_trim_module:n #1
{
\cs_set:Npn \@@_tmpa:w ##1 #1 ##2 \q_stop
{ \exp_not:n {##1} }
@@ -4322,7 +4328,6 @@ page_precedence "rnaA"
%
% \begin{macro}
% {
-% \c_minus_one,
% \c_zero,
% \c_one,
% \c_two,
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
index fd300d5ee45..14626c67e4f 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3docstrip.dtx
@@ -1,38 +1,24 @@
% \iffalse
%
-%% File l3dosctrip.dtx Copyright (C) 2012 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%% File l3dosctrip.dtx Copyright (C) 2012,2016 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|program>
\def\ExplFileDate{2012/06/08}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx
index fc30245ded9..20e53271c95 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3drivers.dtx
@@ -1,44 +1,30 @@
% \iffalse meta-comment
%
%% File: l3drivers.dtx Copyright(C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $
+\GetIdInfo$Id: l3drivers.dtx 6809 2017-01-01 06:33:13Z bruno $
{L3 Experimental drivers}
%</driver|package>
%<*driver>
@@ -90,7 +76,7 @@
% The code here is all very low-level, and should not in general be used
% outside of the kernel. It is also important to note that many of the
% functions here are closely tied to the immediate level \enquote{up},
-% and they must be used in the correct contexts.d
+% and they must be used in the correct contexts.
%
% \section{Box clipping}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
index ba6f3b4eb7a..2b15d471d7b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3expan.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3expan.dtx 6684 2016-08-19 15:21:49Z bruno $
+\GetIdInfo$Id: l3expan.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Argument expansion}
%</driver|package>
%<*driver>
@@ -158,7 +145,7 @@
% control sequence} is protected or if the \meta{variant} involves
% |x|~arguments, then the \meta{variant control sequence} will also be
% protected. The \meta{variant} is created globally, as is any
-% \cs{exp_args:N\meta{variant}} function needed to carry out the
+% \cs[no-index]{exp_args:N\meta{variant}} function needed to carry out the
% expansion.
% \end{function}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
index aca87c16595..fee42ad5736 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3file.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3file.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3file.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 File and I/O operations}
%</driver|package>
%<*driver>
@@ -278,9 +265,9 @@
% \end{texnote}
% \end{function}
%
-% \begin{function}[added = 2012-06-24, updated = 2012-07-31]{\ior_get_str:NN}
+% \begin{function}[added = 2016-12-04]{\ior_str_get:NN}
% \begin{syntax}
-% \cs{ior_get_str:NN} \meta{stream} \meta{token list variable}
+% \cs{ior_str_get:NN} \meta{stream} \meta{token list variable}
% \end{syntax}
% Function that reads one line from the input \meta{stream} and stores
% the result locally in the \meta{token list} variable. If the
@@ -302,7 +289,7 @@
% This protected macro is a wrapper around the \eTeX{} primitive
% \tn{readline}. However, the end-line character normally added by
% this primitive is not included in the result of
-% \cs{ior_get_str:NN}.
+% \cs{ior_str_get:NN}.
% \end{texnote}
% \end{function}
%
@@ -690,7 +677,10 @@
{
\group_begin:
\seq_map_inline:Nn \l_char_active_seq
- { \char_set:active:Npx ##1 { \cs_to_str:N ##1 } }
+ {
+ \tl_set:Nx \l_@@_internal_tl { \iow_char:N ##1 }
+ \char_set_active_eq:NN ##1 \l_@@_internal_tl
+ }
\tl_set:Nx \l_@@_internal_name_tl {#1}
\tl_set:Nx \l_@@_internal_name_tl
{ \tl_to_str:N \l_@@_internal_name_tl }
@@ -803,7 +793,7 @@
%
% \begin{macro}{\file_input:n}
% \begin{macro}[int]{\@@_if_exist:nT}
-% \begin{macro}[aux]{\@@_input:n \@@_input:V}
+% \begin{macro}[aux]{\@@_input:n, \@@_input:V}
% \begin{macro}[aux]{\@@_input_aux:n, \@@_input_aux:o}
% Loading a file is done in a safe way, checking first that the file
% exists and loading only if it does. Push the file name on the
@@ -1110,7 +1100,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \ior_close:N #1
{
- \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
+ \int_compare:nT { - \c_one < #1 < \c_sixteen }
{
\tex_closein:D #1
\prop_gremove:NV \g_@@_streams_prop #1
@@ -1186,15 +1176,15 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\ior_get_str:NN}
+% \begin{macro}{\ior_str_get:NN}
% Reading as strings is a more complicated wrapper, as we wish to
% remove the endline character.
% \begin{macrocode}
-\cs_new_protected:Npn \ior_get_str:NN #1#2
+\cs_new_protected:Npn \ior_str_get:NN #1#2
{
\use:x
{
- \int_set_eq:NN \tex_endlinechar:D \c_minus_one
+ \int_set:Nn \tex_endlinechar:D { - \c_one }
\exp_not:n { \etex_readline:D #1 to #2 }
\int_set:Nn \tex_endlinechar:D { \int_use:N \tex_endlinechar:D }
}
@@ -1349,13 +1339,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \iow_close:N #1
{
- \int_compare:nT { \c_minus_one < #1 < \c_sixteen }
+ \int_compare:nT { - \c_one < #1 < \c_sixteen }
{
\tex_immediate:D \tex_closeout:D #1
\prop_gremove:NV \g_@@_streams_prop #1
\seq_if_in:NVF \g_@@_streams_seq #1
{ \seq_gpush:NV \g_@@_streams_seq #1 }
- \cs_gset_eq:NN #1 \c_term_ior
+ \cs_gset_eq:NN #1 \c_term_iow
}
}
\cs_generate_variant:Nn \iow_close:N { c }
@@ -1572,7 +1562,7 @@
% nicer.
% \begin{macrocode}
\group_begin:
- \int_set_eq:NN \tex_escapechar:D \c_minus_one
+ \int_set:Nn \tex_escapechar:D { - \c_one }
\tl_const:Nx \c_@@_wrap_marker_tl
{ \tl_to_str:n { \^^I \^^O \^^W \^^_ \^^W \^^R \^^A \^^P } }
\group_end:
@@ -1638,7 +1628,7 @@
\cs_new_protected:Npn \iow_wrap:nnnN #1#2#3#4
{
\group_begin:
- \int_set_eq:NN \tex_escapechar:D \c_minus_one
+ \int_set:Nn \tex_escapechar:D { - \c_one }
\cs_set:Npx \{ { \token_to_str:N \{ }
\cs_set:Npx \# { \token_to_str:N \# }
\cs_set:Npx \} { \token_to_str:N \} }
@@ -1892,6 +1882,15 @@
{ Only~\iow_wrap:nnnN~(arg~1)~allows~\iow_indent:n }
% \end{macrocode}
%
+% \subsection{Deprecated functions}
+%
+% \begin{macro}[added = 2012-06-24, updated = 2012-07-31, deprecated=2017-12-31]{\ior_get_str:NN}
+% For removal after 2017-12-31.
+% \begin{macrocode}
+\cs_new_eq:NN \ior_get_str:NN \ior_str_get:NN
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
index c5217673bb7..40b9cbe27df 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3final.dtx
@@ -1,41 +1,28 @@
% \iffalse meta-comment
%
%% File: l3final.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3final.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3final.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental format finalisation}
\begin{document}
\DocInput{\jobname.dtx}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3format.ins b/Master/texmf-dist/source/latex/l3kernel/l3format.ins
index 1e38ca555f3..0a4822eb012 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3format.ins
+++ b/Master/texmf-dist/source/latex/l3kernel/l3format.ins
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3kernel bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -22,12 +33,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 1990-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3kernel bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
index 265613f9025..d696a2ba2e5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-assign.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
-%%
+%
%% File: l3fp-assign.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-assign.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3fp-assign.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point assignments}
\begin{document}
\DocInput{\jobname.dtx}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
index 519a63fd6d9..382bfb3ecc3 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-aux.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-aux.dtx Copyright(C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-aux.dtx 6750 2016-11-21 01:24:26Z bruno $
+\GetIdInfo$Id: l3fp-aux.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point support functions}
\documentclass[full]{l3doc}
\begin{document}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
index 81fa321e1b2..8bdb1f07152 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-basics.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-basics.dtx Copyright (C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-basics.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3fp-basics.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point arithmetic}
\begin{document}
\DocInput{\jobname.dtx}
@@ -215,7 +201,7 @@
\if_int_compare:w #2 > #4 \exp_stop_f:
\c_three
\else:
- \c_minus_one
+ \c_four
\fi:
\fi:
\exp_after:wN \@@_add_zeros_o:Nww \__int_value:w
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
index 0a300cd1341..728085952a1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-convert.dtx Copyright(C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-convert.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3fp-convert.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point conversion}
\begin{document}
\DocInput{\jobname.dtx}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
index 05da6150eb4..5f9a05d834b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-expo.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-expo.dtx Copyright (C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-expo.dtx 6441 2016-03-24 10:11:59Z joseph $
+\GetIdInfo$Id: l3fp-expo.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point exponential-related functions}
\begin{document}
\DocInput{\jobname.dtx}
@@ -1208,12 +1194,12 @@
% \meta{digits} |;| which would be the digits surrounding the decimal
% period. If the \meta{digits} are non-zero, the number is not an
% integer. Otherwise, check the parity of the \meta{digit} and return
-% \cs{c_zero} or \cs{c_minus_one}.
+% \cs{c_zero} or |-|\cs{c_one}.
% \begin{macrocode}
\cs_new:Npn \@@_pow_neg_case:w \s_@@ \@@_chk:w #1#2#3;
{
\if_case:w #1 \exp_stop_f:
- \c_minus_one
+ -\c_one
\or: \@@_pow_neg_case_aux:nnnnn #3
\else: \c_one
\fi:
@@ -1222,7 +1208,7 @@
{
\if_int_compare:w #1 > \c_eight
\if_int_compare:w #1 > \c_sixteen
- \c_minus_one
+ -\c_one
\else:
\exp_after:wN \exp_after:wN
\exp_after:wN \@@_pow_neg_case_aux:NNNNNNNNw
@@ -1248,7 +1234,7 @@
\if_int_odd:w #8 \exp_stop_f:
\c_zero
\else:
- \c_minus_one
+ -\c_one
\fi:
\else:
\c_one
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
index 6900fcc0ba2..1e8fe4b7cb5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-extended.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-extended.dtx Copyright (C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-extended.dtx 6684 2016-08-19 15:21:49Z bruno $
+\GetIdInfo$Id: l3fp-extended.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-points with extended precision}
\begin{document}
\DocInput{\jobname.dtx}
@@ -290,7 +276,7 @@
{
\exp_after:wN \@@_fixed_div_int_after:Nw
\exp_after:wN #8
- \__int_value:w \__int_eval:w \c_minus_one
+ \__int_value:w \__int_eval:w - \c_one
\@@_fixed_div_int:wnN
#1; {#7} \@@_fixed_div_int_auxi:wnn
#2; {#7} \@@_fixed_div_int_auxi:wnn
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
index 68282396cce..fa1b7538c83 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-logic.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-logic.dtx Copyright (C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-logic.dtx 6759 2016-11-21 17:04:08Z joseph $
+\GetIdInfo$Id: l3fp-logic.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point conditionals}
\begin{document}
\DocInput{\jobname.dtx}
@@ -318,56 +304,72 @@
%
% \begin{macro}[EXP]{\fp_step_function:nnnN, \fp_step_function:nnnc}
% \begin{macro}[EXP, aux]{\@@_step:wwwN}
-% \begin{macro}[EXP, aux]{\@@_step:NnnnN, \@@_step:NfnnN}
-% The approach here is much the same as \cs{int_step_function:nnnN} except we
-% do not have a convenient low-level way to evaluation each argument to give
-% a pure number. Instead, the internal parser is used to leave values in the
-% internal format (and avoid a more expensive \texttt{f}-type expansion of
-% multiple uses of \texttt{fp_eval:n}).
+% \begin{macro}[EXP, aux]{\@@_step:NnnnnN, \@@_step:NfnnnN}
+% The approach here is somewhat similar to
+% \cs{int_step_function:nnnN}. There are two subtleties: we use the
+% internal parser \cs{@@_parse:n} to avoid converting back and forth
+% from the internal representation; and (due to rounding) even a
+% non-zero step does not guarantee that the loop counter will
+% increase.
% \begin{macrocode}
\cs_new:Npn \fp_step_function:nnnN #1#2#3
{
\exp_after:wN \@@_step:wwwN
- \exp:w \exp_end_continue_f:w \@@_parse_o:n {#1} :
- \exp:w \exp_end_continue_f:w \@@_parse_o:n {#2} :
- \exp:w \exp_end_continue_f:w \@@_parse:n {#3} :
+ \exp:w \exp_end_continue_f:w \@@_parse_o:n {#1}
+ \exp:w \exp_end_continue_f:w \@@_parse_o:n {#2}
+ \exp:w \exp_end_continue_f:w \@@_parse:n {#3}
}
\cs_generate_variant:Nn \fp_step_function:nnnN { nnnc }
-% \end{macrocode}
-% Here, |#1| will be passed to the output on the first pass of the loop.
-% To avoid this being in internal form, an \texttt{f}-type expansion is used
-% here on that value only. The second and third arguments will be converted
-% during the loop itself.
+% \end{macrocode}
+% Only \enquote{normal} floating points (not $\pm 0$,
+% $\pm\texttt{inf}$, \texttt{nan}) can be used as step; if positive,
+% call \cs{@@_step:NnnnnN} with argument |>| otherwise~|<|. This
+% function has one more argument than its integer counterpart, namely
+% the previous value, to catch the case where the loop has made no
+% progress. Conversion to decimal is done just before calling the
+% user's function.
% \begin{macrocode}
-\cs_new:Npn \@@_step:wwwN #1 : #2 : #3 : #4
+\cs_new:Npn \@@_step:wwwN #1 ; \s_@@ \@@_chk:w #2#3#4 ; #5; #6
{
- \fp_compare:nNnTF {#2} > 0
- { \@@_step:NfnnN > }
+ \token_if_eq_meaning:NNTF #2 1
+ {
+ \token_if_eq_meaning:NNTF #3 0
+ { \@@_step:NnnnnN > }
+ { \@@_step:NnnnnN < }
+ }
{
- \fp_compare:nNnTF {#2} = 0
+ \token_if_eq_meaning:NNTF #2 0
+ { \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#6} }
{
- \__msg_kernel_expandable_error:nnn { kernel } { zero-step } {#4}
- \use_none:nnnn
+ \@@_error:nnfn { bad-step } { }
+ { \fp_to_tl:n { \s_@@ \@@_chk:w #2#3#4 ; } } {#6}
}
- { \@@_step:NfnnN < }
+ \use_none:nnnnn
}
- { \fp_eval:n {#1} } {#2} {#3} #4
+ { #1 ; } { \c_nan_fp } { \s_@@ \@@_chk:w #2#3#4 ; } { #5 ; } #6
}
-
-\cs_new:Npn \@@_step:NnnnN #1#2#3#4#5
+\cs_new:Npn \@@_step:NnnnnN #1#2#3#4#5#6
{
- \fp_compare:nNnF {#2} #1 {#4}
+ \fp_compare:nNnTF {#2} = {#3}
+ {
+ \@@_error:nffn { tiny-step }
+ { \fp_to_tl:n {#3} } { \fp_to_tl:n {#4} } {#6}
+ }
{
- #5 {#2}
- \@@_step:NfnnN
- #1 { \fp_eval:n { #2 + #3 } } {#3} {#4} #5
+ \fp_compare:nNnF {#2} #1 {#5}
+ {
+ \exp_args:Nf #6 { \@@_to_decimal_dispatch:w #2 }
+ \@@_step:NfnnnN
+ #1 { \@@_parse:n { #2 + #4 } } {#2} {#4} {#5} #6
+ }
}
}
-\cs_generate_variant:Nn \@@_step:NnnnN { Nf }
+\cs_generate_variant:Nn \@@_step:NnnnnN { Nf }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+%
% \begin{macro}{\fp_step_inline:nnnn}
% As for \cs{int_step_inline:nnnn}, create a global function and apply it,
% following up with a break point.
@@ -384,6 +386,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macrocode}
+\__msg_kernel_new:nnn { kernel } { fp-bad-step }
+ { Invalid~step~size~#2~in~step~function~#3. }
+\__msg_kernel_new:nnn { kernel } { fp-tiny-step }
+ { Tiny~step~size~(#1+#2=#1)~in~step~function~#3. }
+% \end{macrocode}
+%
% \subsection{Extrema}
%
% \begin{macro}[int, EXP]{\@@_minmax_o:Nw}
@@ -400,9 +409,9 @@
\cs_new:Npn \@@_minmax_o:Nw #1#2 @
{
\if_meaning:w 0 #1
- \exp_after:wN \@@_minmax_loop:Nww \exp_after:wN \c_one
+ \exp_after:wN \@@_minmax_loop:Nww \exp_after:wN +
\else:
- \exp_after:wN \@@_minmax_loop:Nww \exp_after:wN \c_minus_one
+ \exp_after:wN \@@_minmax_loop:Nww \exp_after:wN -
\fi:
#2
\s_@@ \@@_chk:w 2 #1 \s_@@_exact ;
@@ -412,7 +421,7 @@
% \end{macro}
%
% \begin{macro}[aux, EXP]{\@@_minmax_loop:Nww}
-% The first argument is $-1$ or $1$ to denote the case where the
+% The first argument is $-$ or $+$ to denote the case where the
% currently largest (smallest) number found (first floating point
% argument) should be replaced by the new number (second floating
% point argument). If the new number is \texttt{nan}, keep that as
@@ -436,7 +445,7 @@
\@@_compare_back:ww
\s_@@ \@@_chk:w #4#5;
\s_@@ \@@_chk:w #2#3;
- = #1
+ = #1 \c_one
\@@_minmax_auxii:ww
\else:
\@@_minmax_auxi:ww
@@ -545,7 +554,7 @@
\@@_exp_after_array_f:w #3 \s_@@_stop
\exp_after:wN @
\exp:w
- \@@_parse_operand:Nw \c_two
+ \@@_parse_operand:Nw \c_@@_prec_colon_int
\@@_parse_expand:w
\else:
\__msg_kernel_expandable_error:nnnn
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
index 339595c6d2e..1936b34f888 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-parse.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-parse.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-parse.dtx 6750 2016-11-21 01:24:26Z bruno $
+\GetIdInfo$Id: l3fp-parse.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point expression parsing}
\begin{document}
\DocInput{\jobname.dtx}
@@ -111,20 +97,57 @@
% \begin{itemize}
% \item[16] Function calls with multiple arguments.
% \item[15] Function calls expecting exactly one argument.
-% \item[14] Binary |**| and~|^| (right to left).
+% \item[13/14] Binary |**| and~|^| (right to left).
% \item[12] Unary |+|, |-|, |!| (right to left).
% \item[10] Binary |*|, |/|, and juxtaposition (implicit~|*|).
% \item[9] Binary |+| and~|-|.
% \item[7] Comparisons.
-% \item[5] Logical \texttt{and}, denoted by~|&&|.
-% \item[4] Logical \texttt{or}, denoted by~\verb*+||+.
-% \item[3] Ternary operator |?:|, piece~|?|.
-% \item[2] Ternary operator |?:|, piece~|:|.
-% \item[1] Commas, and parentheses accepting commas.
-% \item[0] Parentheses expecting exactly one argument.
-% \item[-1] Start and end of the expression.
+% \item[6] Logical \texttt{and}, denoted by~|&&|.
+% \item[5] Logical \texttt{or}, denoted by~\verb*+||+.
+% \item[4] Ternary operator |?:|, piece~|?|.
+% \item[3] Ternary operator |?:|, piece~|:|.
+% \item[2] Commas, and parentheses accepting commas.
+% \item[1] Parentheses expecting exactly one argument.
+% \item[0] Start and end of the expression.
% \end{itemize}
%
+% \begin{variable}
+% {
+% \c_@@_prec_funcii_int,
+% \c_@@_prec_func_int,
+% \c_@@_prec_hatii_int,
+% \c_@@_prec_hat_int,
+% \c_@@_prec_not_int,
+% \c_@@_prec_times_int,
+% \c_@@_prec_plus_int,
+% \c_@@_prec_comp_int,
+% \c_@@_prec_and_int,
+% \c_@@_prec_or_int,
+% \c_@@_prec_quest_int,
+% \c_@@_prec_colon_int,
+% \c_@@_prec_comma_int,
+% \c_@@_prec_paren_int,
+% \c_@@_prec_end_int,
+% }
+% \begin{macrocode}
+\int_const:Nn \c_@@_prec_funcii_int { 16 }
+\int_const:Nn \c_@@_prec_func_int { 15 }
+\int_const:Nn \c_@@_prec_hatii_int { 14 }
+\int_const:Nn \c_@@_prec_hat_int { 13 }
+\int_const:Nn \c_@@_prec_not_int { 12 }
+\int_const:Nn \c_@@_prec_times_int { 10 }
+\int_const:Nn \c_@@_prec_plus_int { 9 }
+\int_const:Nn \c_@@_prec_comp_int { 7 }
+\int_const:Nn \c_@@_prec_and_int { 6 }
+\int_const:Nn \c_@@_prec_or_int { 5 }
+\int_const:Nn \c_@@_prec_quest_int { 4 }
+\int_const:Nn \c_@@_prec_colon_int { 3 }
+\int_const:Nn \c_@@_prec_comma_int { 2 }
+\int_const:Nn \c_@@_prec_paren_int { 1 }
+\int_const:Nn \c_@@_prec_end_int { 0 }
+% \end{macrocode}
+% \end{variable}
+%
% \subsubsection{Storing results}
%
% The main question in parsing expressions expandably is to decide where
@@ -215,8 +238,8 @@
% previous binary operator is, or rather, its precedence: we thus rename
% it |\operand:Nw|. Let us describe as an example how the calculation
% |41-2^3*4+5| will be done. Here, we abuse notations: the first
-% argument of |\operand:Nw| should be an integer constant (\cs{c_three},
-% \cs{c_nine}, \ldots{}) equal to the precedence of the given operator,
+% argument of |\operand:Nw| should be an integer constant (\cs{c_@@_prec_plus_int},
+% \ldots{}) equal to the precedence of the given operator,
% not directly the operator itself.
% \begin{itemize}
% \item Clean up~|41| and find~|-|. We call |\operand:Nw|~|-| to find
@@ -1736,7 +1759,7 @@
% \begin{macro}[EXP, aux]{\@@_parse_prefix_-:Nw, \@@_parse_prefix_!:Nw}
% The unary~|-| and boolean not are harder: we parse the operand using
% a precedence equal to the maximum of the previous precedence~|##1|
-% and the precedence \cs{c_twelve} of the unary operator, then call
+% and the precedence \cs{c_@@_prec_not_int} of the unary operator, then call
% the appropriate |\__fp_|\meta{operation}|_o:w| function,
% where the \meta{operation} is |set_sign| or |not|.
% \begin{macrocode}
@@ -1757,8 +1780,8 @@
\@@_parse_expand:w
}
}
-\@@_tmp:w - \c_twelve \@@_set_sign_o:w 2
-\@@_tmp:w ! \c_twelve \@@_not_o:w ?
+\@@_tmp:w - \c_@@_prec_not_int \@@_set_sign_o:w 2
+\@@_tmp:w ! \c_@@_prec_not_int \@@_not_o:w ?
% \end{macrocode}
% \end{macro}
%
@@ -1801,10 +1824,10 @@
\exp_after:wN \@@_parse_lparen_after:NwN
\exp_after:wN #1
\exp:w
- \if_int_compare:w #1 = \c_sixteen
- \@@_parse_operand:Nw \c_one
+ \if_int_compare:w #1 = \c_@@_prec_funcii_int
+ \@@_parse_operand:Nw \c_@@_prec_comma_int
\else:
- \@@_parse_operand:Nw \c_zero
+ \@@_parse_operand:Nw \c_@@_prec_paren_int
\fi:
\@@_parse_expand:w
}
@@ -1827,31 +1850,15 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}[aux, EXP, verb]{\@@_parse_prefix_,:Nw}
% \begin{macro}[aux, EXP]{\@@_parse_prefix_):Nw}
-% The right parenthesis and the comma can appear as unary prefixes
-% when an argument of a multi-argument function is missing (for
-% instance the first and last ones in |max(,1,2,)| or in |rand()|).
-% In single-argument functions (precedence~$0$ rather than~$1$) forbid
-% this.
+% The right parenthesis can appear as unary prefixes when arguments of
+% a multi-argument function end with a comma, or when there is no
+% argument, as in |max(1,2,)| or in |rand()|. In single-argument
+% functions (precedence~$0$ rather than~$1$) forbid this.
% \begin{macrocode}
-\cs_new:cpn { @@_parse_prefix_,:Nw } #1
- {
- \if_int_compare:w #1 = \c_one
- \exp_after:wN \@@_parse_one:Nw
- \exp_after:wN #1
- \else:
- \__msg_kernel_expandable_error:nnn
- { kernel } { fp-missing-number } { , }
- \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w
- \exp_after:wN \@@_parse_infix:NN
- \exp_after:wN #1
- \exp_after:wN ,
- \fi:
- }
\cs_new:cpn { @@_parse_prefix_):Nw } #1
{
- \if_int_compare:w #1 = \c_one
+ \if_int_compare:w #1 = \c_@@_prec_comma_int
\else:
\__msg_kernel_expandable_error:nnn
{ kernel } { fp-missing-number } { ) }
@@ -1861,7 +1868,6 @@
}
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \subsubsection{Constants}
%
@@ -1958,7 +1964,7 @@
\exp_after:wN #2
\cs:w @@_#1_o:w \exp_after:wN \cs_end:
\exp:w
- \@@_parse_operand:Nw \c_fifteen \@@_parse_expand:w
+ \@@_parse_operand:Nw \c_@@_prec_func_int \@@_parse_expand:w
}
\cs_new:Npn \@@_parse_function:NNN #1#2#3
{
@@ -1967,7 +1973,7 @@
\exp_after:wN #2
\exp_after:wN #1
\exp:w
- \@@_parse_operand:Nw \c_sixteen \@@_parse_expand:w
+ \@@_parse_operand:Nw \c_@@_prec_funcii_int \@@_parse_expand:w
}
% \end{macrocode}
% \end{macro}
@@ -2108,7 +2114,7 @@
% Start an \cs{exp:w} expansion so that \cs{@@_parse:n} expands
% in two steps. The \cs{@@_parse_operand:Nw} function will perform
% computations until reaching an operation with precedence
-% \cs{c_minus_one} or less, namely, the end of the expression. The
+% \cs{c_@@_prec_end_int} or less, namely, the end of the expression. The
% marker \cs{s_@@_mark} indicates that the next token is an already
% parsed version of an infix operator, and \cs{@@_parse_infix_end:N}
% has infinitely negative precedence. Finally, clean up a
@@ -2120,7 +2126,7 @@
\exp:w
\exp_after:wN \@@_parse_after:ww
\exp:w
- \@@_parse_operand:Nw \c_minus_one
+ \@@_parse_operand:Nw \c_@@_prec_end_int
\@@_parse_expand:w #1
\s_@@_mark \@@_parse_infix_end:N
\s_@@_stop
@@ -2272,7 +2278,7 @@
\char_set_catcode_letter:N \)
\cs_new:Npn \@@_parse_infix_):N #1
{
- \if_int_compare:w #1 < \c_zero
+ \if_int_compare:w #1 < \c_@@_prec_paren_int
\__msg_kernel_expandable_error:nnn { kernel } { fp-extra } { ) }
\exp_after:wN \@@_parse_infix:NN
\exp_after:wN #1
@@ -2288,37 +2294,53 @@
% \end{macro}
%
% \begin{macro}[aux, verb, EXP]{\__fp_parse_infix_,:N}
+% \begin{macro}[aux, EXP]{\@@_parse_infix_comma:w, \@@_parse_infix_comma_error:w}
+% \begin{macro}[aux, verb, EXP]{\__fp_,_o:ww}
+% \cs{@@_,_o:ww} is a complicated way of replacing any number of
+% floating point arguments by \texttt{nan}.
% \begin{macrocode}
\group_begin:
\char_set_catcode_letter:N \,
\cs_new:Npn \@@_parse_infix_,:N #1
{
- \if_int_compare:w #1 > \c_one
+ \if_int_compare:w #1 > \c_@@_prec_comma_int
\exp_after:wN @
\exp_after:wN \use_none:n
\exp_after:wN \@@_parse_infix_,:N
\else:
- \if_int_compare:w #1 = \c_one
- \exp_after:wN \@@_parse_infix_comma:w
- \exp:w
- \else:
- \exp_after:wN \@@_parse_infix_comma_gobble:w
- \exp:w
+ \if_int_compare:w #1 < \c_@@_prec_comma_int
+ \@@_parse_infix_comma_error:w
\fi:
- \@@_parse_operand:Nw \c_one
+ \exp_after:wN \@@_parse_infix_comma:w
+ \exp:w \@@_parse_operand:Nw \c_@@_prec_comma_int
\exp_after:wN \@@_parse_expand:w
\fi:
}
\cs_new:Npn \@@_parse_infix_comma:w #1 @
{ #1 @ \use_none:n }
- \cs_new:Npn \@@_parse_infix_comma_gobble:w #1 @
+ \cs_new:Npn \@@_parse_infix_comma_error:w #1 \exp:w
{
+ \fi:
\__msg_kernel_expandable_error:nn { kernel } { fp-extra-comma }
- @ \use_none:n
+ \exp_after:wN @
+ \exp_after:wN \@@_parse_apply_binary:NwNwN
+ \exp_after:wN ,
+ \exp:w
+ }
+ \cs_new:Npn \@@_,_o:ww #1
+ {
+ \if_meaning:w \s_@@ #1
+ \exp_after:wN \@@_use_i_until_s:nw
+ \exp_after:wN \@@_,_o:ww
+ \fi:
+ \exp_after:wN \c_nan_fp
+ #1
}
\group_end:
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{Usual infix operators}
%
@@ -2367,13 +2389,13 @@
\fi:
}
}
- \@@_tmp:w \@@_parse_infix_^:N ^ \c_fifteen \c_fourteen
- \@@_tmp:w \@@_parse_infix_/:N / \c_ten \c_ten
- \@@_tmp:w \@@_parse_infix_mul:N * \c_ten \c_ten
- \@@_tmp:w \@@_parse_infix_-:N - \c_nine \c_nine
- \@@_tmp:w \@@_parse_infix_+:N + \c_nine \c_nine
- \@@_tmp:w \@@_parse_infix_and:N & \c_five \c_five
- \@@_tmp:w \@@_parse_infix_or:N | \c_four \c_four
+ \@@_tmp:w \@@_parse_infix_^:N ^ \c_@@_prec_hatii_int \c_@@_prec_hat_int
+ \@@_tmp:w \@@_parse_infix_/:N / \c_@@_prec_times_int \c_@@_prec_times_int
+ \@@_tmp:w \@@_parse_infix_mul:N * \c_@@_prec_times_int \c_@@_prec_times_int
+ \@@_tmp:w \@@_parse_infix_-:N - \c_@@_prec_plus_int \c_@@_prec_plus_int
+ \@@_tmp:w \@@_parse_infix_+:N + \c_@@_prec_plus_int \c_@@_prec_plus_int
+ \@@_tmp:w \@@_parse_infix_and:N & \c_@@_prec_and_int \c_@@_prec_and_int
+ \@@_tmp:w \@@_parse_infix_or:N | \c_@@_prec_or_int \c_@@_prec_or_int
\group_end:
% \end{macrocode}
% \end{macro}
@@ -2403,11 +2425,11 @@
% \begin{macrocode}
\cs_new:Npn \@@_parse_infix_juxtapose:N #1
{
- \if_int_compare:w #1 < \c_ten
+ \if_int_compare:w #1 < \c_@@_prec_times_int
\exp_after:wN @
\exp_after:wN \@@_parse_apply_juxtapose:NwwN
\exp:w
- \@@_parse_operand:Nw \c_ten
+ \@@_parse_operand:Nw \c_@@_prec_times_int
\exp_after:wN \@@_parse_expand:w
\else:
\exp_after:wN @
@@ -2493,11 +2515,11 @@
\char_set_catcode_letter:N \?
\cs_new:Npn \@@_parse_infix_?:N #1
{
- \if_int_compare:w #1 < \c_three
+ \if_int_compare:w #1 < \c_@@_prec_quest_int
\exp_after:wN @
\exp_after:wN \@@_ternary:NwwN
\exp:w
- \@@_parse_operand:Nw \c_three
+ \@@_parse_operand:Nw \c_@@_prec_quest_int
\exp_after:wN \@@_parse_expand:w
\else:
\exp_after:wN @
@@ -2507,13 +2529,13 @@
}
\cs_new:Npn \@@_parse_infix_::N #1
{
- \if_int_compare:w #1 < \c_three
+ \if_int_compare:w #1 < \c_@@_prec_quest_int
\__msg_kernel_expandable_error:nnnn
{ kernel } { fp-missing } { ? } { ~for~?: }
\exp_after:wN @
\exp_after:wN \@@_ternary_auxii:NwwN
\exp:w
- \@@_parse_operand:Nw \c_two
+ \@@_parse_operand:Nw \c_@@_prec_colon_int
\exp_after:wN \@@_parse_expand:w
\else:
\exp_after:wN @
@@ -2574,7 +2596,7 @@
}
\cs_new:Npn \@@_parse_compare:NNNNNNN #1
{
- \if_int_compare:w #1 < \c_seven
+ \if_int_compare:w #1 < \c_@@_prec_comp_int
\exp_after:wN \@@_parse_compare_auxi:NNNNNNN
\exp_after:wN \@@_parse_excl_error:
\else:
@@ -2587,7 +2609,7 @@
{
\if_case:w
\if_catcode:w \scan_stop: \exp_not:N #7
- \c_minus_one
+ \c_four
\else:
\__int_eval:w `#7 - `< \__int_eval_end:
\fi:
@@ -2620,7 +2642,7 @@
\exp_after:wN #3
\exp_after:wN #4
\exp:w
- \@@_parse_operand:Nw \c_seven \@@_parse_expand:w #5
+ \@@_parse_operand:Nw \c_@@_prec_comp_int \@@_parse_expand:w #5
}
\cs_new:Npn \@@_parse_apply_compare:NwNNNNNwN
#1 #2@ #3 #4#5#6#7 #8@ #9
@@ -2677,7 +2699,7 @@
\exp_after:wN \@@_function_apply:nw
\exp_after:wN #1
\exp:w
- \@@_parse_operand:Nw \c_sixteen \@@_parse_expand:w
+ \@@_parse_operand:Nw \c_@@_prec_funcii_int \@@_parse_expand:w
}
% \end{macrocode}
% \end{macro}
@@ -2713,7 +2735,7 @@
\__int_value:w #3 \exp_after:wN ; \exp_after:wN
}
\exp:w
- \@@_parse_operand:Nw \c_sixteen \@@_parse_expand:w
+ \@@_parse_operand:Nw \c_@@_prec_funcii_int \@@_parse_expand:w
}
\cs_new:Npn #2 #4 {#5}
}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
index e2708e193fc..a8e3f199dba 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-random.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-random.dtx Copyright (C) 2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-random.dtx 6750 2016-11-21 01:24:26Z bruno $
+\GetIdInfo$Id: l3fp-random.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point random numbers}
\begin{document}
\DocInput{\jobname.dtx}
@@ -76,49 +62,141 @@
%<@@=fp>
% \end{macrocode}
%
-% \subsection{Random floating point}
+% \subsection{Engine support}
%
-% \begin{macro}[EXP, int]{\@@_rand_o:Nw}
-% \begin{macro}[EXP, aux]{\@@_rand_o:}
-% Check that |random| was called without argument. Random numbers are
-% only available if the engine defines a primitive equivalent to
-% \pdfTeX{}'s \tn{pdfuniformdeviate}. A random floating point number
-% in $[0,1)$, uniformly distributed with equal-spaced steps of
-% $10^{-16}$ is obtained by combining two integers in $[0,10^8-1]$.
+% At present, \XeTeX{}, \pTeX{} and \upTeX{} do not provide random
+% numbers, while \LuaTeX{} and \pdfTeX{} provide the primitive
+% \cs{pdftex_uniformdeviate:D} (\tn{pdfuniformdeviate} in \pdfTeX{} and
+% \tn{uniformdeviate} in \LuaTeX{}). We write the test twice simply in
+% order to write the \texttt{false} branch first.
% \begin{macrocode}
-\cs_new:Npn \@@_rand_o:Nw ? #1 @
+\cs_if_exist:NF \pdftex_uniformdeviate:D
{
- \tl_if_empty:nTF {#1}
- { \@@_rand_o: }
+ \__msg_kernel_new:nnn { kernel } { fp-no-random }
+ { Random~numbers~unavailable }
+ \cs_new:Npn \@@_rand_o:Nw ? #1 @
{
- \__msg_kernel_expandable_error:nnnnn
- { kernel } { fp-num-args } { rand() } { 0 } { 0 }
+ \__msg_kernel_expandable_error:nn { kernel } { fp-no-random }
\exp_after:wN \c_nan_fp
}
+ \cs_new_eq:NN \@@_randint_o:Nw \@@_rand_o:Nw
}
-\cs_if_exist:NTF \pdftex_uniformdeviate:D
+\cs_if_exist:NT \pdftex_uniformdeviate:D
{
- \cs_new:Npn \@@_rand_o:
- {
- \@@_parse_o:n
- {
- .
- \exp_after:wN \use_none:n
- \__int_value:w \__int_eval:w 1 0000 0000 +
- \pdftex_uniformdeviate:D 1 0000 0000 \__int_eval_end:
- \exp_after:wN \use_none:n
- \__int_value:w \__int_eval:w 1 0000 0000 +
- \pdftex_uniformdeviate:D 1 0000 0000 \__int_eval_end:
- }
- }
+% \end{macrocode}
+%
+% \begin{macro}[EXP, int]{\@@_rand_uniform:}
+% \begin{variable}
+% {
+% \c_@@_rand_size_int,
+% \c_@@_rand_four_int,
+% \c_@@_rand_eight_int,
+% }
+% The \cs{pdftex_uniformdeviate:D} primitive gives a pseudo-random
+% integer in a range $[0,n-1]$ of the user's choice. This number is
+% meant to be uniformly distributed, but is produced by rescaling a
+% uniform pseudo-random integer in $[0,2^{28}-1]$. For instance,
+% setting~$n$ to (any multiple of) $2^{29}$ gives only even values.
+% Thus it is only safe to call \cs{pdftex_uniformdeviate:D} with
+% argument $2^{28}$. This integer is also used in the implementation
+% of \cs{int_rand:nn}. We will also use variants of this number
+% rounded down to multiples of $10^4$ and $10^8$.
+% \begin{macrocode}
+\cs_new:Npn \@@_rand_uniform:
+ { \pdftex_uniformdeviate:D \c_@@_rand_size_int }
+\int_const:Nn \c_@@_rand_size_int { 268 435 456 }
+\int_const:Nn \c_@@_rand_four_int { 268 430 000 }
+\int_const:Nn \c_@@_rand_eight_int { 200 000 000 }
+% \end{macrocode}
+% \end{variable}
+% \end{macro}
+%
+% \begin{macro}[EXP, int]{\@@_rand_myriads:n}
+% \begin{macro}[EXP, aux]
+% {
+% \@@_rand_myriads_loop:nn,
+% \@@_rand_myriads_get:w,
+% \@@_rand_myriads_last:,
+% \@@_rand_myriads_last:w,
+% }
+% Used as \cs{@@_rand_myriads:n} |{XXX}| with one input character per
+% block of four digit we want. Given a pseudo-random integer from the
+% primitive, we extract $2$ blocks of digits if possible, namely if
+% the integer is less than $2\times 10^8$. If that's not possible,
+% we try to extract $1$~block, which succeeds in the range $[2\times
+% 10^8, 26843\times 10^4)$. For the $5456$ remaining possible values
+% we just throw away the random integer and get a new one. Depending
+% on whether we got $2$, $1$, or~$0$ blocks, remove the same number of
+% characters from the input stream with \cs{use_i:nnn}, \cs{use_i:nn}
+% or nothing.
+% \begin{macrocode}
+\cs_new:Npn \@@_rand_myriads:n #1
+ {
+ \@@_rand_myriads_loop:nn #1
+ { ? \use_i_delimit_by_q_stop:nw \@@_rand_myriads_last: }
+ { ? \use_none_delimit_by_q_stop:w } \q_stop
+ }
+\cs_new:Npn \@@_rand_myriads_loop:nn #1#2
+ {
+ \use_none:n #2
+ \exp_after:wN \@@_rand_myriads_get:w
+ \__int_value:w \@@_rand_uniform: ; {#1}{#2}
+ }
+\cs_new:Npn \@@_rand_myriads_get:w #1 ;
+ {
+ \if_int_compare:w #1 < \c_@@_rand_eight_int
+ \exp_after:wN \use_none:n
+ \__int_value:w \__int_eval:w
+ \c_@@_rand_eight_int + #1 \__int_eval_end:
+ \exp_after:wN \use_i:nnn
+ \else:
+ \if_int_compare:w #1 < \c_@@_rand_four_int
+ \exp_after:wN \use_none:nnnnn
+ \__int_value:w \__int_eval:w
+ \c_@@_rand_four_int + #1 \__int_eval_end:
+ \exp_after:wN \exp_after:wN \exp_after:wN \use_i:nn
+ \fi:
+ \fi:
+ \@@_rand_myriads_loop:nn
+ }
+\cs_new:Npn \@@_rand_myriads_last:
+ {
+ \exp_after:wN \@@_rand_myriads_last:w
+ \__int_value:w \@@_rand_uniform: ;
}
+\cs_new:Npn \@@_rand_myriads_last:w #1 ;
{
- \cs_new:Npn \@@_rand_o:
+ \if_int_compare:w #1 < \c_@@_rand_four_int
+ \exp_after:wN \use_none:nnnnn
+ \__int_value:w \__int_eval:w
+ \c_@@_rand_four_int + #1 \__int_eval_end:
+ \else:
+ \exp_after:wN \@@_rand_myriads_last:
+ \fi:
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Random floating point}
+%
+% \begin{macro}[EXP, int]{\@@_rand_o:Nw}
+% \begin{macro}[EXP, aux]{\@@_rand_o:, \@@_rand_o:w}
+% First we check that |random| was called without argument. Then get
+% four blocks of four digits.
+% \begin{macrocode}
+\cs_new:Npn \@@_rand_o:Nw ? #1 @
+ {
+ \tl_if_empty:nTF {#1}
+ { \@@_rand_o: }
{
- \__msg_kernel_expandable_error:nn { kernel } { fp-no-random }
+ \__msg_kernel_expandable_error:nnnnn
+ { kernel } { fp-num-args } { rand() } { 0 } { 0 }
\exp_after:wN \c_nan_fp
}
}
+\cs_new:Npn \@@_rand_o:
+ { \@@_parse_o:n { . \@@_rand_myriads:n { xxxx } } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -130,29 +208,33 @@
% {
% \@@_randint_badarg:w,
% \@@_randint_e:w,
-% \@@_randint_narrow_e:nn,
-% \@@_randint_wide_e:nn,
-% \@@_randint_wide_e:nnn,
+% \@@_randint_e:wnn,
+% \@@_randint_e:wwNnn,
+% \@@_randint_e:wwwNnn,
+% \@@_randint_narrow_e:nnnn,
% \@@_randint_wide_e:nnnn,
+% \@@_randint_wide_e:wnnn,
% }
% Enforce that there is one argument (then add first argument~$1$)
% or two arguments. Enforce that they are integers in
-% $(-10^{16},10^{16})$ and ordered.
-%
-% When the range is narrow (less than $2\times 10^9$) we can
-% directly use the primitive. Otherwise we use the primitive twice.
-% To ensure a uniform distribution we combine two uniformly
-% distributed integers into a total range greater or equal to our
-% target range and try again if the random number ended up being too
-% big.
-%
-% The strange |+\c_six| ensures that the first argument of
-% \cs{@@_randint_wide_e:nnn} is larger than $10^{-8}$ times the
-% difference between the end-points even if these are near
-% $-10^{16}$ and $+10^{16}$ (their difference is rounded to sixteen
-% digits). Note that we cannot just concatenate the two random
-% numbers provided by the engine as that may give an integer up to
-% (almost) $2\times 10^{16}$ which incurs rounding.
+% $(-10^{16},10^{16})$ and ordered. We distinguish narrow ranges
+% (less than $2^{28}$) from wider ones.
+%
+% For narrow ranges, compute the number~$n$ of possible outputs as
+% an integer using \cs{fp_to_int:n}, and reduce a pseudo-random
+% $28$-bit integer~$r$ modulo~$n$. On its own, this is not uniform
+% when $[0,2^{28}-1]$ does not divide evenly into intervals of
+% size~$n$. The auxiliary \cs{@@_randint_e:wwwNnn} discards the
+% pseudo-random integer if it lies in an incomplete interval, and
+% repeats.
+%
+% For wide ranges we use the same code except for the last eight
+% digits which use \cs{@@_rand_myriads:n}. It is not safe to
+% combine the first digits with the last eight as a single string of
+% digits, as this may exceed $16$~digits and be rounded. Instead,
+% we first add the first few digits (times $10^8$) to the lower
+% bound. The result is compared to the upper bound and the process
+% repeats if needed.
% \begin{macrocode}
\cs_new:Npn \@@_randint_o:Nw ? #1 @
{
@@ -186,73 +268,64 @@
\@@_randint_badarg:w #1;
\@@_randint_badarg:w #2;
\fp_compare:nNnTF { #1; } > { #2; } { \c_one } { \c_zero }
- \fp_compare:nNnTF { #1; + 2e9 } < { #2; }
- { \@@_randint_wide_e:nn }
- { \@@_randint_narrow_e:nn }
- { #1; } { #2; }
+ \exp_after:wN \exp_after:wN \exp_after:wN \@@_randint_e:wnn
+ \@@_parse:n { #2; - #1; } { #1; } { #2; }
\or:
\@@_invalid_operation_tl_o:ff
{ randint } { \@@_array_to_clist:n { #1; #2; } }
\exp:w
\fi:
}
-\cs_if_exist:NTF \pdftex_uniformdeviate:D
+\cs_new:Npn \@@_randint_e:wnn #1;
{
- \cs_new:Npn \@@_randint_narrow_e:nn #1#2
- {
- \@@_parse_o:n
- {
- #1 +
- \pdftex_uniformdeviate:D
- \int_eval:n { \fp_to_int:n { #2 - #1 } + \c_one }
- }
- \exp:w
- }
- \cs_new:Npn \@@_randint_wide_e:nn #1 #2
- {
- \exp_args:Nf \@@_randint_wide_e:nnn
- { \fp_to_int:n { ceil ( ( #2 - #1 + \c_six ) * 1e-8 ) } }
- {#1} {#2}
- }
- \cs_new:Npn \@@_randint_wide_e:nnn #1#2#3
- {
- \exp_args:Nf \@@_randint_wide_e:nnnn
- {
- \@@_parse:n
- {
- #2 +
- \pdftex_uniformdeviate:D #1 e 8 +
- \pdftex_uniformdeviate:D 1 0000 0000
- }
- }
- {#1} {#2} {#3}
- }
- \cs_new:Npn \@@_randint_wide_e:nnnn #1#2#3#4
- {
- \fp_compare:nNnTF {#1} > {#4}
- { \@@_randint_wide_e:nnn {#2} {#3} {#4} }
- { \@@_exp_after_o:w #1 \exp:w }
- }
+ \exp_after:wN \@@_randint_e:wwNnn
+ \__int_value:w \@@_rand_uniform: \exp_after:wN ;
+ \exp:w \exp_end_continue_f:w
+ \fp_compare:nNnTF { #1 ; } < \c_@@_rand_size_int
+ { \fp_to_int:n { #1 ; + 1 } ; \@@_randint_narrow_e:nnnn }
+ { \fp_to_int:n { floor(#1 ; * 1e-8 + 1) } ; \@@_randint_wide_e:nnnn }
}
+\cs_new:Npn \@@_randint_e:wwNnn #1 ; #2 ;
{
- \cs_new:Npn \@@_randint_narrow_e:nn #1#2
+ \exp_after:wN \@@_randint_e:wwwNnn
+ \__int_value:w \int_mod:nn {#1} {#2} ; #1 ; #2 ;
+ }
+\cs_new:Npn \@@_randint_e:wwwNnn #1 ; #2 ; #3 ; #4
+ {
+ \int_compare:nNnTF { #2 - #1 + #3 } > \c_@@_rand_size_int
{
- \__msg_kernel_expandable_error:nn { kernel } { fp-no-random }
- \exp_after:wN \c_nan_fp \exp:w
+ \exp_after:wN \@@_randint_e:wwNnn
+ \__int_value:w \@@_rand_uniform: ; #3 ; #4
}
- \cs_new:Npn \@@_randint_wide_e:nn #1#2
+ { #4 {#1} {#3} }
+ }
+\cs_new:Npn \@@_randint_narrow_e:nnnn #1#2#3#4
+ { \@@_parse_o:n { #3 + #1 } \exp:w }
+\cs_new:Npn \@@_randint_wide_e:nnnn #1#2#3#4
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \@@_randint_wide_e:wnnn
+ \@@_parse:n { #3 + #1e8 + \@@_rand_myriads:n { xx } }
+ {#2} {#3} {#4}
+ }
+\cs_new:Npn \@@_randint_wide_e:wnnn #1 ; #2#3#4
+ {
+ \fp_compare:nNnTF { #1 ; } > {#4}
{
- \__msg_kernel_expandable_error:nn { kernel } { fp-no-random }
- \exp_after:wN \c_nan_fp \exp:w
+ \exp_after:wN \@@_randint_e:wwNnn
+ \__int_value:w \@@_rand_uniform: ; #2 ;
+ \@@_randint_wide_e:nnnn {#3} {#4}
}
+ { \@@_exp_after_o:w #1 ; \exp:w }
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
+% End the initial conditional that ensures these commands are only
+% defined in \pdfTeX{} and \LuaTeX{}.
% \begin{macrocode}
-\__msg_kernel_new:nnn { kernel } { fp-no-random }
- { Random~numbers~unavailable }
+ }
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
index 899c1a3bd6b..9f9e0d0f352 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-round.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-round.dtx Copyright(C) 2011-2012,2014-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-round.dtx 6750 2016-11-21 01:24:26Z bruno $
+\GetIdInfo$Id: l3fp-round.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point rounding}
\begin{document}
\DocInput{\jobname.dtx}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
index d273a3e7cba..e6ce10175fa 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-traps.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
-%%
+%
%% File: l3fp-traps.dtx Copyright (C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-traps.dtx 6596 2016-06-13 21:29:58Z joseph $
+\GetIdInfo$Id: l3fp-traps.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point exception trapping}
\begin{document}
\DocInput{\jobname.dtx}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
index 85d8ce0c05f..e1ab93969d5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-trig.dtx
@@ -1,42 +1,28 @@
% \iffalse meta-comment
%
%% File: l3fp-trig.dtx Copyright (C) 2011-2014,2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
-\GetIdInfo$Id: l3fp-trig.dtx 6723 2016-10-17 16:42:15Z bruno $
+\GetIdInfo$Id: l3fp-trig.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating-point trigonometric functions}
\begin{document}
\DocInput{\jobname.dtx}
@@ -1272,7 +1258,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_atan_Taylor_loop:www #1; #2; #3;
{
- \if_int_compare:w #1 = \c_minus_one
+ \if_int_compare:w #1 = - \c_one
\@@_atan_Taylor_break:w
\fi:
\exp_after:wN \@@_fixed_div_int:wwN \c_@@_one_fixed_tl ; #1;
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
index 2cbbe3e2cb6..ea20f8d1bc8 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3fp.dtx
@@ -1,44 +1,30 @@
% \iffalse meta-comment
%
%% File: l3fp.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3fp.dtx 6761 2016-11-21 21:48:43Z joseph $
+\GetIdInfo$Id: l3fp.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Floating points}
%</driver|package>
%<*driver>
@@ -91,7 +77,6 @@
% \item Boolean logic: negation $\mathop{!}x$, conjunction
% $x\mathop{\&\&}y$, disjunction $x\mathop{\vert\vert}y$, ternary
% operator $x\mathop{?}y\mathop{:}z$.
-% \item Random numbers: $\mathop{rand}()$, $\mathop{randint}(m,n)$.
% \item Exponentials: $\exp x$, $\ln x$, $x^y$.
% \item Trigonometry: $\sin x$, $\cos x$, $\tan x$, $\cot x$, $\sec
% x$, $\csc x$ expecting their arguments in radians, and
@@ -123,6 +108,8 @@
% ties rounded to an even value by default, towards zero if $t=0$,
% towards $+\infty$ if $t>0$ and towards $-\infty$ if $t<0$. And
% \emph{(not yet)} modulo, and \enquote{quantize}.
+% \item Random numbers: $\mathop{rand}()$, $\mathop{randint}(m,n)$ in
+% \pdfTeX{} and \LuaTeX{} engines.
% \item Constants: \texttt{pi}, \texttt{deg} (one degree in radians).
% \item Dimensions, automatically expressed in points, \emph{e.g.},
% \texttt{pc} is~$12$.
@@ -541,8 +528,8 @@
% \texttt{false}.
% \end{function}
%
-% \begin{function}[added = 2016-11-21, rEXP]
-% {\fp_step_function:nnnN}
+% \begin{function}[added = 2016-11-21, updated = 2016-12-06, rEXP]
+% {\fp_step_function:nnnN, \fp_step_function:nnnc}
% \begin{syntax}
% \cs{fp_step_function:nnnN} \Arg{initial value} \Arg{step} \Arg{final value} \meta{function}
% \end{syntax}
@@ -569,9 +556,14 @@
% [I saw 1.4] \quad
% [I saw 1.5] \quad
% \end{quote}
+% \begin{texnote}
+% Due to rounding, it may happen that adding the \meta{step} to the
+% \meta{value} does not change the \meta{value}; such cases give an
+% error, as they would otherwise lead to an infinite loop.
+% \end{texnote}
% \end{function}
%
-% \begin{function}[added = 2016-11-21]
+% \begin{function}[added = 2016-11-21, updated = 2016-12-06]
% {\fp_step_inline:nnnn}
% \begin{syntax}
% \cs{fp_step_inline:nnnn} \Arg{initial value} \Arg{step} \Arg{final value} \Arg{code}
@@ -1180,20 +1172,36 @@
% $\sqrt{\text{\nan{}}}=\text{\nan{}}$.
% \end{function}
%
-% \begin{function}[added = 2016-11-20]{rand}
+% \begin{function}[added = 2016-12-05]{rand}
% \begin{syntax}
% \cs{fp_eval:n} \{ |rand()| \}
% \end{syntax}
% Produces a pseudo-random floating-point number (multiple of
-% $10^{-16}$) between $0$~included and $1$~excluded.
+% $10^{-16}$) between $0$~included and $1$~excluded. Available in
+% \pdfTeX{} and \LuaTeX{} engines only.
% \begin{texnote}
-% This is a wrapper around \tn{pdfuniformdeviate}. The random seed
-% can be queried using \tn{pdfrandomseed} and set using
-% \tn{pdfsetrandomseed}.
+% This is based on pseudo-random numbers provided by the engine's
+% primitive \tn{pdfuniformdeviate} in \pdfTeX{} and
+% \tn{uniformdeviate} in \LuaTeX{}. The underlying code in
+% \pdfTeX{} and \LuaTeX{} is based on Metapost, which follows an
+% additive scheme recommended in Section 3.6 of \enquote{The Art of
+% Computer Programming, Volume~2}.
+%
+% While we are more careful than \tn{uniformdeviate} to preserve
+% uniformity of the underlying stream of $28$-bit pseudo-random
+% integers, these pseudo-random numbers should of course not be
+% relied upon for serious numerical computations nor cryptography.
+%
+% The random seed can be queried using \tn{pdfrandomseed} and set
+% using \tn{pdfsetrandomseed} (in \LuaTeX{} \tn{randomseed} and
+% \tn{setrandomseed}). While a $32$-bit (signed) integer can be
+% given as a seed, only the absolute value is used and any number
+% beyond $2^{28}$ is divided by an appropriate power of~$2$. We
+% recommend using an integer in $[0,2^{28}-1]$.
% \end{texnote}
% \end{function}
%
-% \begin{function}[added = 2016-11-20]{randint}
+% \begin{function}[added = 2016-12-05]{randint}
% \begin{syntax}
% \cs{fp_eval:n} \{ |randint(| \meta{fpexpr} |)| \}
% \cs{fp_eval:n} \{ |randint(| \meta{fpexpr_1} , \meta{fpexpr_2} |)| \}
@@ -1201,12 +1209,8 @@
% Produces a pseudo-random integer between $1$~and \meta{fpexpr} or
% between \meta{fpexpr_1} and \meta{fpexpr_2} inclusive. The bounds
% must be integers in the range $(-10^{16},10^{16})$ and the first
-% must be smaller or equal to the second.
-% \begin{texnote}
-% This is a wrapper around \tn{pdfuniformdeviate}. The random seed
-% can be queried using \tn{pdfrandomseed} and set using
-% \tn{pdfsetrandomseed}.
-% \end{texnote}
+% must be smaller or equal to the second. See \texttt{rand} for
+% important comments on how these pseudo-random numbers are generated.
% \end{function}
%
% \begin{variable}[tested = m3fp-parse001]{inf, nan}
@@ -1297,8 +1301,6 @@
% \item Hyperbolic functions \texttt{cosh}, \texttt{sinh}, \texttt{tanh}.
% \item Inverse hyperbolics.
% \item Base conversion, input such as \texttt{0xAB.CDEF}.
-% \item Random numbers (pgfmath provides |rnd|, |rand|, |random|), with
-% seed reset at every \cs{fp_set:Nn}.
% \item Factorial (not with |!|), gamma function.
% \item Improve coefficients of the \texttt{sin} and \texttt{tan}
% series.
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
index c2e913ef444..cef7ea6897b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3int.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3int.dtx 6700 2016-09-07 22:16:49Z bruno $
+\GetIdInfo$Id: l3int.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Integers}
%</driver|package>
%<*driver>
@@ -1313,7 +1300,7 @@
\cs_new_protected:Npn \int_incr:N #1
{ \tex_advance:D #1 \c_one }
\cs_new_protected:Npn \int_decr:N #1
- { \tex_advance:D #1 \c_minus_one }
+ { \tex_advance:D #1 - \c_one }
\cs_new_protected:Npn \int_gincr:N
{ \tex_global:D \int_incr:N }
\cs_new_protected:Npn \int_gdecr:N
@@ -2372,11 +2359,7 @@
%
% \subsection{Constant integers}
%
-% \begin{variable}{\c_minus_one}
-% This is needed early, and so is in \pkg{l3basics}
-% \end{variable}
-%
-% \begin{variable}{\c_zero, \c_sixteen}
+% \begin{variable}{\c_zero}
% Again, in \pkg{l3basics}
% \end{variable}
%
@@ -2384,7 +2367,7 @@
% {
% \c_one, \c_two, \c_three, \c_four, \c_five, \c_six, \c_seven, \c_eight,
% \c_nine, \c_ten, \c_eleven, \c_twelve, \c_thirteen, \c_fourteen,
-% \c_fifteen
+% \c_fifteen, \c_sixteen
% }
% Low-number values not previously defined.
% \begin{macrocode}
@@ -2403,6 +2386,20 @@
\int_const:Nn \c_thirteen { 13 }
\int_const:Nn \c_fourteen { 14 }
\int_const:Nn \c_fifteen { 15 }
+\int_const:Nn \c_sixteen { 16 }
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{variable}{\c_minus_one}
+% The actual allocation mechanism is in \pkg{l3alloc}; it requires
+% \cs{c_one} to be defined. In package mode, reuse \tn{m@ne}.
+% \begin{macrocode}
+%<*package>
+\cs_new_eq:NN \c_minus_one \m@ne
+%</package>
+%<*initex>
+\int_const:Nn \c_minus_one { -1 }
+%</initex>
% \end{macrocode}
% \end{variable}
%
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
index 0f109a3d695..202cc321018 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
-%% File: l3keys.dtx Copyright (C) 2006-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3keys.dtx Copyright (C) 2006-2017 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3keys.dtx 6711 2016-09-21 07:04:35Z joseph $
+\GetIdInfo$Id: l3keys.dtx 6811 2017-01-01 08:50:54Z joseph $
{L3 Key-value interfaces}
%</driver|package>
%<*driver>
@@ -320,6 +307,26 @@
% described in Section~\ref{sec:l3keys:selective}.
% \end{function}
%
+% \begin{function}[added = 2016-11-22]{.inherit:n}
+% \begin{syntax}
+% \meta{key} .inherit:n = \Arg{parents}
+% \end{syntax}
+% Specifies that the \meta{key} path should inherit the keys listed
+% as \meta{parents}. For example, with setting
+% \begin{verbatim}
+% \keys_define:n { foo } { test .code:n = \tl_show:n {#1} }
+% \keys_define:n { } { bar .inherit:n = foo }
+% \end{verbatim}
+% setting
+% \begin{verbatim}
+% \keys_set:n { bar } { test = a }
+% \end{verbatim}
+% will be equivalent to
+% \begin{verbatim}
+% \keys_set:n { foo } { test = a }
+% \end{verbatim}
+% \end{function}
+%
% \begin{function}[updated = 2013-07-09]
% {.initial:n, .initial:V, .initial:o, .initial:x}
% \begin{syntax}
@@ -1115,8 +1122,9 @@
% {
% \c_@@_code_root_tl ,
% \c_@@_default_root_tl ,
-% \c_@@_groups_root_tl,
-% \c_@@_info_root_tl ,
+% \c_@@_groups_root_tl ,
+% \c_@@_inherit_root_tl ,
+% \c_@@_type_root_tl ,
% \c_@@_validate_root_tl
% }
% Various storage areas for the different data which make up keys.
@@ -1124,7 +1132,8 @@
\tl_const:Nn \c_@@_code_root_tl { key~code~>~ }
\tl_const:Nn \c_@@_default_root_tl { key~default~>~ }
\tl_const:Nn \c_@@_groups_root_tl { key~groups~>~ }
-\tl_const:Nn \c_@@_info_root_tl { key~info~>~ }
+\tl_const:Nn \c_@@_inherit_root_tl { key~inherit~>~ }
+\tl_const:Nn \c_@@_type_root_tl { key~type~>~ }
\tl_const:Nn \c_@@_validate_root_tl { key~validate~>~ }
% \end{macrocode}
% \end{variable}
@@ -1316,7 +1325,12 @@
{
\str_if_eq:nnTF {#3} { . }
{
- \tl_set:Nx \l_keys_path_tl { \l_@@_module_tl / #1 }
+ \tl_set:Nx \l_keys_path_tl
+ {
+ \tl_if_empty:NF \l_@@_module_tl
+ { \l_@@_module_tl / }
+ #1
+ }
\tl_set:Nn \l_@@_property_tl { . #2 }
}
{
@@ -1376,35 +1390,6 @@
%
% \subsection{Turning properties into actions}
%
-% \begin{macro}[int]{\@@_ensure_exist:n, \@@_ensure_exist:V}
-% Used to make sure that a key implementation and the related property
-% list will exist whenever this is required. We cannot use for example
-% \cs{prop_clear_new:c} here as that would affect the order in which key
-% properties must be set. As key definitions are never global we use
-% |\cs_set_protected:cpn| not |\cs_new_protected:cpn| here. For the
-% same reason, to avoid issues if the key has been undefined in the
-% current scope but exists at a higher level, we do not use \cs{prop_new:c}
-% but rather \cs{prop_set_eq:cN}. The function \cs{__chk_log:x} only
-% writes to the log file if logging all new functions is active: without
-% it keys would not show up (as we are not using \cs[no-index]{..._new}).
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_ensure_exist:n #1
- {
- \prop_if_exist:cF { \c_@@_info_root_tl #1 }
- {
- \prop_set_eq:cN { \c_@@_info_root_tl #1 } \c_empty_prop
- }
-
- \cs_if_exist:cF { \c_@@_code_root_tl #1 }
- {
- \__chk_log:x { Defining~key~#1~ \msg_line_context: }
- \cs_set_protected:cpn { \c_@@_code_root_tl #1 } ##1 { }
- }
- }
-\cs_generate_variant:Nn \@@_ensure_exist:n { V }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}[int]{\@@_bool_set:Nn, \@@_bool_set:cn}
% Boolean keys are really just choices, but all done by hand. The
% second argument here is the scope: either empty or \texttt{ g } for
@@ -1452,13 +1437,10 @@
% \end{macro}
%
% \begin{macro}[int]{\@@_choice_make:, \@@_multichoice_make:}
-% \begin{macro}[int]{\@@_choice_make:N}
+% \begin{macro}[aux]{\@@_choice_make:N}
% \begin{macro}[aux]{\@@_choice_make_aux:N}
-% \begin{macro}[aux]{\@@_parent:n, \@@_parent:o}
-% \begin{macro}[aux]{\@@_parent:wn}
% To make a choice from a key, two steps: set the code, and set the
-% unknown key. There is one point to watch here: choice keys cannot be
-% nested! As multichoices and choices are essentially the same bar one
+% unknown key. As multichoices and choices are essentially the same bar one
% function, the code is given together.
% \begin{macrocode}
\cs_new_protected:Npn \@@_choice_make:
@@ -1467,12 +1449,12 @@
{ \@@_choice_make:N \@@_multichoice_find:n }
\cs_new_protected:Npn \@@_choice_make:N #1
{
- \prop_if_exist:cTF
- { \c_@@_info_root_tl \@@_parent:o \l_keys_path_tl }
+ \cs_if_exist:cTF
+ { \c_@@_type_root_tl \@@_parent:o \l_keys_path_tl }
{
- \prop_get:cnNTF
- { \c_@@_info_root_tl \@@_parent:o \l_keys_path_tl }
- { choice } \l_keys_value_tl
+ \str_if_eq_x:nnTF
+ { \exp_not:v { \c_@@_type_root_tl \@@_parent:o \l_keys_path_tl } }
+ { choice }
{
\__msg_kernel_error:nnxx { kernel } { nested-choice-key }
{ \l_keys_path_tl } { \@@_parent:o \l_keys_path_tl }
@@ -1483,32 +1465,18 @@
}
\cs_new_protected:Npn \@@_choice_make_aux:N #1
{
+ \cs_set_nopar:cpn { \c_@@_type_root_tl \l_keys_path_tl } { choice }
\@@_cmd_set:nn { \l_keys_path_tl } { #1 {##1} }
- \prop_put:cnn { \c_@@_info_root_tl \l_keys_path_tl } { choice }
- { true }
\@@_cmd_set:nn { \l_keys_path_tl / unknown }
{
\__msg_kernel_error:nnxx { kernel } { key-choice-unknown }
{ \l_keys_path_tl } {##1}
}
}
-\cs_new:Npn \@@_parent:n #1
- { \@@_parent:wn #1 / / \q_stop { } }
-\cs_generate_variant:Nn \@@_parent:n { o }
-\cs_new:Npn \@@_parent:wn #1 / #2 / #3 \q_stop #4
- {
- \tl_if_blank:nTF {#2}
- { \use_none:n #4 }
- {
- \@@_parent:wn #2 / #3 \q_stop { #4 / #1 }
- }
- }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{macro}[int]{\@@_choices_make:nn, \@@_multichoices_make:nn}
% \begin{macro}[aux]{\@@_choices_make:Nnn}
@@ -1546,7 +1514,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_cmd_set:nn #1#2
{
- \@@_ensure_exist:V \l_keys_path_tl
+ \cs_if_exist:cF { \c_@@_code_root_tl #1 }
+ { \__chk_log:x { Defining~key~#1~\msg_line_context: } }
\cs_set_protected:cpn { \c_@@_code_root_tl #1 } ##1 {#2}
}
\cs_generate_variant:Nn \@@_cmd_set:nn { nx , Vn , Vo }
@@ -1575,27 +1544,39 @@
% \end{macro}
%
% \begin{macro}[int]{\@@_groups_set:n}
-% Assigning a key to one or more groups uses comma lists. So that the comma
-% list is \enquote{well-behaved} later, the storage is done via a stored
-% list here, which does the normalisation.
+% Assigning a key to one or more groups uses comma lists. As the list of
+% groups only exists if there is anything to do, the setting is done using
+% a scratch list. For the usual grouping reasons we use the low-level
+% approach to undefining a list.
% \begin{macrocode}
\cs_new_protected:Npn \@@_groups_set:n #1
{
- \@@_ensure_exist:V \l_keys_path_tl
\clist_set:Nn \l_@@_groups_clist {#1}
\clist_if_empty:NTF \l_@@_groups_clist
{
- \prop_remove:cn { \c_@@_info_root_tl \l_keys_path_tl }
- { groups }
+ \cs_set_eq:cN { \c_@@_groups_root_tl \l_keys_path_tl }
+ \tex_undefined:D
}
{
- \prop_put:cnV { \c_@@_info_root_tl \l_keys_path_tl }
- { groups } \l_@@_groups_clist
+ \clist_set_eq:cN { \c_@@_groups_root_tl \l_keys_path_tl }
+ \l_@@_groups_clist
}
}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[int]{\@@_inherit:n}
+% Inheritance means ignoring anything already said about the key:
+% zap the lot and set up.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_inherit:n #1
+ {
+ \@@_undefine:
+ \cs_set_nopar:cpn { \c_@@_inherit_root_tl \l_keys_path_tl } {#1}
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}[int]{\@@_initialise:n}
% A set up for initialisation: just run the code if it exists.
% \begin{macrocode}
@@ -1631,7 +1612,7 @@
\cs_new_protected:Npn \@@_undefine:
{
\clist_map_inline:nn
- { code , default , groups , info , validate }
+ { code , default , groups , inherit , type , validate }
{
\cs_set_eq:cN
{ \tl_use:c { c_@@_ ##1 _root_tl } \l_keys_path_tl }
@@ -1866,6 +1847,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{.inherit:n}
+% Nothing complex: only one variant at the moment!
+% \begin{macrocode}
+\cs_new_protected:cpn { \c_@@_props_root_tl .inherit:n } #1
+ { \@@_inherit:n {#1} }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{.initial:n, .initial:V, .initial:o, .initial:x}
% The standard hand-off approach.
% \begin{macrocode}
@@ -2143,7 +2132,12 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_aux:nnn #1#2#3
{
- \tl_set:Nx \l_keys_path_tl { #1 / \@@_remove_spaces:n {#2} }
+ \tl_set:Nx \l_keys_path_tl
+ {
+ \tl_if_blank:nF {#1}
+ { #1 / }
+ \@@_remove_spaces:n {#2}
+ }
\tl_clear:N \l_@@_module_tl
\exp_after:wN \@@_find_key_module:w \l_keys_path_tl / \q_stop
\@@_value_or_default:n {#3}
@@ -2174,16 +2168,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_selective:
{
- \prop_if_exist:cTF { \c_@@_info_root_tl \l_keys_path_tl }
+ \cs_if_exist:cTF { \c_@@_groups_root_tl \l_keys_path_tl }
{
- \prop_get:cnNTF { \c_@@_info_root_tl \l_keys_path_tl }
- { groups } \l_@@_groups_clist
- { \@@_check_groups: }
- {
- \bool_if:NTF \l_@@_filtered_bool
- { \@@_execute: }
- { \@@_store_unused: }
- }
+ \clist_set_eq:Nc \l_@@_groups_clist
+ { \c_@@_groups_root_tl \l_keys_path_tl }
+ \@@_check_groups:
}
{
\bool_if:NTF \l_@@_filtered_bool
@@ -2274,23 +2263,41 @@
\bool_if:NTF \l_@@_only_known_bool
{ \@@_store_unused: }
{
- \cs_if_exist:cTF { \c_@@_code_root_tl \l_@@_module_tl / unknown }
+ \cs_if_exist:cTF
+ { \c_@@_inherit_root_tl \@@_parent:o \l_keys_path_tl }
{
- \cs:w \c_@@_code_root_tl \l_@@_module_tl / unknown \exp_after:wN
- \cs_end: \exp_after:wN { \l_keys_value_tl }
+ \clist_map_inline:cn
+ { \c_@@_inherit_root_tl \@@_parent:o \l_keys_path_tl }
+ {
+ \cs_if_exist:cT
+ { \c_@@_code_root_tl ##1 / \l_keys_key_tl }
+ {
+ \cs:w \c_@@_code_root_tl ##1 / \l_keys_key_tl
+ \exp_after:wN \cs_end: \exp_after:wN
+ { \l_keys_value_tl }
+ \clist_map_break:
+ }
+ }
}
{
- \__msg_kernel_error:nnxx { kernel } { key-unknown }
- { \l_keys_path_tl } { \l_@@_module_tl }
+ \cs_if_exist:cTF { \c_@@_code_root_tl \l_@@_module_tl / unknown }
+ {
+ \cs:w \c_@@_code_root_tl \l_@@_module_tl / unknown
+ \exp_after:wN \cs_end: \exp_after:wN { \l_keys_value_tl }
+ }
+ {
+ \__msg_kernel_error:nnxx { kernel } { key-unknown }
+ { \l_keys_path_tl } { \l_@@_module_tl }
+ }
}
- }
+ }
}
\cs_new:Npn \@@_execute:nn #1#2
{
\cs_if_exist:cTF { \c_@@_code_root_tl #1 }
{
- \exp_args:Nc \exp_args:No { \c_@@_code_root_tl #1 }
- \l_keys_value_tl
+ \cs:w \c_@@_code_root_tl #1 \exp_after:wN \cs_end:
+ \exp_after:wN { \l_keys_value_tl }
}
{#2}
}
@@ -2328,6 +2335,25 @@
%
% \subsection{Utilities}
%
+% \begin{macro}[EXP, int]{\@@_parent:n, \@@_parent:o}
+% \begin{macro}[EXP, aux]{\@@_parent:w}
+% Used to strip off the ending part of the key path after the last~|/|.
+% \begin{macrocode}
+\cs_new:Npn \@@_parent:n #1
+ { \@@_parent:w #1 / / \q_stop { } }
+\cs_generate_variant:Nn \@@_parent:n { o }
+\cs_new:Npn \@@_parent:w #1 / #2 / #3 \q_stop #4
+ {
+ \tl_if_blank:nTF {#2}
+ { \use_none:n #4 }
+ {
+ \@@_parent:w #2 / #3 \q_stop { #4 / #1 }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}[EXP, int]{\@@_remove_spaces:n}
% \begin{macro}[EXP, aux]{\@@_remove_spaces:w}
% Removes all spaces from the input which is detokenized as a result.
@@ -2375,7 +2401,7 @@
% \end{macro}
%
% \begin{macro}{\keys_show:nn}
-% \begin{macro}[aux]{\@@_show:NN}
+% \begin{macro}[aux]{\@@_show:N}
% To show a key, test for its existence to issue the correct message
% (same message, but with a |t| or |f| argument, then build the
% control sequences which contain the code and other information
@@ -2389,9 +2415,8 @@
{
\__msg_show_pre:nnxxxx { LaTeX / kernel } { show-key }
{ \@@_remove_spaces:n { #1 / #2 } } { t } { } { }
- \exp_args:Ncc \@@_show:NN
+ \exp_args:Nc \@@_show:N
{ \c_@@_code_root_tl \@@_remove_spaces:n { #1 / #2 } }
- { \c_@@_info_root_tl \@@_remove_spaces:n { #1 / #2 } }
}
{
\__msg_show_pre:nnxxxx { LaTeX / kernel } { show-key }
@@ -2399,7 +2424,7 @@
\__msg_show_wrap:n { }
}
}
-\cs_new_protected:Npn \@@_show:NN #1#2
+\cs_new_protected:Npn \@@_show:N #1
{
\use:x
{
@@ -2407,8 +2432,6 @@
{
\exp_not:N \__msg_show_item_unbraced:nn { code }
{ \token_get_replacement_spec:N #1 }
- \exp_not:n
- { \prop_map_function:NN #2 \__msg_show_item_unbraced:nn }
}
}
}
@@ -2491,20 +2514,6 @@
}
% \end{macrocode}
%
-% \subsection{Deprecated functions}
-%
-% \begin{macro}[deprecated = 2017]{.value_forbidden:}
-% \begin{macro}{.value_required:}
-% Deprecated 2015-07-14.
-% \begin{macrocode}
-\cs_new_protected:cpn { \c_@@_props_root_tl .value_forbidden: }
- { \@@_value_requirement:nn { forbidden } { true } }
-\cs_new_protected:cpn { \c_@@_props_root_tl .value_required: }
- { \@@_value_requirement:nn { required } { true } }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index 4b751fca13a..c37e446ac83 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3luatex.dtx Copyright (C) 2010-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package&tex>
-\GetIdInfo$Id: l3luatex.dtx 6679 2016-08-18 20:54:06Z bruno $
+\GetIdInfo$Id: l3luatex.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental LuaTeX-specific functions}
%</driver|package&tex>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index 0900a2a71b0..f44a405ac15 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3msg.dtx Copyright (C) 2009-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3msg.dtx 6691 2016-08-19 22:14:26Z bruno $
+\GetIdInfo$Id: l3msg.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Messages}
%</driver|package>
%<*driver>
@@ -1074,7 +1061,7 @@
}
\__iow_with:Nnn \tex_newlinechar:D { `\^^J }
{
- \__iow_with:Nnn \tex_errorcontextlines:D \c_minus_one
+ \__iow_with:Nnn \tex_errorcontextlines:D { - \c_one }
{
\group_begin:
\cs_set_protected:Npn &
@@ -1124,7 +1111,7 @@
% deliberate change by a user this is only set in format mode.
% \begin{macrocode}
%<*initex>
-\int_gset_eq:NN \tex_errorcontextlines:D \c_minus_one
+\int_gset:Nn \tex_errorcontextlines:D { - \c_one }
%</initex>
% \end{macrocode}
%
@@ -2256,7 +2243,7 @@
{
\__iow_with:Nnn \tex_newlinechar:D { 10 }
{
- \__iow_with:Nnn \tex_errorcontextlines:D \c_minus_one
+ \__iow_with:Nnn \tex_errorcontextlines:D { - \c_one }
{
\etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
{ \exp_after:wN \l_@@_internal_tl }
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
index 8cb7f99d6c3..3865cbf8ad5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3names.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3names.dtx 6722 2016-10-13 10:22:35Z joseph $
+\GetIdInfo$Id: l3names.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Namespace for primitives}
%</driver|package>
%<*driver>
@@ -86,11 +73,14 @@
% the primitives. These are named based on the engine which first introduced
% them:
% \begin{itemize}
-% \item[\cs{tex_\ldots}] Introduced by \TeX{} itself;
-% \item[\cs{etex_\ldots}] Introduced by the \eTeX{} extensions;
-% \item[\cs{pdftex_\ldots}] Introduced by \pdfTeX{};
-% \item[\cs{xetex_\ldots}] Introduced by \XeTeX{};
-% \item[\cs{luatex_\ldots}] Introduced by \LuaTeX{}.
+% \item[{\cs[no-index]{tex_\ldots}}] Introduced by \TeX{} itself;
+% \item[{\cs[no-index]{etex_\ldots}}] Introduced by the \eTeX{} extensions;
+% \item[{\cs[no-index]{pdftex_\ldots}}] Introduced by \pdfTeX{};
+% \item[{\cs[no-index]{xetex_\ldots}}] Introduced by \XeTeX{};
+% \item[{\cs[no-index]{luatex_\ldots}}] Introduced by \LuaTeX{};
+% \item[{\cs[no-index]{utex_\ldots}}] Introduced by \XeTeX{} and \LuaTeX{};
+% \item[{\cs[no-index]{ptex_\ldots}}] Introduced by p\TeX{};
+% \item[{\cs[no-index]{uptex_\ldots}}] Introduced by up\TeX{}.
% \end{itemize}
%
% \end{documentation}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx
index 1dd7223c214..5fa4071258b 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx
@@ -1,37 +1,24 @@
% \iffalse meta-comment
%
-%% File: l3oldmodules.dtx Copyright (C) 2014 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3oldmodules.dtx Copyright (C) 2014,2016 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|oldmodules>
\def\ExplFileDate{2014/09/06}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
index abe03c06261..320c9d230e7 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
-%% File: l3prg.dtx Copyright (C) 2005-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3prg.dtx Copyright (C) 2005-2017 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3prg.dtx 6679 2016-08-18 20:54:06Z bruno $
+\GetIdInfo$Id: l3prg.dtx 6811 2017-01-01 08:50:54Z joseph $
{L3 Control structures}
%</driver|package>
%<*driver>
@@ -1553,15 +1540,6 @@
% \end{macro}
% \end{macro}
%
-% \subsection{Deprecated functions}
-%
-% \begin{macro}[int]{\scan_align_safe_stop:}
-% Deprecated 2015-08-01 for removal after 2016-12-31.
-% \begin{macrocode}
-\cs_new_protected:Npn \scan_align_safe_stop: { }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
index 5513946feef..cb4deb613d7 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3prop.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3prop.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3prop.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3prop.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Property lists}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
index 7fb44625dd3..2516c123615 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3quark.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
-%% File: l3quark.dtx Copyright (C) 1990-2015 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3quark.dtx Copyright (C) 1990-2016 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3quark.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3quark.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Quarks}
%</driver|package>
%<*driver>
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
index 942b6fcdb35..e9079d80701 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3seq.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3seq.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3seq.dtx 6685 2016-08-19 16:26:52Z bruno $
+\GetIdInfo$Id: l3seq.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Sequences and stacks}
%</driver|package>
%<*driver>
@@ -1684,7 +1671,7 @@
% \end{macro}
%
% \begin{macro}{\seq_item:Nn, \seq_item:cn}
-% \begin{macro}[aux]{\@@_item:wNn, \@@_item:nnn}
+% \begin{macro}[aux]{\@@_item:wNn, \@@_item:nN, \@@_item:nnn}
% The idea here is to find the offset of the item from the left, then use
% a loop to grab the correct item. If the resulting offset is too large,
% then the stop code |{ ? \__prg_break: } { }| will be used by the auxiliary,
@@ -1695,18 +1682,17 @@
\cs_new:Npn \@@_item:wNn \s_@@ #1 \q_stop #2#3
{
\exp_args:Nf \@@_item:nnn
- {
- \int_eval:n
- {
- \int_compare:nNnT {#3} < \c_zero
- { \seq_count:N #2 + \c_one + }
- #3
- }
- }
+ { \exp_args:Nf \@@_item:nN { \int_eval:n {#3} } #2 }
#1
{ ? \__prg_break: } { }
\__prg_break_point:
}
+\cs_new:Npn \@@_item:nN #1#2
+ {
+ \int_compare:nNnTF {#1} < \c_zero
+ { \int_eval:n { \seq_count:N #2 + \c_one + #1 } }
+ {#1}
+ }
\cs_new:Npn \@@_item:nnn #1#2#3
{
\use_none:n #2
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index e22e024ef16..838657d7950 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -2,43 +2,30 @@
%
%% File: l3skip.dtx Copyright (C) 2004-2011 Frank Mittelbach, The LaTeX3 Project
%% (C) 2012-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3skip.dtx 6692 2016-08-19 22:29:47Z bruno $
+\GetIdInfo$Id: l3skip.dtx 6809 2017-01-01 06:33:13Z bruno $
{L3 Dimensions and skips}
%</driver|package>
%<*driver>
@@ -1151,7 +1138,7 @@
}
\cs_new:Npn \@@_abs:N #1
{ \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
-\cs_set:Npn \dim_max:nn #1#2
+\cs_new:Npn \dim_max:nn #1#2
{
\dim_use:N \@@_eval:w \exp_after:wN \@@_maxmin:wwN
\dim_use:N \@@_eval:w #1 \exp_after:wN ;
@@ -1159,7 +1146,7 @@
>
\@@_eval_end:
}
-\cs_set:Npn \dim_min:nn #1#2
+\cs_new:Npn \dim_min:nn #1#2
{
\dim_use:N \@@_eval:w \exp_after:wN \@@_maxmin:wwN
\dim_use:N \@@_eval:w #1 \exp_after:wN ;
@@ -1321,7 +1308,7 @@
% |while_do| and |do_while| functions for dimensions. Same as for the
% |int| type only the names have changed.
% \begin{macrocode}
-\cs_set:Npn \dim_while_do:nn #1#2
+\cs_new:Npn \dim_while_do:nn #1#2
{
\dim_compare:nT {#1}
{
@@ -1329,7 +1316,7 @@
\dim_while_do:nn {#1} {#2}
}
}
-\cs_set:Npn \dim_until_do:nn #1#2
+\cs_new:Npn \dim_until_do:nn #1#2
{
\dim_compare:nF {#1}
{
@@ -1337,13 +1324,13 @@
\dim_until_do:nn {#1} {#2}
}
}
-\cs_set:Npn \dim_do_while:nn #1#2
+\cs_new:Npn \dim_do_while:nn #1#2
{
#2
\dim_compare:nT {#1}
{ \dim_do_while:nn {#1} {#2} }
}
-\cs_set:Npn \dim_do_until:nn #1#2
+\cs_new:Npn \dim_do_until:nn #1#2
{
#2
\dim_compare:nF {#1}
@@ -1362,7 +1349,7 @@
% |while_do| and |do_while| functions for dimensions. Same as for the
% |int| type only the names have changed.
% \begin{macrocode}
-\cs_set:Npn \dim_while_do:nNnn #1#2#3#4
+\cs_new:Npn \dim_while_do:nNnn #1#2#3#4
{
\dim_compare:nNnT {#1} #2 {#3}
{
@@ -1370,7 +1357,7 @@
\dim_while_do:nNnn {#1} #2 {#3} {#4}
}
}
-\cs_set:Npn \dim_until_do:nNnn #1#2#3#4
+\cs_new:Npn \dim_until_do:nNnn #1#2#3#4
{
\dim_compare:nNnF {#1} #2 {#3}
{
@@ -1378,13 +1365,13 @@
\dim_until_do:nNnn {#1} #2 {#3} {#4}
}
}
-\cs_set:Npn \dim_do_while:nNnn #1#2#3#4
+\cs_new:Npn \dim_do_while:nNnn #1#2#3#4
{
#4
\dim_compare:nNnT {#1} #2 {#3}
{ \dim_do_while:nNnn {#1} #2 {#3} {#4} }
}
-\cs_set:Npn \dim_do_until:nNnn #1#2#3#4
+\cs_new:Npn \dim_do_until:nNnn #1#2#3#4
{
#4
\dim_compare:nNnF {#1} #2 {#3}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
index 376bcb729fe..ea75d3e69d1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3str.dtx Copyright (C) 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3str.dtx 6692 2016-08-19 22:29:47Z bruno $
+\GetIdInfo$Id: l3str.dtx 6809 2017-01-01 06:33:13Z bruno $
{L3 Strings}
%</driver|package>
%<*driver>
@@ -1333,13 +1320,13 @@
% \begin{macrocode}
\cs_new:Npn \str_head:N { \exp_args:No \str_head:n }
\cs_generate_variant:Nn \str_head:N { c }
-\cs_set:Npn \str_head:n #1
+\cs_new:Npn \str_head:n #1
{
\exp_after:wN \@@_head:w
\tl_to_str:n {#1}
{ { } } ~ \q_stop
}
-\cs_set:Npn \@@_head:w #1 ~ %
+\cs_new:Npn \@@_head:w #1 ~ %
{ \use_i_delimit_by_q_stop:nw #1 { ~ } }
\cs_new:Npn \str_head_ignore_spaces:n #1
{
@@ -1370,13 +1357,13 @@
% \begin{macrocode}
\cs_new:Npn \str_tail:N { \exp_args:No \str_tail:n }
\cs_generate_variant:Nn \str_tail:N { c }
-\cs_set:Npn \str_tail:n #1
+\cs_new:Npn \str_tail:n #1
{
\exp_after:wN \@@_tail_auxi:w
\reverse_if:N \if_charcode:w
\scan_stop: \tl_to_str:n {#1} X X \q_stop
}
-\cs_set:Npn \@@_tail_auxi:w #1 X #2 \q_stop { \fi: #1 }
+\cs_new:Npn \@@_tail_auxi:w #1 X #2 \q_stop { \fi: #1 }
\cs_new:Npn \str_tail_ignore_spaces:n #1
{
\exp_after:wN \@@_tail_auxii:w
@@ -1472,9 +1459,9 @@
{ \utex_char:D \use:c { __str_lookup_ #1 :N } #2 ~ }
}
}
- \cs_set_protected:Npn \@@_lookup_lower:N #1 { \tex_lccode:D `#1 }
- \cs_set_protected:Npn \@@_lookup_upper:N #1 { \tex_uccode:D `#1 }
- \cs_set_eq:NN \@@_lookup_fold:N \@@_lookup_lower:N
+ \cs_new_protected:Npn \@@_lookup_lower:N #1 { \tex_lccode:D `#1 }
+ \cs_new_protected:Npn \@@_lookup_upper:N #1 { \tex_uccode:D `#1 }
+ \cs_new_eq:NN \@@_lookup_fold:N \@@_lookup_lower:N
}
{
\cs_new:Npn \@@_change_case_char_aux:nN #1#2
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
index 6d2e81b4b03..faca036fc44 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
-%% File: l3sys.dtx Copyright (C) 2015 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX3 Project.
-%%
-%% -----------------------------------------------------------------------
+%% File: l3sys.dtx Copyright (C) 2015-2017 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3sys.dtx 6087 2015-09-25 10:29:53Z joseph $
+\GetIdInfo$Id: l3sys.dtx 6811 2017-01-01 08:50:54Z joseph $
{L3 Experimental system/runtime functions}
%</driver|package>
%<*driver>
@@ -312,39 +299,6 @@
% \end{variable}
% \end{macro}
%
-% \subsection{Deprecated functions}
-%
-% Deprecated 2015-09-07 for removal after 2016-12-31. The older logic supported
-% only three engines so that has to be allowed for.
-% \begin{macrocode}
-\prg_new_eq_conditional:NNn \luatex_if_engine: \sys_if_engine_luatex:
- { T , F , TF , p }
-\prg_new_eq_conditional:NNn \xetex_if_engine: \sys_if_engine_xetex:
- { T , F , TF , p }
-\bool_if:nTF
- {
- \sys_if_engine_luatex_p: ||
- \sys_if_engine_xetex_p:
- }
- {
- \cs_new_eq:NN \pdftex_if_engine:T \use_none:n
- \cs_new_eq:NN \pdftex_if_engine:F \use:n
- \cs_new_eq:NN \pdftex_if_engine:TF \use_ii:nn
- \cs_new_eq:NN \pdftex_if_engine_p: \c_false_bool
- }
- {
- \cs_new_eq:NN \pdftex_if_engine:T \use:n
- \cs_new_eq:NN \pdftex_if_engine:F \use_none:n
- \cs_new_eq:NN \pdftex_if_engine:TF \use_i:nn
- \cs_new_eq:NN \pdftex_if_engine_p: \c_true_bool
- }
-% \end{macrocode}
-%
-% Deprecated 2015-09-19 for removal after 2016-12-31.
-% \begin{macrocode}
-\cs_set_eq:NN \c_job_name_tl \c_sys_jobname_str
-% \end{macrocode}
-%
% \begin{macrocode}
%</initex|package>
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
index d22763484f9..8f1fac513ed 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3tl.dtx Copyright (C) 1990-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3tl.dtx 6692 2016-08-19 22:29:47Z bruno $
+\GetIdInfo$Id: l3tl.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Token lists}
%</driver|package>
%<*driver>
@@ -1457,7 +1444,7 @@
\group_begin:
\exp_args:No \etex_everyeof:D { \c_@@_rescan_marker_tl \exp_not:N }
\int_compare:nNnT \tex_endlinechar:D = { 32 }
- { \tex_endlinechar:D \c_minus_one }
+ { \tex_endlinechar:D - \c_one }
\tex_newlinechar:D \tex_endlinechar:D
#3 \scan_stop:
\exp_args:No \@@_set_rescan:n { \tl_to_str:n {#4} }
@@ -1582,7 +1569,7 @@
}
\cs_new_protected:Npn \@@_set_rescan_single_aux:nn #1#2
{
- \tex_endlinechar:D \c_minus_one
+ \tex_endlinechar:D - \c_one
\use:x
{
\exp_not:N \use:n
@@ -2860,7 +2847,7 @@
% \subsection{Using a single item}
%
% \begin{macro}{\tl_item:nn, \tl_item:Nn, \tl_item:cn}
-% \begin{macro}[aux]{\@@_item:nn}
+% \begin{macro}[aux]{\@@_item_aux:nn, \@@_item:nn}
% The idea here is to find the offset of the item from the left, then use
% a loop to grab the correct item. If the resulting offset is too large,
% then \cs{quark_if_recursion_tail_stop:n} terminates the loop, and returns
@@ -2869,18 +2856,17 @@
\cs_new:Npn \tl_item:nn #1#2
{
\exp_args:Nf \@@_item:nn
- {
- \int_eval:n
- {
- \int_compare:nNnT {#2} < \c_zero
- { \tl_count:n {#1} + \c_one + }
- #2
- }
- }
+ { \exp_args:Nf \@@_item_aux:nn { \int_eval:n {#2} } {#1} }
#1
\q_recursion_tail
\__prg_break_point:
}
+\cs_new:Npn \@@_item_aux:nn #1#2
+ {
+ \int_compare:nNnTF {#1} < \c_zero
+ { \int_eval:n { \tl_count:n {#2} + \c_one + #1 } }
+ {#1}
+ }
\cs_new:Npn \@@_item:nn #1#2
{
\__quark_if_recursion_tail_break:nN {#2} \__prg_break:
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
index 98aedaa038e..34bdf48ad68 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx
@@ -1,43 +1,30 @@
% \iffalse meta-comment
%
%% File: l3token.dtx Copyright (C) 2005-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3kernel bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3kernel bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver>
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3token.dtx 6695 2016-09-01 15:38:50Z bruno $
+\GetIdInfo$Id: l3token.dtx 6805 2016-12-28 22:15:52Z joseph $
{L3 Experimental token manipulation}
%</driver|package>
%<*driver>
@@ -128,7 +115,7 @@
%
% \begin{function}[added = 2015-11-12]
% {
-% \char_set_active_eq:nN, \char_set_active_eq:nc
+% \char_set_active_eq:nN, \char_set_active_eq:nc,
% \char_gset_active_eq:nN, \char_gset_active_eq:nc
% }
% \begin{syntax}
@@ -197,7 +184,7 @@
% \begin{verbatim}
% \char_set_catcode_other:N \%
% \end{verbatim}
-% The assignment is local.
+% The assignment is local.
% \end{function}
%
% \begin{function}[updated = 2015-11-11]
@@ -237,7 +224,7 @@
% The first \meta{integer expression}
% is the character code and the second is the category code to apply.
% The setting applies within the current \TeX{} group. In general, the
-% symbolic functions \cs{char_set_catcode_\meta{type}} should be preferred,
+% symbolic functions \cs[no-index]{char_set_catcode_\meta{type}} should be preferred,
% but there are cases where these lower-level functions may be useful.
% \end{function}
%
@@ -1036,10 +1023,15 @@
% identical to the command that was used to select the current font
% (such as \tn{tenrm}) but it differs from it in shape.
% \item A \enquote{frozen} |\relax|, which differs from the primitive in
-% both shape and meaning, is inserted when the closing \tn{fi} of a
+% shape (but has the same meaning), is inserted when the closing \tn{fi} of a
% conditional is encountered before the conditional is evaluated.
-% \item An |\endtemplate| (which expands to |\outer endtemplate:|)
-% can be enountered when peeking ahead at the next token.
+% \item Expanding \tn{noexpand} \meta{token} (when the \meta{token} is
+% expandable) results in an internal token, displayed (temporarily)
+% as \cs{notexpanded: \meta{token}}, whose shape coincides with the
+% \meta{token} and whose meaning differs from \tn{relax}.
+% \item An |\outer endtemplate:| (expanding to another internal token,
+% |end of alignment template|) can be encountered when peeking ahead
+% at the next token.
% \item Tricky programming might access a frozen |\endwrite|.
% \item Some frozen tokens can only be accessed in interactive
% sessions: |\cr|, |\right|, |\endgroup|, |\fi|, |\inaccessible|.
@@ -1347,7 +1339,7 @@
\seq_set_split:Nnn \l_char_special_seq { }
{ \ \" \# \$ \% \& \\ \^ \_ \{ \} \~ }
\seq_new:N \l_char_active_seq
-\seq_set_split:Nnn \l_char_special_seq { }
+\seq_set_split:Nnn \l_char_active_seq { }
{ \" \$ \& \^ \_ \~ }
% \end{macrocode}
% \end{variable}
@@ -1372,7 +1364,6 @@
\cs_new_protected:cpn { #1 :nN } ##1
{
\group_begin:
- \char_set_catcode_active:n { ##1 }
\char_set_lccode:nn { `\^^@ } { ##1 }
\tex_lowercase:D { \group_end: #2 ^^@ }
}
@@ -2110,7 +2101,7 @@
% and \tn{hyphen}, whose meaning is at most two characters.
% This leaves a string terminated by some |:|, and \cs{q_stop}.
%
-% The meaning of each one of the five \tn{...mark} primitives
+% The meaning of each one of the five \tn[no-index]{...mark} primitives
% has the form \meta{letters}|:|\meta{user material}. In other words,
% the first non-letter is a colon. We remove everything after the first
% colon.
diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
index ae2238cef24..da221d72cfd 100644
--- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.dtx
@@ -1,44 +1,30 @@
% \iffalse meta-comment
%
-%% File: l3keys2e.dtx (C) Copyright 2009,2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3packages bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%% File: l3keys2e.dtx (C) Copyright 2009,2011-2017 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3packages bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{l3keys2e}{Support package l3kernel too old}
@@ -52,8 +38,8 @@
%<package> }
\def\ExplFileName{l3keys2e}
\def\ExplFileDescription{LaTeX2e option processing using LaTeX3 keys}
-\def\ExplFileDate{2016/11/21}
-\def\ExplFileVersion{6760}
+\def\ExplFileDate{2017/01/28}
+\def\ExplFileVersion{6834}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
@@ -103,7 +89,7 @@
% option which simply stores a value would be created using:
% \begin{verbatim}
% \keys_define:nn { module }
-% { option .set:N = \l_module_variable_tl }
+% { option .tl_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
diff --git a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins
index bf2f1b09d88..f3fd165f4dd 100644
--- a/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins
+++ b/Master/texmf-dist/source/latex/l3packages/l3keys2e/l3keys2e.ins
@@ -21,12 +21,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2009-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3packages bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
index 2591d9d4c7b..37e3eaa7f43 100644
--- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.dtx
@@ -1,45 +1,31 @@
% \iffalse meta-comment
%
%% File: xfrac.dtx Copyright (C) 2004, 2008-2010 Morten Hoegholm
-%% (C) 2011,2012,2014-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3packages bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%% (C) 2011,2012,2014-2017 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
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3packages bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{xfrac}{Support package l3kernel too old}
@@ -54,8 +40,8 @@
\RequirePackage{amstext,graphicx,l3keys2e,textcomp,xparse,xtemplate}
\def\ExplFileName{xfrac}
\def\ExplFileDescription{L3 Experimental split-level fractions}
-\def\ExplFileDate{2016/11/21}
-\def\ExplFileVersion{6760}
+\def\ExplFileDate{2017/01/28}
+\def\ExplFileVersion{6834}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
@@ -929,7 +915,6 @@
}
\@@_math:n
{ % THIS IS JUST WRONG!
- \scan_align_safe_stop:
\mode_if_math:TF
{ \tex_mskip:D \l_@@_slash_right_muskip }
{ \tex_hskip:D \l_@@_slash_right_sep_dim }
diff --git a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins
index 4c240c56648..12e0cca6158 100644
--- a/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins
+++ b/Master/texmf-dist/source/latex/l3packages/xfrac/xfrac.ins
@@ -22,12 +22,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2011-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3packages bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
index 00f10f1c432..72e95c647ad 100644
--- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.dtx
@@ -5,44 +5,30 @@
%% (C) Copyright 2004-2008 Frank Mittelbach,
%% The LaTeX3 Project
%% (C) Copyright 2009-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3packages bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3packages bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{xparse}{Support package l3kernel too old}
@@ -56,8 +42,8 @@
%<package> }
\def\ExplFileName{xparse}
\def\ExplFileDescription{L3 Experimental document command parser}
-\def\ExplFileDate{2016/11/21}
-\def\ExplFileVersion{6760}
+\def\ExplFileDate{2017/01/28}
+\def\ExplFileVersion{6834}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
diff --git a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins
index bec43149679..817023b80f8 100644
--- a/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins
+++ b/Master/texmf-dist/source/latex/l3packages/xparse/xparse.ins
@@ -21,12 +21,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2009-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3packages bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput
diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
index d462fd1f58c..0e0cc211476 100644
--- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
+++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.dtx
@@ -5,44 +5,30 @@
%% (C) Copyright 2004-2010 Frank Mittelbach,
%% The LaTeX3 Project
%% (C) Copyright 2011-2016 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
-%% license or (at your option) any later version. The latest version
-%% of this license is in the file
-%%
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This file is part of the "l3packages bundle" (The Work in LPPL)
-%% and all files in that bundle must be distributed together.
-%%
-%% The released version of this bundle is available from CTAN.
-%%
-%% -----------------------------------------------------------------------
-%%
-%% The development version of the bundle can be found at
-%%
-%% http://www.latex-project.org/svnroot/experimental/trunk/
-%%
-%% for those people who are interested.
-%%
-%%%%%%%%%%%
-%% NOTE: %%
-%%%%%%%%%%%
-%%
-%% Snapshots taken from the repository represent work in progress and may
-%% not work or may contain conflicting material! We therefore ask
-%% people _not_ to put them into distributions, archives, etc. without
-%% prior consultation with the LaTeX Project Team.
-%%
-%% -----------------------------------------------------------------------
-%%
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% http://www.latex-project.org/lppl.txt
+%
+% This file is part of the "l3packages bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% -----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/latex3/latex3
+%
+% for those people who are interested.
%
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2016/11/21]
-%<package>\@ifpackagelater{expl3}{2016/11/21}
+\RequirePackage{expl3}[2017/01/28]
+%<package>\@ifpackagelater{expl3}{2017/01/28}
%<package> {}
%<package> {%
%<package> \PackageError{xtemplate}{Support package l3kernel too old}
@@ -56,8 +42,8 @@
%<package> }
\def\ExplFileName{xtemplate}
\def\ExplFileDescription{L3 Experimental prototype document functions}
-\def\ExplFileDate{2016/11/21}
-\def\ExplFileVersion{6760}
+\def\ExplFileDate{2017/01/28}
+\def\ExplFileVersion{6834}
%</driver|package>
%<*driver>
\documentclass[full]{l3doc}
diff --git a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins
index 2679b22ae38..086a41a4cc5 100644
--- a/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins
+++ b/Master/texmf-dist/source/latex/l3packages/xtemplate/xtemplate.ins
@@ -1,6 +1,6 @@
\iffalse meta-comment
-File xtemplate.ins Copyright (C) 2000-2012 The LaTeX3 Project
+File xtemplate.ins Copyright (C) 2000-2012,2016 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
@@ -12,7 +12,18 @@ of this license is in the file
This file is part of the "l3packages bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-The released version of this bundle is available from CTAN.
+-----------------------------------------------------------------------
+
+The development version of the bundle can be found at
+
+ https://github.com/latex3/latex3
+
+for those people who are interested.
+
+-----------------------------------------------------------------------
+
+Any modification of this file should ensure that the copyright and
+license information is placed in the derived files.
\fi
@@ -21,12 +32,17 @@ The released version of this bundle is available from CTAN.
\preamble
-EXPERIMENTAL CODE
+Copyright (C) 2011-2016 The LaTeX3 Project
-Do not distribute this file without also distributing the
-source files specified above.
+It may be distributed and/or modified under the conditions of
+the LaTeX Project Public License (LPPL), either version 1.3c of
+this license or (at your option) any later version. The latest
+version of this license is in the file:
-Do not distribute a modified version of this file.
+ http://www.latex-project.org/lppl.txt
+
+This file is part of the "l3packages bundle" (The Work in LPPL)
+and all files in that bundle must be distributed together.
\endpreamble
% stop docstrip adding \endinput