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}
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.