1

I have the following MWE with \listoffigures and \listofalgorithms. In the output, the list of figures are grouped based on the chapter they are in. However, when I add list of algorithms with the algorithms numbered based on the chapters they are defined in (using \usepackage[chapter]{algorithm}), it is not grouped at all. Is there some way to display it grouped as in \listoffigures?

\documentclass{memoir}
\usepackage[chapter]{algorithm}

\begin{document}
\tableofcontents
\listoffigures
\listofalgorithms

\chapter{First chapter}
\begin{figure}[ht]
  \caption{A figure}
\end{figure}

\begin{algorithm}[ht]
  \caption{Another algorithm}
\end{algorithm}

\section{Next section}

\begin{figure}[ht]
  \caption{Another figure}
\end{figure}

\begin{algorithm}[ht]
  \caption{An algorithm}
\end{algorithm}

\chapter{Second chapter}
\begin{figure}[ht]
  \caption{A figure}
\end{figure}

\begin{algorithm}[ht]
  \caption{Another algorithm}
\end{algorithm}

\section{Next section}

\begin{figure}[ht]
  \caption{Another figure}
\end{figure}

\begin{algorithm}[ht]
  \caption{An algorithm}
\end{algorithm}
\end{document}
2

You need to add this manually as part of \insertchapterspace. So, within your preamble, add

\makeatletter
\g@addto@macro\insertchapterspace{%
  \addtocontents{loa}{\protect\addvspace{10pt}}}
\makeatother

For the default document classes, see The line spacing in the list of algorithms.

2

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.