在 LaTeX 中插入 PDF 文件

问题描述 投票:0回答:7

我正在尝试将 PDF 或 doc 文件作为附录插入到我的 LaTeX 文件中。你知道我该怎么做吗?

pdf latex include
7个回答
1024
投票

使用

pdfpages
套件。

\usepackage{pdfpages}

要包含 PDF 文件中的所有页面:

\includepdf[pages=-]{myfile.pdf}

仅包含 PDF 的第一页:

\includepdf[pages={1}]{myfile.pdf}

在 shell 中运行

texdoc pdfpages
以查看
pdfpages
的完整手册。


103
投票

要将整个 pdf 放入文件中,而不仅仅是一页,请使用:

\usepackage{pdfpages}

\includepdf[pages=-]{myfile.pdf}

56
投票
\includegraphics{myfig.pdf}

34
投票

\includegraphics
功能有一个
page
选项,用于将 PDF 文件的特定页面作为图表插入。默认为 1,但您可以更改它。

\includegraphics[scale=0.75,page=2]{multipage.pdf}

您可以在这里找到更多信息。


21
投票

我认为不会有一种自动的方式。您可能还想将页码正确添加到附录中。假设您已经拥有多页的 pdf 文档,则必须首先使用 Adobe Acrobat Professional 提取 pdf 文档的每一页,并将每个页面保存为单独的 pdf 文件。然后,您必须将每个 pdf 文档作为图像包含在每页基础上(每页 1 个),并在每页之间使用 newpage e,g,

\appendix
\section{Quiz 1}\label{sec:Quiz}
\begin{figure}[htp] \centering{
\includegraphics[scale=0.82]{quizz.pdf}}
\caption{Experiment 1}
\end{figure}  

\newpage
\section{Sample paper}\label{sec:Sample}
\begin{figure}[htp] \centering{
\includegraphics[scale=0.75]{sampaper.pdf}}
\caption{Experiment 2}
\end{figure}

现在,每页将显示 1 张 pdf 图像,底部将显示正确的页码。如我的示例所示,您必须对每个图像的比例因子进行一些调整,以使其达到适合单个页面的正确尺寸。希望有帮助...


11
投票

有一个无需额外软件包即可在 pdflatex 下运行的选项

调整此代码

\begin{figure}[h]
    \centering
    \includegraphics[width=\ScaleIfNeeded]{figuras/diagrama-spearman.pdf}
    \caption{Schematical view of Spearman's theory.}
\end{figure}

“diagrama-spearman.pdf”是用 TikZ 生成的图,这是代码(它是另一个 .tex 文件,与我要插入 pdf 的 .tex 文件不同)

\documentclass[border=3mm]{standalone}
\usepackage[applemac]{inputenc}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[bb=lucida,bbscaled=1,cal=boondoxo]{mathalfa}
\usepackage[stdmathitalics=true,math-style=iso,lucidasmallscale=true,romanfamily=bright]{lucimatx}
\usepackage{tikz}
\usetikzlibrary{intersections}
\newcommand{\at}{\makeatletter @\makeatother}

\begin{document}

\begin{tikzpicture}
\tikzset{venn circle/.style={draw,circle,minimum width=5cm,fill=#1,opacity=1}}
\node [venn circle = none, name path=A] (A) at (45:2cm) { };
\node [venn circle = none, name path=B] (B) at (135:2cm) { };
\node [venn circle = none, name path=C] (C) at (225:2cm) { };
\node [venn circle = none, name path=D] (D) at (315:2cm) { };
\node[above right] at (barycentric cs:A=1) {logical}; 
\node[above left] at (barycentric cs:B=1) {mechanical}; 
\node[below left] at (barycentric cs:C=1) {spatial}; 
\node[below right] at (barycentric cs:D=1) {arithmetical}; 
\node at (0,0) {G};    
\end{tikzpicture}

\end{document} 

这是我包含的图表


-2
投票

将命令写在Latex文档序言中

\begin{document}
之前。

\usepackage{pdfpages}

添加以下命令以包含

myfile.pdf
:

\includepdf[pages={6-7}, scale=0.9, angle=-90,  offset=0 0]{myfile.pdf}

此处,角度选项用于旋转 PDF 页面,偏移量

x
y
坐标用于创建边距。

© www.soinside.com 2019 - 2024. All rights reserved.