%D \module
%D   [       file=luatex-plain,
%D        version=2009.12.01,
%D          title=\LUATEX\ Macros,
%D       subtitle=Plain Format,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]

%D We found out that in some cases the cm* fonts are not found and we don't
%D want to load them anyway. So we skip the font definitions. Alas, we also
%D need to intercept the magstep .. so actually we can then best have a bogus
%D callback that gobbles the lot but not now.

\catcode`\{=1 % begin group
\catcode`\}=2 % end group
\catcode`\#=6 % macro parameter

% \let\normalfont            \font
% %let\normalskewchar        \skewchar
% \let\normaltextfont        \textfont
% \let\normalscriptfont      \scriptfont
% \let\normalscriptscriptfont\scriptscriptfont
%
% \def\font           #1=#2 {\immediate\write99{ignoring \string#1=\string#2}\let#1\nullfont}
% %def\skewchar       #1=#2 {\immediate\write99{ignoring \string#1=\string#2}}
% \def\textfont        #1=#2{\immediate\write99{ignoring \string\textfont        \string#1=\string#2}}
% \def\scriptfont      #1=#2{\immediate\write99{ignoring \string\scriptfont      \string#1=\string#2}}
% \def\scriptscriptfont#1=#2{\immediate\write99{ignoring \string\scriptscriptfont\string#1=\string#2}}

\input plain

% \let\font            \normalfont
% %let\skewchar        \normalskewchar
% \let\textfont        \normaltextfont
% \let\scriptfont      \normalscriptfont
% \let\scriptscriptfont\normalscriptscriptfont

\directlua {tex.enableprimitives('', tex.extraprimitives())}

% We assume that pdf is used.

\ifdefined\pdfextension
    \input luatex-pdf \relax
\fi

\outputmode 1

% \outputmode 0 \magnification\magstep5

% We set the page dimensions because otherwise the backend does weird things
% when we have for instance this on a line of its own:
%
%   \hbox to 100cm {\hss wide indeed\hss}
%
% The page dimension calculation is a fuzzy one as there are some compensations
% for the \hoffset and \voffset and such. I remember long discussions and much
% trial and error in figuring this out during pdftex development times. Where
% a dvi driver will project on a papersize (and thereby clip) the pdf backend
% has to deal with the lack of a page concept on tex by some guessing. Normally
% a macro package will set the dimensions to something reasonable anyway.

\pagewidth   8.5truein
\pageheight 11.0truein

% We load some code at runtime:

\everyjob \expandafter {%
    \the\everyjob
    \input {luatex-basics}%
    \input {luatex-fonts}%
    \input {luatex-math}%
    \input {luatex-languages}%
    \input {luatex-mplib}%
    \input {luatex-gadgets}%
}

% We also patch the version number:

\edef\fmtversion{\fmtversion+luatex}

\automatichyphenmode=1

\dump
