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

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

1 Answer 1

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.

2
  • 1
    Thank you for this question and answer! Can you tell if the speed-up is noticeable?
    – morbusg
    Commented Apr 19, 2014 at 9: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
    Commented Apr 19, 2014 at 12:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .