在LaTeX中裁剪PDF文件作为输出

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

我在使用带有LaTeX选项的preview包在tightpage中生成裁剪的PDF文件时遇到问题。

我想将两个独立创建的PDF图像放入一个LaTeX文件中,并生成单个PDF图像。我的LaTeX文件是

\documentclass{minimal}
\usepackage{graphicx}
\usepackage[active,tightpage,graphics]{preview}

\begin{document}
\begin{centering}
\includegraphics{fig1}\includegraphics{fig2}
\end{centering}
\end{document}

当我运行pdflatex时,我得到一个空的PDf文件。 log如下

...
Preview: Fontsize 10pt
Preview: PDFoutput 1
<fig1.pdf, id=1, 297.28665pt x 190.31703pt> <use fig1.pdf> (./fig.aux) 

No pages of output.
Transcript written on fig.log.

代码有什么问题。如果我使用方程而不是includegraphics和额外的textmath选项,我得到正确的输出。

任何帮助将不胜感激

蜂蜜

pdf latex pdflatex
1个回答
0
投票

minimal文档类通常太小。相反,你可以使用standalone类,它将自动生成一个裁剪的pdf:

\documentclass{standalone}
\usepackage{graphicx}
%\usepackage[active,tightpage,graphics]{preview}

\begin{document}
%\begin{centering}
\includegraphics{example-image-duck}\includegraphics[page=2]{example-image-duck}
%\end{centering}
\end{document}
© www.soinside.com 2019 - 2024. All rights reserved.