The new LuaMetaTeX typesetting engine praises itself as being "lean and mean", but the ConTeXt package that it comes shipped with is actually pretty obese (around 270 MiB when installed). To get some basic understanding of how it works, I would like to run it with the minimal subset of files required for a kind of "hello world" test, converting into PDF the famous "short story" example from the TeXbook ("Once upon a time, in a distant galaxy called Ööç, there lived a computer named R. J. Drofnats...").
Using pdfTeX, this is quite simple (see manual
https://ftp.tu-chemnitz.de/pub/tex/systems/doc/pdftex/manual/pdftex-a.pdf).
Create one single folder C:\TeX
without any subdirectories and copy the
following files into it:
Binaries:
pdftex.exe
,pdftex.dll
,kpathsealib.dll
(from http://mirrors.ctan.org/systems/win32/w32tex/pdftex-w32.tar.xz).Font metrics and outlines:
cm*.tfm
andcm*.pfb
(from https://ctan.org/tex-archive/fonts/cm/tfm and https://ctan.org/tex-archive/fonts/cm/ps-type1/bakoma/pfb).TeX files:
plain.tex
,hyphen.tex
,story.tex
(from https://ctan.org/tex-archive/macros/plain/base).Font map file
pdftex.map
(created manually):cmbx10 CMBX10 <cmbx10.pfb cmr10 CMR10 <cmr10.pfb cmsl10 CMSL10 <cmsl10.pfb [...]
Open a command prompt window, change directory and set environment variables to the current folder:
cd C:\TeX set t1fonts=. set texfontmaps=. set texfonts=. set texformats=. set texinputs=. set texmf=. set texmfcnf=. set tfmfonts=.
Create memory dump format file
plain.fmt
:pdftex --ini ./plain.tex \dump
Typeset document
story.pdf
:pdftex --fmt=plain --output-format=pdf ./story.tex \end
Now do the very same thing with LuaTex (see manual http://www.pragma-ade.com/general/manuals/luatex.pdf):
Download and extract the archive http://lmtx.pragma-ade.nl/install-lmtx/context-win64.zip to another folder and run the included
install.bat
script. Copyluatex.exe
andluametatex.exe
to theC:\TeX
test folder.Create memory dump format file
plain.fmt
:luatex --ini ./plain.tex \dump
Typeset document
story.pdf
:luatex --fmt=plain --output-format=pdf ./story.tex \end
The problem comes with the new LuaMetaTeX engine (see manual http://www.pragma-ade.com/general/manuals/luametatex.pdf). The command
luametatex --ini ./plain.tex \dump
gives error messages
startup error : missing find_log_file callback
and
startup error : missing open_data_file callback
unless a Lua initialization file lmtx-ini.lua
defining callback functions
is also loaded, but obviously these ones are not sufficient:
callback.register ("find_log_file", function () return "plain.log" end)
callback.register ("open_data_file", function () return true end)
because now, the command
luametatex --lua=lmtx-ini.lua --ini ./plain.tex \dump
yields a really fundamental failure:
This is LuaMetaTeX, Version 2.09.33 (INITEX)
runtime error : input file './plain.tex' is not found, quitting
So how do I typeset my story.pdf
using LuaMetaTeX in this minimal environment?
[Edit] As @Marcel points out, essential input-output functionality from TeX and a PDF backend must be rebuilt with Lua. To awaken the LuaMetaTeX engine to life somehow, my question modifies to: How to get his extracted LuaMetaLaTeX script collection (https://github.com/zauguin/luametalatex) running in the above standalone folder? This command fails:
luametatex --lua=./luametaplain-init.lua --ini ./plain.tex \dump
luametaplain
format which is configured together withluametalatex
.plain.tex
, even after 50 years. That's as important as passing the trip test. Hans would not be allowed to christen his ship "-Tex" as long as it only sails under the winds of ConTeXt while sinking here.