如何使用 hyperref 在 LaTeX 中显式结束 \part

发布于 2024-08-06 12:13:39 字数 434 浏览 3 评论 0原文

我有一个 LaTeX 文档,其中包含以下内容:

\tableofcontents
\chapter{Chapter One}
\part{Part One}
...
\part{Final Part}
\chapter{Final Part Chapters}
\chapter{Chapter not Part of Part}

当我使用 hyperref 将其编译为 PDF 时,最后一章将作为最后部分的一部分包含在我的书签中。 (我包括 hyperref,如下所示。)

\usepackage[xetex,breaklinks,a4paper]{hyperref}

我想知道的是如何在最后一章之前明确结束该部分,以便 hyperref 在创建 PDF 时将此书签提升到顶层。

任何帮助将不胜感激。

I have a LaTeX document which contains the following:

\tableofcontents
\chapter{Chapter One}
\part{Part One}
...
\part{Final Part}
\chapter{Final Part Chapters}
\chapter{Chapter not Part of Part}

When I compile this to a PDF with hyperref, the last chapter is included as part of the final part in my bookmarks. (I'm including hyperref as shown below.)

\usepackage[xetex,breaklinks,a4paper]{hyperref}

What I would like to know is how to explicitly end the part before the final chapter, so that hyperref promotes this bookmark to top level when the PDF is created.

Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

锦欢 2024-08-13 12:13:39

Heiko Oberdiek 的书签包(对他在 hyperref 中的工作的改进)允许您使用其 \bookmarksetup 命令来完成此操作。

\documentclass{book}
\usepackage{bookmark,hyperref}
\begin{document}
\tableofcontents
\chapter{Chapter One}
\part{Part One}
\part{Final Part}
\chapter{Final Part Chapters}

\bookmarksetup{startatroot}% this is it
\addtocontents{toc}{\bigskip}% perhaps as well

\chapter{Chapter not Part of Part}
\end{document}

\bigskip 部分在打印的目录中添加了一点空间,以便在视觉上将最后一章与前面的“部分”分开。

Heiko Oberdiek's bookmark package (an improvement on his work in hyperref) allows you do to this with its \bookmarksetup command.

\documentclass{book}
\usepackage{bookmark,hyperref}
\begin{document}
\tableofcontents
\chapter{Chapter One}
\part{Part One}
\part{Final Part}
\chapter{Final Part Chapters}

\bookmarksetup{startatroot}% this is it
\addtocontents{toc}{\bigskip}% perhaps as well

\chapter{Chapter not Part of Part}
\end{document}

The \bigskip parts adds a little space in the printed table of contents to visually separate the final chapter from the preceding "part".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文