leo-colisson / robust-externalize

A LaTeX library to cache pictures (including tikz, python code, and more) in a robust, customizable, and pure way.
8 stars 2 forks source link

Compile to dvi -> ps instead of pdf #35

Closed jagot closed 6 months ago

jagot commented 6 months ago

This is a very interesting and powerful package, it seems! However, I struggle to use it for the toolchain latex -> dvipdf. I managed to set up latexmk to compile the externalized figures to PostScript files, which is what I need, but then robust-externalize complains that no PDF file was produced.

Is it possible to allow this alternative toolchain instead? The reason I need it, is because certain journals still only allow this route, instead of pdflatex or xelatex.

tobiasBora commented 6 months ago

Thanks for the bug report, this is now solved in master (see 2363dc1914e1816fc0850e2b5616cfbdcb9d4dec, most modif are actually unrelated to this bug, only the two added lines in the .sty file matter) ;-)

MWE:

Compile this with:

$ latex --shell-escape yourfile.tex
$ dvips yourfile.dvi 

or if you want a .pdf you can also run dvipdfm yourfile.dvi.

Code

\documentclass[]{article}

\usepackage{robust-externalize}

\robExtConfigure{
  add to preset={latex}{use latex and dvi},
}

\begin{document}

Hello

\cacheTikz

Here is a picture \begin{tikzpicture}
  \node[fill=green] {A};
\end{tikzpicture}

\end{document}

If this fails, please reopen.