Basically I have a section that is describing my algorithm in a pseudo code kind of way, and so I want that text to look like the verbatim text except I still want to be able to use math symbols. Is there any way to do this? Or any other hacky way to get the result?
[Tex/LaTex] How to write math symbols in a verbatim
math-modeverbatim
Related Question
- [Tex/LaTex] Changing color of text snippet in a verbatim environment
- [Tex/LaTex] Putting math inside a verbatim environment without altering the formatting
- [Tex/LaTex] How to make lstlisting look exactly like verbatim
- [Tex/LaTex] Quote verbatim in Latex
- [Tex/LaTex] Inline verbatim with line breaks, colored font and highlighting
Best Answer
listings
provides amathescape
option to escape to LaTeX within math mode (between$
...$
). There are other escapable options as well, details of which are contained within thelistings
documentation (section 4.14 Escaping to LaTeX, p 39).Here is a quick example: