
我正在使用 xelatex,並且嘗試使用epspdfconversion
包來即時刪除圖中不必要的空白邊距。圖形本身是動態生成的,透過bbox
選項計算嚴格的邊界框epspdf
似乎是一個好主意。
不幸的是,epspdfconversion 似乎無法與 xelatex 很好地配合使用。下面是一個最小的工作範例:
\documentclass{tufte-handout}
%\usepackage{xltxtra}
\usepackage{color}
\usepackage[bbox,pdftopdf=true,suffix=]{epspdfconversion}
\begin{document}
\includegraphics{unnamed-chunk-2.pdf}
\end{document}`
但是,如果取消註釋\usepackage{xltxtra}
並編譯 xelatex,我會收到以下訊息:
Package epstopdf Warning: Drivers other than `pdftex.def' are not supported.
epspdfconversion.sty is using epstopdf.sty with the following setup:
update=true,
verbose=true,
prefersuffix=true,
suffix=,
option outdir not set. Default: same directory as the .eps-source-file
append,
enable
epspdf is used with the following command:
epspdf --bbox <file>
Package epspdfconversion Info:
(epspdfconversion) epspdf --bbox <file> is used to convert eps-pdf
(epspdfconversion) (not epstopdf (script))
(epspdfconversion) on input line 334.
! Undefined control sequence.
l.345 \epstopdfDeclareGraphicsRule
{.eps}{pdf}{.pdf}{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
這似乎是 xelatex 之間的衝突,epspdfconversion.sty
我正在使用額外的 OTF 字體,並且使用 xelatex 似乎有必要。有人對解決或繞過這個問題有任何建議嗎?
答案1
epstopdf
正如第一個警告告訴您的那樣,僅適用pdftex
於 的驅動程式。graphics
但是,lualatex
也可以使用pdflatex
。