我只想打开树的第一个按钮
为了创建级别,我使用了这个
\pdfbookmark[0]{Start}{start}
要关闭其他级别,我使用这个
\hypersetup{
bookmarksopen=false
}
但我得到了这个结果:
如何打开第一个按钮?
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{imakeidx}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[pdftex, bookmarksnumbered, pagebackref, colorlinks=true, citecolor=Blue, linkcolor=DarkBlue!30!Black, urlcolor=Black,bookmarksopen]{hyperref}
\makeindex[columns=3, title=Alphabetical Index, intoc]
\begin{document}
\tableofcontents
\cleardoublepage
\pdfbookmark{Dedicatory}{dedic}
\chapter*{Dedicatory}
to all my family
\cleardoublepage
\pdfbookmark{Abstract}{abstr}
\chapter*{Abstract}
hello world
\chapter{chapter}
\section{Introduction}
In this example several keywords\index{keywords} will be
used which are important and deserve to appear in the
Index\index{Index}.
\subsection{subsection}
Terms like generate\index{generate} and some\index{others}
will also show up. Terms in the index can also be
nested \index{Index!nested}
\clearpage
\section{Second section}
This second section\index{section} may include some special
word, and expand the ones already used\index{keywords!used}.
\printindex
\end{document}
答案1
据我了解,您的请求是只打开第一级书签。使用您的 MWE,您可以将bookmarksopenlevel=0
作为一个选项添加到hyperref
。(如果您希望打开更深的级别,您可以将 0 更改为 1 或其他值。)
对您当前的 MWE 进行以下修改:
\usepackage[pdftex, bookmarksnumbered, pagebackref, colorlinks=true, citecolor=Blue, linkcolor=DarkBlue!30!Black, urlcolor=Black,bookmarksopen,bookmarksopenlevel=0]{hyperref}
%
如果我将深度增加到 1,如下所示
\usepackage[pdftex, bookmarksnumbered, pagebackref, colorlinks=true, citecolor=Blue, linkcolor=DarkBlue!30!Black, urlcolor=Black,bookmarksopen,bookmarksopenlevel=1]{hyperref}
%
然后我得到: