diff options
author | Karl Berry <karl@freefriends.org> | 2010-09-13 16:20:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-09-13 16:20:18 +0000 |
commit | 4b0df656c35cd9a2eded4e224631cc9d74fe70d4 (patch) | |
tree | dd2f0014181215f7f21f2be0d19ceb3c88db01c1 /Master/texmf-dist | |
parent | 911279d196a13bf093ab94e5373318522abb08f2 (diff) |
expl3 update (26jul10)
git-svn-id: svn://tug.org/texlive/trunk@19701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
16 files changed, 691 insertions, 219 deletions
diff --git a/Master/texmf-dist/doc/latex/expl3/expl3.pdf b/Master/texmf-dist/doc/latex/expl3/expl3.pdf Binary files differindex d39de4dec1e..d6843a90040 100644 --- a/Master/texmf-dist/doc/latex/expl3/expl3.pdf +++ b/Master/texmf-dist/doc/latex/expl3/expl3.pdf diff --git a/Master/texmf-dist/doc/latex/expl3/l3calc.pdf b/Master/texmf-dist/doc/latex/expl3/l3calc.pdf Binary files differindex abc9988d515..9fcf61288b7 100644 --- a/Master/texmf-dist/doc/latex/expl3/l3calc.pdf +++ b/Master/texmf-dist/doc/latex/expl3/l3calc.pdf diff --git a/Master/texmf-dist/doc/latex/expl3/source3.pdf b/Master/texmf-dist/doc/latex/expl3/source3.pdf Binary files differindex 27bef1ec5a9..2b91c30f255 100644 --- a/Master/texmf-dist/doc/latex/expl3/source3.pdf +++ b/Master/texmf-dist/doc/latex/expl3/source3.pdf diff --git a/Master/texmf-dist/source/latex/expl3/source3.tex b/Master/texmf-dist/doc/latex/expl3/source3.tex index af54c2329c7..33ba1db3a99 100644 --- a/Master/texmf-dist/source/latex/expl3/source3.tex +++ b/Master/texmf-dist/doc/latex/expl3/source3.tex @@ -381,6 +381,9 @@ note}' section: % \DocInput{l3alloc.dtx} % \DocInput{l3chk.dtx} +\DocInput{l3fp.dtx} +\DocInput{l3luatex.dtx} + \part{Implementation} \def\maketitle{} \EnableImplementation diff --git a/Master/texmf-dist/source/latex/expl3/expl3.dtx b/Master/texmf-dist/source/latex/expl3/expl3.dtx index 8f2af1a5a2a..0251c705b42 100644 --- a/Master/texmf-dist/source/latex/expl3/expl3.dtx +++ b/Master/texmf-dist/source/latex/expl3/expl3.dtx @@ -37,7 +37,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: expl3.dtx 1982 2010-07-13 07:16:14Z joseph $ +\GetIdInfo$Id: expl3.dtx 1987 2010-07-25 14:55:46Z joseph $ {L3 Experimental code bundle wrapper}% %\iffalse %<*driver> @@ -317,7 +317,7 @@ % \item[stream] an input or output stream (for reading from or writing % to, respectively); % \item[bool] either true or false (the \LaTeX3 implementation does -% not use \cs{iftrue} or \cs{ iffalse}). +% not use \cs{iftrue} or \cs{iffalse}). %\end{description} % When the \m{type} and \m{module} are identical (as often happens in % the more basic modules) the \m{module} part is often omitted for @@ -921,6 +921,7 @@ l3xref, l3file, l3fp, + l3luatex, } \RequirePackage{calc} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/expl3/l3.ins b/Master/texmf-dist/source/latex/expl3/l3.ins deleted file mode 100644 index d15965fbda3..00000000000 --- a/Master/texmf-dist/source/latex/expl3/l3.ins +++ /dev/null @@ -1,121 +0,0 @@ - -\input docstrip.tex -\askforoverwritefalse - -\preamble - - -EXPERIMENTAL CODE - -Do not distribute this file without also distributing the -source files specified above. - -Do not distribute a modified version of this file. - - -\endpreamble -% stop docstrip adding \endinput -\postamble -\endpostamble - -\keepsilent - -% wrapper package for the expl3 bundle -\generate{\file{expl3.sty}{\from{expl3.dtx}{package}}} - - -% l3names.sty sets up the naming scheme for TeX primitives. -\generate{\file{l3names.sty}{\from{l3names.dtx}{package}}} - - - -% Define some basic commands to get us started with the new -% programming style. -\generate{\file{l3basics.sty}{\from{l3basics.dtx}{package,trace}}} - - -% Define some basic commands that check various conditions -% related to defining commands eg defined/undefined global/local -% Not sure how much of this really makes sense as a package, but... -\generate{\file{l3chk.sty}{\from{l3chk.dtx}{package,trace}}} - - -%% toks register handling (can be compiled with check module) -\generate{\file{l3toks.sty}{\from{l3toks.dtx}{package,trace}}} - - -%% token lists -\generate{\file{l3tl.sty}{\from{l3tl.dtx}{package,trace}}} - - -%% LaTeX3 expansion module -\generate{\file{l3expan.sty}{\from{l3expan.dtx}{package,trace}}} - - -%% LaTeX3 quarks. -\generate{\file{l3quark.sty}{\from{l3quark.dtx}{package,trace}}} - - -%% LaTeX3 sequences. -\generate{\file{l3seq.sty}{\from{l3seq.dtx}{package,trace}}} - - -%% LaTeX3 clists. -\generate{\file{l3clist.sty}{\from{l3clist.dtx}{package,trace}}} - - -%% LaTeX3 property lists. -\generate{\file{l3prop.sty}{\from{l3prop.dtx}{package,trace}}} - - -%% LaTeX3 fake integer macros. --- this is still needed in places such as xor !!! -\generate{\file{l3num.sty}{\from{l3num.dtx}{package,trace}}} - -%% LaTeX3 integer registers. (can be compiled with check module) -\generate{\file{l3int.sty}{\from{l3int.dtx}{package,trace}}} - -%% LaTeX3 integer expressions. -\generate{\file{l3intexpr.sty}{\from{l3intexpr.dtx}{package,trace}}} - - -%% LaTeX3 skip registers. -\generate{\file{l3skip.sty}{\from{l3skip.dtx}{package,trace}}} - - -%% LaTeX3 precompilation -\generate{\file{l3precom.sty}{\from{l3precom.dtx}{package,precompile,trace}}} - -%% LaTeX3 I/O module. -\generate{\file{l3io.sty}{\from{l3io.dtx}{package,trace}}} - -%% LaTeX3 program control structures (loops, booleans, ...) -\generate{\file{l3prg.sty}{\from{l3prg.dtx}{package}}} - -%% LaTeX3 box module -\generate{\file{l3box.sty}{\from{l3box.dtx}{package}}} - -%% LaTeX3 messages -\generate{\file{l3msg.sty}{\from{l3msg.dtx}{package}}} - -%% LaTeX3 tokens -\generate{\file{l3token.sty}{\from{l3token.dtx}{package}}} - -%% LaTeX3 cross references -\generate{\file{l3xref.sty}{\from{l3xref.dtx}{package}}} -%%\generate{\file{l3xref-test.tex}{\from{l3xref.dtx}{testfile}}} - -%% LaTeX3 calc module -\generate{\file{l3calc.sty}{\from{l3calc.dtx}{package}}} - -%% LaTeX3 keyval modules -\generate{\file{l3keyval.sty}{\from{l3keyval.dtx}{package}}} -\generate{\file{l3keys.sty}{\from{l3keys.dtx}{package}}} - -%% LaTeX3 file loading -\generate{\file{l3file.sty}{\from{l3file.dtx}{package}}} - -%% LaTeX3 floating point unit -\generate{\file{l3fp.sty}{\from{l3fp.dtx}{package}}} - - -\endbatchfile diff --git a/Master/texmf-dist/source/latex/expl3/l3doc.dtx b/Master/texmf-dist/source/latex/expl3/l3doc.dtx index e56cd330ecc..df4cdf0ab5f 100644 --- a/Master/texmf-dist/source/latex/expl3/l3doc.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3doc.dtx @@ -77,7 +77,7 @@ Do not distribute a modified version of this file. % \end{macrocode} % %<*driver|class> -\GetIdInfo$Id: l3doc.dtx 1890 2010-04-11 03:37:15Z will $ +\GetIdInfo$Id: l3doc.dtx 1987 2010-07-25 14:55:46Z joseph $ {L3 Experimental documentation class} %</driver|class> % @@ -558,6 +558,11 @@ Do not distribute a modified version of this file. \if b\expandafter\@car\f@series\@nil\boldmath\fi $\m@th\varepsilon$-\TeX } +\providecommand*\IniTeX{Ini\TeX} +\providecommand*\Lua{Lua} +\providecommand*\LuaTeX{\Lua\TeX} +\providecommand*\pdfTeX{pdf\TeX} +\RequirePackage{graphicx} \cs_if_free:NT \XeTeX { \cs_new_protected_nopar:Npn \XeTeX {X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\TeX} @@ -700,7 +705,9 @@ Do not distribute a modified version of this file. % the argument. % \end{arguments} % \begin{macrocode} -\cs_set_nopar:Npn \function_aux:n #1 { +\group_begin: +\char_make_other:N \| +\cs_gset_nopar:Npn \function_aux:n #1 { \cs_set_nopar:Npn \nextnewline{\cs_gset_nopar:Npn\nextnewline{\\}} \tl_gset_eq:NN \g_doc_macro_tl \c_empty_tl \bigskip\endgraf\noindent\ttfamily @@ -711,6 +718,7 @@ Do not distribute a modified version of this file. \endtabular \group_end: } +\group_end: % \end{macrocode} % \end{macro} % \end{environment} @@ -720,7 +728,9 @@ Do not distribute a modified version of this file. % This function reads in a "|"-separated list, passing each item to % the auxiliary function "\doc_showmacro_aux:w". % \begin{macrocode} -\cs_set_nopar:Npn \doc_showmacro:w #1 | { +\group_begin: +\char_make_other:N \| +\cs_gset_nopar:Npn \doc_showmacro:w #1 | { \tl_if_blank:nTF {#1} { \use_none:n }{ @@ -728,6 +738,7 @@ Do not distribute a modified version of this file. \peek_meaning:NTF \q_stop { \use_none:n } { \doc_showmacro:w } } } +\group_end: % \end{macrocode} % \end{macro} % diff --git a/Master/texmf-dist/source/latex/expl3/l3format.ins b/Master/texmf-dist/source/latex/expl3/l3format.ins deleted file mode 100644 index fc3e62d85f0..00000000000 --- a/Master/texmf-dist/source/latex/expl3/l3format.ins +++ /dev/null @@ -1,81 +0,0 @@ - -\input docstrip.tex -\askforoverwritefalse - -\preamble - - -EXPERIMENTAL CODE - -Do not distribute this file without also distributing the -source files specified above. - -Do not distribute a modified version of this file. - - -\endpreamble -% stop docstrip adding \endinput -\postamble -\endpostamble - -\keepsilent - -% generate the format file -\generate{% - \file{latex3.ltx}{% - \from{l3names.dtx}{initex} % The naming conventions - \from{l3basics.dtx}{initex} % Initialisations - \from{l3expan.dtx}{initex} % Controlling expansion of arguments - \from{l3tl.dtx}{initex} % token list variables - \from{l3intexpr.dtx}{initex} % - \from{l3quark.dtx}{initex} % quarks - \from{l3seq.dtx}{initex} % Sequences and stacks -% - \from{l3alloc.dtx}{initex} % Register allocations -% - \from{l3toks.dtx}{initex} % dealing with token registers - \from{l3int.dtx}{initex} % dealing with integer registers - \from{l3prg.dtx}{initex} % Program control structures - \from{l3clist.dtx}{initex} % Comma separated lists - \from{l3token.dtx}{initex} % token investigation - \from{l3prop.dtx}{initex} % property lists - \from{l3msg.dtx}{initex} % setting up for user communication - \from{l3io.dtx}{initex} % dealing with I/O - \from{l3skip.dtx}{initex} % dealing with skip registers - \from{l3box.dtx}{initex} % dealing with box registers - \from{l3keyval.dtx}{initex} % - \from{l3keys.dtx}{initex} % -% -% \from{l3precom.dtx}{initex,precompile} % -% - \from{l3calc.dtx}{initex} % - \from{l3xref.dtx}{initex} % Cross references - \from{l3file.dtx}{initex} % file loading -% - \from{l3vers.dtx}{initex} % Version information -% -% -% \from{l3chk.dtx}{initex} % Checking functions -% - \from{l3final.dtx}{initex} % Final wrap-up - } -} - -% generate higher-level material -\generate{% - \file{xparse.ltx}{\from{xparse.dtx}{initex}} - \file{xtemplate.ltx}{\from{xtemplate.dtx}{initex}} -} - -\Msg{} -\Msg{*************************************} -\Msg{*} -\Msg{* Now run (PDF)INITEX on lbase.ltx} -\Msg{*} -\Msg{* On an up to date system, run } -\Msg{* pdftex -ini -etex *latex3.ltx } -\Msg{*} -\Msg{*************************************} -\Msg{} - -\endbatchfile diff --git a/Master/texmf-dist/source/latex/expl3/l3fp.dtx b/Master/texmf-dist/source/latex/expl3/l3fp.dtx index 7b3b63ba16f..bb64842ee90 100644 --- a/Master/texmf-dist/source/latex/expl3/l3fp.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3fp.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3fp.dtx 1979 2010-07-08 19:51:19Z joseph $ +\GetIdInfo$Id: l3fp.dtx 1985 2010-07-18 09:05:56Z joseph $ {L3 Experimental floating-point operations} %\iffalse %<*driver> @@ -2228,7 +2228,7 @@ % When reaching the digit to check for rounding, the discards are used % to indicate if there is an exact half to take into account. When the % rounding takes place without an exact half, things are the same as -% for the \enquote{away from zero} approach. When rounding an exact +% for the `away from zero' approach. When rounding an exact % half, there is an odd/even test before applying any modification. % \begin{macrocode} \cs_new_protected_nopar:cpn { fp_round_half-even: } { diff --git a/Master/texmf-dist/source/latex/expl3/l3luatex.dtx b/Master/texmf-dist/source/latex/expl3/l3luatex.dtx new file mode 100644 index 00000000000..471c573efd3 --- /dev/null +++ b/Master/texmf-dist/source/latex/expl3/l3luatex.dtx @@ -0,0 +1,432 @@ +% \iffalse +%% File: l3fp.dtx Copyright (C) 2010 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 ``expl3 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. +%% +%% ----------------------------------------------------------------------- +%<*driver|package> +\RequirePackage{l3names} +%</driver|package> +%\fi +\GetIdInfo$Id: l3luatex.dtx 1985 2010-07-18 09:05:56Z joseph $ + {L3 Experimental LuaTeX functions} +%\iffalse +%<*driver> +%\fi +\ProvidesFile{\filename.\filenameext} + [\filedate\space v\fileversion\space\filedescription] +%\iffalse +\documentclass[full]{l3doc} +\begin{document} + \DocInput{l3fp.dtx} +\end{document} +%</driver> +% \fi +% +% \title{The \textsf{l3luatex} package\thanks{This file +% has version number \fileversion, last +% revised \filedate.}\\ +% \LuaTeX-specific functions} +% \author{\Team} +% \date{\filedate} +% \maketitle +% +%\begin{documentation} +% +%\section{Breaking out to \Lua} +% +% The \LuaTeX\ engine provides access to the \Lua\ programming language, +% and with it access to the 'internals' of \TeX. In order to use +% this within the framework provided here, two functions are available. +% When used with \pdfTeX\ or \XeTeX these will raise an error: use +% \cs{engine_if_luatex:T} to avoid this. Details of coding the \LuaTeX\ +% engine are detailed in the \LuaTeX\ manual. +% +%\begin{function}{ \lua_now:x / (EXP) } +% \begin{syntax} +% \cs{lua_now:x} \Arg{token list} +% \end{syntax} +% The \meta{token list} is fully expandable using the current +% applicable \TeX\ category codes: this will include converting line +% ends to spaces in the usual \TeX\ manner. The resulting +% \meta{Lua input} is passed to the Lua interpreter for processing. +% Each \cs{lua_now:x} block is treated by Lua as a separate chunk. +% The Lua interpreter will execute the \meta{Lua input} immediately, +% and in an expandable manner. +%\end{function} +% +%\begin{function}{ \lua_shipout:x / (EXP) } +% \begin{syntax} +% \cs{lua_shipout:x} \Arg{token list} +% \end{syntax} +% The \meta{token list} is fully expandable using the current +% applicable \TeX\ category codes: this will include converting line +% ends to spaces in the usual \TeX\ manner. The resulting +% \meta{Lua input} is passed to the Lua interpreter for processing. +% Each \cs{lua_now:x} block is treated by Lua as a separate chunk. +% The Lua interpreter will execute the \meta{Lua input} during the +% page-building routine. (At a \TeX\ level, the \meta{Lua input} is +% stored as a 'whatsit'.) +%\end{function} +% +%\section{Category code tables} +% +% As well as providing methods to break out into \Lua, there are +% places where additional \LaTeX3 functions are provided by the +% \LuaTeX\ engine. In particular, \LuaTeX\ provides category code +% tables. These can be used to ensure that a set of category codes +% are in force in a more robust way than is possible with other +% engines. These are therefore used by \cs{ExplSyntaxOn} and +% \pkg{ExplSyntaxOff} when using the \LuaTeX\ engine. +% +%\begin{function}{ \cctab_new:N } +% \begin{syntax} +% \cs{cctab_new:N} \meta{category code table} +% \end{syntax} +% Creates a new category code table, initially with the codes as +% used by \IniTeX. +%\end{function} +% +%\begin{function}{ \cctab_gset:Nn } +% \begin{syntax} +% \cs{cctab_gset:Nn} \meta{category code table} +% \Arg{category code set up} +% \end{syntax} +% Sets the \meta{category code table} to apply the category codes +% which apply when the prevailing regime is modified by the +% \meta{category code set up}. Thus within a standard code block +% the starting point will be the code applied by \cs{c_code_cctab}. +% The assignment of the table is global: the underlying primitive does +% not respect grouping. +%\end{function} +% +%\begin{function}{ \cctab_begin:N } +% \begin{syntax} +% \cs{cctab_begin:N} \meta{category code table} +% \end{syntax} +% Switches the category codes in force to those stored in the +% \meta{category code table}. The prevailing codes before the +% function is called are added to a stack, for use with +% \cs{cctab_end:}. +%\end{function} +% +%\begin{function}{ \cctab_end: } +% \begin{syntax} +% \cs{cctab_end:} +% \end{syntax} +% Ends the scope of a \meta{category code table} started using +% \cs{cctab_begin:N}, retuning the codes to those in force before the +% matching \cs{cctab_begin:N} was used. +%\end{function} +% +%\begin{variable}{ \c_code_cctab } +% Category code table for the code environment. This does not include +% setting the behaviour of the line-end character, which is only +% altered by \cs{ExplSyntaxOn}. +%\end{variable} +% +%\begin{variable}{ \c_document_cctab } +% Category code table for a standard \LaTeX\ document. This does not +% include setting the behaviour of the line-end character, which is +% only altered by \cs{ExplSyntaxOff}. +%\end{variable} +% +%\begin{variable}{ \c_initex_cctab } +% Category code table as set up by \IniTeX. +%\end{variable} +% +%\begin{variable}{ \c_other_cctab } +% Category code table where all characters have category code \( 12 \) +% (other). +%\end{variable} +% +%\begin{variable}{ \c_string_cctab } +% Category code table where all characters have category code \( 12 \) +% (other) with the exception of spaces, which have category code +% \( 10 \) (space). +%\end{variable} +% +%\end{documentation} +% +%\begin{implementation} +% +%\section{Implementation} +% +% Announce and ensure that the required packages are loaded. +% \begin{macrocode} +%<*package> +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\package_check_loaded_expl: +%</package> +%<*initex|package> +% \end{macrocode} +% +%\begin{macro}{\lua_now:x} +%\begin{macro}{\lua_shipout:x} +%\begin{macro}{\lua_wrong_engine:} +% When \LuaTeX\ is in use, this is all a question of primitives with new +% names. On the other hand, for \pdfTeX\ and \XeTeX\ the argument should +% be removed from the input stream before issuing an error. This needs +% to be expandable, so the same idea is used as for \texttt{V}-type +% expansion, with an appropriately-named but undefined function. +% \begin{macrocode} +\luatex_if_engine:TF + { + \cs_new_eq:NN \lua_now:x \luatex_directlua:D + \cs_new_eq:NN \lua_shipout:x \luatex_latelua:D + } + { + \cs_new:Npn \lua_now:x #1 { \lua_wrong_engine: } + \cs_new:Npn \lua_shipout:x #1 { \lua_wrong_engine: } + } +\group_begin: +\char_make_letter:N\! +\char_make_letter:N\ % +\cs_gset:Npn\lua_wrong_engine:{% +\LuaTeX engine not in use!% +}% +\group_end:% +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\subsection{Category code tables} +% +%\begin{macro}{\g_cctab_allocate_int} +%\begin{macro}{\g_cctab_stack_int} +%\begin{macro}{\g_cctab_stack_seq} +% To allocate category code tables, both the read-only and stack +% tables need to be followed. There is also a sequence stack for the +% dynamic tables themselves. +% \begin{macrocode} +\int_new:N \g_cctab_allocate_int +\int_set:Nn \g_cctab_allocate_int { -1 } +\int_new:N \g_cctab_stack_int +\seq_new:N \g_cctab_stack_seq +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\begin{macro}{\cctab_new:N} +% Creating a new category code table is done slightly differently +% from other registers. Low-numbered tables are more efficiently-stored +% than high-numbered ones. There is also a need to have a stack of +% flexible tables as well as the set of read-only ones. To satisfy both +% of these requirements, odd numbered tables are used for read-only +% tables, and even ones for the stack. Here, therefore, the odd numbers +% are allocated. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \cctab_new:N #1 { + \cs_if_free:NTF #1 + { + \int_gadd:Nn \g_cctab_allocate_int { 2 } + \int_compare:nNnTF + { \g_cctab_allocate_int } < { \c_allocate_max_tl + 1 } + { + \tex_global:D \tex_mathchardef:D #1 \g_cctab_allocate_int + \luatex_initcatcodetable:D #1 + } + { + \msg_kernel_error:nnx { code } { out-of-registers } { cctab } + } + } + { + \msg_kernel_error:nnx { code } { variable-already-defined } + { \token_to_str:N #1 } + } +} +\luatex_if_engine:F { + \cs_set_protected_nopar:Npn \cctab_new:N #1 { \lua_wrong_engine: } +} +%<*package> +\luatex_if_engine:T { + \cs_set_protected_nopar:Npn \cctab_new:N #1 + { + \newcatcodetable #1 + \luatex_initcatcodetable:D #1 + } +} +%</package> +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\cctab_begin:N} +%\begin{macro}{\cctab_end:} +%\begin{macro}{\l_cctab_tmp_tl} +% The aim here is to ensure that the saved tables are read-only. This is +% done by using a stack of tables which are not read only, and actually +% having them as 'in use' copies. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \cctab_begin:N #1 { + \seq_gpush:Nx \g_cctab_stack_seq { \tex_the:D \luatex_catcodetable:D } + \luatex_catcodetable:D #1 + \int_gadd:Nn \g_cctab_stack_int { 2 } + \int_compare:nNnT { \g_cctab_stack_int } > { 268435453 } + { \msg_kernel_error:nn { code } { cctab-stack-full } } + \luatex_savecatcodetable:D \g_cctab_stack_int + \luatex_catcodetable:D \g_cctab_stack_int +} +\cs_new_protected_nopar:Npn \cctab_end: { + \int_gsub:Nn \g_cctab_stack_int { 2 } + \seq_gpop:NN \g_cctab_stack_seq \l_cctab_tmp_tl + \quark_if_no_value:NT \l_cctab_tmp_tl + { \tl_set:Nn \l_cctab_tmp_tl { 0 } } + \luatex_catcodetable:D \l_cctab_tmp_tl \scan_stop: +} +\luatex_if_engine:F { + \cs_set_protected_nopar:Npn \cctab_begin:N #1 { \lua_wrong_engine: } + \cs_set_protected_nopar:Npn \cctab_end: { \lua_wrong_engine: } +} +%<*package> +\luatex_if_engine:T { + \cs_set_protected_nopar:Npn \cctab_begin:N #1 + { \BeginCatcodeRegime #1 } + \cs_set_protected_nopar:Npn \cctab_end: + { \EndCatcodeRegime } +} +%</package> +\tl_new:N \l_cctab_tmp_tl +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\begin{macro}{\cctab_gset:Nn} +% Category code tables are always global, so only one version is needed. +% The set up here is simple, and means that at the point of use there is +% no need to worry about escaping category codes. +% \begin{macrocode} +\cs_new_protected:Npn \cctab_gset:Nn #1#2 { + \group_begin: + #2 + \luatex_savecatcodetable:D #1 + \group_end: +} +\luatex_if_engine:F { + \cs_set_protected_nopar:Npn \cctab_gset:Nn #1#2 { \lua_wrong_engine: } +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\c_code_cctab} +%\begin{macro}{\c_document_cctab} +%\begin{macro}{\c_initex_cctab} +%\begin{macro}{\c_other_cctab} +%\begin{macro}{\c_string_cctab} +% Creating category code tables is easy using the function above. +% The \texttt{other} and \texttt{string} ones are done by completely +% ignoring the existing codes as this makes life a lot less complex. The +% table for \pkg{expl3} category codes is always needed, whereas when in +% package mode the rest can be copied from the existing \LaTeXe\ package +% \pkg{luatex}. +% \begin{macrocode} +\luatex_if_engine:T { + \cctab_new:N \c_code_cctab + \cctab_gset:Nn \c_code_cctab { } +} +%<*package> +\luatex_if_engine:T { + \cs_new_eq:NN \c_document_cctab \CatcodeTableLaTeX + \cs_new_eq:NN \c_initex_cctab \CatcodeTableIniTeX + \cs_new_eq:NN \c_other_cctab \CatcodeTableOther + \cs_new_eq:NN \c_string_cctab \CatcodeTableString +} +%</package> +%<*!package> +\luatex_if_engine:T { + \cctab_new:N \c_document_cctab + \cctab_new:N \c_other_cctab + \cctab_new:N \c_string_cctab + \cctab_gset:Nn \c_document_cctab + { + \char_make_space:n { 9 } + \char_make_space:n { 32 } + \char_make_other:n { 58 } + \char_make_subscript:n { 95 } + \char_make_active:n { 126 } + } + \cctab_gset:Nn \c_other_cctab + { + \prg_stepwise_inline:nnnn { 0 } { 1 } { 127 } + { \char_make_other:n {#1} } + } + \cctab_gset:Nn \c_string_cctab + { + \prg_stepwise_inline:nnnn { 0 } { 1 } { 127 } + { \char_make_other:n {#1} } + \char_make_space:n { 32 } + } +} +%</!package> +% \end{macrocode} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +%\end{macro} +% +%\begin{macro}{\ExplSyntaxOn} +% When using \LuaTeX, \cs{ExplSyntaxOn} can be redefined to used category +% code tables. +% \begin{macrocode} +\luatex_if_engine:T { + \cs_set_protected_nopar:Npn \ExplSyntaxOn + { + \tex_ifodd:D \ExplSyntaxStatus \scan_stop: + \tex_else:D + \cs_set_protected_nopar:Npx \ExplSyntaxOff + { + \cctab_end: + \tex_endlinechar:D = + \tex_the:D \tex_endlinechar:D \scan_stop: + \cs_set_protected:Npn \ExplSyntaxOff { } + \tl_set:Nn \exp_not:N \ExplSyntaxStatus { 0 } + } + \tl_set:Nn \ExplSyntaxStatus { 1 } + \cctab_begin:N \c_code_cctab + \tex_endlinechar:D = 32 \scan_stop: + \tex_fi:D + } +} +% \end{macrocode} +%\end{macro} +% +% \begin{macrocode} +%</initex|package> +% \end{macrocode} +% +%\end{implementation} +% +%\PrintChanges +% +%\PrintIndex
\ No newline at end of file diff --git a/Master/texmf-dist/source/latex/expl3/l3names.dtx b/Master/texmf-dist/source/latex/expl3/l3names.dtx index 99b224d62c5..659cf399330 100644 --- a/Master/texmf-dist/source/latex/expl3/l3names.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3names.dtx @@ -128,7 +128,7 @@ \RequirePackage{l3names} %</driver> %\fi -\GetIdInfo$Id: l3names.dtx 1981 2010-07-11 07:28:30Z will $ +\GetIdInfo$Id: l3names.dtx 1987 2010-07-25 14:55:46Z joseph $ {L3 Experimental Naming Scheme for TeX Primitives} % % @@ -299,6 +299,25 @@ } %</initex|package> % \end{macrocode} +% +%\subsection{Lua\TeX\ work} +% +% When being used as a package, managing some Lua\TeX\ primitives has to +% work correctly with other packages. This is done by loading the +% \pkg{luatex} package and making the appropriate adjustments. +% \begin{macrocode} +\def\@tempa{% + \def\@tempa{}% + \RequirePackage{luatex}% + \RequirePackage{pdftexcmds}% + \let\pdfstrcmp\pdf@strcmp +} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname directlua\endcsname\relax +\else + \expandafter\@tempa +\fi +% \end{macrocode} % % \subsection{Catcode assignments} % @@ -932,11 +951,14 @@ \name_primitive:NN \pdfnoligatures \pdf_noligatures:D % \end{macrocode} % -% We're ignoring XeTeX and LuaTeX right -% now except for a check whether they're in use: +% Only a little bit of \XeTeX\ and Lua\TeX\ at the moment. % \begin{macrocode} \name_primitive:NN \XeTeXversion \xetex_version:D +\name_primitive:NN \catcodetable \luatex_catcodetable:D \name_primitive:NN \directlua \luatex_directlua:D +\name_primitive:NN \initcatcodetable \luatex_initcatcodetable:D +\name_primitive:NN \latelua \luatex_latelua:D +\name_primitive:NN \savecatcodetable \luatex_savecatcodetable:D % \end{macrocode} % % XeTeX adds \cs{strcmp} to the set of primitives, with the same @@ -1154,7 +1176,7 @@ % as the packages in this distribution do like this: % \begin{verbatim} % \RequirePackage{l3names} -% \GetIdInfo$Id: l3names.dtx 1981 2010-07-11 07:28:30Z will $ +% \GetIdInfo$Id: l3names.dtx 1987 2010-07-25 14:55:46Z joseph $ % {L3 Experimental Box module} % \ProvidesExplPackage % {\filename}{\filedate}{\fileversion}{\filedescription} @@ -1297,6 +1319,9 @@ \tex_let:D\tex_everydisplay:D \frozen@everydisplay \tex_let:D\tex_italiccor:D \@@italiccorr \tex_let:D\tex_hyphen:D \@@hyph +\tex_let:D\luatex_catcodetable:D \luatexcatcodetable +\tex_let:D\luatex_initcatcodetable:D \luatexinitcatcodetable +\tex_let:D\luatex_savecatcodetable:D \luatexsavecatcodetable % \end{macrocode} % % \TeX\ has a nasty habit of inserting a command with the name |\par| diff --git a/Master/texmf-dist/tex/latex/expl3/expl3.sty b/Master/texmf-dist/tex/latex/expl3/expl3.sty index 108bdfb6a7d..63917163f94 100644 --- a/Master/texmf-dist/tex/latex/expl3/expl3.sty +++ b/Master/texmf-dist/tex/latex/expl3/expl3.sty @@ -49,7 +49,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: expl3.dtx 1982 2010-07-13 07:16:14Z joseph $ +\GetIdInfo$Id: expl3.dtx 1987 2010-07-25 14:55:46Z joseph $ {L3 Experimental code bundle wrapper}% \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} @@ -88,6 +88,7 @@ l3xref, l3file, l3fp, + l3luatex, } \RequirePackage{calc} \bool_if:nT { \@l@expl@check@declarations@bool } { diff --git a/Master/texmf-dist/tex/latex/expl3/l3doc.cls b/Master/texmf-dist/tex/latex/expl3/l3doc.cls index 286c61a03a5..e747cf92e84 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3doc.cls +++ b/Master/texmf-dist/tex/latex/expl3/l3doc.cls @@ -53,7 +53,7 @@ \let \filedateOld \filedate \let \fileversionOld \fileversion \let \filedescriptionOld \filedescription -\GetIdInfo$Id: l3doc.dtx 1890 2010-04-11 03:37:15Z will $ +\GetIdInfo$Id: l3doc.dtx 1987 2010-07-25 14:55:46Z joseph $ {L3 Experimental documentation class} \ProvidesExplClass {\filename}{\filedate}{\fileversion}{\filedescription} @@ -133,6 +133,11 @@ \if b\expandafter\@car\f@series\@nil\boldmath\fi $\m@th\varepsilon$-\TeX } +\providecommand*\IniTeX{Ini\TeX} +\providecommand*\Lua{Lua} +\providecommand*\LuaTeX{\Lua\TeX} +\providecommand*\pdfTeX{pdf\TeX} +\RequirePackage{graphicx} \cs_if_free:NT \XeTeX { \cs_new_protected_nopar:Npn \XeTeX {X\kern-.125em\lower.5ex\hbox{\reflectbox{E}}\kern-.1667em\TeX} @@ -202,7 +207,9 @@ } \group_end: \cs_set_eq:NN \variable \function -\cs_set_nopar:Npn \function_aux:n #1 { +\group_begin: +\char_make_other:N \| +\cs_gset_nopar:Npn \function_aux:n #1 { \cs_set_nopar:Npn \nextnewline{\cs_gset_nopar:Npn\nextnewline{\\}} \tl_gset_eq:NN \g_doc_macro_tl \c_empty_tl \bigskip\endgraf\noindent\ttfamily @@ -213,7 +220,10 @@ \endtabular \group_end: } -\cs_set_nopar:Npn \doc_showmacro:w #1 | { +\group_end: +\group_begin: +\char_make_other:N \| +\cs_gset_nopar:Npn \doc_showmacro:w #1 | { \tl_if_blank:nTF {#1} { \use_none:n }{ @@ -221,6 +231,7 @@ \peek_meaning:NTF \q_stop { \use_none:n } { \doc_showmacro:w } } } +\group_end: \bool_new:N \l_doc_meta_TF_bool \bool_new:N \l_doc_meta_EXP_bool \cs_new_nopar:Npn \doc_showmacro_aux:w #1 / #2 \q_stop { diff --git a/Master/texmf-dist/tex/latex/expl3/l3fp.sty b/Master/texmf-dist/tex/latex/expl3/l3fp.sty index f2677b2c481..93915ae18be 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3fp.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3fp.sty @@ -48,7 +48,7 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3fp.dtx 1979 2010-07-08 19:51:19Z joseph $ +\GetIdInfo$Id: l3fp.dtx 1985 2010-07-18 09:05:56Z joseph $ {L3 Experimental floating-point operations} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} diff --git a/Master/texmf-dist/tex/latex/expl3/l3luatex.sty b/Master/texmf-dist/tex/latex/expl3/l3luatex.sty new file mode 100644 index 00000000000..0aa6468d7e8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/expl3/l3luatex.sty @@ -0,0 +1,172 @@ +%% +%% This is file `l3luatex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% l3luatex.dtx (with options: `package') +%% +%% +%% EXPERIMENTAL CODE +%% +%% Do not distribute this file without also distributing the +%% source files specified above. +%% +%% Do not distribute a modified version of this file. +%% +%% +%% File: l3fp.dtx Copyright (C) 2010 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 ``expl3 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. +%% +%% ----------------------------------------------------------------------- +\RequirePackage{l3names} +\GetIdInfo$Id: l3luatex.dtx 1985 2010-07-18 09:05:56Z joseph $ + {L3 Experimental LuaTeX functions} +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\package_check_loaded_expl: +\luatex_if_engine:TF + { + \cs_new_eq:NN \lua_now:x \luatex_directlua:D + \cs_new_eq:NN \lua_shipout:x \luatex_latelua:D + } + { + \cs_new:Npn \lua_now:x #1 { \lua_wrong_engine: } + \cs_new:Npn \lua_shipout:x #1 { \lua_wrong_engine: } + } +\group_begin: +\char_make_letter:N\! +\char_make_letter:N\ % +\cs_gset:Npn\lua_wrong_engine:{% +\LuaTeX engine not in use!% +}% +\group_end:% +\int_new:N \g_cctab_allocate_int +\int_set:Nn \g_cctab_allocate_int { -1 } +\int_new:N \g_cctab_stack_int +\seq_new:N \g_cctab_stack_seq +\cs_new_protected_nopar:Npn \cctab_new:N #1 { + \cs_if_free:NTF #1 + { + \int_gadd:Nn \g_cctab_allocate_int { 2 } + \int_compare:nNnTF + { \g_cctab_allocate_int } < { \c_allocate_max_tl + 1 } + { + \tex_global:D \tex_mathchardef:D #1 \g_cctab_allocate_int + \luatex_initcatcodetable:D #1 + } + { + \msg_kernel_error:nnx { code } { out-of-registers } { cctab } + } + } + { + \msg_kernel_error:nnx { code } { variable-already-defined } + { \token_to_str:N #1 } + } +} +\luatex_if_engine:F { + \cs_set_protected_nopar:Npn \cctab_new:N #1 { \lua_wrong_engine: } +} +\luatex_if_engine:T { + \cs_set_protected_nopar:Npn \cctab_new:N #1 + { + \newcatcodetable #1 + \luatex_initcatcodetable:D #1 + } +} +\cs_new_protected_nopar:Npn \cctab_begin:N #1 { + \seq_gpush:Nx \g_cctab_stack_seq { \tex_the:D \luatex_catcodetable:D } + \luatex_catcodetable:D #1 + \int_gadd:Nn \g_cctab_stack_int { 2 } + \int_compare:nNnT { \g_cctab_stack_int } > { 268435453 } + { \msg_kernel_error:nn { code } { cctab-stack-full } } + \luatex_savecatcodetable:D \g_cctab_stack_int + \luatex_catcodetable:D \g_cctab_stack_int +} +\cs_new_protected_nopar:Npn \cctab_end: { + \int_gsub:Nn \g_cctab_stack_int { 2 } + \seq_gpop:NN \g_cctab_stack_seq \l_cctab_tmp_tl + \quark_if_no_value:NT \l_cctab_tmp_tl + { \tl_set:Nn \l_cctab_tmp_tl { 0 } } + \luatex_catcodetable:D \l_cctab_tmp_tl \scan_stop: +} +\luatex_if_engine:F { + \cs_set_protected_nopar:Npn \cctab_begin:N #1 { \lua_wrong_engine: } + \cs_set_protected_nopar:Npn \cctab_end: { \lua_wrong_engine: } +} +\luatex_if_engine:T { + \cs_set_protected_nopar:Npn \cctab_begin:N #1 + { \BeginCatcodeRegime #1 } + \cs_set_protected_nopar:Npn \cctab_end: + { \EndCatcodeRegime } +} +\tl_new:N \l_cctab_tmp_tl +\cs_new_protected:Npn \cctab_gset:Nn #1#2 { + \group_begin: + #2 + \luatex_savecatcodetable:D #1 + \group_end: +} +\luatex_if_engine:F { + \cs_set_protected_nopar:Npn \cctab_gset:Nn #1#2 { \lua_wrong_engine: } +} +\luatex_if_engine:T { + \cctab_new:N \c_code_cctab + \cctab_gset:Nn \c_code_cctab { } +} +\luatex_if_engine:T { + \cs_new_eq:NN \c_document_cctab \CatcodeTableLaTeX + \cs_new_eq:NN \c_initex_cctab \CatcodeTableIniTeX + \cs_new_eq:NN \c_other_cctab \CatcodeTableOther + \cs_new_eq:NN \c_string_cctab \CatcodeTableString +} +\luatex_if_engine:T { + \cs_set_protected_nopar:Npn \ExplSyntaxOn + { + \tex_ifodd:D \ExplSyntaxStatus \scan_stop: + \tex_else:D + \cs_set_protected_nopar:Npx \ExplSyntaxOff + { + \cctab_end: + \tex_endlinechar:D = + \tex_the:D \tex_endlinechar:D \scan_stop: + \cs_set_protected:Npn \ExplSyntaxOff { } + \tl_set:Nn \exp_not:N \ExplSyntaxStatus { 0 } + } + \tl_set:Nn \ExplSyntaxStatus { 1 } + \cctab_begin:N \c_code_cctab + \tex_endlinechar:D = 32 \scan_stop: + \tex_fi:D + } +} +%% +%% +%% End of file `l3luatex.sty'. diff --git a/Master/texmf-dist/tex/latex/expl3/l3names.sty b/Master/texmf-dist/tex/latex/expl3/l3names.sty index da660a756e5..dce13baccdb 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3names.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3names.sty @@ -87,7 +87,7 @@ \gdef\filedescription{#1}% \ProvidesPackage{[unknown package]}[0000/00/00 v0.0 #1] } -\GetIdInfo$Id: l3names.dtx 1981 2010-07-11 07:28:30Z will $ +\GetIdInfo$Id: l3names.dtx 1987 2010-07-25 14:55:46Z joseph $ {L3 Experimental Naming Scheme for TeX Primitives} \endgroup \begingroup @@ -106,6 +106,17 @@ \endgroup \endinput } +\def\@tempa{% + \def\@tempa{}% + \RequirePackage{luatex}% + \RequirePackage{pdftexcmds}% + \let\pdfstrcmp\pdf@strcmp +} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname directlua\endcsname\relax +\else + \expandafter\@tempa +\fi \protected\edef\ExplSyntaxOff{ \unexpanded{\ifodd \ExplSyntaxStatus\relax \def\ExplSyntaxStatus{0} @@ -637,7 +648,11 @@ \name_primitive:NN \pdfsetrandomseed \pdf_setrandomseed:D \name_primitive:NN \pdfnoligatures \pdf_noligatures:D \name_primitive:NN \XeTeXversion \xetex_version:D +\name_primitive:NN \catcodetable \luatex_catcodetable:D \name_primitive:NN \directlua \luatex_directlua:D +\name_primitive:NN \initcatcodetable \luatex_initcatcodetable:D +\name_primitive:NN \latelua \luatex_latelua:D +\name_primitive:NN \savecatcodetable \luatex_savecatcodetable:D \etex_ifdefined:D \strcmp \etex_ifdefined:D \xetex_version:D \name_primitive:NN \strcmp \pdf_strcmp:D @@ -781,6 +796,9 @@ \tex_let:D\tex_everydisplay:D \frozen@everydisplay \tex_let:D\tex_italiccor:D \@@italiccorr \tex_let:D\tex_hyphen:D \@@hyph +\tex_let:D\luatex_catcodetable:D \luatexcatcodetable +\tex_let:D\luatex_initcatcodetable:D \luatexinitcatcodetable +\tex_let:D\luatex_savecatcodetable:D \luatexsavecatcodetable \tex_let:D\par \tex_par:D \tex_ifx:D\name_undefine:N\@gobble \tex_def:D\name_pop_stack:w{} |