How to configure LaTeX list of items?

I use auctex to write linguistic texts with many examples using an exe environment that looks like this:

\begin{exe} \ex (some text, glossed examples, etc.) \end{exe} 

Now I would like for the LaTeX-insert-item attached to M-RET to automatically insert \ex instead of \item in this environment, as is the case with description -environment and others, The documentation tells me that I can configure the LaTeX list elements for this but

  • When I try customize-variable RET LaTeX-item-list , I get a "no match" error
  • LaTeX-item-list documentation states: "A list of environments in which items have special syntax.

Cdr is the name of the function used to insert such items. "
Now I read that these lists have the syntax of the form (car. Cdr), so I assume that I should put something line by line in the .emacs file

 setq LaTeX-item-list (quote ("exe" . "function-to-insert-\ex-label"))) 

but my actual knowledge of elisp is pretty subtle, so I'm really not sure if this is correct. Can someone please help me here?

+6
source share
2 answers

You can put the following in 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.

+3
source

I really don't know why you want to use \ ex instead of \ item. In any case, try using \ renewcommand. In your case, you will need the following: \ Renewcommand {clause} {} ex I hope this works for you.

+1
source

Source: https://habr.com/ru/post/959278/