14

I have a PDF file created with WinEdt 9 (see picture 1). The tex source file is made with class book, obviously generator bookmarks.

enter image description here

\documentclass[12pt]{book}
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=black]{hyperref}
\usepackage{bookmark}
\begin{document}
\chapter{Chapter [One}
\section{Section two}
\subsection{Section one}
\subsection{Section two}
\section{Section three}
\subsection{Section one}
\subsection{Section two}
\section{Section four}
\subsection{Section one}
\subsection{Section two}
\subsection{Section three}
\end{document} 

Whenever compiled using PDFLaTeX always have to deploy each of the bookmarks labeled (+). And that is annoying when there are many subgroups (so to speak) of bookmarks with (+).

Specifically: I want to know if there is any code that you can add to the preamble of my tex file so that the resulting PDF output by default as in picture 2, with bookmarks (+) fully deployed (-).

enter image description here

I hope let me understand.

Thanks in advance for your help.

  • Please provide a minimal example demonstrating the issue. It should begin \documentclass and end \end{document}. – cfr Jan 18 '16 at 22:46
  • 1
    Try bookmarksopen=true. My viewer ignores it, along with the bookmarks default for showing them at all. But presumably acroread should respect it. (I would test but acroread takes half a year to even think about possibly considering opening something, so I figure it will be quicker for you if you're already using it.) – cfr Jan 18 '16 at 23:36
  • 1
    \usepackage[open]{bookmark} – egreg Jan 18 '16 at 23:38
  • 1
    @cfr Thanks. My tex file compiles perfectly. All bookmarks are open. :) – mathsalomon Jan 18 '16 at 23:41
  • 1
    @cfr Yes. It works. Just put \usepackage [pdfstartview=FitH]{hyperref} Many Thanks. – mathsalomon Jan 19 '16 at 0:17
13

Simply add bookmarksopen=true for the default bookmarks-open to also expand them. I will refrain from posting a screenshot as my viewer ignores all these options anyway and acroread simply takes forever to even consider possibly thinking about sometime in the distant future opening a file. (But the OP confirmed that it works in Adobe's viewer.)

\documentclass[12pt]{book}

\usepackage[colorlinks=true,linkcolor=blue,urlcolor=black,bookmarksopen=true]{hyperref}

\usepackage{bookmark}

\begin{document}

\chapter{Chapter [One}
\section{Section two}
\subsection{Section one}
\subsection{Section two}
\section{Section three}
\subsection{Section one}
\subsection{Section two}
\section{Section four}
\subsection{Section one}
\subsection{Section two}
\subsection{Section three}

\end{document}
  • And to open first X levels only use bookmarksopenlevel=X. – Michael Oct 4 at 11:56
17

According to the documentation of bookmark you can use the open option; if you want to set the level, you can say openlevel=<level>; so

\usepackage[open,openlevel=1]{bookmark}

will show something like

enter image description here

whereas the simple open option will show

enter image description here

Tested with Skim and Adobe Reader on Mac OS X.

  • Thanks This is most useful. But he had already voted by the method of user cfr. Thank you anyway. – mathsalomon Jan 19 '16 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.