[Tex/LaTex] Emacs as the latex editor

emacs

I am using Emacs for editing my latex document. Is there any way to make Emacs as WYSIWYG editor so that the editing will be easier. I need to reduce the number of time I compile the document also. I was using Texmaker before for editing the documents but I find Emacs more powerful. In texmaker, I need to compile every time to see the output. This is also same for Emacs in tex mode also.

I use Xelatex for compilation on Ubuntu 12.04. I am expecting a package like
Lyx.
I am not asking for a complete WYSIWYG editor – I rephrase my question to
HOw can I change Emacs as an editor that can show the alignments of margins, displaying text in prescribed fonts, and overall layout without compilation. Together with the text handling capability of Emacs.

Best Answer

There is no real WYSIWYG possible with LaTeX, because the editor needs to display the commands, sections, environments, whatever.

But there are several steps to provide a clean look on your text and have a real fast compilation.

  1. C-o C-b C-t (as far as I remember) hides most of the commands in Emacs.

  2. Install and use PDF-Tools for viewing the PDF, very fast.

  3. Open the shell of Emacs (M-x eshell) and start »latexmk«, which will compile your *.tex file every time you save it.

  4. Use automatic saving:

    (require 'auto-save-buffers) (run-with-idle-timer 2 t 'auto-save-buffers) (global-set-key [f8] 'auto-save-buffers-toggle)

  5. If you are really done with the preamble, you can even build your own format and use it, it will accelerate compiling very much.