From 7b016bf61c831dcd0c54e899b72b61a5295c550d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 22 Dec 2009 00:57:04 +0000 Subject: luatextra update (21dec09) git-svn-id: svn://tug.org/texlive/trunk@16473 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luatextra/README | 17 +++ .../texmf-dist/doc/luatex/luatextra/luatextra.pdf | Bin 141366 -> 240141 bytes .../source/luatex/luatextra/luatextra.dtx | 150 ++++++++++++++++----- .../texmf-dist/tex/luatex/luatextra/luatextra.lua | 39 +++++- .../texmf-dist/tex/luatex/luatextra/luatextra.sty | 57 ++++++-- TODO | 1 + 6 files changed, 210 insertions(+), 54 deletions(-) diff --git a/Master/texmf-dist/doc/luatex/luatextra/README b/Master/texmf-dist/doc/luatex/luatextra/README index 424cbf636df..1d266a84d04 100644 --- a/Master/texmf-dist/doc/luatex/luatextra/README +++ b/Master/texmf-dist/doc/luatex/luatextra/README @@ -21,6 +21,23 @@ Please see the luatextra-reference.pdf documentation for more details. This package is developped on . +History +------- + +2009/12/16, luatextra v0.95: + * package can now be loaded with a different engine, it then loads only + \LuaTeX and \LuaLaTeX + * \CatcodeTableLaTeXAtLetter and \CatcodeTableExpl have appeared + * short names have been added to the tex.catcodetablenumber table + +2009/09/22, luatextra v0.94: + * prefixing macros with \luatex instead of \lua, to be coherent with + TeX Live 2009. + +2009/09/18, luamcallbacks v0.93: + * adding the callback process_output_buffer, to use it with luainputenc + + Installation ------------ diff --git a/Master/texmf-dist/doc/luatex/luatextra/luatextra.pdf b/Master/texmf-dist/doc/luatex/luatextra/luatextra.pdf index 0d628797f2d..f37335a4707 100644 Binary files a/Master/texmf-dist/doc/luatex/luatextra/luatextra.pdf and b/Master/texmf-dist/doc/luatex/luatextra/luatextra.pdf differ diff --git a/Master/texmf-dist/source/luatex/luatextra/luatextra.dtx b/Master/texmf-dist/source/luatex/luatextra/luatextra.dtx index 3265121c2c6..77013873b65 100644 --- a/Master/texmf-dist/source/luatex/luatextra/luatextra.dtx +++ b/Master/texmf-dist/source/luatex/luatextra/luatextra.dtx @@ -34,7 +34,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: luatextra 2009/09/22 v0.94 Extra low level functions for LuaTeX} +\Msg{* Package: luatextra 2009/12/16 v0.95 Extra low level functions for LuaTeX} \Msg{************************************************************************} \keepsilent @@ -101,7 +101,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luaminimalotf.drv}% - [2009/09/22 v0.94 LuaTeX extra low-level macros.]% + [2009/12/16 v0.95 LuaTeX extra low-level macros.]% \documentclass{ltxdoc} \EnableCrossrefs \CodelineIndex @@ -132,7 +132,7 @@ and the derived files % \GetFileInfo{luatextra.drv} % % \title{The \textsf{luatextra} package} -% \date{2009/09/22 v0.94} +% \date{2009/12/16 v0.95} % \author{Elie Roux \\ \texttt{elie.roux@telecom-bretagne.eu}} % % \maketitle @@ -264,7 +264,7 @@ do if luatextrapath:sub(1,2) == "./" then luatextrapath = luatextrapath:sub(3) end - texio.write(' ('..luatextrapath) + texio.write_nl('('..luatextrapath) end end @@ -292,9 +292,9 @@ module("luatextra", package.seeall) luatextra.modules = {} luatextra.modules['luatextra'] = { - version = 0.94, + version = 0.95, name = "luatextra", - date = "2009/09/22", + date = "2009/12/16", description = "Additional low level functions for LuaTeX", author = "Elie Roux", copyright = "Elie Roux, 2009", @@ -426,7 +426,7 @@ function luatextra.use_module(name) if path:sub(1,2) == "./" then path = path:sub(3) end - texio.write(' ('..path) + texio.write_nl('('..path) dofile(path) if not luatextra.modules[name] then luatextra.internal_warning(format("You have requested module `%s',\n%s but the file %s does not provide it.", name, luatextra.internal_warning_spaces, filename)) @@ -633,6 +633,45 @@ function luatextra.catcodetabledef_from_tex(name, number) luatextra.catcodetables[truename] = tonumber(number) end +% \end{macrocode} +% +% With this function we create some shortcuts for a +% better readability in lua code. This makes +% |tex.catcodetablenumber.latex| equivalent to +% |tex.catcodetablenumber['CatcodeTableLaTeX']|. +% +% \begin{macrocode} + +function luatextra.catcodetable_do_shortcuts() + local cat = tex.catcodetablenumber + local val = cat['CatcodeTableLaTeX'] + if val then + cat['latex'] = val + end + val = cat['CatcodeTableLaTeXAtLetter'] + if val then + cat['latex-package'] = val + cat['latex-atletter'] = val + end + val = cat['CatcodeTableIniTeX'] + if val then + cat['ini'] = val + end + val = cat['CatcodeTableExpl'] + if val then + cat['expl3'] = val + cat['expl'] = val + end + val = cat['CatcodeTableString'] + if val then + cat['string'] = val + end + val = cat['CatcodeTableOther'] + if val then + cat['other'] = val + end +end + % \end{macrocode} % % \subsection{Multiple callbacks on the \texttt{open\_read\_file} @@ -890,7 +929,7 @@ end % \end{macrocode} % -% Then we load \textsf{ifluatex}. +% Then we load \textsf{ifluatex} and etex if under \LaTeX. % % \begin{macrocode} @@ -900,43 +939,66 @@ end \fi \else \RequirePackage{ifluatex} + \NeedsTeXFormat{LaTeX2e} + \ProvidesPackage{luatextra} + [2009/12/16 v0.95 LuaTeX extra low-level macros] + \RequirePackage{etex}[1998/03/26] \fi -\expandafter\ifx\csname ProvidesPackage\endcsname\relax % \end{macrocode} % -% If the package is loaded with Plain, we raise an error if the package is -% called with a non-Lua\TeX\ engine, and we define -% \texttt{\string\luaRequireModule} with two mandatory arguments. +% The two macros \texttt{\string\LuaTeX} and \texttt{\string\LuaLaTeX} are +% defined to Lua\TeX\ and Lua\LaTeX , because that's the way it's written +% in the Lua\TeX 's manual (not in small capitals). +% +% These two macros are the only two loaded if we are under a non-Lua\TeX{} +% engine. % % \begin{macrocode} - \ifluatex\else + +\def\LuaTeX{Lua\TeX } +\def\LuaLaTeX{Lua\LaTeX } + +% \end{macrocode} +% +% Here we end the loading of the file if we are under a non-Lua\TeX{} +% engine, and we issue a warning. +% +% \begin{macrocode} + +\ifluatex\else + \expandafter\ifx\csname ProvidesPackage\endcsname\relax \immediate\write16{} - \errmessage{Package luatextra Error: This package must be used with LuaTeX} + \immediate\write16{Package luatextra Warning: this package should be used with LuaTeX.} + \else + \PackageWarning{luatextra}{this package should be used with LuaTeX.} \fi + \expandafter\endinput +\fi + +\expandafter\ifx\csname ProvidesPackage\endcsname\relax +% \end{macrocode} +% +% If the package is loaded with Plain, we define +% \texttt{\string\luaRequireModule} with two mandatory arguments. +% +% \begin{macrocode} \def\luatexRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}} \else % \end{macrocode} % -% If the package is loaded with \LaTeX , we also print the error message, -% and we define \texttt{\string\luaRequireModule} with one mandatory +% If the package is loaded with \LaTeX , we define +% \texttt{\string\luaRequireModule} with one mandatory % argument (the name of the package) and one optional (the version or the % date). We also define the environment \texttt{luacode}. % % \begin{macrocode} - \ifluatex\else - \PackageError{luatextra}{This package must be used with LuaTeX.} - \fi - \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatextra} - [2009/04/15 v0.93 LuaTeX extra low-level macros] \RequirePackage{environ} \NewEnviron{luacode}{\luadirect{\BODY}} \newcommand\luatexRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}} % \end{macrocode} % -% We also require the package \textsf{etex} to be loaded. The -% \texttt{\string\input} is a hack that modifies some values in the +% The \texttt{\string\input} is a hack that modifies some values in the % register attribution scheme of $\varepsilon$-\TeX\ and remaps % \texttt{\string\newcount} to \textsf{etex}'s \texttt{\string\globcount}. % We have to do such a remapping in a separate file that Plain doesn't see, @@ -945,21 +1007,9 @@ end % macro). See section \ref{sub:latex} for the file content. % % \begin{macrocode} - \RequirePackage{etex}[1998/03/26]% \input luatextra-latex.tex \fi -% \end{macrocode} -% -% The two macros \texttt{\string\LuaTeX} and \texttt{\string\LuaLaTeX} are -% defined to Lua\TeX\ and Lua\LaTeX , because that's the way it's written -% in the Lua\TeX 's manual (not in small capitals). -% -% \begin{macrocode} - -\def\LuaTeX{Lua\TeX } -\def\LuaLaTeX{Lua\LaTeX } - % \end{macrocode} % % \subsection{Primitives renaming} @@ -1207,6 +1257,9 @@ See the module #1 documentation for explanation.^^J ...^^J}% % \item \texttt{\string\CatcodeTableOther}: all characters have catcode 12 % (even space) % \item \texttt{\string\CatcodeTableLaTeX}: the \LaTeX\ classical catcodes +% \item \texttt{\string\CatcodeTableLaTeXAtLetter}: the \LaTeX\ classical +% catcodes and |@| letter +% \item \texttt{\string\CatcodeTableExpl}: the expl3 catcodes % \end{itemize} % % \begin{macrocode} @@ -1215,6 +1268,8 @@ See the module #1 documentation for explanation.^^J ...^^J}% \newluatexcatcodetable\CatcodeTableString \newluatexcatcodetable\CatcodeTableOther \newluatexcatcodetable\CatcodeTableLaTeX +\newluatexcatcodetable\CatcodeTableLaTeXAtLetter +\newluatexcatcodetable\CatcodeTableExpl \initluatexcatcodetable\CatcodeTableIniTeX \expandafter\ifx\csname @firstofone\endcsname\relax @@ -1241,6 +1296,27 @@ See the module #1 documentation for explanation.^^J ...^^J}% \catcode126=13 % tilde \catcode127=15 % \saveluatexcatcodetable\CatcodeTableLaTeX + \catcode64=11 % + \saveluatexcatcodetable\CatcodeTableLaTeXAtLetter + \endgroup + \begingroup + \luatexsetcatcoderange{0}{8}{15}% + \catcode9=9 % tab ignored + \catcode11=15 % + \catcode12=13 % form feed + \luatexsetcatcoderange{14}{31}{15}% + \catcode32=9 % space is ignored + \catcode35=6 % hash mark is macro parameter character + \catcode36=3 % dollar (not so sure about the catcode...) + \catcode38=4 % ampersand + \catcode58=11 % colon letter + \catcode94=7 % circumflex is superscript character + \catcode95=11 % underscore letter + \catcode123=1 % left brace is begin-group character + \catcode125=2 % right brace is end-group character + \catcode126=10 % tilde is a space char. + \catcode127=15 % + \saveluatexcatcodetable\CatcodeTableExpl \endgroup \@makeother{0}% nul \@makeother{13}% carriage return @@ -1257,6 +1333,8 @@ See the module #1 documentation for explanation.^^J ...^^J}% \ltxtra@AtEnd +\luadirect{luatextra.catcodetable_do_shortcuts()} + % \end{macrocode} % % We provide some functions for backward compatibility with old versions of luatextra. diff --git a/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua b/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua index 02313348446..2340fec3164 100644 --- a/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua +++ b/Master/texmf-dist/tex/luatex/luatextra/luatextra.lua @@ -21,7 +21,7 @@ do if luatextrapath:sub(1,2) == "./" then luatextrapath = luatextrapath:sub(3) end - texio.write(' ('..luatextrapath) + texio.write_nl('('..luatextrapath) end end @@ -34,9 +34,9 @@ module("luatextra", package.seeall) luatextra.modules = {} luatextra.modules['luatextra'] = { - version = 0.94, + version = 0.95, name = "luatextra", - date = "2009/09/22", + date = "2009/12/16", description = "Additional low level functions for LuaTeX", author = "Elie Roux", copyright = "Elie Roux, 2009", @@ -126,7 +126,7 @@ function luatextra.use_module(name) if path:sub(1,2) == "./" then path = path:sub(3) end - texio.write(' ('..path) + texio.write_nl('('..path) dofile(path) if not luatextra.modules[name] then luatextra.internal_warning(format("You have requested module `%s',\n%s but the file %s does not provide it.", name, luatextra.internal_warning_spaces, filename)) @@ -251,6 +251,37 @@ function luatextra.catcodetabledef_from_tex(name, number) end +function luatextra.catcodetable_do_shortcuts() + local cat = tex.catcodetablenumber + local val = cat['CatcodeTableLaTeX'] + if val then + cat['latex'] = val + end + val = cat['CatcodeTableLaTeXAtLetter'] + if val then + cat['latex-package'] = val + cat['latex-atletter'] = val + end + val = cat['CatcodeTableIniTeX'] + if val then + cat['ini'] = val + end + val = cat['CatcodeTableExpl'] + if val then + cat['expl3'] = val + cat['expl'] = val + end + val = cat['CatcodeTableString'] + if val then + cat['string'] = val + end + val = cat['CatcodeTableOther'] + if val then + cat['other'] = val + end +end + + function luatextra.open_read_file(filename) local path = kpse.find_file(filename) local env = { diff --git a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty index db4acd9aa27..090e821a509 100644 --- a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty +++ b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty @@ -25,33 +25,37 @@ \fi \else \RequirePackage{ifluatex} + \NeedsTeXFormat{LaTeX2e} + \ProvidesPackage{luatextra} + [2009/12/16 v0.95 LuaTeX extra low-level macros] + \RequirePackage{etex}[1998/03/26] \fi -\expandafter\ifx\csname ProvidesPackage\endcsname\relax - \ifluatex\else + +\def\LuaTeX{Lua\TeX } +\def\LuaLaTeX{Lua\LaTeX } + + +\ifluatex\else + \expandafter\ifx\csname ProvidesPackage\endcsname\relax \immediate\write16{} - \errmessage{Package luatextra Error: This package must be used with LuaTeX} + \immediate\write16{Package luatextra Warning: this package should be used with LuaTeX.} + \else + \PackageWarning{luatextra}{this package should be used with LuaTeX.} \fi + \expandafter\endinput +\fi + +\expandafter\ifx\csname ProvidesPackage\endcsname\relax \def\luatexRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}} \else - \ifluatex\else - \PackageError{luatextra}{This package must be used with LuaTeX.} - \fi - \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatextra} - [2009/04/15 v0.93 LuaTeX extra low-level macros] \RequirePackage{environ} \NewEnviron{luacode}{\luadirect{\BODY}} \newcommand\luatexRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}} - \RequirePackage{etex}[1998/03/26]% \input luatextra-latex.tex \fi -\def\LuaTeX{Lua\TeX } -\def\LuaLaTeX{Lua\LaTeX } - - \ifnum\luatexversion<36 \def\directlua{\pdfprimitive\directlua0} \def\latelua{\pdfprimitive\latelua0} @@ -189,6 +193,8 @@ See the module #1 documentation for explanation.^^J ...^^J}% \newluatexcatcodetable\CatcodeTableString \newluatexcatcodetable\CatcodeTableOther \newluatexcatcodetable\CatcodeTableLaTeX +\newluatexcatcodetable\CatcodeTableLaTeXAtLetter +\newluatexcatcodetable\CatcodeTableExpl \initluatexcatcodetable\CatcodeTableIniTeX \expandafter\ifx\csname @firstofone\endcsname\relax @@ -215,6 +221,27 @@ See the module #1 documentation for explanation.^^J ...^^J}% \catcode126=13 % tilde \catcode127=15 % \saveluatexcatcodetable\CatcodeTableLaTeX + \catcode64=11 % + \saveluatexcatcodetable\CatcodeTableLaTeXAtLetter + \endgroup + \begingroup + \luatexsetcatcoderange{0}{8}{15}% + \catcode9=9 % tab ignored + \catcode11=15 % + \catcode12=13 % form feed + \luatexsetcatcoderange{14}{31}{15}% + \catcode32=9 % space is ignored + \catcode35=6 % hash mark is macro parameter character + \catcode36=3 % dollar (not so sure about the catcode...) + \catcode38=4 % ampersand + \catcode58=11 % colon letter + \catcode94=7 % circumflex is superscript character + \catcode95=11 % underscore letter + \catcode123=1 % left brace is begin-group character + \catcode125=2 % right brace is end-group character + \catcode126=10 % tilde is a space char. + \catcode127=15 % + \saveluatexcatcodetable\CatcodeTableExpl \endgroup \@makeother{0}% nul \@makeother{13}% carriage return @@ -231,6 +258,8 @@ See the module #1 documentation for explanation.^^J ...^^J}% \ltxtra@AtEnd +\luadirect{luatextra.catcodetable_do_shortcuts()} + \let\newluaattribute\newluatexattribute \let\luaattribute\luatexattribute diff --git a/TODO b/TODO index 20987e8805c..c7ca976cde9 100644 --- a/TODO +++ b/TODO @@ -16,6 +16,7 @@ Public domain. TODO: file from the package itself when decreasing revisions need to be handled. Norbert mail to tldev, 22 Nov 2009 01:09:56. +- Remove scheme-gut. 0. Things that have to hang fire until 2009 =========================================== -- cgit v1.2.3