How to export the image in .eps
from the tex code using PdfLaTeX
in TeXStudio.
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}
A\arrow{d}\arrow{r}[near start]{\phi}[near end]{\psi}&B\arrow[red]{d}{\xi}\\
C \arrow[red]{r}[blue]{\eta} & D
\end{tikzcd}
\end{document}
I have tried with the code given here
\documentclass{article}
\usepackage{tikz-cd}
\usetikzlibrary{external}
\tikzexternalize
\begin{document}
\begin{tikzcd}
A\arrow {d}\arrow{r}[near start]{\phi}[near end]{\psi}&B\arrow[red]{d}{\xi}\\
C \arrow[red]{r}[ blue ]{\eta} & D
\end{tikzcd}
\end{document}
I got the following error File ended while scanning use of \tikzexternal@laTeX@collect@until@end@tikzpicture.
Also adding the following code in the preamble didn't help me.
\usetikzlibrary{external}
\tikzset{external/system call={pdflatex \tikzexternalcheckshellescape
-halt-on-error
-interaction=batchmode
-jobname "\image" "\texsource"
&& pdftops -eps "\image.pdf"}}
\tikzexternalize[shell escape=-enable-write18]
I have found another help using pdftops
here, which is helpful for the TeXWorks
users. Can any one please help me to export the .eps
file of the image using PdfLaTeX
?
Best Answer
standalone
class can be used to create cropped figures but also to convert frompdf
them to other formats likepng, jpg, ...
usually withimagemagick
help. See, as example, Compile a LaTeX document into a PNG image that's as short as possibleOP wants to obtain an
eps
file usingpdflatex
from TeXstudio.The idea is using
standalone
class to do all for us.As I'm using MikTeX which has a
pdftops
converter (I don't know if its available on other systems), commandcan be used to convert a pdf file to encapsulated postscript. This command can be included as a
standalone
class option with:\unexpanded
is not mentioned in documentation but it's explained in Martin's answerTherefore compiling with
pdflatex
a file likewill generate a pdf and eps results.
Important:
-shell-escape
must be added in configure options for pdflatex in TeXstudio