Re: Is it possible to have a PDF table of contents list? [corrected]

Valery Ushakov <[email protected]> Thu, 29 Nov 2018 16:52:42 +0300
Newsgroups gmane.comp.type-setting.lout
Message-ID <[email protected]>
On Thu, Nov 29, 2018 at 13:38:34 +0000, Mark Summerfield wrote:

>             {   # lout provides ] ?
>                 "[ /Title ("x") /Count "-count" /OUT pdfmark "

No, lout doesn't provide ], it's how pdfmark is to be used.  [ and ]
are not syntactic in PostScript, they are just operators.  "[" is a
synonym for "mark" (and "<<").  "]" is an operator that uses stack
contents up to the nearest mark to create an array.  "pdfmark" uses
the stack contents up to the nearest mark to create a PDF object in
the produced PDF.  Lout emits in its standard prologue this
boilerplate code

  /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse

that aliases "pdfmark" to "cleartomark" if pdfmark doesn't exist, so
that the whole [ /key value ... pdfmark segment would be ignored if we
the output is processed e.g. by a printer.

-uwe