Browse Source

Make initialization more similar to luatex

master
Marcel Krüger 10 months ago
parent
commit
d71a9549e5
3 changed files with 58 additions and 12 deletions
  1. +2
    -2
      build.lua
  2. +15
    -10
      luametalatex.ini
  3. +41
    -0
      luametatexconfig.tex

+ 2
- 2
build.lua View File

@ -4,5 +4,5 @@ module = "luametalatex"
tdsroot = "luametatex" -- Would be luametalatex but we use the same files for luametaplain
installfiles = {"luameta*.lua", "luameta*.ini", "kpse.*", "luametalatex-ltexpl-hook.tex"}
sourcefiles = {"luameta*.lua", "luameta*.ini", "kpse.*", "luametalatex-ltexpl-hook.tex"}
installfiles = {"luameta*.lua", "luameta*.ini", "*.so", "*.dll", "luametatexconfig.tex", "luametalatex-ltexpl-hook.tex"}
sourcefiles = {"luameta*.lua", "luameta*.ini", "*.so", "*.dll", "luametatexconfig.tex", "luametalatex-ltexpl-hook.tex"}

+ 15
- 10
luametalatex.ini View File

@ -1,14 +1,19 @@
% Thomas Esser, 1998. public domain.
%
% Based on lualatex.ini, originally written 2008 by Karl Berry. Public domain.
\input luametatexconfig.tex
\scrollmode
\begingroup
\catcode`\{=1
\catcode`\}=2
\global\chardef\eTeXversion=2
\global\def\eTeXrevision{.2}
\catcode`\{=1 %
\catcode`\}=2 %
% Set up job name quoting before latex.ltx
% Web2c pdfTeX/XeTeX quote job names containing spaces, but LuaTeX does
% not do this at the engine level. The behaviour can be changed using
% a callback. Originally this code was loaded via lualatexquotejobname.tex
% but that required a hack around latex.ltx: the behaviour has been altered
% to allow the callback route to be used directly.
\global\everyjob{\directlua{require("lualatexquotejobname.lua")}}
\global\chardef\eTeXversion=2
\global\def\eTeXrevision{.2}
\endgroup
% \let\savedversionofdump\dump
% \let\dump\relax
\input latex.ltx
\endinput

+ 41
- 0
luametatexconfig.tex View File

@ -0,0 +1,41 @@
% Adapted based on tex-ini-files 2016-04-15: luatexconfig.tex
% Load shared (PDF) settings in LuaMetaTeX
\begingroup
\catcode`\{=1 %
\catcode`\}=2 %
\catcode`\#=6 %
\def\list{%
{compresslevel}%
{decimaldigits}%
{horigin}%
{minorversion}%
{objcompresslevel}%
{pkresolution}%
{vorigin}%
}%
% LuaMetaTeX doesn't have \pdfoutput, etc.:
% emulate names where appropriate
\let\pdfoutput\outputmode
\let\pdfpageheight\pageheight
\let\pdfpagewidth\pagewidth
\def\do#1{%
\ifx\relax#1\else
\expandafter\edef\csname pdf#1\endcsname{\pdfvariable #1}%
\expandafter\do
\fi
}%
\expandafter\do\list\relax
% 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 the rest of the group
\globaldefs=1 %
\input{pdftexconfig}%
% Pick up on a request for DVI mode and apply it whilst \pdfoutput is
% still defined
\ifx\dvimode\relax
\pdfoutput=0 %
\fi
\let\dvimode\undefined
\endgroup

Loading…
Cancel
Save