在 LaTeX 中插入 PDF 文件
我正在尝试将 PDF 或 doc 文件作为附录插入到我的 LaTeX 文件中。你知道我该怎么做吗?
I am trying to insert a PDF or doc file as an appendix in my LaTeX file. Do you know how I can do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
使用
pdfpages
包。要包含 PDF 文件中的所有页面:
要仅包含 PDF 的第一页:
在 shell 中运行
texdoc pdfpages
以查看pdfpages
的完整手册。Use the
pdfpages
package.To include all the pages in the PDF file:
To include just the first page of a PDF:
Run
texdoc pdfpages
in a shell to see the complete manual forpdfpages
.要将整个 pdf 而不仅仅是一页放入文件中,请使用:
For putting a whole pdf in your file and not just 1 page, use:
\includegraphics
函数有一个page
选项,用于将 PDF 文件的特定页面作为图形插入。默认值为 1,但您可以更改它。您可以在此处找到更多信息。
The
\includegraphics
function has apage
option for inserting a specific page of a PDF file as graphs. The default is one, but you can change it.You can find more here.
我不认为会有一种自动的方式。您可能还想将页码正确添加到附录中。假设您已经拥有多页的 pdf 文档,则必须首先使用 Adobe Acrobat Professional 提取 pdf 文档的每一页,并将每个页面保存为单独的 pdf 文件。然后,您必须将每个 pdf 文档作为图像包含在每页基础上(每页 1 个),并在每页之间使用 newpage 例如,
现在每页将显示 1 个 pdf每页图像,您将在底部看到正确的页码。如我的示例所示,您必须对每个图像的比例因子进行一些调整,以使其达到适合单个页面的正确尺寸。希望有帮助...
I don't think there would be an automatic way. You might also want to add a page number to the appendix correctly. Assuming that you already have your pdf document of several pages, you'll have to extract each page first of your pdf document using Adobe Acrobat Professional for instance and save each of them as a separate pdf file. Then you'll have to include each of the the pdf documents as images on an each page basis (1 each page) and use newpage between each page e,g,
Now each page will appear with 1 pdf image per page and you'll have a correct page number at the bottom. As shown in my example, you'll have to play a bit with the scale factor for each image to get it in the right size that will fit on a single page. Hope that helps...
有一个无需额外软件包的选项,可以在 pdflatex 下工作,
调整此代码
“diagrama-spearman.pdf”是使用 TikZ 生成的图,这是代码(它是另一个 .tex 文件,与我要插入的 .tex 文件不同) a pdf)
这是我包含的图表
There is an option without additional packages that works under pdflatex
Adapt this code
"diagrama-spearman.pdf" is a plot generated with TikZ and this is the code (it is another .tex file different from the .tex file where I want to insert a pdf)
This is the diagram I included
将命令写在Latex文档的序言部分的
\begin{document}
之前。添加以下命令以包含
myfile.pdf
:此处,角度选项用于旋转 PDF 页面并偏移
x
和y
坐标用于创建边距。Write the command in the preamble of the Latex document before
\begin{document}
.Add the following command to include the
myfile.pdf
:Here, the angle option is used to rotate the PDF pages and offset
x
andy
coordinates are used to create margins.