I want to use showexpl
and have the LaTeX code printed with colored braces. I can do this within a lstlisting
environment by adding a literate option like in the example below, but not within a LTXexample
environment (it produces an error). Is there a way to have the braces colored in the code block of a LTXexample
environment?
\documentclass{article}
\usepackage{xcolor}
\usepackage{showexpl}
\lstset{language=[LaTeX]Tex,texcsstyle=*\color{red}}
\begin{document}
\begin{LTXexample}
\textit{Test}
\end{LTXexample}
\begin{lstlisting}[
literate=
*{\{}{{\textcolor{blue}{\{}}}{1}
{\}}{{\textcolor{blue}{\}}}}{1}
]
\textit{Test}
\end{lstlisting}
\end{document}