Did you use graphical editor for LaTeX such as Texmaker? Ever wondering if Emacs can have the same feature (two vertical panels, one for code and one for real-time preview)? Yes, now you can have it in Emacs by using LaTeX Preview Pane extension. This Emacs extension is a work by John Singleton, big thanks for him.

Note: you can not use LaTeX previewing in Emacs console mode. Please read issue report 34.

Install pdflatex

To have pdflatex program installed in your Ubuntu system, you need to install texlive-latex-base package from official repository. Here is the command:

$ sudo apt-get install texlive-latex-base

Add LaTeX Preview Pane Repository

To install LaTeX Preview Pane, you need to enable MELPA, an extensions repository for Emacs. It's because this extension is available online at MELPA. To do it, edit your ~/.emacs file and add these configuration lines and restart Emacs.

Configure The Pane

Add one another configuration line to your ~/.emacs file so the LaTeX Preview Pane will automatically show up whenever you open a LaTeX file document.

(latex-preview-pane-enable)

Using LaTeX Preview Pane

To use LaTeX preview in Emacs, you must start Emacs in GUI mode not in console mode. The easiest way is open Emacs from the desktop menu. Then, write a LaTeX (.tex) file and try to save it (C-x C-s) and you should see the preview on the right panel. If you don't know what LaTeX source code to write, just copy-paste my code below to your Emacs.