11

The list (from \lstlistoflistings) is indented compared to list of tables (\listoftables). How can I remove the extra indentations?

\documentclass{memoir}
\usepackage{listings}

\begin{document}

\listoftables
\lstlistoflistings

\chapter{The chapter}

\begin{table}[h]
\caption{Table}
\end{table}

\begin{lstlisting}[caption={List}]
\end{lstlisting}

\end{document}

1 Answer 1

7

The indentation in listings' \lstlistoflistings resembles that of the LoF/LoT in standard classes. Here's the adaption for memoir:

\documentclass{memoir}

\usepackage{listings}

\makeatletter
\renewcommand*{\l@lstlisting}{\@dottedtocline{1}{0em}{2.3em}}
\makeatother

\begin{document}

\listoftables

\lstlistoflistings

\chapter{The chapter}

\begin{table}[h]
\caption{Table}
\end{table}

\begin{lstlisting}[caption={List}]
\end{lstlisting}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .