在latex中插入pdf文件

时间:2010-04-29 16:48:51

标签: pdf latex include

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

6 个答案:

答案 0 :(得分:657)

使用pdfpages包。

\usepackage{pdfpages}

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

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

仅包含PDF的第一页:

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

在shell中运行texdoc pdfpages以查看pdfpages的完整手册。

答案 1 :(得分:73)

要将整个pdf放入您的文件而不只是1页,请使用:

\usepackage{pdfpages}

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

答案 2 :(得分:30)

\includegraphics{myfig.pdf}

答案 3 :(得分:18)

我认为不会有自动方式。您可能还需要正确地向附录添加页码。假设您已经拥有多个页面的pdf文档,则必须首先使用Adobe Acrobat Professional提取每个页面的pdf文档,并将每个页面保存为单独的pdf文件。然后,您必须在每个页面的基础上(每页1个)包含每个pdf文档作为图像,并在每个页面之间使用 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图像,底部会显示正确的页码。如我的示例所示,您必须使用每个图像的比例因子,以使其适合单个页面的正确大小。希望有所帮助...

答案 4 :(得分:6)

有一个没有额外包的选项可以在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} 

这是我包含的图表

enter image description here

答案 5 :(得分:3)

\includegraphics函数具有一个page选项,用于将PDF文件的特定页面插入为图形。默认值为1,但是您可以更改它。

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

您可以找到更多here