summaryrefslogtreecommitdiff
path: root/luatexbase-attr.dtx
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-11 17:23:52 +0100
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-03-11 17:23:52 +0100
commit34918abf33f091050444ea42a63e43e0d9632da2 (patch)
tree484b2be400fe75e991e9c1e77b7f7e59ff7f06c9 /luatexbase-attr.dtx
parentaea103a1f2d2604cd5ae6883e6e808930f7ccef4 (diff)
downloadluatexbase-34918abf33f091050444ea42a63e43e0d9632da2.tar.gz
attr is working now
Diffstat (limited to 'luatexbase-attr.dtx')
-rw-r--r--luatexbase-attr.dtx63
1 files changed, 63 insertions, 0 deletions
diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx
index 4af129c..759c5a7 100644
--- a/luatexbase-attr.dtx
+++ b/luatexbase-attr.dtx
@@ -143,6 +143,68 @@ and the derived files
%<*texpackage>
% \end{macrocode}
%
+% \subsubsection{Preliminaries}
+%
+% Reload protection, especially for \plaintex.
+%
+% \begin{macrocode}
+ \csname lltxb@attr@loaded\endcsname
+\expandafter\let\csname lltxb@attr@loaded\endcsname\endinput
+% \end{macrocode}
+%
+% Package declaration.
+%
+% \begin{macrocode}
+\begingroup
+ \expandafter\ifx\csname ProvidesPackage\endcsname\relax
+ \def\x#1[#2]{\immediate\write16{Package: #1 #2}}
+ \else
+ \let\x\ProvidesPackage
+ \fi
+\expandafter\endgroup
+\x{luatexbase-attr}[2010/03/11 v0.1 Attributes allocation for LuaTeX (mpg)]
+% \end{macrocode}
+%
+% Make sure \luatex is used.
+%
+% \begin{macrocode}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax
+ \input ifluatex.sty
+\else
+ \RequirePackage{ifluatex}
+\fi
+\ifluatex\else
+ \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-attr}{LuaTeX is required for this package.^^J
+ Aborting package loading.}
+ \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'))}
+% \end{macrocode}
+%
% The most important macro here is |\newluatexattribute| that allocates a
% new attribute, and adds it in the |tex.attributename| table (see
% |luatextra.attributedef_from_tex| for more details. It works just like
@@ -186,6 +248,7 @@ and the derived files
% \end{macrocode}
%
% \begin{macrocode}
+\lltxb@attr@AtEnd
%</texpackage>
% \end{macrocode}
%