I have the following listing with 3 titles:
\begin{figure}
\begin{lstlisting}[mathescape=true]
Enhancing Access Privacy of Range Retrievals over $(\mathbb{B}^+)$-Trees.
Enhancing Access Privacy of Range Retrievals over \$({\rm B}^+)\$ -Trees
Enhancing Access Privacy of Range Retrievals Over B+-trees
\end{lstlisting}
\label{title_example}
\caption {example title}
\end{figure}
I would like the first title to use math mode and the second to not use math mode. I tried escaping the dollar signs but that removes everything after the first.
Best Answer
Just choose a different escaping sequence/character: