2

Using preview-latex to preview the tikzpicture environment shows either a blank rectangle in pdf mode or simply produces no preview file in ps mode.

I am using aquamacs 23.3a, using auctex and gs 9.04.

I tested multiple file format outputs and preview options. I don't see any errors or warning pop up either, so I can't tell for sure if the error lies with ghostscript, auctex or preview.

The following previews a blank for the entire tikzpicture environment.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \node[draw] {tikz rectangle};
\end{tikzpicture}
\end{document}

Is there a way to see what exactly goes wrong where?

Beef
  • 121
  • Have you tried to create a preview by hand, i.e. using the preview-package in your LaTeX document and \begin{preview} ... \end{preview} ? – J Fabian Meier Sep 15 '11 at 18:33
  • It is creating a preview, adding a preview environment around it manually gives the same effect: blank preview. – Beef Sep 16 '11 at 09:51
  • Does this only happen with a picture, or also with just a text document? Have you tried viewing the PDF in Adobe Acrobat? – Peter Grill Sep 16 '11 at 17:53
  • I'm talking about the preview images generated, the complete pdf generates just fine with text and all. It's just the preview images generated by preview/gs that are empty. – Beef Oct 13 '11 at 11:37
  • You could try adding \usepackage[active,float]{preview}\PreviewEnvironment{tikzpicture} as the last package. If that is not enough, try wrapping tikzpicture within a \begin{figure}...\end{figure}aspreview-latex` might be looking for a float. – Peter Grill Dec 01 '11 at 17:24
  • @PeterGrill Would you turn your comment into an answer? – egreg Jan 07 '12 at 21:26
  • @egreg: Done... – Peter Grill Jan 08 '12 at 19:20

1 Answers1

5

You should add

\usepackage[active,float]{preview}
\PreviewEnvironment{tikzpicture} 

as the last package.

If that is not enough, try wrapping the tikzpicture within a \begin{figure}...\end{figure} as preview-latex might be looking for a float.

Peter Grill
  • 223,288