我编译latex文件的方式如下:
FILE="main.tex"
pdflatex -shell-escape -shell-escape -jobname=main_temp $FILE
mv main_temp.pdf main.pdf
open main.pdf # opens on pdf editor
通过 emacs 处理的方式可以在这个答案中看到: 如何在编译 latex 文件后运行其他 Linux 命令。
我遇到的问题:
下面的例子来自TikZ 文档(p610)。tikZexternalize
当我尝试使用“pdflatex -shell-escape -jobname="file_temp"”编译文件时不起作用
文件名为doo.tex
:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=figures/] % activate
\begin{document}
\tikzsetnextfilename{trees}
\begin{tikzpicture} % will be written to ’figures/trees.pdf’
\node {root}
child {node {left}}
child {node {right}
child {node {child}}
child {node {child}}
};
\end{tikzpicture}
\tikzsetnextfilename{simple}
A simple image is \tikz \fill (0,0) circle(5pt);. % will be written to ’figures/simple.pdf’
\begin{tikzpicture} % will be written to ’figures/main-figure0.pdf’
\draw[help lines] (0,0) grid (5,5);
\end{tikzpicture}
\end{document}
如果可能的话,我希望能够使用带或不带-jobname=
参数的方法来编译它。当我尝试使用 来编译它时pdflatex -shell-escape -jobname="doo_temp" doo.tex
,出现以下错误:
! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e
rror -interaction=batchmode -jobname "figures/doo_temp-figure0" "\def\tikzexter
nalrealjob{doo_temp}\input{doo_temp}"' did NOT result in a usable output file '
figures/doo_temp-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verif
y that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-es
cape'. Sometimes it is also named 'write 18' or something like that. Or maybe t
he command simply failed? Error messages can be found in 'figures/doo_temp-figu
re0.log'. If you continue now, I'll try to typeset the picture.
See the tikz package documentation for explanation.
Type H <return> for immediate help.
...
l.21 \end{tikzpicture}
可以修复这个错误吗?