0

I am unable to find an easy way to break apart the tree view, to standalone separate bookmarks. I know that I can manually, probably, \pdfbookmark[0]{section}{section} on each by hand, but isn't there a fancier way?

Problem: enter image description here

LATEX:

\documentclass[a4paper,svgnames,11pt]{article}
\usepackage{hyperref}
\usepackage[numbered]{bookmark}

% Do not change
\textheight = 220mm
\textwidth = 150mm
\topmargin = 10mm
\oddsidemargin = 5.0mm
\evensidemargin = 5.0mm
\unitlength = 1mm

\begin{document}
\thispagestyle{empty}
\phantomsection
%\hypertarget{cover}{}
\bookmark[page=\thepage,view={XYZ null \calc{\paperheight} null},level=0]{Cover}
\section*{Cover Page}

\cleardoublepage
\ifodd\value{page}\else\mbox{}\newpage\fi
\thispagestyle{empty}
{
\hypersetup{linkcolor=black}
\cleardoublepage
\phantomsection
\renewcommand{\contentsname}{Table of Contents}
\pdfbookmark[0]{\contentsname}{toc}
\tableofcontents
}

\cleardoublepage
\listoffigures
\listoftables

\cleardoublepage
\section{Section 1.1}
\subsection{Subsection 1.1.1}
\subsection{Subsection 1.1.2}

\cleardoublepage
\section{Section 1.2}
\subsection{Subsection 1.2.1}
\subsection{Subsection 1.2.2}

\cleardoublepage
\section{Section 2.1}
\subsection{Subsection 2.1.1}
\subsection{Subsection 2.1.2}

\cleardoublepage
\section{Section 2.2}
\subsection{Subsection 2.2.1}
\subsection{Subsection 2.2.2}

\end{document}

1 Answer 1

2

Use

\bookmarksetup{startatroot} before the sections:

\documentclass[a4paper,svgnames,11pt]{article}
\usepackage{hyperref}
\usepackage[numbered]{bookmark}

% Do not change
\textheight = 220mm
\textwidth = 150mm
\topmargin = 10mm
\oddsidemargin = 5.0mm
\evensidemargin = 5.0mm
\unitlength = 1mm

\begin{document}
\thispagestyle{empty}
\phantomsection
%\hypertarget{cover}{}
\bookmark[page=\thepage,view={XYZ null \calc{\paperheight} null},level=0]{Cover}
\section*{Cover Page}

\cleardoublepage
\ifodd\value{page}\else\mbox{}\newpage\fi
\thispagestyle{empty}
{
\hypersetup{linkcolor=black}
\cleardoublepage
\phantomsection
\renewcommand{\contentsname}{Table of Contents}
\pdfbookmark[0]{\contentsname}{toc}
\tableofcontents
}

\cleardoublepage
\listoffigures
\listoftables

\bookmarksetup{startatroot}
\cleardoublepage
\section{Section 1.1}
\subsection{Subsection 1.1.1}
\subsection{Subsection 1.1.2}

\cleardoublepage
\section{Section 1.2}
\subsection{Subsection 1.2.1}
\subsection{Subsection 1.2.2}

\cleardoublepage
\section{Section 2.1}
\subsection{Subsection 2.1.1}
\subsection{Subsection 2.1.2}

\cleardoublepage
\section{Section 2.2}
\subsection{Subsection 2.2.1}
\subsection{Subsection 2.2.2}

\end{document}

enter image description here

1
  • Ulrike Fischer, thank you sooo much! You are GREAT!.
    – Albin M
    Commented Jan 28, 2022 at 11:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .