# Signature below listings

How can I put automatic signature below my code listings. Now I put my code listings like this:

\begin{lstlisting}
MY CODE
\end{lstlisting}


Settings of listings:

    \usepackage{color}
\definecolor{bluekeywords}{rgb}{0.13,0.13,1}
\definecolor{redstrings}{rgb}{0.9,0,0}

\usepackage{listings}
\lstset{language=[Sharp]C,
showspaces=false,
showtabs=false,
breaklines=true,
numbers=left,
frame=single,
showstringspaces=false,
breakatwhitespace=true,
escapeinside={(*@}{@*)},
keywordstyle=\color{bluekeywords},
stringstyle=\color{redstrings},
basicstyle=\ttfamily
}

-
Welcome to TeX.SX! What do you mean by "automatic signature"? – egreg Jan 26 '14 at 22:11
Maybe some kind of caption would do what you want? – Geoff Pointer Jan 26 '14 at 22:15
Yes, I want to make caption below listing and finally I would like to make table of contents - listings – Aclber Jan 26 '14 at 23:46
Maybe this link will help. – Geoff Pointer Jan 30 '14 at 12:41

You can use the caption key to obtain the captions; use captionpos=b so that the captions appear below the listing (the default position is above). The command \lstlistoflistings gives you a list of all listings for which you declared a caption.

\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}

\definecolor{bluekeywords}{rgb}{0.13,0.13,1}
\definecolor{redstrings}{rgb}{0.9,0,0}

\usepackage{listings}
\lstset{language=[Sharp]C,
showspaces=false,
showtabs=false,
breaklines=true,
numbers=left,
frame=single,
showstringspaces=false,
breakatwhitespace=true,
escapeinside={(*@}{@*)},
keywordstyle=\color{bluekeywords},
stringstyle=\color{redstrings},
basicstyle=\ttfamily,
captionpos=b
}

\begin{document}

\lstlistoflistings

\begin{lstlisting}[caption={this is some description of the first listing}]
MY CODE
\end{lstlisting}

\begin{lstlisting}[caption={this is some description of the second listing}]
MY CODE
\end{lstlisting}

\begin{lstlisting}[caption={this is some description of the third listing}]
MY CODE
\end{lstlisting}

\end{document}


-