3

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.

9
  • 1
    Do you already use AucTeX? By the way, why did you add the xetex tab? Are you only using XeTeX?
    – ph0t0nix
    May 27, 2016 at 11:52
  • @ph0t0nix Is it WYSIWYG editor?
    – karu
    May 27, 2016 at 11:54
  • 1
    Did you click the link? The first line on the page says "AUCTeX is an extensible package for writing and formatting TeX files in GNU Emacs". A bit further down it says: "AUCTeX includes preview-latex which makes LaTeX a tightly integrated component of your editing workflow by visualizing selected source chunks (such as single formulas or graphics) directly as images in the source buffer.".
    – ph0t0nix
    May 27, 2016 at 11:54
  • 1
    use org-mode orgmode.org; some swear by it
    – doed
    May 27, 2016 at 12:17
  • 1
    I just use latexmk running in continuous preview mode, then I just have to save the file, the rest is compiled automatically. Of course I loose C-c ` but for me that has not been that big a deal when I can still use the power full editing tools. I use Evince as preview (with inverse search enabled). If the project is large, then using \include and \includeonly to limit what is being compiles increases the compilation speed. (Note Hadn't seen that Keks had already mentioned latexmk, though I've never used PDF-tools)
    – daleif
    May 27, 2016 at 14:40

3 Answers 3

4

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.

4
  • I don't need a complete WYSIWYG editor. I need features like I can see the margins and formatting , fonts, alignment, adding tables etc..
    – karu
    May 27, 2016 at 16:14
  • Then PDF-Tools, latexmk and especially a feature called synctex are your friends.
    – Keks Dose
    May 27, 2016 at 17:36
  • Could you post a screenshot? I need to know how it looks like
    – karu
    May 27, 2016 at 17:39
  • You mean C-c C-o C-b, after tex-fold-mode has been activated. Nov 16, 2020 at 9:32
2

I strongly suggest you trying spacemacs and it's Latex layer. It offers a 0 configuration way to use latex with emacs. Live preview is also provided by Preview Latex package. If you love both latex and emacs, spacemacs will amaze you.

0

Finally, I got a solution GNU TeXmacs Editor. I installed it from Ubuntu Software center.

http://www.texmacs.org/tmweb/home/welcome.en.html 
2
  • 5
    FYI: TeXmacs doesn't in fact use TeX at all. May 28, 2016 at 10:00
  • @TorbjørnT. Yeah but I can export to tex.
    – karu
    May 29, 2016 at 7:32

You must log in to answer this question.

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