LaTeX 和 pdfpages 的问题

发布于 2024-09-26 01:23:21 字数 844 浏览 0 评论 0原文

这个问题是此处。

我已经尝试过提出的建议,即:

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

但如果我这样做,我只能输入页码为1,因为目录不会接受任何其他整数。我希望我的附录 A 从第 43 页开始,但 pdfpages 不允许我使用该值,它只是默认为 1。

\appendix
\input{./Appendix1.tex}
\clearpage
\includepdf[pages=-,landscape=true,addtotoc={43, section, 1, Appendix A, AppendixA}]{TrackDetails1.pdf}
\input{./Appendix2.tex}
\clearpage
\includepdf[pages=-,landscape=true]{TrackDetails2.pdf}
\input{./Appendix3.tex}
\thispagestyle{empty}
\clearpage

这是我的附录部分的示例,我不确定问题的一部分是否是我是否在插入的 PDF 之前插入标题页?显然上面的内容是不正确的,这只是我的附录部分现在所处的状态。

在过去的 4 个小时里,我一直在尝试各种组合,坦率地说,我厌倦了每次构建最终的 PDF 并发现 LaTeX 仍然没有达到我想要的效果。

请有人帮忙!

This question is a follow on from the one that was asked here.

I've tried the suggestion that was put forward, which was:

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

but if I do this, I can only input the page number as 1, as the TOC won't accept any other integers. I want my Appendix A to start at Page 43, but pdfpages won't let me use that was a value, it just defaults to 1.

\appendix
\input{./Appendix1.tex}
\clearpage
\includepdf[pages=-,landscape=true,addtotoc={43, section, 1, Appendix A, AppendixA}]{TrackDetails1.pdf}
\input{./Appendix2.tex}
\clearpage
\includepdf[pages=-,landscape=true]{TrackDetails2.pdf}
\input{./Appendix3.tex}
\thispagestyle{empty}
\clearpage

This is a sample of my Appendix section, i'm not sure whether part of the problem is that i'm inserting a title page before the inserted PDF or not? Obviously the above isn't right, it's just the current state that my appendix section is in right now.

I've been trying various combinations for the last 4 hours now and frankly i'm sick of building my final PDF each time and finding that LaTeX still isn't doing what I want it to.

Someone please help!

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

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

发布评论

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

评论(2

星軌x 2024-10-03 01:23:21

在 autotoc 中,“页码”是指原始 pdf 文件中的编号。因此,将“页码”设置为 43 会为original.pdf 的第 43 页添加一个目录条目。您可能正在寻找类似以下内容的内容:

\documentclass{report}
\usepackage{pdfpages}

\begin{document}
\tableofcontents
\chapter{foo}
(...)

\setcounter{page}{42}
\appendix
\includepdf[pages=-,addtotoc={1, chapter, 1, bar, bar}]{baz.pdf}
%first page of baz.pdf is added to toc as page 43

\end{document}

In autotoc, 'page number' refers to the numbering in the original pdf-file. Thus, setting 'page number' to 43 adds a toc-entry for the 43th page of original.pdf. You may be looking for something like the following:

\documentclass{report}
\usepackage{pdfpages}

\begin{document}
\tableofcontents
\chapter{foo}
(...)

\setcounter{page}{42}
\appendix
\includepdf[pages=-,addtotoc={1, chapter, 1, bar, bar}]{baz.pdf}
%first page of baz.pdf is added to toc as page 43

\end{document}
把回忆走一遍 2024-10-03 01:23:21

通过回忆录类,您可以执行以下操作:

\def\chaptername{Appendix}
\addappheadtotoc
\includepdf{mypdf.pdf}

这使得附录显示在目录中正确的页面+位置。现在我不确定这是否特定于回忆录类,但快速谷歌搜索显示了不使用回忆录类但仍在使用该命令的人的示例。也许值得一试。

当然你也可以这样做:

\def\sectionname{Appendix}
\addappheadtotoc
\includepdf{mypdf.pdf}

如果你想让它显示为一个部分。

With the memoir class you can do something along the lines of:

\def\chaptername{Appendix}
\addappheadtotoc
\includepdf{mypdf.pdf}

Which makes Appendix show up at the correct page + place in your TOC. Now i'm not sure if this is specific for the Memoir class but quick googling shows examples of people not using the memoir class and still using the command. It might be worth a shot.

Of course you can also do:

\def\sectionname{Appendix}
\addappheadtotoc
\includepdf{mypdf.pdf}

If you want it to appear as a section.

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