# Emacs keyboard shortcut to insert \label{} \\ and a new line in math mode.

So, I'm using emacs with auctex to edit my latex documents. It's been a while since last time I used it, but I still remember my shortcuts. Except one.

While editing equations inside and align environment, you have to add \\ at the end of each line, and add a label if you want reference that line specifically. I remember that emacs had a keyboard shorcut for that. You would use the shorcut and emacs automatically added \label{numer} \\ followed by a line break.

What shortcut is that? I tried Alt+Enter, but that simply inserts a new line followed by a \item.

EDIT: Seems that C-c-( key should be doing the trick, but it just inserts a label for me.

I got both auctex and emacs from the repositories. My emacs version is 32.1.1. If I use C-h a and type in "LaTeX-amsmath-env-alignat" (or even just "amsmath") it doesn't find any matches, so I guess it's not defined. The major/minor modes I use for editing latex documents are "LaTeX/S Ref".

-
The variable LaTeX-amsmath-label contains this, which should be inserted by Reftex if it is bound to the usual key C-c-( (control-C "("). If this doesn't work, well, something's wrong... – Charles Stewart Sep 15 '10 at 12:34
@Charles Stewart: That key combination successfully inserts a label wherever I am, but doesn't insert \ or a line break. It's what I've been using so far, since it's way better than typing a label. But I was sure there was a key for labeling and line breaking all in one.=/ – Malabarba Sep 15 '10 at 13:57
Reftex should look at the environment you're in, and insert the full string. To help try and figure out what is wrong: what version of Emacs are you using? Where did you get Auctex? Is the function LaTeX-amsmath-env-alignat defined (use C-h a, apropos-function, to check)? – Charles Stewart Sep 15 '10 at 16:46
@Charles:I got both auctex and emacs from the repositories. My emacs version is 32.1.1. If I use C-h a and type in "LaTeX-amsmath-env-alignat" (or even just "amsmath") it doesn't find any matches. The major/minor modes I use for editing latex documents are "LaTeX/S Ref". – Malabarba Sep 16 '10 at 13:58