
我的最初的問題得到了解答,但現在又出現了新的問題。它與 PDF 中的書籤有關。我正在與 Overleaf 合作,該公司沒有當前的版本hyperref
,而是較舊的版本。在下面的 MWE 中,背景章節在「二月」書籤下排序。但我不想要這樣。我該如何防止這種情況?我只想像前頁書籤一樣創建後頁書籤。
\documentclass{book}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}
\begin{document}
\frontmatter
\chapter{preface}
\chapter{introduction}
\mainmatter
\hypertarget{jan}{}
\bookmark[level=part,dest=jan]{January}
\chapter{1 jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture
\cleardoublepage
\hypertarget{feb}{}
\bookmark[level=part,dest=feb]{February}
\chapter{1 feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture
\cleardoublepage
\backmatter
\chapter{appendix A}
\chapter{appendix B}
\end{document}
答案1
我在文檔中找到了答案bookmark
。它是\backmatter
透過添加以下內容立即開始一棵新樹\bookmarksetup{startatroot}
:
\documentclass{book}
\usepackage[hidelinks, bookmarksopen=false]{hyperref}
\usepackage{bookmark}
\begin{document}
\frontmatter
\chapter{introduction}
\hypertarget{jan}{}
\bookmark[level=part,dest=jan]{January}
\chapter{1 jan}First January lecture
\chapter{2 jan}Another January lecture
\chapter{3 jan}Another January lecture
\cleardoublepage
\hypertarget{feb}{}
\bookmark[level=part,dest=feb]{February}
\chapter{1 feb}First February lecture
\chapter{2 feb}Another February lecture
\chapter{3 feb}Another February lecture
\cleardoublepage
\backmatter
\bookmarksetup{startatroot}
\chapter{appendix A}
\chapter{appendix B}
\end{document}