Live data from Hacker News

Emacs as the Ultimate LaTeX Editor

piotrkazmierczak.com

11–20 of 41 posts

Re: Emacs as the Ultimate LaTeX Editor

#11
post #2

Anyone seriously considering Emacs for LaTeX editing should also take a look at the yasnippet package. The customizable autocompletion shortcuts make it really easy to insert commands using just keywords. In my case this has proved to be very helpful especially when inserting figures or inline equations. I can create a snippet so that when I type fig + it inserts a \begin{figure}.. \end{figure}float and positions the…

AUCTeX has the LaTeX-environment function (C-c C-e by default) that does even better than that (inserts the figure environment, offers to center, creates a label, a caption, etc.), and also handles all environments, plus there's no need to create the snippets.

I just used figure as an example. If there's no predefined keystroke or function available such as in the case of LaTeX macros that you tend to use frequently, snippets can be of use. Of course one can do without them, but they're definitely worth considering if you use emacs regularly.

Re: Emacs as the Ultimate LaTeX Editor

#12

I hate the best editor debate because I think it's distracting from what's more important — what both editors can learn from each other and what both need to do to improve. I used Emacs for years, switched to Vim because of RSI, then recently switched back to emacs+evil. Frankly, for what I do most (R, R+knitr, C++ with clang autocomplete), no single editor is great. First, there's too little ability to switch betwee…

Code (live code) + LaTeX can be done with org-babel (kind of,) and I use mmm-mode (sorry, not on my computer now and don't remember the precise name, but it's on Melpa) and for multiple major modes in different blocks, works nicely (but don't know a way to keep the defined modes per section across sessions/file closes)

Re: Emacs as the Ultimate LaTeX Editor

#13

I hate the best editor debate because I think it's distracting from what's more important — what both editors can learn from each other and what both need to do to improve. I used Emacs for years, switched to Vim because of RSI, then recently switched back to emacs+evil. Frankly, for what I do most (R, R+knitr, C++ with clang autocomplete), no single editor is great. First, there's too little ability to switch betwee…

Well, the "best editor debates" do keep people from being insular. :-)

Are the vi keybindings really better for your RSI? I've heard different stories. For example,

http://changelog.complete.org/archives/661-so-long-vim-im-re...

There's a new ergoemacs mode that I haven't tried yet: http://ergoemacs.org

Personally, I spend more time using IntelliJ, Xcode, and Sublime these days, but recently I started using Emacs again for a bunch of .org stuff.

By the way, there's an Emacs StackExchange which will hopefully make emacs more accessible.

http://emacs.stackexchange.com/questions/2671/how-can-i-get-...

Re: Emacs as the Ultimate LaTeX Editor

#14

I hate the best editor debate because I think it's distracting from what's more important — what both editors can learn from each other and what both need to do to improve. I used Emacs for years, switched to Vim because of RSI, then recently switched back to emacs+evil. Frankly, for what I do most (R, R+knitr, C++ with clang autocomplete), no single editor is great. First, there's too little ability to switch betwee…

Neovim has a good chance to become the best editor. They are taking a really hard stance against all the cruft in Vim and have some really great features already implemented. I'm especially excited about their goal of reimplementing all IO with libuv. The lack of proper asynchronous IO has been a sore point in vim and emacs for a long, long time.

Re: Emacs as the Ultimate LaTeX Editor

#15
post #14

I hate the best editor debate because I think it's distracting from what's more important — what both editors can learn from each other and what both need to do to improve. I used Emacs for years, switched to Vim because of RSI, then recently switched back to emacs+evil. Frankly, for what I do most (R, R+knitr, C++ with clang autocomplete), no single editor is great. First, there's too little ability to switch betwee…

Neovim has a good chance to become the best editor. They are taking a really hard stance against all the cruft in Vim and have some really great features already implemented. I'm especially excited about their goal of reimplementing all IO with libuv. The lack of proper asynchronous IO has been a sore point in vim and emacs for a long, long time.

Uh, Emacs has asynchronous IO, and it works fine. http://www.gnu.org/software/emacs/manual/html_node/elisp/Asy...

Re: Emacs as the Ultimate LaTeX Editor

#17
post #15
post #14

Earlier quoted context omitted.

Neovim has a good chance to become the best editor. They are taking a really hard stance against all the cruft in Vim and have some really great features already implemented. I'm especially excited about their goal of reimplementing all IO with libuv. The lack of proper asynchronous IO has been a sore point in vim and emacs for a long, long time.

Uh, Emacs has asynchronous IO, and it works fine. http://www.gnu.org/software/emacs/manual/html_node/elisp/Asy...

It has support for AIO, as had vim for quite a while, but it's not pervasive in the standard library and the ecosystem. Both editors have way too many plugins that block the UI needlessly while you're typing (autocompletion, syntax checking etc).

Re: Emacs as the Ultimate LaTeX Editor

#18
I switched to vim years ago for everything else, but I still use emacs specifically for auctex. I have yet to find a vim equivalent nearly as convenient. In particular, C-c C-c as a do what I mean compiler (checking timestamps to figure out whether to run LaTeX, BibTeX, etc, as well as C-c C-e to insert an environment, and alt-enter to insert a newline and \item.

Re: Emacs as the Ultimate LaTeX Editor

#19
post #4

Earlier quoted context omitted.

I've stopped using yasnippet because I find it too resource-intensive. It's especially noticeable on emacs-startup, even of good machines, and I've found myself not using it very often. So I decided that it wasn't worth the time. Just as a FYI to people on weaker hardware.

My main gripe with yasnippet is that its feature list is pretty lackluster compared to some advanced vim snippet plugins like xptemplate.[1] xptemplate has a bazillion features, and yasnippet is primitive in comparison. Just a simple example is that in xptemplate (and probably any respectable snippet plugin in vim) you can type a part of a snippet name, hit TAB, and it will expand the snippet whose partial name you t…

> Just a simple example is that in xptemplate (and probably any respectable snippet plugin in vim) you can type a part of a snippet name, hit TAB, and it will expand the snippet whose partial name you typed (assuming there's no exact match). In yasnippet, you have to type out the full snippet name before it can be expanded. This is pretty annoying, especially for long snippet names.

Yes, you can do that as well. See the list of expansion methods with screenshots inside: https://capitaomorte.github.io/yasnippet/snippet-expansion.h.... You may interest in minibuffer prompting.

You already have a built-in template system in Emacs called Srecode that allows you to program your templates: http://cedet.sourceforge.net/srecode.shtml

According to the homepage, "the core template text is based loosely on Google ctemplate".

Re: Emacs as the Ultimate LaTeX Editor

#20

I hate the best editor debate because I think it's distracting from what's more important — what both editors can learn from each other and what both need to do to improve. I used Emacs for years, switched to Vim because of RSI, then recently switched back to emacs+evil. Frankly, for what I do most (R, R+knitr, C++ with clang autocomplete), no single editor is great. First, there's too little ability to switch betwee…

What's wrong with Company: http://company-mode.github.io/? It can give me a large amount of completion candidates without any issue. It's also smooth. Maybe you are using auto-complete?
Post reply on HN