# How to create a format file with initex to speed up processing time?

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).

-
I've found the solution by myself: have a look at TEX BY TOPIC, A TEXNICIAN’S REFERENCE by VICTOR EIJKHOUT at page 257. –  Matteo Apr 17 '14 at 17:34
Please make this a proper answer. –  Martin Schröder Apr 17 '14 at 19:32
@MartinSchröder What do you mean? Can I answer my own question? –  Matteo Apr 18 '14 at 12:08
Yes. –  Martin Schröder Apr 18 '14 at 13:52

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.

-
Thank you for this question and answer! Can you tell if the speed-up is noticeable? –  morbusg Apr 19 '14 at 9:46
@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. –  Matteo Apr 19 '14 at 12:21