groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Suppress output (+ -me questions)


From: Sigfrid Lundberg, NetLab
Subject: Re: [Groff] Suppress output (+ -me questions)
Date: Fri, 15 Feb 2002 10:12:15 +0100 (CET)

On Thu, 14 Feb 2002 address@hidden wrote:

>
> Hi Christian,
>
> > 1) Is it possible to turn on (and off) printing of output from within
> > a document?
>
> Not that I can readily think of.

What about the .ig request

.ig

text to be ignored

..


> > For example I would like to be able to print only an index (table of
> > contents) for later inclusion (automatically) into the main document.

I would use .am (append macro) to add an indexing facility to those macros
that are involved in your chapter and section headings. That facility
could be used to output page number and whatever you want to have in your
TOC. A simple Perl/whatever-script could help to get the TOC your way.

Then put a '.so your_toc.me' wherever you want it to appear.

Run groff on this a couple of runs, and the page numbering will then be
correct.

You have almost certainly other related issues. I.e., you may want your
refence list _before_ your appendices, but you may want the references
ocurring in the them in the reference list. I have found the
macro-processor m4 an ideal tool for such overall restructuring of a
longer documents.

Using m4 diversion you may have a document (doc.m4) which may be
structured like this:

divert(0).\"
.so Introduction.me
.so Chapter_I.me
.so Chapter_II.me
.so Chapter_III.me
.so Chapter_IV.me
.so Chapter_V.me
divert(2).\"
.so Appendix_A.me
.so Appendix_B.me
divert(1).\"
.[
$LIST$
.]


It should be processed as follows

        soelim doc.m4 | refer | m4 | groff

Then m4 will undivert things in the correct order. But beware, m4 contains
builtin macros that are plain English. You have to rename them. Likewise,
you have to be careful with quotes and the like...



Sigge



reply via email to

[Prev in Thread] Current Thread [Next in Thread]