Currently, it's looking like this (the caption's name isn't used) :
1 <caption content>
2 <caption content>
...
For consistency with the list of figures, I would like the list of listings to be like this :
Code 1 : <caption content>
Code 2 : <caption content>
How can we do this ?
EDIT : Here's a compilable example of a list of listings :
Code: Select all
\documentclass[12pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{amsmath}
\usepackage{subfig}
\usepackage{listings}
\renewcommand*{\lstlistingname}{Code \arabic{lstlisting} de \textsl{Mathematica}}
\renewcommand*{\lstlistlistingname}{Table des codes de \textsl{Mathematica}}
\captionsetup[lstlisting]{margin=0cm,format=hang,font=small,format=plain,labelfont={bf,up},textfont={it}}
\captionsetup[lstlistoflistings]{\lstname Code \arabic{lstlisting} :}
\usepackage{chngcntr}
\usepackage{tocloft}
\begin{document}
\counterwithout{lstlisting}{chapter}
\chapter{Test}
Test
\lstset{}
\chapter{Test}
\begin{lstlisting}[caption={A simple caption}]
x := -2 + y
\end{lstlisting}
\begin{lstlisting}[caption={Another caption}]
x := -2 + z^2
\end{lstlisting}
\chapter{Another chapter}
Bla bla bla
\begin{lstlisting}[caption={And yet another caption}]
x := -2
\end{lstlisting}
%\renewcommand{\lstlistoflistings}{\thelstlisting }
\lstlistoflistings
\end{document}