summaryrefslogtreecommitdiff
path: root/luatexbase-attr.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'luatexbase-attr.dtx')
-rw-r--r--luatexbase-attr.dtx71
1 files changed, 50 insertions, 21 deletions
diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx
index 7b192c6..1580168 100644
--- a/luatexbase-attr.dtx
+++ b/luatexbase-attr.dtx
@@ -9,7 +9,7 @@
% This work consists of the main source file luatexbase-attr.dtx
% and the derived files
% luatexbase-attr.sty luatexbase.attr.lua
-% test-regs-plain.tex test-regs-latex.tex
+% test-regs-plain.tex test-regs-latex.tex
%
% Unpacking:
% tex luatexbase-attr.dtx
@@ -34,17 +34,11 @@
\let\MetaPrefix\relax
\preamble
-This is a generated file.
-Written in 2009, 2010 by Manuel Pégourié-Gonnard and Élie Roux.
- <mpg@elzevir.fr>
- <elie.roux@telecom-bretagne.eu>
+Written in 2009, 2010 by Manuel Pegourie-Gonnard and Elie Roux.
This work is under the CC0 license.
-
-This work consists of the main source file luatexbase-attr.dtx
-and the derived files
- luatexbase-attr.sty luatexbase.attr.lua ...
+See source file '\inFileName' for details.
\endpreamble
@@ -81,7 +75,7 @@ and the derived files
\Msg{* To finish the installation you have to move the following}
\Msg{* files into a directory searched by TeX:}
\Msg{*}
-\Msg{* luatexbase-attr.sty luatexbase.attr.lua ...}
+\Msg{* luatexbase-attr.sty luatexbase.attr.lua}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
@@ -180,6 +174,43 @@ and the derived files
\expandafter\let\csname lltxb@attr@loaded\endcsname\endinput
% \end{macrocode}
%
+% Catcode defenses.
+%
+% \begin{macrocode}
+\begingroup
+ \catcode123 1 % {
+ \catcode125 2 % }
+ \catcode 35 6 % #
+ \toks0{}%
+ \def\x{}%
+ \def\y#1 #2 {%
+ \toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
+ \edef\x{\x \catcode#1 #2}}%
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 10 12 % ^^J
+ \y 34 12 % "
+ \y 36 3 % $ $
+ \y 39 12 % '
+ \y 40 12 % (
+ \y 41 12 % )
+ \y 42 12 % *
+ \y 43 12 % +
+ \y 44 12 % ,
+ \y 45 12 % -
+ \y 46 12 % .
+ \y 47 12 % /
+ \y 60 12 % <
+ \y 61 12 % =
+ \y 64 11 % @ (letter)
+ \y 62 12 % >
+ \y 95 12 % _ (other)
+ \y 96 12 % `
+ \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
+\expandafter\y\csname lltxb@attr@AtEnd\endcsname
+% \end{macrocode}
+%
% Package declaration.
%
% \begin{macrocode}
@@ -211,26 +242,24 @@ and the derived files
\let\x\PackageWarningNoLine
\fi
\expandafter\endgroup
- \x{luatexbase-attr}{LuaTeX is required for this package.^^J
- Aborting package loading.}
+ \x{luatexbase-attr}{LuaTeX is required for this package. Aborting.}
+ \lltxb@attr@AtEnd
\expandafter\endinput
\fi
% \end{macrocode}
%
-% Make sure the catcode of @ is correct, especially for \plaintex.
-%
-% \begin{macrocode}
-\expandafter\edef\csname lltxb@attr@AtEnd\endcsname{%
- \catcode64 \the\catcode64\relax}
-\catcode64 11
-% \end{macrocode}
-%
% \subsubsection{Main content}
%
% Load the supporting Lua module.
%
% \begin{macrocode}
-\directlua{dofile(kpse.find_file('luatexbase.attr.lua', 'lua'))}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input luatexbase-loader.sty
+\else
+ \RequirePackage{luatexbase-loader}
+\fi
+\directlua{require('luatexbase.attr.lua')}
% \end{macrocode}
%
% The allocaton macro.