I am trying to dig into the inner workings of LaTeX and to see where basic macros such as \{ are defined. texdef gives nothing useful (saying that it is defined by LaTeX) and the .fmt files, being binary files, are obviously generated from something. How are the .fmt files generated, and where can I get the files from which they are made?

  • latex.ltx in tex/latex/base/.
    – cfr
    Jun 27 '14 at 2:47
  • @cfr You are correct. \{ and friends are defined with DeclareRobustCommand which I had forgotten to search for.
    – Demi
    Jun 27 '14 at 3:04

An .fmt file is a "format" file that is generated by the program inittex. It loads a standard .tex file and in a sense "compiles" it using inittex's dump command which creates a binary representation of this "compiled" .tex file.

The original purpose of format files was to speed the loading of such tex files. Bechtolsheim, in "TeX in Practice, Vol II", states that loading the plain.tex file would take 80 seconds on a VAX 11/780 under BSD UNIX 4.2, while loading plain.fmt took only 10 seconds.

Obviously, today's machines are so much faster that the difference probably isn't discernible. Still, for reasons of efficiency, .fmt files might as well be used with common formats such as plain, csplain, LaTeX, etc.

The standard way of loading an .fmt file is something like tex --fmt=pdfcsplain ..., but that can be embedded inside a command, shell script or other executable. (I'm sure latex is one of those.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.