I'm working currently on a beamer-document and want to use LaTeX-code. Therefore I set up the listings-package in the following way:
\documentclass[12pt]{beamer}
\usepackage{listings}
\usepackage{xcolor}
\definecolor{keywordcolor}{HTML}{102D5D}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{commentcolor}{HTML}{562B71}
\lstset{
language=[LaTeX]TeX,
texcsstyle=*\bf\color{keywordcolor},
numbers=left,
breaklines=true,
keywordstyle=\color{darkgreen},
commentstyle=\itshape\color{commentcolor},
morekeywords={},
otherkeywords={$, \{, \}, \[, \]},
tabsize=2,
frame=leftline,
basicstyle=\footnotesize\ttfamily,
backgroundcolor=\color{black!5}}
\begin{document}
\begin{frame}[fragile]
\begin{lstlisting}
\usepackage[Option]{Paket}
\end{lstlisting}
\end{frame}
\end{document}
The tex-file otherkeywords contains {$, \{, \}, \[, \]}. If I use \input, I'll get a bunch of errors. If I use the content for itself, I'll get the right result. Am I doing something wrong?
The errors:
Improper alphabetic constant backgroundcolor=\color{black!5}}
Extra \else backgroundcolor=\color{black!5}}
Improper alphabetic constant backgroundcolor=\color{black!5}}
Improper alphabetic constant backgroundcolor=\color{black!5}}
Paragraph ended before \filehook@@ensureext was complete
Missing \endcsname inserted
I tried all the suggestions at another question, but no success for me.
Sincerely
\inputthere. – egreg Jun 01 '14 at 21:48otherkeywordswants a list of (possibly escaped) characters, not the instructions to produce a list of characters. – egreg Jun 01 '14 at 22:08