Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs how to render lslisting as verbatim

Tags:

emacs

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

enter image description here

In verbatim mode it renders special symbols correctly:

enter image description here

How to make it render lslisting as verbatim?

like image 937
user4035 Avatar asked Feb 10 '13 20:02

user4035


1 Answers

Add "lstlisting" to LaTeX-verbatim-environments (using M-x customize-variable) and reopen your file.

LaTeX-verbatim-environments is a variable defined in `latex.el'.
Its value is ("verbatim" "verbatim*" "lstlisting")
Original value was ("verbatim" "verbatim*")

Documentation:
Verbatim environments.
like image 155
Anton Kovalenko Avatar answered Oct 21 '22 07:10

Anton Kovalenko