9

I have a file called matteo.tex which contains lots of macros. I'd like to create a format file with initex so that, every time tex processes a file that contains some of matteo.tex macros, it doesn't have to waste time processing the file matteo.tex. How to do it? And, then, how to make tex load the format generated from matteo.tex?

(matteo.tex is all written in plain tex).

User
  • 2,530
  • 1
  • 14
  • 25

1 Answers1

6

To make a format file from matteo.tex, you should simply add at the end of matteo.tex the control word \dump and then type on the command line

tex matteo

Now a file called matteo.fmt should have been generated. To load such file, you should type on the command line

tex &matteo.

If the format in matteo.tex does not extends plain tex, in order to create matteo.fmt you can start tex with the option -ini, i.e. you start initex.

User
  • 2,530
  • 1
  • 14
  • 25
  • 1
    Thank you for this question and answer! Can you tell if the speed-up is noticeable? – morbusg Apr 19 '14 at 09:46
  • 1
    @morbusg I made up a test, running 50 consecutive times the compilation in both ways. It resulted that the usual way took about 9 seconds, and the ".fmt" way took about 7.5 seconds: so the difference is not so noticeable. But I think that if there were more macros in matteo.tex, the difference in time would be greater. Ah I forgot to say that in Unix systems, you have to write tex \&matteo instead of tex &matteo. – User Apr 19 '14 at 12:21