diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-11 17:23:52 +0100 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2010-03-11 17:23:52 +0100 |
commit | 34918abf33f091050444ea42a63e43e0d9632da2 (patch) | |
tree | 484b2be400fe75e991e9c1e77b7f7e59ff7f06c9 | |
parent | aea103a1f2d2604cd5ae6883e6e808930f7ccef4 (diff) | |
download | luatexbase-34918abf33f091050444ea42a63e43e0d9632da2.tar.gz |
attr is working now
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | luatexbase-attr.dtx | 63 | ||||
-rw-r--r-- | luatexbase-regs.dtx | 4 |
4 files changed, 67 insertions, 3 deletions
@@ -42,7 +42,7 @@ DO_MAKEINDEX = makeindex -s gind.ist $(subst .dtx,,$<) >/dev/null 2>&1 # Main targets definition all: $(GENERATED) -check: check-regs +check: check-regs check-attr doc: $(COMPILED) unpack: $(UNPACKED) ctan: check $(CTAN_ZIP) @@ -10,6 +10,7 @@ general - import/update doc - date & changes entry +- redo module loading in packages once mods is done. Later ===== 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} % diff --git a/luatexbase-regs.dtx b/luatexbase-regs.dtx index 11b7013..30e477d 100644 --- a/luatexbase-regs.dtx +++ b/luatexbase-regs.dtx @@ -211,7 +211,7 @@ and the derived files % Make sure the catcode of @ is correct, especially for \plaintex. % % \begin{macrocode} -\expandafter\edef\csname lltxb@AtEnd\endcsname{% +\expandafter\edef\csname lltxb@regs@AtEnd\endcsname{% \catcode64 \the\catcode64\relax} \catcode64 11 % \end{macrocode} @@ -388,7 +388,7 @@ and the derived files % That's all folks! % % \begin{macrocode} -\lltxb@AtEnd +\lltxb@regs@AtEnd %</texpackage> % \end{macrocode} % |