Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using org-mode 8.0, Emacs 24.3, Auctex 11.87, in Windows.

I was able to use LaTeX preview functions in org-mode files by pressing Ctrl + X, Ctrl + C, Ctrl + L. However, I think it would be more useful if the math preview can be done automatically when the cursor leaves the math equation, e.g. for $$a=b+c$$, when my cursor is out of $$, Emacs should automatically enable preview. This may not be so important for .tex file, but is quite useful for org-mode, especially when you input equations during note taking, you want instantaneous preview.

I thought that latex-math-preview.el should provide such function but seems it is just another implementation of preview-latex.el.

How to enable automatic LaTeX math preview in org-mode/Emacs?

share|improve this question
    
Looks like we now have a solution to this, thanks to John Kitchin: kitchingroup.cheme.cmu.edu/blog/2015/10/09/… – Kaushal Modi Oct 11 '15 at 11:04

Hmmm...An ugly and not imperfect solution:

(define-key org-mode-map (kbd "$") (lambda ()
                                     (interactive)
                                     (insert "$")
                                     (save-excursion
                                       (left-char 1)
                                       (if (org-inside-LaTeX-fragment-p)
                                           (progn
                                             (right-char 2)
                                             (org-preview-latex-fragment))))))

Anyway, it works on some degree.

share|improve this answer

You must log in to answer this question.

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