0

The way I compile latex file is as follows:

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

Way it is handled through emacs could be seen in this answer: How can I run additonal linux commands after compiling a latex file.


Problem I am having:

The example bellow comes from the documentation of TikZ (p610). tikZexternalize does not work when I attempt to compile the file using ``pdflatex -shell-escape -jobname="file_temp"`

file called 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}

If possible, I want to able compile it using with or without-jobname= parameter. When I try to compile it using pdflatex -shell-escape -jobname="doo_temp" doo.tex, I get following error:

! 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}

Would it be possible to fix this error?

alper
  • 1,389

0 Answers0