# Adding a Line Between \begin{enumerate} and \item in AUCTeX

I am using Emacs with AUCTeX as my editor. Right now, if I use C-c C-e and create an enumerate environment, it will give me

\begin{enumerate}
\item
\end{enmerate}


What I'd like is

\begin{enumerate}

\item

\end{enumerate}


Or, at least

\begin{enumerate}

\item
\end{enumerate}


That is a single newline between the begin and the first item. I would like this to work with all environments with items. Thanks.

This is probably not the most efficient way, but it should do the job:

(defun TeX-arg-item-with-newline (_optional)
"Insert \\item with a newline above and below the macro.
OPTIONAL is ignored."
(when (or TeX-arg-item-label-p
(string-equal (LaTeX-current-environment)
"description"))
(let ((TeX-arg-opening-brace LaTeX-optop)
(TeX-arg-closing-brace LaTeX-optcl))
(TeX-argument-prompt t nil "Item label"))
t)))
(insert " ")
(save-excursion
(re-search-backward "\\\\item"
(line-beginning-position) t)
(forward-line -1)
(unless (looking-at-p "^[ ]*$") (forward-line) (LaTeX-newline) (indent-according-to-mode))) (save-excursion (forward-line) (unless (looking-at-p "^[ ]*$")
(LaTeX-newline)
(delete-horizontal-space))))