Skip to content

Commit

Permalink
Add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Apr 14, 2016
1 parent 194f703 commit c54c469
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions luatexconfig.tex
Expand Up @@ -6,6 +6,8 @@
\catcode`\{=1 %
\catcode`\}=2 %
\catcode`\#=6 %
% Settings that were primitives
% accessed in newer LuaTeX releases via \pdfvariable
\def\list{%
{compresslevel}%
{decimaldigits}%
Expand All @@ -21,9 +23,13 @@
\expandafter\do
\fi
}%
% Enable all \pdf... primitives in one go
\expandafter\do\list{output}{pageheight}{pagewidth}{variable}\relax
% Other required primitives that are not named \pdf...
\directlua{tex.enableprimitives("",
{"pageheight", "pagewidth", "outputmode"})}%
% Newer LuaTeX releases don't have \pdfoutput, etc.:
% emulate names where appropriate
\ifx\pdfoutput\undefined
\global\let\pdfoutput\outputmode
\global\let\pdfpageheight\pageheight
Expand All @@ -36,13 +42,19 @@
}%
\expandafter\do\list\relax
\fi
% The file pdftexconfig.tex contains only <primitive> = <value> lines
% so can now be read using the (emulated) primitives
% This needs to be global so set \globaldefs for this step
\globaldefs=1 %
\input{pdftexconfig}%
\globaldefs=0 %
% Pick up on a request for DVI mode and apply it whilst \pdfoutput is
% still defined
\ifx\dvimode\relax
\global\pdfoutput=0 %
\fi
\global\let\dvimode\undefined
% Clean up all of the globally-allocated names
\def\do#1{%
\ifx\relax#1\else
\global\expandafter\let\csname pdf#1\endcsname\undefined
Expand Down

0 comments on commit c54c469

Please sign in to comment.