我的最初的问题已得到解答,但现在又出现了一个新问题。它与 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}