I am preparing a beamer presentation and using the lstlisting environment in order to put in TeX code. I am using the following code which is largely copied from here:
\definecolor{lightgrey}{rgb}{0.9,0.9,0.9} % defining color for listing
\definecolor{darkgreen}{rgb}{0,0.6,0} % defining color for listing
\lstset{language=[LaTeX]TeX, texcsstyle=*\bf\color{blue},
numbers=left, breaklines=true, keywordstyle=\color{darkgreen},
commentstyle=\color{red}, otherkeywords={$}, frame=leftline,
tabsize=2, backgroundcolor=\color{lightgrey}}
I would like to also copy the otherkeywords={$, \{, \}, \[, \]}, line from tom (here again). However, it is always giving me error messages with that line. Is there something wrong with that code?
Thanks, Max
In response to the comment: The error occurs I do this:
\documentclass{beamer}
\usepackage{remreset}
\usepackage{comment} % end and begin comment
\usepackage{dtklogos} % for \BibTeX
\usepackage{listings} % display code on slides; don't forget [fragile] option after \begin{frame}
\usepackage{bera} % pause in listing
\usepackage{color}
\definecolor{lightgrey}{rgb}{0.9,0.9,0.9} % defining color for listing
\definecolor{darkgreen}{rgb}{0,0.6,0} % defining color for listing
\makeatletter
\@removefromreset{subsection}{section} % creates navigation circles for every slide not section
\makeatother
\setcounter{subsection}{1} % creates navigation circles for every slide not section
\usetheme{Frankfurt}
\setbeamercovered{transparent}
\lstset{language=[LaTeX]TeX,
texcsstyle=*\bf\color{blue},
numbers=left,
breaklines=true,
keywordstyle=\color{darkgreen},
commentstyle=\color{red},
otherkeywords={$, \{, \}, \[, \]},
frame=leftline,
tabsize=2,
backgroundcolor=\color{lightgrey},
escapeinside=||
}
\begin{document}
\begin{lstlisting}
\title[Title]{An Introduction to \LaTeX}
\subtitle[Event]{ABC}
\author[Author]{XXX}
\institute[University]{XYZ University}
\maketitle
\end{lstlisting}
\end{document}
I does not occur if I substitute otherkeywords={$, \{, \}, \[, \]}, with otherkeywords={$},
