lout-users
[Top][All Lists]
Advanced

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

PDF bookmarks


From: Michael Piotrowski
Subject: PDF bookmarks
Date: 30 Jul 2001 14:31:47 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.1 (Bryce Canyon)

About three years ago, I had tried (without success) to generate
hierarchical PDF bookmarks in Lout (see message 382, "Counting
subordinate structure elements").

The problem is that you need to know how many direct subordinates an
element has, e.g., if a section contains two subsections, the count
would be 2.

Recently I had another look at the problem, and found that hooking
into @EndSubSections (report setup) would easily provide the needed
information: You only need to write it to the cross-reference
database, and insert it in the next pass.

I have some problems with the details, though, and would appreciate
some help.

Here's my current setup:

   def @Hier named @Tag {} right num
   {
      num
   }

   def @GetHier right tag
   {
      address@hidden&&tag} @Case
      {
         ??   @Yield 1
         else @Yield @Hier&&tag
      }
   }

   def @EndSubSections force into { @EndSubSectionsPlace&&preceding }
   {
      @Hier @Tag address@hidden @Next { address@hidden&&preceding} @Open { num 
} }
   }

When generating the pdfmark for a section, I say:

   "/Count" address@hidden @Tag} @Minus 1

There are some obvious problems here:

- The number is not only written into the database, but also appears
  in the document--how could I suppress this?

- I'm using @Next to force the evaluation of
  address@hidden&&preceding} @Open { num }; this is not very elegant
  ;-) Is there any other way?

- If a section doesn't have subsections, the cross-reference can never
  be resolved; @GetHier produces the right result, but you always get
  a warning.  Is it possible to somehow suppress this?

Many thanks in advance

-- 
Michael Piotrowski, M.A.                                  <address@hidden>


reply via email to

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