I have some cites in my captions. But I do not want to appear them in the table of figures or listings.
With figures I managed to display an different caption like this:
\begin{figure}
\centering
\includegraphics[width=0.55\linewidth]{images/FIPA_Message-Transport-Reference-Model}
\caption[FIPA Message Transport Reference Model]{FIPA Message Transport Reference Model (\cite{FIPA2000}).}
\label{fig:FIPA_Message-Transport-Reference-Model}
\end{figure}
But with lstlisting I have some troubles because the caption is an option of the listings and that seems not to have an optional caption label.
\begin{lstlisting}[ language=Scala,
label={lst:Publisher},
caption={Publisher notify\cite{Zenger2013}}]
protected def publish(event: Evt) {
filters.keys.foreach(sub =>
if (!suspended.contains(sub) && filters.entryExists(sub, p => p(event)))
sub.notify(self, event)
)
}
\end{lstlisting}
Any Ideas how to solve this?
Thanks in advance!
Best Answer
This is covered in Section 4.9 of the
listings
documentation; you can useHere's a complete MWE to demonstrate: