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?

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

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.

  • 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 '13 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 '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

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.