0

I am working with eps figures, and I would like to externalise some figures thought external tikz library. Thus, I prefer to use latex compiler rather than to use pdflatex compiler. But it is not working.

I am using Windows 8.1 OS, with Miktex 2.9.700 and Texstudio 2.12.14.

I made a MWE based on Export eps figures from TikZ TeX topic and Tikz and PGF manual for version 3.0.0, page 617:

\documentclass{article}

\usepackage{tikz}

% set up externalization

\usetikzlibrary{external}

\tikzset{external/system call={latex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname \image \texsource && dvips -o "\image".ps "\image".dvi && ps2eps "\image.ps"}}
\tikzexternalize[shell escape=-enable-write18] % MikTeX uses a -enable-write18 instead of --shell-escape.

\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (1cm);
\end{tikzpicture}
\end{document}

But it is returning an error as follows:

Package tikz Error: Sorry, the system call 'latex -halt-on-error -interaction

Is there any configuration that I must change in texstudio or I am mistaking in any procedure?

  • I thought eps is (equivalent to) a superset of pdf. What makes you not consider compiling pdfs as usual and convert them to eps? – Symbol 1 May 20 '19 at 23:54
  • Every figure of my work is in eps format. There are a lot of figures (50 approximately), and to convert everyone to pdf format would be a painful task. Besides that, I should change the compilation method whenever I converted a tikz picture to pdf format. But my work comes being compiled with eps figures from the beginning. Thus, I could to convert every tikz picture to pdf format, but after I should convert each one to eps format, what would be another painful task. – Adriano May 21 '19 at 1:44
  • IDK... if you have magickimage, a command line tool, you can do convert *.pdf *.eps to convert everything at once; plus 50 is not a large number. – Symbol 1 May 21 '19 at 19:18
0

As an alternative to using \tikzexternalize if the document is stable and you will make few modifications to tikzpicture, it is better to handle it in separate files and include them as an image (or with \input{test-in-tkz.tex}). The ltximg script you can do the following:

$ ltximg --latex --eps --subenv --imgdir=mypics --prefix=tkz -o test-out test-in.tex

Now you will have a document with the tikzpicture environments converted into images (preserving the consistency of the fonts) and you will also have each tikzpicture environment in separate files (in case you need some extra modification). First check the documentation to see the options and conditions that the input file must meet.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.