I would like to typeset the \listofalgorithms
generated by package algorithm
in the same way than the \listoffigures
and \listoftables
, using package titletoc
. However, I have not been able to find a solution to that problem.
Here is a MWE:
\documentclass[12pt,a4paper]{book}
\usepackage{titletoc}
\usepackage[chapter]{algorithm}
\usepackage{algpseudocode}
\renewcommand{\cleardoublepage}{\clearpage}
\titlecontents{figure}[2.0em]{}{\contentslabel{2.3em}}{}{\titlerule*[0.25pc]{.}\contentspage}{}
\titlecontents{table}[2.0em]{}{\contentslabel{2.3em}}{}{\titlerule*[0.25pc]{.}\contentspage}{}
\contentsuse{algorithm}{loa}
\titlecontents{algorithm}[2.0em]{}{\contentslabel{2.3em}}{}{\titlerule*[0.25pc]{.}\contentspage}{}
\begin{document}
\listoffigures
\listoftables
\listofalgorithms
\chapter{Nice chapter}
\begin{figure}[t]
\caption{Nice figure}
\end{figure}
\begin{table}[t]
\caption{Nice table}
\end{table}
\begin{algorithm}[t]
\caption{Nice algorithm}
\end{algorithm}
\end{document}
Can someone think of a way to do it ?
Best Answer
The
\listofalgorithms
command is defined by thefloat
package. One can do by copying the definition of\listoftables
and patching it: