3.10 Alt Key Macros

3.10.1 <Alt-L>
3.10.2 <Alt-M>
3.10.3 <Alt-C>

Latex-Suite utilizes a set of macros originally created by Carl Mueller in auctex.vim to make inserting all the \left ... \right stuff very easy and to also make some use of the heavily under-utilized <Alt> key.

Note

By default, typing Alt-<key> in Vim takes focus to the menu bar if a menu with the hotkey <key> exists. If in your case, there are conflicts due to this behavior, you will need to set

set winaltkeys=no

in your $VIM/ftplugin/tex.vim in order to use these maps.

Customizing the maps

If for some reason, you wish to not map the <Alt> keys, (some European users need to use the <Alt> key to enter diacritics), you can change these maps to other keys as described in the section Customizing Alt-key maps.

3.10.1 <Alt-L>

This is a polymorphic insert-mode mapping which expands to one of the following depending on the character just before the cursor location.

Character before cursorExpansion
(\left( <++> \right)
[\left[ <++> \right]
|\left| <++> \right|
{\left\{ <++> \right\}
<\langle <++> \rangle
q\lefteqn{<++>}<++>

If the character before the cursor is none of the above, then it will simply insert a \label{<++>}<++>.

3.10.2 <Alt-M>

This insert-mode mapping encloses the previous character in \mathbf{}.

3.10.3 <Alt-C>

In insert mode, this key is polymorphic as follows:

  1. If the previous character is a letter or number, then capitalize it and enclose it in \mathcal{}.
  2. otherwise insert \cite{}.

In visual mode, it will simply enclose the selection in \mathcal{}