diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-12 21:24:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-12 21:24:44 +0000 |
commit | d501b4397bbc0f4389add919be80ccfca5b3863e (patch) | |
tree | 41af122e914676e41bc048a14128468bdfa83f6d /Master/texmf-dist/source/latex/l3kernel | |
parent | af6faae1a8553e2c55f7980152d84d8cf4ac5a96 (diff) |
l3 (12sep15)
git-svn-id: svn://tug.org/texlive/trunk@38360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel')
22 files changed, 658 insertions, 185 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx index 69518ad2ae1..b0dbaa76993 100644 --- a/Master/texmf-dist/source/latex/l3kernel/expl3.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/expl3.dtx @@ -36,8 +36,8 @@ %<*driver|generic|package> \def\ExplFileName{expl3} \def\ExplFileDescription{L3 programming layer} -\def\ExplFileDate{2015/09/06} -\def\ExplFileVersion{5925} +\def\ExplFileDate{2015/09/11} +\def\ExplFileVersion{6002} %</driver|generic|package> %<*driver> \documentclass[full]{l3doc} @@ -948,7 +948,8 @@ % are driver-dependent. Options available are % \begin{itemize}[font = \texttt] % \item[auto] Let \LaTeX3 determine the correct driver. With DVI output, this -% will select the \texttt{dvips} back-end. This is the standard setting. +% will select the \texttt{dvips} back-end for \pdfTeX{} and \LuaTeX{}, and +% \texttt{dvipdfmx} for \pTeX{} and \upTeX{}. This is the standard setting. % \item[latex2e] Use the \pkg{graphics} package to select the driver, rather % than \LaTeX3 code. % \item[dvips] Use the \texttt{dvips} driver. @@ -993,7 +994,7 @@ % \end{itemize} % Any engine which defines |\pdfoutput| (\emph{i.e.}~allows direct production % of a PDF file without a DVI intermediate) must also provide |\pdfliteral|. -% +% % Practically, these requirements are met by the engines % \begin{itemize} % \item \pdfTeX{} v1.30 or later. @@ -1003,7 +1004,7 @@ % \end{itemize} % of which the first three engines are currently officially supported by % the team. -% +% % Additional modules beyond the core of \pkg{expl3} may require additional % primitives. In particular, third-party authors may significantly % extend the primitive coverage requirements. @@ -1323,19 +1324,27 @@ { \tl_set:Nx \l__expl_driver_tl { - \xetex_if_engine:TF + \sys_if_engine_xetex:TF { xdvipdfmx } { \__expl_if_pdf:TF { pdfmode } - { dvips } + { + \bool_if:nTF + { + \sys_if_engine_pdftex_p: || + \sys_if_engine_luatex_p: + } + { dvips } + { dvipdfmx } + } } } }, driver / dvipdfmx .code:n = { \tl_set:Nn \l__expl_driver_tl { dvipdfmx } - \xetex_if_engine:TF + \sys_if_engine_xetex:TF { \__msg_kernel_error:nnnn { expl } { wrong-driver } { dvipdfmx } { xdvipdfmx } @@ -1353,7 +1362,7 @@ driver / dvips .code:n = { \tl_set:Nn \l__expl_driver_tl { dvips } - \xetex_if_engine:TF + \sys_if_engine_xetex:TF { \__msg_kernel_error:nnnn { expl } { wrong-driver } { dvips } { xdvipdfmx } @@ -1373,7 +1382,7 @@ driver / pdfmode .code:n = { \tl_set:Nn \l__expl_driver_tl { pdfmode } - \xetex_if_engine:TF + \sys_if_engine_xetex:TF { \__msg_kernel_error:nnnn { expl } { wrong-driver } { pdfmode } { xdvipdfmx } @@ -1391,7 +1400,7 @@ driver / xdvipdfmx .code:n = { \tl_set:Nn \l__expl_driver_tl { xdvipdfmx } - \xetex_if_engine:F + \sys_if_engine_xetex:F { \__expl_if_pdf:TF { @@ -1735,7 +1744,7 @@ } \tex_input:D l3 - \xetex_if_engine:TF + \sys_if_engine_xetex:TF { xdvipdfmx } { \bool_if:nTF diff --git a/Master/texmf-dist/source/latex/l3kernel/l3.ins b/Master/texmf-dist/source/latex/l3kernel/l3.ins index ac8b3aa7b9d..2876e8968b6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3.ins @@ -76,6 +76,7 @@ Do not distribute a modified version of this file. \from{l3coffins.dtx} {package} \from{l3color.dtx} {package} \from{l3candidates.dtx} {package} + \from{l3sys.dtx} {package} \from{l3luatex.dtx} {package} } } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx index cd79e4469d9..16009950b33 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3alloc.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3alloc.dtx Copyright (C) 1990-2012,2014 The LaTeX3 Project +%% 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 @@ -35,7 +35,7 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3alloc.dtx 5363 2014-08-24 19:57:56Z joseph $ +\GetIdInfo$Id: l3alloc.dtx 5952 2015-09-08 16:10:05Z joseph $ {L3 Register allocation} \begin{document} \DocInput{\jobname.dtx} @@ -184,7 +184,7 @@ % need to have their allocators set up \enquote{early}. It therefore % makes sense to collect most of them together here. % \begin{macrocode} -\luatex_if_engine:TF +\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 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 63bde464f33..058c99aba53 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3basics.dtx 5897 2015-08-28 09:06:29Z joseph $ +\GetIdInfo$Id: l3basics.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Basic definitions} %</driver|package> %<*driver> @@ -1088,29 +1088,6 @@ % \cs{cs_if_exist:N}). % \end{function} % -% \subsection{Engine-specific conditionals} -% -% \begin{function}[updated = 2011-09-06,EXP,pTF]{\luatex_if_engine:} -% \begin{syntax} -% \cs{luatex_if_engine:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Detects is the document is being compiled using \LuaTeX{}. -% \end{function} -% -% \begin{function}[updated = 2011-09-06,EXP,pTF]{\pdftex_if_engine:} -% \begin{syntax} -% \cs{pdftex_if_engine:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Detects is the document is being compiled using \pdfTeX{}. -% \end{function} -% -% \begin{function}[updated = 2011-09-06,EXP,pTF]{\xetex_if_engine:} -% \begin{syntax} -% \cs{xetex_if_engine:TF} \Arg{true code} \Arg{false code} -% \end{syntax} -% Detects is the document is being compiled using \XeTeX{}. -% \end{function} -% % \subsection{Primitive conditionals} % % The \eTeX{} engine itself provides many different conditionals. Some @@ -2142,7 +2119,7 @@ % for the boolean. For example, % |\__cs_split_function:NN \foo_bar:cnx \use_i:nnn| as input % becomes |\use_i:nnn {foo_bar} {cnx} \c_true_bool|. -% +% % We cannot use |:| directly as it has the wrong category code so % an |x|-type expansion is used to force the conversion. % @@ -2971,50 +2948,6 @@ % \end{macrocode} % \end{macro} % -% \subsection{Engine specific definitions} -% -% \begin{macro}[pTF, EXP] -% {\xetex_if_engine:, \luatex_if_engine:, \pdftex_if_engine:} -% In some cases it will be useful to know which engine we're running. -% This can all be hard-coded for speed. -% \begin{macrocode} -\cs_new_eq:NN \luatex_if_engine:T \use_none:n -\cs_new_eq:NN \luatex_if_engine:F \use:n -\cs_new_eq:NN \luatex_if_engine:TF \use_ii:nn -\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 \xetex_if_engine:T \use_none:n -\cs_new_eq:NN \xetex_if_engine:F \use:n -\cs_new_eq:NN \xetex_if_engine:TF \use_ii:nn -\cs_new_eq:NN \luatex_if_engine_p: \c_false_bool -\cs_new_eq:NN \pdftex_if_engine_p: \c_true_bool -\cs_new_eq:NN \xetex_if_engine_p: \c_false_bool -\cs_if_exist:NT \xetex_XeTeXversion:D - { - \cs_gset_eq:NN \pdftex_if_engine:T \use_none:n - \cs_gset_eq:NN \pdftex_if_engine:F \use:n - \cs_gset_eq:NN \pdftex_if_engine:TF \use_ii:nn - \cs_gset_eq:NN \xetex_if_engine:T \use:n - \cs_gset_eq:NN \xetex_if_engine:F \use_none:n - \cs_gset_eq:NN \xetex_if_engine:TF \use_i:nn - \cs_gset_eq:NN \pdftex_if_engine_p: \c_false_bool - \cs_gset_eq:NN \xetex_if_engine_p: \c_true_bool - } -\cs_if_exist:NT \luatex_directlua:D - { - \cs_gset_eq:NN \luatex_if_engine:T \use:n - \cs_gset_eq:NN \luatex_if_engine:F \use_none:n - \cs_gset_eq:NN \luatex_if_engine:TF \use_i:nn - \cs_gset_eq:NN \pdftex_if_engine:T \use_none:n - \cs_gset_eq:NN \pdftex_if_engine:F \use:n - \cs_gset_eq:NN \pdftex_if_engine:TF \use_ii:nn - \cs_gset_eq:NN \luatex_if_engine_p: \c_true_bool - \cs_gset_eq:NN \pdftex_if_engine_p: \c_false_bool - } -% \end{macrocode} -% \end{macro} -% % \subsection{Doing nothing functions} % % \begin{macro}[EXP]{\prg_do_nothing:} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 9de367fc7ea..29d0a01caa8 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -145,7 +145,7 @@ % \end{macro} % \end{macro} % \end{macro} -\GetIdInfo$Id: l3bootstrap.dtx 5729 2015-07-31 05:56:12Z joseph $ +\GetIdInfo$Id: l3bootstrap.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Bootstrap code} %</driver|package> %<*driver> @@ -318,11 +318,11 @@ end end end - tex.enableprimitives("", t) + tex.enableprimitives("", t) }% \fi \endgroup -%</package> +%</package> % \end{macrocode} % % \subsection{The \tn{pdfstrcmp} primitive with \XeTeX{} and \LuaTeX{}} @@ -387,7 +387,73 @@ \global\everyjob\expandafter {% \the\expandafter\everyjob - \expandafter\luatex_directlua:D\expandafter{\tempa}% + \expandafter\lua_now_x:n\expandafter{\tempa}% + } + \fi + \fi + \fi +\endgroup +% \end{macrocode} +% +% \subsection{Emulating \tn{Ucharchar} in \LuaTeX{}} +% +% Expandably creating character tokens can be done in macros but for the +% full Unicode range requires engine support in practical terms. That is +% available in \XeTeX{} as \tn{Ucharcat} but in \LuaTeX{} some Lua code +% is required. That is set up here, following the model above. Note that +% we do not try to emulate the syntax of the primitive (doable with \LuaTeX{} +% 0.80 or later, but not required by our use case). +% +% One minor wrinkle is that a catcode table is needed to return values. +% For format mode, long-term we can simply take an arbitrary one and make +% sure this is never allocated. In package mode use the same approach +% (and table) as \pkg{ucharcat}: look for an allocator and use it if available, +% or use a table unlikely to clash with any other use. We use the same table +% as \pkg{ucharcat} but as this is \enquote{disposable} we are safe. +% \begin{macrocode} +\begingroup + \expandafter\ifx\csname directlua\endcsname\relax + \else + \ifnum\luatexversion<70 % + \else +%<*initex> + % TEMP + \catcode`\@=11 % + \chardef\ucharcat@table="8000 % +%</initex> +%<*package> + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname newcatcodetable\endcsname\relax + \directlua{tex.enableprimitives("",{"initcatcodetable"})} + \chardef\ucharcat@table"7000 % + \initcatcodetable\ucharcat@table + \else + \newcatcodetable\ucharcat@table + \fi +%</package> + \catcode`\_=11 % + \catcode`\:=11 % + \def\tempa + {% + l3kernel = l3kernel or { } + local utf8_char = unicode.utf8.char + function l3kernel.charcat(charcode, catcode) + tex.setcatcode(\number\ucharcat@table, charcode, catcode) + tex.sprint(\number\ucharcat@table, utf8_char(charcode)) + end + } + \directlua{\tempa} + \ifnum 0% + \directlua + {% + if status.ini_version then + tex.write("1") + end + }>0 % + \global\everyjob\expandafter + {% + \the\expandafter\everyjob + \expandafter\lua_now_x:n\expandafter{\tempa}% } \fi \fi @@ -458,7 +524,7 @@ \endgroup \noexpand\endinput }% -%</package> +%</package> \fi \next % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 3b8cf3368c5..f5ad9fc0a00 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -38,7 +38,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3candidates.dtx 5911 2015-09-03 08:24:00Z joseph $ +\GetIdInfo$Id: l3candidates.dtx 6002 2015-09-11 22:13:30Z joseph $ {L3 Experimental additions to l3kernel} %</driver|package> %<*driver> @@ -822,7 +822,7 @@ % letter-like characters which can also be case-changed). Begin-group and % end-group characters in the \meta{tokens} are normalized and become |{| % and |}|, respectively. -% +% % Importantly, notice that these functions are intended for working with % user text for typesetting. For case changing programmatic data see the % \pkg{l3str} module and discussion there of \cs{str_lower_case:n}, @@ -833,7 +833,7 @@ % input in the form of token lists or expandable functions will be expanded % \emph{unless} it falls within one of the special handling classes described % below. This expansion approach means that in general the result of case -% changing will match the \enquote{natural} outcome expected from a +% changing will match the \enquote{natural} outcome expected from a % \enquote{functional} approach to case modification. For example % \begin{verbatim} % \tl_set:Nn \l_tmpa_tl { hello } @@ -859,7 +859,7 @@ % \end{verbatim} % Material inside math mode is left entirely unchanged: in particular, no % expansion is undertaken. -% +% % Detection of math mode is controlled by the list of tokens in % \cs{l_tl_case_change_math_tl}, which should be in open--close pairs. In % package mode the standard settings is @@ -875,7 +875,7 @@ % the case changing functions are intended to apply to this should not be % an issue. % \end{variable} -% +% % \begin{variable}{\l_tl_case_change_exclude_tl} % Case changing can be prevented by using any command on the list % \cs{l_tl_case_change_exclude_tl}. Each entry should be a function @@ -902,7 +902,7 @@ % and |\ref| are automatically included in the list for exclusion from % case changing. % \end{variable} -% +% % In package mode, the case change system will also % convert text stored using the \LaTeXe{} \enquote{LICR} approach. This % will upper/lower case tokens as implemented for the font encodings @@ -926,12 +926,12 @@ % \end{verbatim} % When finding the first \enquote{letter} for this process, any content in % math mode or covered by \cs{l_tl_case_change_exclude_tl} is ignored. -% +% % (Note that the Unicode Consortium describe this as \enquote{title case}, but % that in English title case applies on a word-by-word basis. The % \enquote{mixed} case implemented here is a lower level concept needed for % both \enquote{title} and \enquote{sentence} casing of text.) -% +% % \begin{variable}{\l_tl_mixed_case_ignore_tl} % The list of characters to ignore when searching for the first % \enquote{letter} in mixed-casing is determined by @@ -1040,7 +1040,7 @@ % \cs{char_set_active_eq:NN} \meta{char} \meta{function} % \end{syntax} % Sets the behaviour of the \meta{char} in situations where it is -% active (category code $13$) to be equivalent to that of the +% active (category code $13$) to be equivalent to that of the % \meta{function}. The category code of the \meta{char} is % \emph{unchanged} by this process. The \meta{function} may itself % be an active character. @@ -1059,6 +1059,31 @@ % be an active character. % \end{function} % +% \begin{function}[EXP, added = 2015-09-09]{\char_generate:nn} +% \begin{syntax} +% \cs{char_generate:nn} \Arg{charcode} \Arg{catcode} +% \end{syntax} +% Generates a character token of the given \meta{charcode} and \meta{catcode} +% (both of which may be integer expressions). The \meta{catcode} may be +% one of +% \begin{itemize} +% \item $1$ (begin group) +% \item $2$ (end group) +% \item $3$ (math toggle) +% \item $4$ (alignment) +% \item $6$ (parameter) +% \item $7$ (math superscript) +% \item $8$ (math subscript) +% \item $11$ (letter) +% \item $12$ (other) +% \end{itemize} +% and other values will raise an error. +% +% The \meta{catcode} may be any one valid for the engine in use. Note +% however that for \XeTeX{} releases prior to 0.99992 only the 8-bit +% range ($0$ to $255$) is accepted due to engine limitations. +% \end{function} +% % \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:} % \begin{syntax} % \cs{peek_N_type:TF} \Arg{true code} \Arg{false code} @@ -2969,7 +2994,7 @@ \cs_generate_variant:Nn \tl_if_head_eq_catcode:nNTF { o } % \end{macrocode} % \end{macro} -% +% % \begin{macro}[EXP]{\tl_lower_case:n, \tl_upper_case:n, \tl_mixed_case:n} % \begin{macro}[EXP]{\tl_lower_case:nn, \tl_upper_case:nn, \tl_mixed_case:nn} % The user level functions here are all wrappers around the internal @@ -3269,7 +3294,7 @@ % a string then examining the first four characters. For Cyrillic, the % fourth character can be used for a second split based on the character % code. -% +% % Note that as this is dependent on \LaTeXe{}, in format mode the code % goes straight to the final phase of handling control sequences. % \begin{macrocode} @@ -3308,8 +3333,8 @@ \cs_new:Npn \@@_change_case_cs_cyr:NnNNNNw #1#2#3#4#5#6#7 \q_stop { \@@_change_case_cs_type:Nnnnn #1 - { cyrillic } - { + { cyrillic } + { #2 _ \int_to_roman:n { @@ -3437,7 +3462,7 @@ % \end{macro} % \end{macro} % \end{macro} -% +% % \begin{macro}[aux, EXP]{\@@_change_case_lower_sigma:Nnw} % \begin{macro}[aux, EXP]{\@@_change_case_lower_sigma:w} % \begin{macro}[aux, EXP]{\@@_change_case_lower_sigma:Nw} @@ -3742,7 +3767,7 @@ % to generic routines, but at the cost of making the process rather opaque. % Instead, the approach taken here is to use a dedicated set of functions % which keep the different loop requirements clearly separate. -% +% % The main loop looks for the first \enquote{real} char in the input % (skipping any pre-letter chars). Once one is found, it is case changed to % upper case but first checking that there is not an entry in the exceptions @@ -3837,7 +3862,7 @@ \@@_change_case_cs:Nnnn #1 { upper } { \@@_change_case_loop:wnn - #2 \q_recursion_stop { lower } {#3} + #2 \q_recursion_stop { lower } {#3} } { \@@_change_case_cs:N #1 @@ -3991,7 +4016,7 @@ %</package> % \end{macrocode} % \end{variable} -% +% % \begin{variable}{\l_tl_mixed_case_ignore_tl} % Characters to skip over when finding the first letter in a word to be % mixed cased. @@ -4132,7 +4157,7 @@ \cyrishrt \CYRISHRT \cyrishrtdsc \CYRISHRTDSC \cyrizh \CYRIZH - \cyrje \CYRJE + \cyrje \CYRJE \cyrk \CYRK \cyrkbeak \CYRKBEAK \cyrkdsc \CYRKDSC @@ -4200,7 +4225,7 @@ \cyrz \CYRZ \cyrzdsc \CYRZDSC \cyrzh \CYRZH - \cyrzhdsc \CYRZHDSC + \cyrzhdsc \CYRZHDSC } { \q_recursion_tail } \@@_change_case_setup:nnnn @@ -4255,7 +4280,7 @@ \accdialytikatonos { \exp_stop_f: \LGR@accDialytika } \accdialytikavaria { \exp_stop_f: \LGR@accDialytika } \accdialytikaperispomeni { \exp_stop_f: \LGR@accDialytika } - \accperispomeni { \exp_stop_f: \LGR@accdropped } + \accperispomeni { \exp_stop_f: \LGR@accdropped } } \tl_const:Nn \c_@@_change_case_acc_lower_tl { } \tl_const:Nn \c_@@_change_case_misc_upper_tl @@ -4340,6 +4365,208 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}[EXP]{\char_generate:nn} +% \begin{macro}[EXP, aux]{\@@_generate_aux:nn} +% \begin{macro}[EXP, aux]{\@@_generate_aux:nnw} +% \begin{variable}{\l_@@_tmp_tl} +% \begin{variable}{\c_@@_max_int} +% \begin{macro}[EXP, aux]{\@@_generate_invalid_catcode:} +% The aim here is to generate characters of (broadly) arbitrary category +% code. Where possible, that is done using engine support (\XeTeX{}, +% \LuaTeX{}). There are though various issues which are covered below. At +% the interface layer, turn the two arguments into integers up-front so +% this is only done once. +% \begin{macrocode} +\cs_new:Npn \char_generate:nn #1#2 + { + \exp:w \exp_after:wN \@@_generate_aux:w + \int_use:N \__int_eval:w #1 \exp_after:wN ; + \int_use:N \__int_eval:w #2 ; + } +% \end{macrocode} +% Before doing any actual conversion, first some special case filtering. +% The \tn{Ucharcat} primitive cannot make active chars, so that is turned +% off here: if the primitive gets altered then the code is already in +% place for 8-bit engines and will kick in for \LuaTeX{} too. Spaces +% are also banned here as \LuaTeX{} emulation only makes normal (charcode +% $32$ spaces. However, |^^@| is filtered out separately as that can't be +% done with macro emulation either, so is flagged up separately. That +% done, hand off to the engine-dependent part. +% \begin{macrocode} +\cs_new:Npn \@@_generate_aux:w #1 ; #2 ; + { + \if_int_compare:w #2 = \c_thirteen + \__msg_kernel_expandable_error:nn { kernel } { char-active } + \else: + \if_int_compare:w #2 = \c_ten + \if_int_compare:w #1 = \c_zero + \__msg_kernel_expandable_error:nn { kernel } { char-null-space } + \else: + \__msg_kernel_expandable_error:nn { kernel } { char-space } + \fi: + \else: + \if_int_odd:w 0 + \if_int_compare:w #2 < \c_one 1 \fi: + \if_int_compare:w #2 = \c_five 1 \fi: + \if_int_compare:w #2 = \c_nine 1 \fi: + \if_int_compare:w #2 > \c_thirteen 1 \fi: \exp_stop_f: + \__msg_kernel_expandable_error:nn { kernel } + { char-invalid-catcode } + \else: + \if_int_odd:w 0 + \if_int_compare:w #1 < \c_zero 1 \fi: + \if_int_compare:w #1 > \c_@@_max_int 1 \fi: \exp_stop_f: + \__msg_kernel_expandable_error:nn { kernel } + { char-out-of-range } + \else: + \@@_generate_aux:nnw {#1} {#2} + \fi: + \fi: + \fi: + \fi: + \exp_end: + } +\tl_new:N \l_@@_tmp_tl +% \end{macrocode} +% Engine-dependent definitions are now needed for the implementation. For +% \LuaTeX{} and recent \XeTeX{} releases there is engine-level support. +% They can do cases that macro emulation can't. All of those are filtered +% out here using a primitive-based boolean expression for speed. +% The final level is the basic definition at the engine level: the arguments +% here are integers so there is no need to worry about them too much. +% \begin{macrocode} +\group_begin: +%<*package> + \cs_set_nopar:Npn ^^L { } +%</package> + \char_set_catcode_other:n { 0 } + \if_int_odd:w 0 + \cs_if_exist:NT \luatex_directlua:D { 1 } + \cs_if_exist:NT \utex_charcat:D { 1 } \exp_stop_f: + \int_const:Nn \c_@@_max_int { 1114111 } + \cs_if_exist:NTF \luatex_directlua:D + { + \cs_new:Npn \@@_generate_aux:nnw #1#2#3 \exp_end: + { + #3 + \exp_after:wN \exp_end: + \luatex_directlua:D { l3kernel.charcat(#1, #2) } + } + } + { + \cs_new:Npn \@@_generate_aux:nnw #1#2#3 \exp_end: + { + #3 + \exp_after:wN \exp_end: + \utex_charcat:D #1 ~ #2 ~ + } + } + \else: +% \end{macrocode} +% For engines where \tn{Ucharcat} isn't available (or emulated) then we have +% to work in macros, and cover only the $8$-bit range. The first stage is +% to build up a |tl| containing |^^@| with each category code that can +% be accessed in this way, with an error set up for the other cases. This +% is all done such that it can be quickly accessed using a |\if_case:w| +% low-level conditional. There are a few things to notice here. +% As |^^L| is |\outer| we need to locally set it to avoid a problem. +% To get open/close braces into the list, they are set up using |\if_false:| +% pairing here and will later be |x|-type expanded into the desired form. +% For making spaces, there needs to be an |o|-type expansion of a |\use:n| +% (or some other tokenization) to avoid dropping the space. We also +% set up active tokens although they are (currently) filtered out by the +% interface layer (\tn{Ucharcat} cannot make active tokens). +% \begin{macrocode} + \int_const:Nn \c_@@_max_int { 255 } + \tl_set:Nn \l_@@_tmp_tl { \exp_not:N \or: } + \char_set_catcode_group_begin:n { 0 } % { + \tl_put_right:Nn \l_@@_tmp_tl { ^^@ \if_false: } } + \char_set_catcode_group_end:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { { \fi: \exp_not:N \or: ^^@ } % } + \tl_set:Nx \l_@@_tmp_tl { \l_@@_tmp_tl } + \char_set_catcode_math_toggle:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \char_set_catcode_alignment:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \tl_put_right:Nn \l_@@_tmp_tl { \or: } + \char_set_catcode_parameter:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \char_set_catcode_math_superscript:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \char_set_catcode_math_subscript:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \tl_put_right:Nn \l_@@_tmp_tl { \or: } + \char_set_catcode_space:n { 0 } + \tl_put_right:No \l_@@_tmp_tl { \use:n { \or: } ^^@ } + \char_set_catcode_letter:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \char_set_catcode_other:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } + \char_set_catcode_active:n { 0 } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } +% \end{macrocode} +% Convert the above temporary list into a series of constant token +% lists, one for each character code, using \tn{tex_lowercase:D} to +% convert |^^@| in each case. The \texttt{x}-type expansion deals with +% the |\if_false:| stuff introduced earlier. This is done in three parts +% as |^^L| is awkward. Notice that at this stage |^^@| is active. In +% format mode this is not needed. +% \begin{macrocode} + \cs_set_protected:Npn \@@_tmp:n #1 + { + \char_set_lccode:nn { 0 } {#1} + \char_set_lccode:nn { 32 } {#1} + \exp_args:Nx \tex_lowercase:D + { + \tl_const:cn { c_@@_ \__int_to_roman:w #1 _tl } + { \exp_not:o \l_@@_tmp_tl } + } + } +%<*package> + \int_step_function:nnnN { 0 } { 1 } { 11 } \@@_tmp:n + \group_begin: + \tl_replace_once:Nnn \l_@@_tmp_tl { ^^@ } { \ERROR } + \@@_tmp:n { 12 } + \group_end: + \int_step_function:nnnN { 13 } { 1 } { 255 } \@@_tmp:n +%</package> +%<*initex> + \int_step_function:nnnN { 0 } { 1 } { 255 } \@@_tmp:n +%</initex> + \cs_new:Npn \@@_generate_aux:nnw #1#2#3 \exp_end: + { + #3 + \exp_after:wN \exp_after:wN + \exp_after:wN \exp_end: + \exp_after:wN \exp_after:wN + \if_case:w #2 + \exp_last_unbraced:Nv \exp_stop_f: + { c_@@_ \__int_to_roman:w #1 _tl } + \fi: + } + \fi: +\group_end: +% \end{macrocode} +% Job done, set up a few messages. +% \begin{macrocode} +\__msg_kernel_new:nnn { kernel } { char-active } + { Cannot~generate~active~chars. } +\__msg_kernel_new:nnn { kernel } { char-invalid-catcode } + { Invalid~catcode~for~char~generation. } +\__msg_kernel_new:nnn { kernel } { char-null-space } + { Cannot~generate~null~char~as~a~space. } +\__msg_kernel_new:nnn { kernel } { char-out-of-range } + { Charcode~requested~out~of~engine~range. } +\__msg_kernel_new:nnn { kernel } { char-space } + { Cannot~generate~space~chars. } +% \end{macrocode} +% \end{macro} +% \end{variable} +% \end{variable} +% \end{macro} +% \end{macro} +% \end{macro} +% % \begin{macrocode} %<@@=peek> % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx index 8c02dcb39fc..502eb1a1e4a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx @@ -75,7 +75,7 @@ Do not distribute a modified version of this file. % %<*driver|class> \RequirePackage{expl3,xparse,calc} -\GetIdInfo$Id: l3doc.dtx 5903 2015-09-02 06:03:07Z joseph $ +\GetIdInfo$Id: l3doc.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Experimental documentation class} %</driver|class> % @@ -1255,7 +1255,8 @@ Do not distribute a modified version of this file. } % \end{macrocode} % -% \begin{macro}{\eTeX, \IniTeX, \Lua, \LuaTeX, \pdfTeX, \XeTeX} +% \begin{macro}{\eTeX, \IniTeX, \Lua, \LuaTeX, \pdfTeX, \XeTeX, +% \pTeX, \upTeX, \epTeX, \eupTeX} % Some commands for logos. % \begin{macrocode} \providecommand*\eTeX{\hologo{eTeX}} @@ -1264,6 +1265,10 @@ Do not distribute a modified version of this file. \providecommand*\LuaTeX{\hologo{LuaTeX}} \providecommand*\pdfTeX{\hologo{pdfTeX}} \providecommand*\XeTeX{\hologo{XeTeX}} +\providecommand*\pTeX{p\kern-.2em\hologo{TeX}} +\providecommand*\upTeX{up\kern-.2em\hologo{TeX}} +\providecommand*\epTeX{$\varepsilon$-\pTeX} +\providecommand*\eupTeX{$\varepsilon$-\upTeX} % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx index 65105c61736..c96720f149b 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3expan.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3expan.dtx 5897 2015-08-28 09:06:29Z joseph $ +\GetIdInfo$Id: l3expan.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Argument expansion} %</driver|package> %<*driver> @@ -240,7 +240,7 @@ % \begin{verbatim} % \tl_set:No \l_tmpa_tl { { \l_tmpa_tl } } % \end{verbatim} -% and +% and % \begin{verbatim} % \tl_set:Nf \l_tmpa_tl { { \l_tmpa_tl } } % \end{verbatim} @@ -650,7 +650,7 @@ % \begin{function}[added=2015-08-23,EXP] % { % \exp:w , -% \exp_end: +% \exp_end: % } % \begin{syntax} % \cs{exp:w} \meta{expandable-tokens} \cs{exp_end:} \\ @@ -680,7 +680,7 @@ % \begin{function}[added=2015-08-23,EXP] % { % \exp:w , -% \exp_end_continue_f:w +% \exp_end_continue_f:w % } % \begin{syntax} % \cs{exp:w} \meta{expandable-tokens} \cs{exp_end_continue_f:w} \meta{further-tokens} @@ -700,7 +700,7 @@ % % % In typical use cases \meta{expandable-tokens} contains no tokens at all, -% e.g., you will see code such as +% e.g., you will see code such as %\begin{verbatim} % \exp_after:wN { \exp:w \exp_end_continue_f:w #2 } %\end{verbatim} @@ -732,7 +732,7 @@ % \begin{function}[added=2015-08-23,EXP] % { % \exp:w , -% \exp_end_continue_f:nw +% \exp_end_continue_f:nw % } % \begin{syntax} % \cs{exp:w} \meta{expandable-tokens} \cs{exp_end_continue_f:nw} \meta{further-tokens} @@ -886,12 +886,12 @@ % \begin{macro}[int, EXP]{\::f} % \begin{macro}{\exp_stop_f:} % This function is used to expand a token list until the first -% unexpandable token is found. This is achieved through \cs{exp:w} +% unexpandable token is found. This is achieved through \cs{exp:w} % \cs{exp_end_continue_f:w} that % expands everything in its way following it. This % scanning procedure is terminated once the expansion hits % something non-expandable or a space. We introduce \cs{exp_stop_f:} -% to mark such an end of expansion marker. +% to mark such an end of expansion marker. % In the example shown earlier the scanning was stopped % once \TeX{} had fully expanded |\cs_set_eq:Nc \aaa { b \l_tmpa_tl b }| % into |\cs_set_eq:NN \aaa = \blurb| which then turned out to contain @@ -1460,7 +1460,7 @@ % \begin{macrocode} \cs_new:Npn ^^@{\expansionERROR} % \end{macrocode} -% +% % \begin{macrocode} \cs_new:Npn \exp_end_continue_f:nw #1 { `^^@ #1 } \tex_catcode:D `\^^@=15 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3format.ins b/Master/texmf-dist/source/latex/l3kernel/l3format.ins index 92825d5b08a..3d967cc7e7d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3format.ins +++ b/Master/texmf-dist/source/latex/l3kernel/l3format.ins @@ -76,6 +76,7 @@ Do not distribute a modified version of this file. \from{l3coffins.dtx} {initex} \from{l3color.dtx} {initex} \from{l3candidates.dtx} {initex} + \from{l3sys.dtx} {initex} \from{l3luatex.dtx} {initex} % ======== FORMAT ONLY ========= \from{l3final.dtx} {initex} @@ -89,4 +90,4 @@ Do not distribute a modified version of this file. \generate{\file{l3docstrip.tex}{\from{l3docstrip.dtx}{program}}} -\endbatchfile
\ No newline at end of file +\endbatchfile diff --git a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx index 12af7c088a3..dd30a2f4ff0 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3fp-convert.dtx @@ -36,7 +36,7 @@ % %<*driver> \documentclass[full]{l3doc} -\GetIdInfo$Id: l3fp-convert.dtx 5893 2015-08-26 16:16:52Z mittelba $ +\GetIdInfo$Id: l3fp-convert.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Floating-point conversion} \begin{document} \DocInput{\jobname.dtx} @@ -527,7 +527,7 @@ { \exp_not:N \exp_after:wN , \exp_not:N \exp_after:wN \c_space_tl - \exp_not:N \exp:w + \exp_not:N \exp:w \exp_not:N \exp_end_continue_f:w \exp_not:N \@@_to_tl_dispatch:w #1 #2 ; } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx index ad438e06a72..cbed3f682f9 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3int.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3int.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3int.dtx 5885 2015-08-24 13:29:14Z mittelba $ +\GetIdInfo$Id: l3int.dtx 5987 2015-09-11 05:44:48Z joseph $ {L3 Integers} %</driver|package> %<*driver> @@ -1167,7 +1167,8 @@ % \UnitTested % As stated, most constants can be defined as \tn{chardef} or % \tn{mathchardef} but that's engine dependent. As a result, there is some -% set up code to determine what can be done. +% set up code to determine what can be done. No full engine testing just yet +% so everything is a little awkward. % \begin{macrocode} \cs_new_protected:Npn \int_const:Nn #1#2 { @@ -1190,15 +1191,20 @@ } } \cs_generate_variant:Nn \int_const:Nn { c } -\pdftex_if_engine:TF - { - \cs_new_eq:NN \@@_constdef:Nw \tex_mathchardef:D - \tex_mathchardef:D \c__max_constdef_int 32 767 ~ - } - { - \cs_new_eq:NN \@@_constdef:Nw \tex_chardef:D - \tex_chardef:D \c__max_constdef_int 1 114 111 ~ - } +\if_int_odd:w 0 + \cs_if_exist:NT \luatex_luatexversion:D { 1 } + \cs_if_exist:NT \uptex_disablecjktoken:D + { \if_int_compare:w \ptex_jis:D "2121 = "3000 ~ 1 \fi: } + \cs_if_exist:NT \xetex_XeTeXversion:D { 1 } + ~ + \cs_if_exist:NTF \uptex_disablecjktoken:D + { \cs_new_eq:NN \@@_constdef:Nw \uptex_kchardef:D } + { \cs_new_eq:NN \@@_constdef:Nw \tex_chardef:D } + \@@_constdef:Nw \c__max_constdef_int 1114111 ~ +\else: + \cs_new_eq:NN \@@_constdef:Nw \tex_mathchardef:D + \tex_mathchardef:D \c__max_constdef_int 32767 ~ +\fi: % \end{macrocode} % \end{variable} % \end{macro} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx index d29b7134957..6f781667d1e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3keys.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3keys.dtx 5869 2015-08-20 01:19:17Z bruno $ +\GetIdInfo$Id: l3keys.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Key-value interfaces} %</driver|package> %<*driver> @@ -171,7 +171,7 @@ % discussion, each property is illustrated attached to an % arbitrary \meta{key}, which when used may be supplied with a % \meta{value}. All key \emph{definitions} are local. -% +% % Key properties are applied in the reading order and so the ordering % is significant. Key properties which define \enquote{actions}, such % as |.code:n|, |.tl_set:N|, \emph{etc.}, will override one another. @@ -940,7 +940,7 @@ % any braces, another \cs{q_nil} needed before the next phase of the % parser. Finally, loop around for the next item, adding in the % \cs{q_nil}: this happens whatever the nature of the current argument -% as the end-of-recursion will clear up in all cases. +% as the end-of-recursion will clear up in all cases. % \begin{macrocode} \cs_new_protected:Npn \@@_parse_elt:w #1 , { @@ -1444,10 +1444,10 @@ % Auto-generating choices means setting up the root key as a choice, then % defining each choice in turn. % \begin{macrocode} -\cs_new_protected_nopar:Npn \@@_choices_make:nn +\cs_new_protected_nopar:Npn \@@_choices_make:nn { \@@_choices_make:Nnn \@@_choice_make: } -\cs_new_protected_nopar:Npn \@@_multichoices_make:nn - { \@@_choices_make:Nnn \@@_multichoice_make: } +\cs_new_protected_nopar:Npn \@@_multichoices_make:nn + { \@@_choices_make:Nnn \@@_multichoice_make: } \cs_new_protected:Npn \@@_choices_make:Nnn #1#2#3 { #1 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx index 32950238227..20c8535cf38 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3luatex.dtx 5646 2015-06-30 21:19:24Z joseph $ +\GetIdInfo$Id: l3luatex.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Experimental LuaTeX-specific functions} %</driver|package> %<*driver> @@ -74,7 +74,7 @@ % and with it access to the \enquote{internals} of \TeX{}. In order to use % this within the framework provided here, a family of functions is % available. When used with \pdfTeX{} or \XeTeX{} these will raise an -% error: use \cs{luatex_if_engine:T} to avoid this. Details of coding +% error: use \cs{sys_if_engine_luatex:T} to avoid this. Details of coding % the \LuaTeX{} engine are detailed in the \LuaTeX{} manual. % % \begin{function}[EXP, added = 2015-06-29]{\lua_now_x:n, \lua_now:n} @@ -88,7 +88,7 @@ % Each \cs{lua_now:n} block is treated by \Lua{} as a separate chunk. % The \Lua{} interpreter will execute the \meta{\Lua{} input} immediately, % and in an expandable manner. -% +% % In the case of the \cs{lua_now_x:n} version the input is fully expanded % by \TeX{} in an \texttt{x}-type manner \emph{but} the function remains % fully expandable. @@ -112,7 +112,7 @@ % The \Lua{} interpreter will execute the \meta{\Lua{} input} during the % page-building routine: no \TeX{} expansion of the \meta{\Lua{} input} % will occur at this stage. -% +% % In the case of the \cs{lua_shipout_x:n} version the input is fully % expanded by \TeX{} in an \texttt{x}-type manner during the shipout % operation. @@ -130,7 +130,7 @@ % \Lua{}: embedded backslashes, double and single quotes, and newlines % and carriage returns are escaped. This is done by prepending an extra % token consisting of a backslash with category code~$12$, and for the line -% endings, converting them to |\n| and |\r|, respectively. +% endings, converting them to |\n| and |\r|, respectively. % % In the case of the \cs{lua_escape_x:n} version the input is fully expanded % by \TeX{} in an \texttt{x}-type manner \emph{but} the function remains @@ -168,7 +168,7 @@ { \lua_shipout_x:n { \exp_not:n {#1} } } \cs_new:Npn \lua_escape_x:n #1 { \luatex_luaescapestring:D {#1} } \cs_new:Npn \lua_escape:n #1 { \lua_escape_x:n { \exp_not:n {#1} } } -\luatex_if_engine:F +\sys_if_engine_luatex:F { \clist_map_inline:nn { \lua_now_x:n , \lua_now:n , \lua_escape_x:n , \lua_escape:n } diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index 601d5cf0564..c2591f5a964 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3msg.dtx 5891 2015-08-25 08:00:59Z mittelba $ +\GetIdInfo$Id: l3msg.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Messages} %</driver|package> %<*driver> @@ -788,7 +788,7 @@ % the \cs{__msg_show_item:nn} and \cs{__msg_show_item_unbraced:nn} versions % for key--value like data structures. % \end{function} -% +% % \begin{variable}{\c__msg_coding_error_text_tl} % The text % \begin{verbatim} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx index 71c9f1513ff..d9335665249 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3names.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3names.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3names.dtx 5848 2015-08-17 05:27:13Z joseph $ +\GetIdInfo$Id: l3names.dtx 5939 2015-09-07 21:15:55Z joseph $ {L3 Namespace for primitives} %</driver|package> %<*driver> @@ -1138,6 +1138,15 @@ \tex_let:D \utex_mathcodenum:D \XeTeXmathcodenum \tex_fi:D % \end{macrocode} +% Up to v0.80, \LuaTeX{} defines the \pdfTeX{} version data: rather +% confusing. +% \begin{macrocode} +\etex_ifdefined:D \luatex_luatexversion:D + \tex_let:D \pdftex_pdftexbanner:D \tex_undefined:D + \tex_let:D \pdftex_pdftexbanner:D \tex_undefined:D + \tex_let:D \pdftex_pdftexversion:D \tex_undefined:D +\tex_fi:D +% \end{macrocode} % % For Con\TeX{}t, two tests are needed. Both Mark~II and Mark~IV move several % primitives: these are all covered by the first test, again using \cs{end} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx index 4d884f8381d..98272b0f9e7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3oldmodules.dtx @@ -122,7 +122,7 @@ %<l3tl>{l3tl} %<l3token>{l3token} % \end{macrocode} -% +% % Then identify the current package: % \begin{macrocode} \ProvidesPackage\old@liii@module@name diff --git a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx index d87e58b27af..9acff26f534 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3prg.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3prg.dtx 5891 2015-08-25 08:00:59Z mittelba $ +\GetIdInfo$Id: l3prg.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Control structures} %</driver|package> %<*driver> @@ -238,7 +238,7 @@ % All conditional |\bool_| functions except assignments are expandable % and expect the input to also be fully expandable (which will generally % mean being constructed from predicate functions, possibly nested). -% +% % \begin{texnote} % The \texttt{bool} data type is not implemented using the % \tn{iffalse}/\tn{iftrue} primitives, in contrast to \tn{newif}, @@ -1569,7 +1569,7 @@ % \end{macro} % % \subsection{Deprecated functions} -% +% % \begin{macro}[int]{\scan_align_safe_stop:} % Deprecated 2015-08-01 for removal after 2016-12-31. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx index e329b9bd45e..4dd4749c814 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx @@ -38,7 +38,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3skip.dtx 5893 2015-08-26 16:16:52Z mittelba $ +\GetIdInfo$Id: l3skip.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Dimensions and skips} %</driver|package> %<*driver> @@ -499,7 +499,7 @@ % \end{verbatim} % leaves |0.35277| in the input stream, \emph{i.e.}~the magnitude of % one big point when converted to millimetres. -% +% % Note that this function is not optimised for any particular output % and as such may give different results to \cs{dim_to_decimal_in_bp:n} % or \cs{dim_to_decimal_in_sp:n}. In particular, the latter is able to @@ -1451,7 +1451,7 @@ { \dim_to_decimal:n { ( #1 ) * 800 / 803 } } % \end{macrocode} % \end{macro} -% +% % \begin{macro}[EXP]{\dim_to_decimal_in_sp:n} % Another hard-coded conversion: this one is necessary to avoid things going % off-scale. diff --git a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx index e0787af4833..63129bb4fcb 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3str.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3str.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3str.dtx 5920 2015-09-05 07:55:06Z joseph $ +\GetIdInfo$Id: l3str.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Strings} %</driver|package> %<*driver> @@ -193,7 +193,7 @@ % % \begin{function}[rEXP, added = 2015-03-01] % { -% \str_lower_case:n, \str_lower_case:f, +% \str_lower_case:n, \str_lower_case:f, % \str_upper_case:n, \str_upper_case:f % } % \begin{syntax} @@ -204,7 +204,7 @@ % described for \cs{tl_to_str:n}, and then to the lower or upper % case representation using a one-to-one mapping as described by the % Unicode Consortium file |UnicodeData.txt|. -% +% % These functions are intended for case changing programmatic data in % places where upper/lower case distinctions are meaningful. One example % would be automatically generating a function name from user input where @@ -226,7 +226,7 @@ % would be used to generate a function with an auto-generated name consisting % of the upper case equivalent of the supplied name followed by the lower % case equivalent of the rest of the input. -% +% % These functions should \emph{not} be used for % \begin{itemize} % \item Caseless comparisons: use \cs{str_fold_case:n} for this @@ -393,7 +393,7 @@ % such tokens. % \begin{macrocode} \cs_new:Npn \__str_if_eq_x:nn #1#2 { \pdftex_strcmp:D {#1} {#2} } -\luatex_if_engine:T +\cs_if_exist:NT \luatex_luatexversion:D { \cs_set:Npn \__str_if_eq_x:nn #1#2 { @@ -579,7 +579,7 @@ \cs_generate_variant:Nn \str_upper_case:n { f } \cs_new:Npn \__str_change_case:nn #1 { - \exp_after:wN \__str_change_case_aux:nn \exp_after:wN + \exp_after:wN \__str_change_case_aux:nn \exp_after:wN { \tl_to_str:n {#1} } } \cs_new:Npn \__str_change_case_aux:nn #1#2 diff --git a/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx new file mode 100755 index 00000000000..baf4bfc8756 --- /dev/null +++ b/Master/texmf-dist/source/latex/l3kernel/l3sys.dtx @@ -0,0 +1,203 @@ +% \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. +%% +%% ----------------------------------------------------------------------- +% +%<*driver> +\documentclass[full]{l3doc} +%</driver> +%<*driver|package> +\GetIdInfo$Id$ + {L3 Experimental system/runtime functions} +%</driver|package> +%<*driver> +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +%</driver> +% \fi +% +% \title{^^A +% The \pkg{l3sys} package\\System/runtime functions^^A +% \thanks{This file describes v\ExplFileVersion, +% last revised \ExplFileDate.}^^A +% } +% +% \author{^^A +% The \LaTeX3 Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \date{Released \ExplFileDate} +% +% \maketitle +% +% \begin{documentation} +% +% \subsection{Engine-specific conditionals} +% +% \begin{function}[added = 2015-09-07, EXP, pTF]^^A +% {^^A +% \sys_if_engine_luatex:, +% \sys_if_engine_pdftex:, +% \sys_if_engine_ptex: , +% \sys_if_engine_uptex: , +% \sys_if_engine_xetex: +% } +% \begin{syntax} +% \cs{sys_if_engine_pdftex:TF} \Arg{true code} \Arg{false code} +% \end{syntax} +% Conditionals which allow engine-specific code to be used. The names +% follow naturally from those of the engine binaries: note that the +% |(u)ptex| tests are for \epTeX{} and \eupTeX{} as \pkg{expl3} requires +% the \eTeX{} extensions. Each conditional is true for +% \emph{exactly one} supported engine. In particular, +% |\sys_if_engine_ptex_p:| is true for \epTeX{} but false for \eupTeX{}. +% \end{function} +% +% \end{documentation} +% +% \begin{implementation} +% +% \section{\pkg{l3sys} implementation} +% +% \begin{macrocode} +%<*initex|package> +% \end{macrocode} +% +% \subsubsection{Detecting the engine} +% +% \begin{macro}[pTF, EXP]^^A +% {^^A +% \sys_if_engine_luatex:, +% \sys_if_engine_pdftex:, +% \sys_if_engine_ptex:, +% \sys_if_engine_uptex:, +% \sys_if_engine_xetex: +% } +% Set up the engine tests on the basis exactly one test should be true. +% Mainly a case of looking for the appropriate marker primitive. For +% \upTeX{}, there is a complexity in that setting |-kanji-internal=sjis| +% or |-kanji-internal=euc| effective makes it more like \pTeX{}. In those +% cases we therefore report \pTeX{} rather than \upTeX{}. +% \begin{macrocode} +\clist_map_inline:nn { lua , pdf , p , up , xe } + { + \cs_new_eq:cN { sys_if_engine_ #1 tex:T } \use_none:n + \cs_new_eq:cN { sys_if_engine_ #1 tex:F } \use:n + \cs_new_eq:cN { sys_if_engine_ #1 tex:TF } \use_ii:nn + \cs_new_eq:cN { sys_if_engine_ #1 tex_p: } \c_false_bool + } +\cs_if_exist:NT \luatex_luatexversion:D + { + \cs_gset_eq:NN \sys_if_engine_luatex:T \use:n + \cs_gset_eq:NN \sys_if_engine_luatex:F \use_none:n + \cs_gset_eq:NN \sys_if_engine_luatex:TF \use_i:nn + \cs_gset_eq:NN \sys_if_engine_luatex_p: \c_true_bool + } +\cs_if_exist:NT \pdftex_pdftexversion:D + { + \cs_gset_eq:NN \sys_if_engine_pdftex:T \use:n + \cs_gset_eq:NN \sys_if_engine_pdftex:F \use_none:n + \cs_gset_eq:NN \sys_if_engine_pdftex:TF \use_i:nn + \cs_gset_eq:NN \sys_if_engine_pdftex_p: \c_true_bool + } +\cs_if_exist:NT \ptex_kanjiskip:D + { + \bool_if:nTF + { + \cs_if_exist_p:N \uptex_disablecjktoken:D && + \int_compare_p:nNn { \ptex_jis:D "2121 } = { "3000 } + } + { + \cs_gset_eq:NN \sys_if_engine_uptex:T \use:n + \cs_gset_eq:NN \sys_if_engine_uptex:F \use_none:n + \cs_gset_eq:NN \sys_if_engine_uptex:TF \use_i:nn + \cs_gset_eq:NN \sys_if_engine_uptex_p: \c_true_bool + } + { + \cs_gset_eq:NN \sys_if_engine_ptex:T \use:n + \cs_gset_eq:NN \sys_if_engine_ptex:F \use_none:n + \cs_gset_eq:NN \sys_if_engine_ptex:TF \use_i:nn + \cs_gset_eq:NN \sys_if_engine_ptex_p: \c_true_bool + } + } +\cs_if_exist:NT \xetex_XeTeXversion:D + { + \cs_gset_eq:NN \sys_if_engine_xetex:T \use:n + \cs_gset_eq:NN \sys_if_engine_xetex:F \use_none:n + \cs_gset_eq:NN \sys_if_engine_xetex:TF \use_i:nn + \cs_gset_eq:NN \sys_if_engine_xetex_p: \c_true_bool + } +% \end{macrocode} +% \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} +% +% \begin{macrocode} +%</initex|package> +% \end{macrocode} +% +%\end{implementation} +% +%\PrintIndex diff --git a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx index 59d0b161e94..77673fbd8ef 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3tl.dtx @@ -37,7 +37,7 @@ \documentclass[full]{l3doc} %</driver> %<*driver|package> -\GetIdInfo$Id: l3tl.dtx 5908 2015-09-02 14:50:27Z joseph $ +\GetIdInfo$Id: l3tl.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Token lists} %</driver|package> %<*driver> @@ -326,7 +326,7 @@ % These functions allow the rescanning of tokens: re-apply \TeX{}'s % tokenization process to apply category codes different from those % in force when the tokens were absorbed. Whilst this functionality is -% supported, it is often preferable to find alternative approaches +% supported, it is often preferable to find alternative approaches % to achieving outcomes rather than rescanning tokens (for example % construction of token lists token-by-token with intervening category % code changes). @@ -1526,16 +1526,25 @@ { \@@_set_rescan:NNnn \prg_do_nothing: \use:n } \cs_new_protected:Npn \@@_set_rescan:NNnn #1#2#3#4 { - \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_newlinechar:D \tex_endlinechar:D - #3 \scan_stop: - \exp_args:No \@@_set_rescan:n { \tl_to_str:n {#4} } - \exp_args:NNNo - \group_end: - #1 #2 \l_@@_internal_a_tl + \tl_if_empty:nTF {#4} + { + \group_begin: + #3 + \group_end: + #1 #2 { } + } + { + \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_newlinechar:D \tex_endlinechar:D + #3 \scan_stop: + \exp_args:No \@@_set_rescan:n { \tl_to_str:n {#4} } + \exp_args:NNNo + \group_end: + #1 #2 \l_@@_internal_a_tl + } } \cs_new_protected:Npn \@@_set_rescan_multi:n #1 { diff --git a/Master/texmf-dist/source/latex/l3kernel/l3unicode-data.dtx b/Master/texmf-dist/source/latex/l3kernel/l3unicode-data.dtx index 79fbc2783e6..657e868ae21 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3unicode-data.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3unicode-data.dtx @@ -38,7 +38,7 @@ % plain \TeX{}, set up in generic mode. %<*driver|script> \input expl3-generic\relax -\GetIdInfo$Id: l3unicode-data.dtx 5897 2015-08-28 09:06:29Z joseph $ +\GetIdInfo$Id: l3unicode-data.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Case data script} %</driver|script> % @@ -137,7 +137,7 @@ % \end{macrocode} % % \subsection{Setup} -% +% % \begin{variable}{\l__unicode_tmp_tl} % Scratch space. % \begin{macrocode} @@ -281,7 +281,7 @@ \use:x { \cs_new_protected:Npn - \exp_not:N \__unicode_parse_line:w ##1 - ##2 \tl_to_str:n { .txt } + \exp_not:N \__unicode_parse_line:w ##1 - ##2 \tl_to_str:n { .txt } } #3 \scan_stop: #4 { @@ -340,7 +340,7 @@ %% \__unicode_verb_end: % \end{macrocode} -% +% % \begin{macro}[EXP]{\__unicode_zero_fill:N} % A short piece of reusable code for the header. % \begin{macrocode} @@ -380,8 +380,8 @@ { l3unicode-data.def } ~ { \int_use:N \tex_year:D / - \__unicode_zero_fill:N \tex_month:D / - \__unicode_zero_fill:N \tex_day:D + \__unicode_zero_fill:N \tex_month:D / + \__unicode_zero_fill:N \tex_day:D } ~ { -1 } ~ { L3~Unicode~data } @@ -407,7 +407,11 @@ % range), no-op data is included (as the \emph{output} would be out-of-range). % \begin{macrocode} \__unicode_verb: -\pdftex_if_engine:T +\bool_if:nF + { + \sys_if_engine_luatex_p: || + \sys_if_engine_xetex_p: + } { \group_begin: \cs_set_protected:Npn \__unicode_tmp:NN #1#2 @@ -687,7 +691,7 @@ % \end{macrocode} % % Saving the data uses a single file, with the two arrays followed by the -% exceptions. +% exceptions. % \begin{macrocode} \tl_map_inline:nn { 0123456789 } { @@ -715,7 +719,7 @@ } } \clist_map_inline:nn - { upper , lower , title } + { upper , lower , title } { \iow_now:Nx \g__unicode_result_iow { @@ -724,7 +728,7 @@ { c__unicode_ \str_if_eq:nnTF {#1} { title } { mixed } {#1} - _exceptions_tl + _exceptions_tl } { \exp_not:v { l__unicode_ #1 _ exceptions_tl } } } @@ -917,4 +921,4 @@ % % \end{implementation} % -% \PrintIndex
\ No newline at end of file +% \PrintIndex |