Dear All,
I am writing my PhD thesis and I need to quote a few code snippets. Some of them I want them not to have captions, so in my \begin{lstlisting} directive there is no caption parameter.
However, when I need to reference them I found that it is not possible without a caption. As an example, if you have a listing like the following:
\begin{lstlisting}[label=lis:hw]
printf("Hello World!\n");
\end{lstlisting}
If later on, you write something like listing~\ref{lis:hw}, this will produce the section number and not the value of the listings counter.
Is there any cure for that?
Regards,
George
General ⇒ Listings Package Question
NEW: TikZ book now 40% off at Amazon.com for a short time.
