Emacs how to visualize a list as verbatim

I am using the lstlisting package in LaTeX mode. Sometimes I have a $ symbol inside the code. Emacs sees this as the beginning of the formula. And the rest of the document becomes ugly:

enter image description here

In verbatim mode, it correctly displays special characters:

enter image description here

How to make it render lslisting as verbatim?

+4
source share
1 answer

Add "lstlisting" to LaTeX-verbatim-environments (using Mx customize-variable ) and open the file again.

 LaTeX-verbatim-environments is a variable defined in `latex.el'. Its value is ("verbatim" "verbatim*" "lstlisting") Original value was ("verbatim" "verbatim*") Documentation: Verbatim environments. 
+5
source

All Articles