Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Have you tried to create a preview by hand, i.e. using the preview-package in your LaTeX document and \begin{preview} ... \end{preview} ? –  JF 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 9: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}` as preview-latex might be looking for a float. –  Peter Grill Dec 1 '11 at 17:24

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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