# Speedy LaTeXing

I am LaTeXing my notes for a maths class, and I'm wondering what TeX.SE has to say about tips and tricks that have helped them enter their LaTeX code that much faster. It can be anything from a program to a macro to a seated position / music choice.

-
vim for the win, as described here: help-me-to-write-long-latex-equations-fast-with-colours-and-possibly-with-other‌​/ –  cmhughes Nov 27 '12 at 0:09
@cmhughes does vim work on a Mac? –  Zvpunry Nov 27 '12 at 0:10
If you are on a Mac and don't know about vim, may be you prefer TextMate. –  Manuel Nov 27 '12 at 0:14
GNU Emacs + AUCTeX is a cross-platform solution. The AUCTeX plugin has more functionality than any one person needs. (I don't use math in what I write, however, so someone else should fill you in on that aspect.) –  jon Nov 27 '12 at 9:37
Three words: Emacs, AUCTeX and Yasnippet. –  mbork Dec 19 '12 at 13:14
show 2 more comments

Assuming you are in a Mac.

I don't know vim (which is one of the most used editors), but I will talk about TextMate. In my case, I can't imagine how could vim be better than TextMate for me (I don't know nothing about programming).

In TM (TextMate), apart from normal input, you have four different kinds of 'entry options'

• Typical snippets. You type some text (i.e. mat) press tab and then you get what the snippet has in (in this case the full matrix environment and an option to choose between pmatrix, vmatrix, etc.). Apart from the text you have options like where the cursor goes and more, but this is basic.
• LaTeX symbol based con current word. You type a letter or two letter (i.e. a) you press the key combination and you get some symbol previously assigned (in this case \alpha).
• Environment based on current word. You type what you want to be in \begin{X} ... \end{X} (i.e. type environmentwhichidefined press the key combination and then you get the full \begin{environmentwhichidefined} \end{environmentwhichidefined} with the cursor in the middle).
• Command based on current word. You type a word or a letter and after pressing the key combination you get a 'command' (i.e. you write s press the keys and get \sum_{$1}^{$2} $0, where $i is the places where the cursor goes when you hit tab: if you type s key combination a tab b tab x you will get \sum_{a}^{b} x).

With those commands is pretty easy to be really fast. All the key combinations are configurable, of course. You can create new of any of this different input shortcuts very easy.

In addition, you have a lot of preconfigured commands for LaTeX. Apart from this, you have a lot of commands (like insert new \item, next cell in a tabular, new column and new row in a tabular, create tabular from selection, etc.). The only thing you have to do is to stay one afternoon looking through all its options (you will get impressed).

And, of course, it has a system to save and use preambles, full template documents, etc.

The only thing I believe (but I don't know) vim could be better for me is that may be it supports some extra features in the Find/Replace option, which in TM is the standard and doesn't give you so much flexibility. I miss a good find/replacement system in TM which may be vim could give me (with some little programming).

I do take notes of my lessons (math student) with TM. So, I bet for TextMate (since it's free, I hope this is not considered publicity :P).

PS: I spect some vim users to tell why they use vim. Because I've never tried to learn or discover what vim can do. TM just worked. But please tell the good things about vim.

-
Great answer! Thanks Manuel –  Zvpunry Nov 27 '12 at 0:43

## Precompiled Preamble:

One thing will help speed things up (especially if you use a lot of packages) would be to use a precompiled preamble. A few references:

## Figures:

• All figures should be externalized, but this is probably not relevant for taking notes during class.

## Shortcuts:

For speeding up the entry of the LaTeX you should consider using command/environment shortcuts similar to what is discussed in Does TeXShop for Mac have key bindings. The faster you can enter the LaTeX code, the faster you can get to the compile step.

-
Thanks Peter! I am more interested in speeding up the entry of code, I will edit my post accordingly. Thanks for the key bindings tips! –  Zvpunry Nov 27 '12 at 0:09

How to activate these features depends on your editor and you OS. Gedit/Ubuntu has these:

1. Code completion/Word completion helps a lot (suggests complete words if were previously used in the document)

2. Code snippets generation (create common blocks quickly) and create open/close brackets automatically.

3. Add alternative keyboard layout (extra layer) to add greek letters (e.g. type control-alt-A for α, which in turn can be interpreted as \alpha by xelatex). Not only you will type greek letters fast but also the equations will be more readable. (I didn't see the last one published anywhere else)

4. Your are taking notes, so you don't need to type flawless code. Just the idea to finish the code later.

-
About the fourth point, if it's your first day in a new lesson, may be you have a lot of new definitions, functions, graphs, and new notation. But after a week in the same subject if you have predefined the commands you know you need, you can, of course, type everything the teacher says. Even the comments (if you have good writing speed, despite the code). –  Manuel Nov 27 '12 at 0:51