我正在 Ubuntu Server 13.10 上使用全新安装的 TeX Live(从源代码安装)。我想使用 svg 包来直接包含 SVG 文件。在后台,svg 包在运行时调用 inkscape 来生成 pdf_tex 文件。
使用包管理器安装 inkscape(在安装 Tex Live 之后),并且位于 PATH 中。可以从 shell 调用 inkscape,没有任何问题。在 Windows(MikTeX)上,只需在路径中安装 inkscape 就足够了。
但是,pdflatex 似乎无法调用 inkscape。我使用pdflatex -synctex=1 -interaction=nonstopmode "document".tex --shell-escape
梅威瑟:
\documentclass{article}
\usepackage{svg}
\begin{document}
I am a document
\includesvg{Figure}
\end{document}
(与Figure.svg在同一个文件夹中)
输出:
runsystem(inkscape -z -C -f./Figure.svg -A./Figure.pdf --export-latex)...disabl
ed (restricted).
! LaTeX Error: File `./Figure' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 \includesvg{Figure}
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! LaTeX Error: File `./Figure' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 \includesvg{Figure}
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2,.eps
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! LaTeX Error: File `Figure.pdf_tex' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: pdf_tex)
Enter file name:
! Emergency stop.
<read *>
l.6 \includesvg{Figure}
^^M
*** (cannot \read from terminal in nonstop modes)
这个runsystem()...disabled (restricted).
错误令我困扰。
答案1
命令中选项的顺序很重要。--shell-escape
需要放在文件名之前。