3

I'm trying to compile my own version of pdftex which works fine. However, I must compile my own format file (fmt) for that. This should be done with mktexfmt. My problem is that I don't know where to find the souce code for mktexfmt (for Linux).

Can anybody give me a hint where to find it?


OK, looks like I need a small crash course in the LaTeX architecture.

This is what I understand now:

  1. I don't need mktexfmt to create a format, I can use pdftex -ini -etex
  2. A format is necessary to teach pdftex to understand latex
  3. When I have "teached" pdftex how to understand latex I can parse latex files with pdftex and create pdf files from this

Is this correct?

If so, where do I get a .tex file to create a format? This ctan package looks good, but I cannot download it.

Sorry for beeing so dumb, but until now I only created nice pdfs with latex but I never got that deep into its architecture.

EDIT: I don't see the relevance of why I want to do this. But OK it's because I want to port PDFTeX to Javascript using emscripten. Does this help?

yo'
  • 51,322

1 Answers1

7

If the TeX code for the format is myformat.tex, then

pdftex -ini -etex -output-format=pdf myformat

will produce the file myformat.fmt that you can place anywhere the TeX programs would search for formats; for instance in

~/texmf/web2c/pdftex/

The options:

  • -ini means "be INITEX" (mandatory for building a format)
  • -etex means "enable the e-TeX extensions (recommended)
  • -output-format=pdf means "output will be PDF"
egreg
  • 1,121,712
  • I would also recommend you to use the -enc (encTeX extension) argument, which allows you to enter your whole text as UTF-8 (with some configuration beforehand) – RD6137 Jan 07 '13 at 15:01
  • What is myformat.tex and what is it supposed to contain? Is the source file for pdftex.fmt included in e.g. the texlive source tree? – corwin.amber Jan 26 '20 at 16:24