Joerg van den Hoff wrote: >>> groff is a single pass formatter, LaTeX is multi-pass. >> >> Not sure what you mean by this, but groff and TeX are >> pretty much the same in this regard. Both are single-pass >> formatters... both require multiple >> invocations to enable forward references at all. > > I meant: the functionality is in place. you call latex a few times > on the same document and than you get the correctly formatted document. > (the necessary information seemingly stored in aux files or whatever -- > I really don't know latex well). with groff this sure does not work this > way. if there is a smart way I don't know it. I usually start to use > several small shell scripts to get the job done. even a trivial thing > seems not _that_ straightforward: getting the table of content to the > front. I actually cut+paste the .dit file via a 'awk' script at the end > of my processing pipeline. I don't feel that all this is as easy with > groff as with latex.
I use a Makefile to do the driving. First pass (run with -z to suppress output) collects headings, cross-reference targets, index entries, and their page numbers into an auxfile. I then use scripts to generate markup for ToC, index (the Kernighan scripts), and cross-reference strings/page numbers. Second pass collects up these files and generates a PostScript file that is subsequently fed to ps2pdf. All by typing "make." I can also go back & tweak the ToC a bit, and the Makefile only runs the second pass. >> LaTeX also uses multiple passes (you just call the program >> twice; > > might well be. if so it would be _very_ nice to have the functionality > integrated in the distribution. my point was: you can do all this in > latex out of the box, while in groff you can't. The groff -mm macros are already set up for this kind of treatment; "mmroff" is a script that does pretty much the same things as my Makefile. -- Larry