【问题标题】:Issue with LaTeX and pdfpagesLaTeX 和 pdfpages 的问题
【发布时间】:2023-03-03 22:14:01
【问题描述】:

这个问题是here 提出的问题的后续问题。

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

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

但如果我这样做,我只能将页码输入为 1,因为 TOC 不会接受任何其他整数。我希望我的附录 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 仍然没有达到我想要的效果。

请有人帮忙!

【问题讨论】:

    标签: latex


    【解决方案1】:

    在 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}
    

    【讨论】:

      【解决方案2】:

      在回忆录课程中,您可以按照以下方式做一些事情:

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

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

      当然你也可以这样做:

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

      如果您希望它显示为一个部分。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-12-02
        • 2010-10-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多