23

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
  • @cfr Ok I will do it. – mathsalomon Jan 18 '16 at 22:50
  • 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
  • 2
    \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
  • @mathsalomon Great. Thanks for confirming. acroread is insanely slow on Linux so I avoid using it whenever I have any kind of practical alternative. – cfr Jan 18 '16 at 23:45
  • @egreg Thnaks. Also it works. – mathsalomon Jan 18 '16 at 23:59
  • @cfr One last question: Is there a possibility that the default PDF is displayed in page width mode? – mathsalomon Jan 18 '16 at 23:59
  • Try pdfstartview=FitH. There's a list of possible values on page 11 of the manual. FitH looks most likely, but there are others if that's not quite right. – cfr Jan 19 '16 at 00:13
  • 1
    @cfr Yes. It works. Just put \usepackage [pdfstartview=FitH]{hyperref} Many Thanks. – mathsalomon Jan 19 '16 at 00:17

2 Answers2

25

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.

egreg
  • 1,121,712
24

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}
cfr
  • 198,882