I have to add the word Listing or Lst. in front of the number of a listings in the list-of-listings. I use the listings package. I know how to achieve this with tables:
\renewcommand{\cfttabpresnum}{Tab. }
\settowidth{\cfttabnumwidth}{Tab. 10\quad}
but is there something similar for the listings?
My current code:
\documentclass[12pt,a4paper]{scrartcl}
\usepackage{listings}
\begin{document}
\lstlistoflistings
\section{Test}
\begin{lstlisting}[caption=TestListing]
test()
\end{lstlisting}
\end{document}
{\lstlistingname\space#1}instead of{Listing #1}to keep it in sync if the listings name is ever changed, e.g. bybabel. – Martin Scharrer Jul 07 '11 at 08:44