1

This should be easy an easy task, but somehow I am confused, therefore I would like to state an example

\documentclass[11pt]{report}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{bayesnet}
\begin{document}

\begin{figure}
    \centering
    \tikz{ %
        \node[latent] (phi) {$\phi$};
        \node[latent, right=of phi] (f) {$f$};
        \node[obs, right=of f] (y) {$\bf{y}$};
        \node[latent, above =of f] (sigma) {$\sigma_y$};
        \edge {phi} {f};
        \edge {f, sigma} {y};
    }
\end{figure}
\end{document}

I am using TeXstudio on windows and I would like to produce an image file (say .eps) rather than a pdf.

4
  • In Linux, qtikz would do the job. Not sure whether this is available for Apple (which I believe TeXstudio is?). If so, this may help as well. – vaettchen Jan 8 '18 at 10:20
  • 2
    latex --> dvi --> eps ? – Zarko Jan 8 '18 at 10:52
  • 2
    To get the image as standalone, you can use the standalone-class. – knut Jan 8 '18 at 11:17
  • 1
    .tex --pdflatex--> .pdf --pdftops--> .eps ? – Paul Gaborit Jan 8 '18 at 14:48
1

In my experience with eps exports from tikz, I haven't exactly been pleased with the results. Mostly if I need vector graphics from tikz, I compile to pdf and use that (or convert to svg, e.g. with Inkscape). If you simply need an image, you can convert to png with ImageMagick.

For my own purposes I have created an ImageExport.tex file:

%% Usage for eps-pictures
% Warning: Quality of text seems to be awful with eps...
% Use this documentclass instead of the one below
% \documentclass{standalone}

% Step 1: Include the tikzpicture below, adjust the used packages if needed
% Step 2: Compile to standard pdf, you should receive the image as pdf cropped to the drawing
% Step 3: Run `pdftops -eps ImageExport.pdf`
% Step 4: Rename the resulting eps file accordingly, use it!

% If some app doesn't want to include the graphic correctly, try running `pdftops -level1 -eps ImageExport.pdf` or `pdftops -level2 -eps ImageExport.pdf`

%% Usage for png-pictures
% Needs ImageMagick (http://www.imagemagick.org/script/index.php) and for Windows also Ghostscript (http://ghostscript.com/download/gsdnld.html, 32bit)

% Step 1: Include the tikzpicture below, adjust the used packages if needed
% Step 2: Compile like always but be sure to use the `--shell-escape` option. Ignore errors like "Undefined control sequence \HyperFirstAtBeginDocument"
% Step 3: Rename the resulting png file accordingly, use it!

\documentclass[convert={convertexe={magick}}]{standalone}

\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{positioning,fit,calc,...}

\begin{document}
\input{my/tikz/graphic.tex}
\end{document}

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.