1

I'm having some issues with externalising my tikz images.

I'm using the following preambel with -shell-escape enabled using lualatex:

\documentclass[print]{adelaide-mecheng-thesis}
% for splitting lines on maths
\usepackage{amsmath}
\usepackage{breqn}
\usepackage{mathtools}
% these packages are for inserting graphics, allowing spaces in file paths and specifiying file path
\usepackage{graphicx}  
\usepackage[section]{placeins}
\graphicspath{{James/Analytical/Images/}{James/Safety/Images/}{Ello.5.25/Images/}{TurningVanes.5.26/Images/}{Paul.6.01/ImagesPD/}{Alex.6.01/Images/}{Mick.6.05/Images/}{Ish.5.27/Images/}}
% bibliography setup:
\usepackage[firstinits=true,backend=bibtex,style=authoryear,natbib=true,maxbibnames=99,urldate=long]{biblatex}% use "[style=authoryear]" alternatively.
%\bibliography{James/AnalyticalLiteratureReview/RefListAnalyticalLiteratureReview,Ello.5.25/RefListIntroduction,TurningVanes.5.26/ReferenceListTurningVane,Ish.5.27/ReferenceListIsh,Paul.5.27/RefListPaul}
\bibliography{AllRefList}
\renewbibmacro{in:}{}
\DeclareFieldFormat[article]{volume}{\bibstring{volume}\addnbspace #1}
\DeclareFieldFormat[article]{number}{\bibstring{number}\addnbspace #1}
\DeclareNameAlias{sortname}{last-first}
%for landscape pages
\usepackage{rotating}
% for wider margins
%\usepackage{fullpage}
% for inserting Tikz Figures 
\usepackage{pgfplots}
\usepackage{tikz}
\pgfplotsset{compat=1.8}


\usetikzlibrary{external} 
\tikzexternalize[prefix=TikzOutput2/]


% setting output name same as input name
%\newcommand{\includetikz}[1]{%
%   \tikzsetnextfilename{#1}%
%       \input{./TikzInput/#1.tikz}%
%}  
%for tables
%\captionsetup[table]{singlelinecheck=off}
\usepackage{longtable}
% to include matlab scripts (make sure mcode.sty is in the master tex location)
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
\lstset{breakatwhitespace=false}
% adjusting the margins
\usepackage[margin=1in]{geometry}
% for inserting Pages
\usepackage{docmute}
%\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{2}
% for inserting pdfs
\usepackage{pdfpages}
% for making Tikz Pie charts
\usepackage{pgf-pie}
% for the tick symbol
\usepackage{amsfonts}
\usepackage{pifont}
\newcommand{\tick}{\ding{52}}

% For the Title Page
\thesisdetails{
  honours-prelim, % "honours-final" for the final report
  sppa=true,
}
\begin{document}
\input{TESTING/DELETE}
\end{document

where "TESTING DELETE" contains:

\begin{document} 

\begin{figure}[h] 
\centering   
\newlength\figureheight 
\newlength\figurewidth 
\setlength\figureheight{6cm} 
\setlength\figurewidth{8cm} 
\input{TikzInput/JensenContour.tikz}
\end{figure}

\end{document}

When I run the code without the externalise (\usetikzlibrary{external} and \tikzexternalize[prefix=TikzOutput2/]) it compiles fine.

But when I include the two lines I then get that the file cannot be created, the error that appears is

! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "TikzOutput2/FinalReport-figure0" "\def\tikzexternalreal job{FinalReport}\input{FinalReport}"' did NOT result in a usable output file 'T ikzOutput2/FinalReport-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -sh ell-escape'. Sometimes it is also named 'write 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'TikzOutput2/Fin alReport-figure0.log'. If you continue now, I'll try to typeset the picture.

Besides the fact I'm probably horribly using the wrong packages here and there, can anyone see the issue? I can't seem to find the issue in the log file either.

closed as unclear what you're asking by darthbith, user13907, Maarten Dhondt, Stefan Kottwitz Jan 5 '16 at 12:39

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Try \tikzset{external/system call={lualatex -shell-escape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}} \tikzexternalize - This works for me, as long e.g. no remember picture is used. If it doesn't work, prepare a MWE, otherwise you can be sure that no one can help you, as even the tikz code is missing. – John Sep 29 '14 at 11:33
  • 1
    I've never gotten it to work either. It's faster to develop a tikzpicure using a separate standalone, then just use \inputgraphics once it is stable. – John Kormylo Sep 29 '14 at 13:47
  • I don't see lua in the preamble. What about the size of the tikz? Maybe it is using too much memory. – Ali Sep 29 '14 at 14:19
  • @JohnKormylo I half agree. (But I +1ed your comment as I cant +.5 ;).) It does sometimes work. But it is unpredictable (to me) when, so it is necessary to keep turning it on and off in the file, and to some extent learning by trial and error. This is a shame since using standalone does not always fit very well and adds its own complexities, to boot. I've never gotten the forest derivative to work. It does, however, work quite well for mindmaps. (This is useful as they take forever to compile for me.) – cfr Sep 29 '14 at 23:36
  • @cfr Would you mind to collect the problems you encountered into a "suitable" bug report and sent it to me by email? I have read you suggestion here and in tex.stackexchange.com/questions/204712/… and I am willing to see what could be done about the problems. Apparently, you have a couple of offending documents. My mail address can be found in the manual of pgfplots. – Christian Feuersänger Nov 1 '14 at 21:25