diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatextra/luatextra.sty')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatextra/luatextra.sty | 126 |
1 files changed, 72 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty index 3b86be22d90..db4acd9aa27 100644 --- a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty +++ b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty @@ -32,7 +32,7 @@ \immediate\write16{} \errmessage{Package luatextra Error: This package must be used with LuaTeX} \fi - \def\luaRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}} + \def\luatexRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}} \else \ifluatex\else \PackageError{luatextra}{This package must be used with LuaTeX.} @@ -42,7 +42,7 @@ [2009/04/15 v0.93 LuaTeX extra low-level macros] \RequirePackage{environ} \NewEnviron{luacode}{\luadirect{\BODY}} - \newcommand\luaRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}} + \newcommand\luatexRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}} \RequirePackage{etex}[1998/03/26]% \input luatextra-latex.tex \fi @@ -57,27 +57,33 @@ \def\latelua{\pdfprimitive\latelua0} \def\luadirect{\pdfprimitive\directlua0} \def\lualate{\pdfprimitive\latelua0} - \def\luaattribute{\attribute} - \def\luaattributedef{\attributedef} - \def\luaclearmarks{\pdfprimitive\luaclearmarks} - \def\luaformatname{\pdfprimitive\formatname} - \def\luascantexttokens{\pdfprimitive\scantexttokens} - \def\luacatcodetable{\catcodetable} + \def\luatexattribute{\attribute} + \def\luatexattributedef{\attributedef} + \def\luatexclearmarks{\pdfprimitive\luaclearmarks} + \def\luatexformatname{\pdfprimitive\formatname} + \def\luatexscantexttokens{\pdfprimitive\scantexttokens} + \def\luatexcatcodetable{\catcodetable} + \def\initluatexcatcodetable{\pdfprimitive\initcatcodetable} + \def\saveluatexcatcodetable{\pdfprimitive\savecatcodetable} + \def\luaclose{\pdfprimitive\closelua} \else - \directlua{tex.enableprimitives('lua', {'attribute'})} - \directlua{tex.enableprimitives('lua', {'attributedef'})} - \directlua{tex.enableprimitives('lua', {'clearmarks'})} - \directlua{tex.enableprimitives('lua', {'formatname'})} - \directlua{tex.enableprimitives('lua', {'scantexttokens'})} - \directlua{tex.enableprimitives('lua', {'catcodetable'})} - \def\luadirect{\pdfprimitive\directlua} - \def\lualate{\pdfprimitive\latelua} + \directlua{tex.enableprimitives('luatex', {'attribute'})} + \directlua{tex.enableprimitives('luatex', {'attributedef'})} + \directlua{tex.enableprimitives('luatex', {'clearmarks'})} + \directlua{tex.enableprimitives('luatex', {'formatname'})} + \directlua{tex.enableprimitives('luatex', {'scantexttokens'})} + \directlua{tex.enableprimitives('luatex', {'catcodetable'})} + \directlua{tex.enableprimitives('luatex', {'latelua'})} + \directlua{tex.enableprimitives('luatex', {'initcatcodetable'})} + \directlua{tex.enableprimitives('luatex', {'savecatcodetable'})} + \directlua{tex.enableprimitives('luatex', {'closelua'})} + \let\luadirect\directlua + \let\lualate\luatexlatelua + \let\initluatexcatcodetable\luatexinitcatcodetable + \let\saveluatexcatcodetable\luatexsavecatcodetable + \let\luaclose\luatexcloselua \fi -\def\initluacatcodetable{\pdfprimitive\initcatcodetable} -\def\saveluacatcodetable{\pdfprimitive\savecatcodetable} -\def\luaclose{\pdfprimitive\closelua} - \luadirect{dofile(kpse.find_file("luatextra.lua"))} @@ -87,28 +93,27 @@ } - -\def\luaModuleError#1#2{% +\def\luatexModuleError#1#2{% \errorcontextlines=0\relax \immediate\write16{}% \errmessage{Module #1 error: #2^^J^^J% See the module #1 documentation for explanation.^^J ...^^J}% } -\def\luaUseModule#1{\luadirect{luatextra.use_module([[#1]])}} +\def\luatexUseModule#1{\luadirect{luatextra.use_module([[#1]])}} -\newcount\luaattdefcounter -\luaattdefcounter = 1 +\newcount\luatexattdefcounter +\luatexattdefcounter = 1 -\def\newluaattribute#1{% - \ifnum\luaattdefcounter<65535\relax % - \global\advance\luaattdefcounter by 1\relax % - \allocationnumber\luaattdefcounter % +\def\newluatexattribute#1{% + \ifnum\luatexattdefcounter<65535\relax % + \global\advance\luatexattdefcounter by 1\relax % + \allocationnumber\luatexattdefcounter % \ifluatex % - \global\luaattributedef#1=\allocationnumber % + \global\luatexattributedef#1=\allocationnumber % \fi % - \wlog{\string#1=\string\attribute\the\allocationnumber}% + \wlog{\string#1=\string\luatexattribute\the\allocationnumber}% \luadirect{% luatextra.attributedef_from_tex([[\noexpand#1]], '\number\allocationnumber')}% \else % @@ -117,11 +122,11 @@ See the module #1 documentation for explanation.^^J ...^^J}% } -\def\setluaattribute#1#2{% +\def\setluatexattribute#1#2{% #1=\numexpr#2\relax % } -\def\unsetluaattribute#1{% +\def\unsetluatexattribute#1{% \ifnum\luatexversion<37\relax % #1=-1\relax % \else % @@ -130,14 +135,14 @@ See the module #1 documentation for explanation.^^J ...^^J}% } -\newcount\luacatcodetabledefcounter +\newcount\luatexcatcodetabledefcounter -\luacatcodetabledefcounter = 1 +\luatexcatcodetabledefcounter = 1 -\def\newluacatcodetable#1{% - \ifnum\luacatcodetabledefcounter<1114110\relax % 0x10FFFF is maximal \chardef - \global\advance\luacatcodetabledefcounter by 1\relax % - \allocationnumber=\luacatcodetabledefcounter % +\def\newluatexcatcodetable#1{% + \ifnum\luatexcatcodetabledefcounter<1114110\relax % 0x10FFFF is maximal \chardef + \global\advance\luatexcatcodetabledefcounter by 1\relax % + \allocationnumber=\luatexcatcodetabledefcounter % \global\chardef#1=\allocationnumber % \luadirect{% luatextra.catcodetabledef_from_tex([[\noexpand#1]], '\number\allocationnumber')}% @@ -162,7 +167,7 @@ See the module #1 documentation for explanation.^^J ...^^J}% \fi -\def\luasetcatcoderange#1#2#3{% +\def\luatexsetcatcoderange#1#2#3{% \edef\luaSCR@temp{% \noexpand\@tempcnta=\the\@tempcnta \noexpand\@tempcntb=\the\@tempcntb @@ -180,11 +185,11 @@ See the module #1 documentation for explanation.^^J ...^^J}% } -\newluacatcodetable\CatcodeTableIniTeX -\newluacatcodetable\CatcodeTableString -\newluacatcodetable\CatcodeTableOther -\newluacatcodetable\CatcodeTableLaTeX -\initluacatcodetable\CatcodeTableIniTeX +\newluatexcatcodetable\CatcodeTableIniTeX +\newluatexcatcodetable\CatcodeTableString +\newluatexcatcodetable\CatcodeTableOther +\newluatexcatcodetable\CatcodeTableLaTeX +\initluatexcatcodetable\CatcodeTableIniTeX \expandafter\ifx\csname @firstofone\endcsname\relax \long\def\@firstofone#1{#1}% @@ -193,13 +198,13 @@ See the module #1 documentation for explanation.^^J ...^^J}% \begingroup \def\@makeother#1{\catcode#1=12\relax}% \@firstofone{% - \luacatcodetable\CatcodeTableIniTeX + \luatexcatcodetable\CatcodeTableIniTeX \begingroup - \luasetcatcoderange{0}{8}{15}% + \luatexsetcatcoderange{0}{8}{15}% \catcode9=10 % tab \catcode11=15 % \catcode12=13 % form feed - \luasetcatcoderange{14}{31}{15}% + \luatexsetcatcoderange{14}{31}{15}% \catcode35=6 % hash \catcode36=3 % dollar \catcode38=4 % ampersand @@ -209,21 +214,35 @@ See the module #1 documentation for explanation.^^J ...^^J}% \catcode125=2 % brace right \catcode126=13 % tilde \catcode127=15 % - \saveluacatcodetable\CatcodeTableLaTeX + \saveluatexcatcodetable\CatcodeTableLaTeX \endgroup \@makeother{0}% nul \@makeother{13}% carriage return \@makeother{37}% percent \@makeother{92}% backslash \@makeother{127}% - \luasetcatcoderange{65}{90}{12}% A-Z - \luasetcatcoderange{97}{122}{12}% a-z - \saveluacatcodetable\CatcodeTableString + \luatexsetcatcoderange{65}{90}{12}% A-Z + \luatexsetcatcoderange{97}{122}{12}% a-z + \saveluatexcatcodetable\CatcodeTableString \@makeother{32}% space - \saveluacatcodetable\CatcodeTableOther + \saveluatexcatcodetable\CatcodeTableOther \endgroup } +\ltxtra@AtEnd + + +\let\newluaattribute\newluatexattribute +\let\luaattribute\luatexattribute +\let\unsetluaattribute\unsetluatexattribute +\let\initluacatcodetable\initluatexcatcodetable +\let\luasetcatcoderange\luatexsetcatcoderange +\let\newluacatcodetable\newluatexcatcodetable +\let\setluaattribute\setluatexattribute +\let\luaModuleError\luatexModuleError +\let\luaRequireModule\luatexRequireModule +\let\luaUseModule\luatexUseModule + \expandafter\ifx\csname ProvidesPackage\endcsname\relax \input luaotfload.sty @@ -231,7 +250,6 @@ See the module #1 documentation for explanation.^^J ...^^J}% \RequirePackage{luaotfload} \fi -\ltxtra@AtEnd \endinput %% %% End of file `luatextra.sty'. |