[Top][All Lists]

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

Re: [help-texinfo] glossary tips?

From: Karl Berry
Subject: Re: [help-texinfo] glossary tips?
Date: Sun, 23 Dec 2007 14:00:03 -0600

Hi DJ,

    > I could probably come up with a different incantation (even less pretty)
    > to just add an entry to the PDF outlines, without adding it to the
    > actual toc, if you want to go that way.

    That would be useful.  

I don't have a fully-worked-out solution, but I think this is the idea
for a new tdef that makes an entry in the PDF outlines. I haven't tried
all the macro stuff, just the basic \pdf... commands.

@macro tdef{TERM}
\pdfdest name{\TERM\} xyz
\pdfoutline goto name{\TERM\} count 0 {\TERM\}
@end tex
@end macro
@end iftex

... as before ...
@end ifnottex
@end if nothtml

- \pdfdest defines the destination that the bookmark will link to (like
  <a name="foo"></a> in HTML, more or less).  The "xyz" is a keyword
  meaning "at the current position".

- in \pdfoutline, goto name{\TERM\} says to go the given destination.
  count 0 is the number of subentries to this bookmark; we don't have any.
  The final {\TERM\} is what gets displayed in the bookmark pane.

One remaining problem is that the chapter-level bookmark that is
supposed to have these as subentries isn't going to know about them.
The best answer I can think of for that is to do an explicit \pdfoutline
before any of the terms, to be a new "holder" for the terms, outside of
the sectioning commands.

The next problem is knowing how many terms there are, for the count N
parameter to \pdfoutline.  I guess we have to have tdef keep track and
write it out.  Perhaps adding this to tdef inside the @tex:
\global\advance\lnkcount by 1
And then we can get the value of \lnkcount when writing the new ersatz
holder.  (\lnkcount is already defined in texinfo.tex, but isn't used,
happily enough.)

Well, let me know what you think before I go any further with this ...


reply via email to

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