tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

Does tectonic have an equivalent to `pdftex -ini`?

Open IndianBoy42 opened this issue 1 year ago • 1 comments

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

IndianBoy42 avatar Mar 23 '23 03:03 IndianBoy42

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:

  1. 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.
  2. 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.

pkgw avatar Mar 23 '23 13:03 pkgw