I am using AUCTeX on Emacs. When invoking preview.el with e.g. C-c C-p C-p I obtain previews of external figures (figure environment with .ps files), but not of TikZ pictures.

Is it possible to obtain previews of figures drawn with TikZ?

  • Try using PDF mode: select Command->TeXing Options->PDF Mode from the menu, or press C-c C-t C-p.
    – Alex
    May 1, 2013 at 17:13

1 Answer 1



(eval-after-load "preview"
  '(add-to-list 'preview-default-preamble "\\PreviewEnvironment{tikzpicture}" t)

in your .emacs file, you can include the tikzpicture environments in the preview building process.

  • Thanks for the answer, but this doesn't work for me... I tried on Aquamacs+ MacTex. Everything is good by default. So strange.
    – XxXxX
    May 7, 2013 at 8:52
  • @XxXxX It works for me with a recent GNU Emacs and AUCTeX, and I cannot test on a Max. Could you check whether the variable preview-default-preamble is successfully changed? Load a TeX file and do C-h v preview-default-preamble. It should give you something like preview-default-preamble is a variable defined in preview.el. Its value is ("\\RequirePackage[" ("," . preview-default-option-list) "]{preview}[2004/11/05]" "\\PreviewEnvironment{tikzpicture}")
    – sebschub
    May 7, 2013 at 12:54
  • @sebschub it works for me flawlessly, AucTeX + emacs 24.3 in ubuntu 13.10
    – rafee
    Dec 12, 2013 at 15:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .