
Я хочу открыть только первую кнопку дерева
для создания уровней я использовал это
\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}
%
то я получаю: