[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] mm TC - how to place in the beginning of document?
From: |
Deri |
Subject: |
Re: [Groff] mm TC - how to place in the beginning of document? |
Date: |
Sun, 24 Nov 2019 23:32:32 +0000 |
On Saturday, 23 November 2019 14:02:26 GMT Ralph Corderoy wrote:
> The mom macros have a method of moving the table of contents with -Tpdf
> that depends on gropdf(1)'s .pdfpagename and .pdfswitchtopage. (Deri,
> I don't think they're documented?) mom uses them with the page name
> MOM:TOC. Perhaps mm, or an mm user, could also benefit from them for
> .TC. Hard to say without more investigation.
Apologies for the oversite, I will be adding this to the man page for gropdf.
==============================================================================
\X'pdf: pagename name
This gives the current page a name.
There are two default names for any document which do not need
to be declared ‘top’ and ‘bottom’.
The convenience command for this is .pdfpagename.
\X'pdf: switchtopage when name
Normally each new page is appended to the end of the document,
this command allows following pages to be inserted at a ‘named’
position within the document (see pagename command above).
‘when’ can be either ‘after’ or ‘before’. If it is ommitted it
defaults to ‘before’.
The convenience command for this is .pdfswitchtopage. It should
be used at the end of the page before you want the switch to
happen.
This allows pages such as a TOC to be moved to elsewhere in the
document, but more esoteric uses are possible.
===============================================================================
Also I attach an example using the calls to relocate a pseudo TOC. Note that
the definitions of PDFTARGET and PDFLINK are based on the equivalent
definitions in the om.tmac file. Just to make less typing.
Note that the TOC page is moved to after the title page, and all the clickable
links in the TOC still work properly. Also, although it looks like the TOC
page contains forward references it can be produced with just a standard:-
groff -T pdf switch.trf
Rather than having to do multiple passes to resolve forward references.
Cheers
Deri
switch.trf
Description: Text document