auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX-devel] amsmath, amsthm automatially insert thm, lemma etc


From: Arash Esbati
Subject: Re: [AUCTeX-devel] amsmath, amsthm automatially insert thm, lemma etc
Date: Tue, 20 Oct 2015 21:12:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5

Hi Uwe,

Uwe Brauer <address@hidden> writes:

> I played around a bit the thing I miss most is the automatic insertion
> of labels, but that might be a job of reftex?!

Thanks, does it mean that everything else worked fine?  If yes, I would
make a proper submission and update the style.

Reg. automatic label insertion, yes, you have to tell RefTeX about your
new environment and update `reftex-label-alist'.  Note that `?e' is for
equations, choose another `key-type' acc. to your needs.

--8<---------------cut here---------------start------------->8---
\documentclass{article}

Eval with `C-x C-e':

(LaTeX-add-environments (list "lemma" (vector "Heading")))

(add-to-list 'reftex-label-alist
             '("lemma" ?e "lem:" "~\\ref{%s}" nil ("Lemma" "lemma") nil))

\begin{document}

`C-c C-e lemma RET' inserts:
\begin{lemma}[Optional]
  `C-c (' inserts \label{lem:1}
  Text for short reference.
\end{lemma}

`C-) RET e RET' inserts \ref{lem:1}

\end{document}
--8<---------------cut here---------------end--------------->8---

Best, Arash




reply via email to

[Prev in Thread] Current Thread [Next in Thread]