Search code examples
emacslatexauctex

How to use Auctex + preview-latex + orgmode in emacs


I use Emacs orgmode exclusively. I installed auctex from Melpa. My understanding is that preview-latex is packaged with auctex with no special setup required.

  1. I can't seem to summon preview-latex on any inline latex equations
  2. It seems like I have to change from orgmode to latex-mode to get the "latex" option in the toolbar.

What am I doing wrong here?

Thank you


Solution

  • The best method I found to preview latex in orgmode is:

    1. sudo apt-get install dvipng
    2. Restart emacs
    3. Place point at the beg of a latex inline equation in one of my .org files
    4. C-c C-x C-l

    Equation goes from this:

    $$\frac{a}{b} \cdot \frac{c}{d} = \frac{a \cdot c}{b \cdot d} = \frac{product\ of\ numerators}{product\ of\ denominators}$$
    

    To this: enter image description here

    Use C-c C-x C-l to revert.

    I do have Auctex installed (though I don't think dvipng uses it at all. And in my emacs init file I have:

    * AucTex: Require AucTex
    (require 'tex-site') 
    
    * LaTeX: Enable LaTeX Math mode by default
    (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
    

    This is very sweet!