2

I want to group my bookmarks and used the suggested \superpart command from this thread. Minimal working example:

\documentclass{scrartcl}
\usepackage[latin]{babel}

\usepackage[bookmarksopen=true]{hyperref}
\usepackage{lipsum}

\newcounter{superpart}
\newcommand{\superpart}[1]{%
    \cleardoublepage
    \refstepcounter{superpart}%
    \phantomsection%
    \hypertarget{superpart::\number\value{superpart}}{}%
    \bookmark[startatroot,level=-2,bold,dest=superpart::\number\value{superpart}]{#1}%
}

\begin{document}
    \superpart{Superpart A}
        \twocolumn[\section{Section 1}]
            \lipsum
        \twocolumn[\section{Section 2}]
            \lipsum

    \superpart{Superpart B}
        \twocolumn[\section{Section 3}]
            \lipsum
        \twocolumn[\section{Section 4}]
            \lipsum
\end{document}

With pdfTeX (right picture), this attempt works perfectly fine, but when I use XeTeX (left picture) the order of the bookmarks gets mixed up.

XeTeX pdfTeX

I have to use XeTeX. Does anybody know a solution for this problem?

Cheers Allyve

Allyve
  • 21
  • I think you will have to move the command inside the twocolumn argument: \twocolumn[\superpart{Superpart A}\section{Section 1}]. As no page has started yet the \special gets out of sync. – Ulrike Fischer Dec 23 '19 at 18:56

0 Answers0