How to add square brackets as a caption in a listing? I tried putting caption inside of "{}", but then the output is quiet weird.
\documentclass{article}
\usepackage{listings}
\begin{document}
\begin{lstlisting} - example}]
example
\end{lstlisting}
\end{document}
Best Answer
works on me. or as Manuel said: