diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatextra/luatextra.sty')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatextra/luatextra.sty | 227 |
1 files changed, 35 insertions, 192 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty index 090e821a509..ced176ec071 100644 --- a/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty +++ b/Master/texmf-dist/tex/luatex/luatextra/luatextra.sty @@ -27,35 +27,51 @@ \RequirePackage{ifluatex} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luatextra} - [2009/12/16 v0.95 LuaTeX extra low-level macros] - \RequirePackage{etex}[1998/03/26] + [2010/05/10 v0.97 LuaTeX extra low-level macros] \fi \def\LuaTeX{Lua\TeX } \def\LuaLaTeX{Lua\LaTeX } - +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input ifluatex.sty +\else + \RequirePackage{ifluatex} +\fi \ifluatex\else - \expandafter\ifx\csname ProvidesPackage\endcsname\relax - \immediate\write16{} - \immediate\write16{Package luatextra Warning: this package should be used with LuaTeX.} - \else - \PackageWarning{luatextra}{this package should be used with LuaTeX.} - \fi + \begingroup + \expandafter\ifx\csname PackageWarningNoLine\endcsname\relax + \def\x#1#2{\begingroup\newlinechar10 + \immediate\write16{Package #1 warning: #2}\endgroup} + \else + \let\x\PackageWarningNoLine + \fi + \expandafter\endgroup + \x{luatexbase-modutils}{LuaTeX is required for this package.^^J + Aborting package loading.} \expandafter\endinput \fi - -\expandafter\ifx\csname ProvidesPackage\endcsname\relax - \def\luatexRequireModule#1#2{\luadirect{luatextra.require_module([[#1]], [[#2]])}} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input luatexbase-modutils.sty + \input luatexbase-attr.sty + \input luatexbase-cctb.sty + \input luatexbase-regs.sty + \input luatexbase-mcb.sty \else + \RequirePackage{luatexbase-modutils} + \RequirePackage{luatexbase-attr} + \RequirePackage{luatexbase-cctb} + \RequirePackage{luatexbase-regs} + \RequirePackage{luatexbase-mcb} +\fi +\luatexUseModule{lualibs} +\expandafter\ifx\csname RequirePackage\endcsname\relax \else \RequirePackage{environ} - \NewEnviron{luacode}{\luadirect{\BODY}} - \newcommand\luatexRequireModule[2][0]{\luadirect{luatextra.require_module([[#2]], [[#1]])}} - \input luatextra-latex.tex + \NewEnviron{luacode}{\directlua{\BODY}} \fi - - \ifnum\luatexversion<36 \def\directlua{\pdfprimitive\directlua0} \def\latelua{\pdfprimitive\latelua0} @@ -87,180 +103,10 @@ \let\saveluatexcatcodetable\luatexsavecatcodetable \let\luaclose\luatexcloselua \fi - - -\luadirect{dofile(kpse.find_file("luatextra.lua"))} - - +\directlua{dofile(kpse.find_file("luatextra.lua"))} \def\ltxtra@RegisterFontCallback{ - \luadirect{luatextra.register_font_callback()} + \directlua{luatextra.register_font_callback()} } - - -\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\luatexUseModule#1{\luadirect{luatextra.use_module([[#1]])}} - - -\newcount\luatexattdefcounter -\luatexattdefcounter = 1 - -\def\newluatexattribute#1{% - \ifnum\luatexattdefcounter<65535\relax % - \global\advance\luatexattdefcounter by 1\relax % - \allocationnumber\luatexattdefcounter % - \ifluatex % - \global\luatexattributedef#1=\allocationnumber % - \fi % - \wlog{\string#1=\string\luatexattribute\the\allocationnumber}% - \luadirect{% - luatextra.attributedef_from_tex([[\noexpand#1]], '\number\allocationnumber')}% - \else % - \errmessage{No room for a new \string\attribute}% - \fi % -} - - -\def\setluatexattribute#1#2{% - #1=\numexpr#2\relax % -} - -\def\unsetluatexattribute#1{% - \ifnum\luatexversion<37\relax % - #1=-1\relax % - \else % - #1=-"7FFFFFFF\relax % - \fi % -} - - -\newcount\luatexcatcodetabledefcounter - -\luatexcatcodetabledefcounter = 1 - -\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')}% - \wlog{\string#1=\string\catcodetable\the\allocationnumber}% - \else % - \errmessage{No room for a new \string\catcodetable}% - \fi % -} - - -\expandafter\edef\csname ltxtra@AtEnd\endcsname{% - \catcode64 \the\catcode64\relax -} - -\catcode 64=11\relax - -\expandafter\ifx\csname @tempcnta\endcsname\relax - \csname newcount\endcsname\@tempcnta -\fi -\expandafter\ifx\csname @tempcntb\endcsname\relax - \csname newcount\endcsname\@tempcntb -\fi - - -\def\luatexsetcatcoderange#1#2#3{% - \edef\luaSCR@temp{% - \noexpand\@tempcnta=\the\@tempcnta - \noexpand\@tempcntb=\the\@tempcntb - \noexpand\count@=\the\count@ - \relax - }% - \@tempcnta=#1\relax - \@tempcntb=#2\relax - \count@=#3\relax - \loop\unless\ifnum\@tempcnta>\@tempcntb - \catcode\@tempcnta=\count@ - \advance\@tempcnta by 1\relax - \repeat - \luaSCR@temp -} - - -\newluatexcatcodetable\CatcodeTableIniTeX -\newluatexcatcodetable\CatcodeTableString -\newluatexcatcodetable\CatcodeTableOther -\newluatexcatcodetable\CatcodeTableLaTeX -\newluatexcatcodetable\CatcodeTableLaTeXAtLetter -\newluatexcatcodetable\CatcodeTableExpl -\initluatexcatcodetable\CatcodeTableIniTeX - -\expandafter\ifx\csname @firstofone\endcsname\relax - \long\def\@firstofone#1{#1}% -\fi - -\begingroup - \def\@makeother#1{\catcode#1=12\relax}% - \@firstofone{% - \luatexcatcodetable\CatcodeTableIniTeX - \begingroup - \luatexsetcatcoderange{0}{8}{15}% - \catcode9=10 % tab - \catcode11=15 % - \catcode12=13 % form feed - \luatexsetcatcoderange{14}{31}{15}% - \catcode35=6 % hash - \catcode36=3 % dollar - \catcode38=4 % ampersand - \catcode94=7 % circumflex - \catcode95=8 % underscore - \catcode123=1 % brace left - \catcode125=2 % brace right - \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 - \@makeother{37}% percent - \@makeother{92}% backslash - \@makeother{127}% - \luatexsetcatcoderange{65}{90}{12}% A-Z - \luatexsetcatcoderange{97}{122}{12}% a-z - \saveluatexcatcodetable\CatcodeTableString - \@makeother{32}% space - \saveluatexcatcodetable\CatcodeTableOther - \endgroup -} - -\ltxtra@AtEnd - -\luadirect{luatextra.catcodetable_do_shortcuts()} - - \let\newluaattribute\newluatexattribute \let\luaattribute\luatexattribute \let\unsetluaattribute\unsetluatexattribute @@ -271,14 +117,11 @@ See the module #1 documentation for explanation.^^J ...^^J}% \let\luaModuleError\luatexModuleError \let\luaRequireModule\luatexRequireModule \let\luaUseModule\luatexUseModule - - \expandafter\ifx\csname ProvidesPackage\endcsname\relax \input luaotfload.sty \else \RequirePackage{luaotfload} \fi - \endinput %% %% End of file `luatextra.sty'. |