tectonic
tectonic copied to clipboard
Does tectonic have an equivalent to `pdftex -ini`?
For example how would I replicate this example: https://bitbucket.org/johannesjh/latex-precompiled-preamble-example/src/master/
I thought it would be tectonic --outfmt fmt preamble.tex
but I'm not sure, I immediately get error: preamble.tex:1: Undefined control sequence
You have the right idea. I am not sure how/why the example that you are using works, but in Tectonic at least, the initex-style mode starts with a truly pristine environment, so before you can do anything else you need to load up the LaTeX format. You should be able to do that by starting the input with:
\input xelatex.ini
Once that has processed, you should be able to use \documentclass{}
commands and the like to set up your environment. Then you need to end your input with a \dump
(or maybe it is \@dump
after LaTeX renames things?).
Two remarks:
- In some basic tests that I did a long time ago, it seemed to me that precompiling the preamble did not actually make things much faster, disappointingly.
- Tectonic and XeTeX currently do not let you create a format file that contains a "native" font (TrueType or OpenType), so if you want to use those with this approach, you need to add some gymnastics to load up those fonts on document initialization. I think that the main reason for this restriction in XeTeX is that it would basically have been very hard to properly load native fonts from a format in the WEB2C framework; I think that Tectonic should be much better positioned to relax this restriction. But, it would definitely require some development effort.