I'm trying to create a list of algorithms such that the a colon appears after every algorithm number. I've included a MWE below that produces the following,
I'd like to modify this by adding a colon after the algorithm number,
Algorithm 1.1: Pseudocode caption . . . . 2
I have seen similar questions asked (Formatting \listoftables and \listofalgorithms), however this solution does not work for me. I believe it is because their example uses algorithm
while I am using algorithm2e
. I haven't been able to solve this issue.
The "LIST OF ALGORITHMS" header needs to remain as it is shown in the MWE, I cannot have the default header that usually appears with \listofalgorithms
Minimum working example:
\documentclass[10pt]{report}
\usepackage[ruled,vlined,algochapter]{algorithm2e}
\usepackage{tocloft}
\makeatletter
\newcommand*{\loacontents}{\@starttoc{loa}}
\makeatother
\begin{document}
\begingroup
\renewcommand*{\addvspace}[1]{}
\let\oldnumberline\numberline
\renewcommand{\numberline}{Algorithm~\oldnumberline}
\begin{center}
\textbf{LIST OF ALGORITHMS}
\end{center}
~\\ % Empty lines
~\\
\loacontents
\endgroup
\pagebreak
\chapter{Introduction}
\begin{algorithm}
\caption{Pseudocode caption.}
asdf
\end{algorithm}
\end{document}