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

Mark Summerfield <[email protected]> Thu, 29 Nov 2018 08:51:19 +0000
Newsgroups gmane.comp.type-setting.lout
Organization Qtrac Ltd.
Message-ID <20181129085119.5ae3a776@suki>
Hi Uwe,

On Thu, 29 Nov 2018 02:32:40 +0300
Valery Ushakov <[email protected]> wrote:
> On Wed, Nov 28, 2018 at 21:08:17 +0000, Mark wrote:
[snip]
> This should be solvable with lout cross-references and some
> indirection.  There's probably a relevant example already in the
> standard packages.  If not, this old mail might provide some relevant
> inspiration on creative use of @Tagged
> 
>   http://www.stderr.spb.ru/~uwe/lout/essays/1402.dictionary.txt
> 
> (the same mail in official archives)
> 
>   http://lists.nongnu.org/archive/html/lout-users/1999-11/msg00021.html
> 
> 
> Sorry, I no longer have enough lout cached in my head to come up with
> an answer expromptu.

I'm now using these:

def @Toc left count right x {
    {
        @BackEnd @Case {
            PostScript @Yield
            {   # lout provides ] ?
                "[ /Title ("x") /Count "count" /OUT pdfmark "
            }
            else @Yield @Null
            }
    } @Graphic { }
}

def @SubToc right x {
    {
        @BackEnd @Case {
            PostScript @Yield
            {   # lout provides ] ?
                "[ /Title ("x") /OUT pdfmark "
            }
            else @Yield @Null
            }
    } @Graphic { }
}

Used like this:

    @Lecture
	@Title{Test Session}
    @Begin
    @Toc{Test Session}
    @BeginOverheads
    @Overhead
	@Title{Slide 1}
    @Begin
    @SubToc{Slide 1}
    ...

I'm planning to write a tiny Python program to look for @Toc and count
the @SubToc's for me.

-- 
Mark Summerfield, Qtrac Ltd.
    ComparePDF - easy to use fast PDF comparison tool
        http://www.qtrac.eu/comparepdf.html