使用 latex -> dvips 构建图像时,图像不会被裁剪。我怎样才能裁剪 dvips 生成的图像?
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{external}
\tikzexternalize[mode=list and make]
\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource" && dvips "\image".dvi -o "\image".eps}}
\begin{document}
Hello
\begin{figure}[htbp]
\tikzsetnextfilename{test_fig}
\centering
\begin{tikzpicture}
\fill(0,0) rectangle (4,4);
\end{tikzpicture}
\caption{My fig.}
\end{figure}
\end{document}
eps图形如下所示:
答案1
添加ps2epsi
到external/system call
。它修复了边界框:
\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource" && dvips "\image".dvi -o "\image".ps && ps2epsi "\image".ps "\image".eps}}