在LaTeX TOC中添加随附的PDF [英] Add in the LaTeX TOC an included PDF

查看:313
本文介绍了在LaTeX TOC中添加随附的PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的文档中,使用

\includepdf[pages=-]{./mypdf.pdf}

我遇到的问题是如何为此pdf添加TOC条目.

The problem I'm having is how to add a TOC entry for this pdf.

应该是附录.我尝试在附录中添加新的部分,但是当然,该部分的名称不能与所包含的pdf一起打印在同一页上,因此生成的TOC行将定向到错误的页面.

It supposed to be an appendix. I tried adding a new section in the appendix but of course the section name can't be printed on the same page than the included pdf, so the resulting TOC line directs to a wrong page.

如果我使用\addcontentsline,则我会松开编号,并且该页面也是错误的,因为随附的pdf实际上是从下一页开始的...

If I use \addcontentsline I loose the numbering and the page is wrong too because the included pdf actually starts at the next page...

我在这里迷路了,所以如果有人知道如何做,我将不胜感激.

I'm a bit lost here so I would really appreciate if someone knows how to do this.

注意:我尝试添加的pdf不是从LaTex生成的.

Note: the pdf I try to include was not generated from LaTex.

推荐答案

来自 pdfpages (第6页),看起来好像有一个名为addtotoc的实验性标签.我想您会像这样使用它:

From the documentation of pdfpages (page 6) it looks like there is an experimental tag called addtotoc. I think you'd use it like:

\includepdf[pages=-, addtotoc={<page number>, section, 1, <heading>, <label>}]

<page number>是所包含PDF的所需页码 (编辑)要链接到的<heading>是目录中的标题,而是您如何在本节中\ref.

Where <page number> is the desired page number of the included PDF (edit) to link to, <heading> is the title in the TOC, and <label> is how you may \ref to the section.

这篇关于在LaTeX TOC中添加随附的PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆