Reputation: 110
I use auctex to write linguistic texts with many examples using the exe-environment which looks like this:
\begin{exe}
\ex (some text, glossed examples, etc.)
\end{exe}
Now, i'd like to have LaTeX-insert-item, bound to M-RET, to automatically insert \ex
instead of \item
in this environment, as it does with the description
-environment and others. Documentation tells me i can customize LaTeX-item-list in order to achieve this, but
customize-variable RET LaTeX-item-list
i get a "no match" error The cdr is the name of the function, used to insert this kind of items."
Now i read those lists have a syntax of the form (car . cdr), so my guess is that i should put in my .emacs-file something along the lines of
setq LaTeX-item-list (quote ("exe" . "function-to-insert-\ex-label")))
but my actual knowledge of elisp is rather thin so i'm really not sure if that's the right way. Could someone please help me out here?
Upvotes: 7
Views: 535
Reputation: 5198
You can put the following into your .emacs file:
(add-hook 'LaTeX-mode-hook '(lambda ()
(add-to-list 'LaTeX-item-list
'("exe" lambda () (let (TeX-insert-braces) (TeX-insert-macro "ex"))))))
Very well prepared question.
Upvotes: 4
Reputation: 300
I don't really know why you want to use \ex instead of \item. Anyway try using \renewcommand. In your case you will need this: \renewcommand{item}{ex} Hope this will work for you.
Upvotes: 1