我正在尝试将一个PDF或doc文件作为附录插入到我的LaTeX文件中。你知道我该如何做吗?
我正在尝试将一个PDF或doc文件作为附录插入到我的LaTeX文件中。你知道我该如何做吗?
使用pdfpages
包。
\usepackage{pdfpages}
为了包含PDF文件中的所有页面:
\includepdf[pages=-]{myfile.pdf}
要仅包含PDF的第一页,请使用以下方法:\includepdf[pages={1}]{myfile.pdf}
在命令行中运行texdoc pdfpages
,以查看 pdfpages
的完整手册。
\includepdf[pages={1,3,5}]{myfile.pdf}
会包含文件中的第1、3、5页。若要包含整个文件,则需指定pages={-}
,其中{-}
是一个范围,未指定端点将默认分别为第一页和最后一页。 - rcollyer\includepdf[pages=-,scale=.8,pagecommand={}]{file}
。 - LeoR\includepdf[page={-},offset=<x偏移量>毫米 <y偏移量>毫米]{myfile.pdf}
中很有用。 - Katu如果您想将整个PDF文件而不仅仅是一页放入您的文件中,请使用:
\usepackage{pdfpages}
\includepdf[pages=-]{myfile.pdf}
\includegraphics{myfig.pdf}
\usepackage{graphicx}
包。 - anroesti\includegraphics
函数有一个 page
选项,可以将 PDF 文件的特定页面作为图形插入。默认设置为 1,但您可以更改它。
\includegraphics[scale=0.75,page=2]{multipage.pdf}
更多信息可以在这里找到。
我不认为有一种自动的方法。您可能还需要正确添加附录的页码。假设您已经有了一个多页的PDF文档,您需要首先使用Adobe Acrobat Professional提取每一页并将它们保存为单独的PDF文件。然后,您需要在每一页上将每个PDF文档作为图像包含(每页1个),并在每页之间使用newpage,例如:
\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}
现在每个页面都会显示一个pdf图像,并且您将在底部看到正确的页码。如我的示例所示,您需要针对每个图像调整一下比例因子,以获得合适的尺寸,以适合单个页面。希望这有所帮助...
有一种选项可以在 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生成的图形,这是代码(它是一个与我要插入pdf的.tex文件不同的.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}
这是我包含的图表
\includegraphics[page=2,width=0.5\textwidth,height = 0.3\textheight]{file.pdf}
。 - user2589273