在latex中插入pdf文件

Gui*_*ido 478 pdf latex include

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

Mic*_*ica 694

使用pdfpages包.

\usepackage{pdfpages}
Run Code Online (Sandbox Code Playgroud)

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

\includepdf[pages=-]{myfile.pdf}
Run Code Online (Sandbox Code Playgroud)

仅包含PDF的第一页:

\includepdf[pages={1}]{myfile.pdf}
Run Code Online (Sandbox Code Playgroud)

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

  • 需要说明的是,您需要指定要包含的页面,即`\ includepdf [pages = {1,3,5}] {myfile.pdf}`将包含文件的第1,3和5页.要包含整个文件,请指定`pages = { - }`,其中`{ - }`是一个没有指定端点的范围,它们分别默认为第一页和最后一页. (155认同)
  • 我还必须做的前两件事是缩放和重新启用我的外页设计(再次显示页码),这两者都可以使用配置设置,例如:`\ includepdf [pages = - ,scale = .8, pagecommand = {}] {文件}` (38认同)
  • 它似乎不适用于乳胶投影仪; 以下是如何使用beamer:http://tex.stackexchange.com/questions/57441/how-to-include-existing-pdf-slides-into-my-beamer (4认同)
  • offset选项很有用`\ includepdf [page = { - },offset = <offset in x> mm <offset in y> mm] {myfile.pdf}` (2认同)
  • @Kusavil 来自(文档)[http://mirrors.sorengard.com/ctan/macros/latex/contrib/pdfpages/pdfpages.pdf],您可以指定范围,例如,如果您想从总共 100 页中删除第 49 页,您可以使用 `pages={1-48,50-100}`。不像“pages={!49}”那么简单,但也没有那么困难。 (2认同)

Rob*_*ugy 77

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

\usepackage{pdfpages}

\includepdf[pages=-]{myfile.pdf}
Run Code Online (Sandbox Code Playgroud)

  • 你可以使用\ includepdf {myfile.pdf} (2认同)
  • @CroCo是的,由于某种原因,有时它有效,有时则无效,很抱歉误导你:( (2认同)

小智 34

\includegraphics{myfig.pdf}
Run Code Online (Sandbox Code Playgroud)

  • 我来这里只是为了寻找这个 (26认同)
  • 嗨dagray,你的答案可能是Guido想要的,但即使只是编写一小段代码而没有任何进一步的解释也是无益的. (9认同)
  • @LeoR 我不同意。问题本质上是:“如何在乳胶中插入 pdf?” 答案是达格雷写的。问题不是“你如何将 pdf 插入乳胶中,你能解释它是如何工作的”。这个答案中有足够的信息可以自己找到其余的信息。 (4认同)
  • 是的我知道如何包含一个figure.pdf,但我必须包含的文件有超过1页. (3认同)
  • 不过,问题明确声明它是附录的 DOC/PDF,因此它可能不是一页长。 (3认同)
  • 请注意,需要 `\usepackage{graphicx}` 才能使用此命令 (2认同)

yCa*_*ran 20

我不认为会有自动方式.您可能还需要正确地向附录添加页码.假设您已经拥有多个页面的pdf文档,则必须先使用Adobe Acrobat Professional提取每个页面的pdf文档,然后将每个页面保存为单独的pdf文件.然后,你就必须包括每个PDF文档的作为上每一页的图像基础(每1页),并使用NEWPAGE每个页面电邮之间,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}
Run Code Online (Sandbox Code Playgroud)

现在每个页面每页显示1个pdf图像,底部会显示正确的页码.如我的示例所示,您必须使用每个图像的比例因子,以使其适合单个页面的正确大小.希望有帮助......

  • 问题是按原样插入整个页面,而不是如何将 pdf 文件的内容包含在由 Latex 格式化和生成的现有页面中。 (2认同)

Pho*_* Mu 16

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

\includegraphics[scale=0.75,page=2]{multipage.pdf}
Run Code Online (Sandbox Code Playgroud)

您可以在此处找到更多信息


pac*_*ese 7

有一个选项没有在pdflatex下工作的附加包

调整此代码

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

"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} 
Run Code Online (Sandbox Code Playgroud)

这是我包含的图表

在此输入图像描述

  • 我认为 qn 要求包含多个页面。 (3认同)
  • 值得一提的是,page 参数也适用于使用 graphicsx 的参数`\includegraphics[page=2,width=0.5\textwidth,height = 0.3\textheight]{file.pdf}` (2认同)