Next: , Previous: Writing the .toc file, Up: Contents


4.8.2 Reading the .toc file

You read the .toc file with the command \readtocfile. Naturally, whatever \toc... entry commands that were written to the file must be defined when \readtocfile is invoked. Eplain has minimal definitions for \tocchapterentry, \tocsectionentry, and \tocsubsectionentry, just to prevent undefined control sequence errors in common cases. They aren't suitable for anything but preliminary proofs.

Each of \writetocentry, \writenumberedtocentry and \writenumberedtocline opens the .toc file for writing, thereby deleting the information from the previous run. You should therefore arrange that \readtocfile be called before the first call to a \writetoc... macro. \readtocfile does not itself delete the information from the .toc file, so that you can call it several times, e.g., to create both a short and normal table of contents. (To produce this in particular, define \tocsectionentry to produce nothing while you are reading .toc file for a short table of contents (see Macro arguments).)

On the other hand, if you don't want to rewrite the .toc file at all, perhaps because you are only running TeX on part of your manuscript, you can set \rewritetocfilefalse.