5

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?

pavel
  • 861
XxXxX
  • 51
  • Try using PDF mode: select Command->TeXing Options->PDF Mode from the menu, or press C-c C-t C-p. – Alex May 01 '13 at 17:13

1 Answers1

9

With

(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.

giordano
  • 8,486
sebschub
  • 2,259
  • 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 07 '13 at 08: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 07 '13 at 12:54
  • @sebschub it works for me flawlessly, AucTeX + emacs 24.3 in ubuntu 13.10 – rafee Dec 12 '13 at 15:12