TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}
share|improve this question
up vote 7 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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