开发者

In AucTeX, new item in itemized list after comment results in commented next item

开发者 https://www.devze.com 2022-12-28 17:06 出处:网络
In AucTeX, when editing an itemized list: \\begin{itemize} \\item My item % note to self \\end{itemize}

In AucTeX, when editing an itemized list:

\begin{itemize}
 \item My item % note to self
\end{itemize}

when I do C-c C-j after 'self' I get:

\begin{itemize}
 \item My item % note to self
 % \item
\end{itemize}

when I want:

\begin{itemize}
 \item My item % note to self
 \item
\end{itemize}

Is there a 开发者_JAVA百科setting a can modify to make this work correctly?


(setq LaTeX-insert-into-comments nil)

seems to solve the problem, although it may have other effects that I'm not aware of. To use it, put it in your .emacs customization file; to test it, try M-: then paste the above code into the prompt.

The variable LaTeX-insert-into-comments is defined as

*Whether insertion commands stay in comments. 
This allows using the insertion commands even when
the lines are outcommented, like in dtx files.

EDIT:

Here is something better:

(defadvice LaTeX-insert-item (around my-LaTeX-insert-item activate)
     (let  ((LaTeX-insert-into-comments nil)) ad-do-it))

This will prevent unwanted effects from setting the LaTeX-insert-into-comments globally to nil by changing it only temporarily when you insert an item. Again, to use it, put it in your .emacs customization file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号