Skip to content

PDF table of contents #13

@nkrusch

Description

@nkrusch

In a PDF TOC, in place of *, I wanted hyperlinks for "Table of contents", Tables, Figures, etc.

HAVE
Screen Shot 2024-12-17 at 11 57 24 PM
WANT
Screen Shot 2024-12-18 at 12 01 58 AM

This part on the "printable page" as in template of course

Screen Shot 2024-12-18 at 12 03 10 AM

A starting point:

\AddToHookNext{shipout/foreground}{\put (0, 0){\pdfbookmark[0]{Cover}{sec:cover}}}
\label{sec:cover}\maketitle\clearpage

\AddToHookNext{shipout/foreground}{\put (0, 0){\pdfbookmark[0]{Acknowledgements}{sec:acks}}}
\input{acknowledgements}\clearpage

\AddToHookNext{shipout/foreground}{\put (0, 0){\pdfbookmark[0]{Abstract}{sec:abstract}}}
\input{abstract}\clearpage

\pdfbookmark[0]{\contentsname}{toc}\tableofcontents\clearpage
\pdfbookmark[0]{\listtablename}{lot}\listoftables\clearpage
\pdfbookmark[0]{\listfigurename}{lof}\listoffigures\clearpage
  • The \AddToHookNext{shipout/foreground}{\put (0, 0) bit is to achor to top of page
  • The \pdfbookmark[0]{display text}{ref} adds it to the PDF table of contents (only)

Originally posted by @nkrusch in #12 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions