3

The following MWE produces PDF bookmarks for the each \beginsong when compiled with pdflatex, but not when compiled with lua/xelatex

\documentclass{article}
\usepackage{lipsum}
\usepackage[bookmarks=true]{hyperref}

\usepackage[lyric]{songs}

\begin{document}

\begin{songs}{} 
\beginsong{My Song}
\beginverse
\lipsum[1]
\endverse
\endsong
\end{songs}

\end{document}

1 Answers1

2

Section 11.6.3 of the manual "PDF Bookmarks and Links" states

Each \beginsong environment adds a PDF bookmark (if generating a PDF)

...and offers snippets for customizing this behavior. If the equivalent of the default snippet is included in the premable, xelatex does generate the pdf bookmarks. My guess is that the reference above to "if generating a PDF" translates into some check that depends on pdflatex specifically, and fails when using other engines.

Here's the working, modified, MWE:

\documentclass{article}
\usepackage{lipsum}
\usepackage[bookmarks=true]{hyperref}

\usepackage[lyric]{songs}

% Required for pdf bookmarks if using xelatex/lualatex instead of pdflatex
\renewcommand{\songtarget}[2]
{\pdfbookmark[#1]{\thesongnum. \songtitle}{#2}}
\renewcommand{\songlink}[2]{\hyperlink{#1}{#2}}

\begin{document}

\begin{songs}{}

\beginsong{My Song}
\beginverse
 \lipsum[1]
\endverse
\endsong
\end{songs}
\end{document}