[Top][All Lists]

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

Re: [Groff] What's valid in \X?

From: Larry Jones
Subject: Re: [Groff] What's valid in \X?
Date: Wed, 27 Oct 1999 13:06:40 -0400 (EDT)

address@hidden writes:
> Could we have an explicit full example or two, and a statement of what
> they're intended to achieve?

Sure.  Adobe has defined a special PostScript operator -- pdfmark --
that allows you to embed PDF file metadata like bookmarks, notes, links,
info directory entries, etc. into PostScript files.  For example, to
create a bookmark, you can do:

        [ /Title (1. Introduction) /OUT pdfmark

When that PostScript file is distilled into a PDF file, the list of
bookmarks will contain one called "1. Introduction" that you can click
on to go to the page of the document that contained the pdfmark (there
are also lots of other ways to specify the destination, but that's not
really important).

For a structured document, you probably want a bookmark for each
numbered section heading.  I'm using the mm macros which even have very
convenient hooks for doing this:

        .de HY
        \\X'ps: exec [ /Title (\\*(}0\\$3) /OUT pdfmark'\c

Unfortunately, \*(}0 (the section number) also contains the separating
space so it's something like "1.2\ \ " and $3 (the section title) may
well contains something like "The \&\fInew\fP features".  What groff
does now is object to the nonbreaking space and the zero-width space and
ignore them so I get three warnings and the output is:

        [ /Title (1.2The new features) /OUT pdfmark

whereas what I'd like is to get no warnings and:

        [ /Title (1.2  The new features) /OUT pdfmark

The fundamental idea is that you ought to be able to use formatted text
in \X and get reasonable results.  groff already does a pretty good job
(it's happy to ignore font and size changes), but I think it needs to go
just a bit farther.

-Larry Jones

I always have to help Dad establish the proper context. -- Calvin

reply via email to

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