# Adding a colon to entries in a list of algorithms

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

• Welcome to TeX.SE! – Mensch Dec 7 '18 at 20:13

A minor adjustment to the redefinition of \numberline. Instead, collect the regular argument, and add a : suffix when you pass that on to \oldnumberline:

\documentclass{report}

\usepackage[ruled,vlined,algochapter]{algorithm2e}

\makeatletter
\newcommand*{\loacontents}{\@starttoc{loa}}
\makeatother

\begin{document}

\begingroup
\let\oldnumberline\numberline
\renewcommand{\numberline}[1]{Algorithm~\oldnumberline{#1:}}
\begin{center}
\bfseries LIST OF ALGORITHMS
\end{center}
\vspace{2\baselineskip}
\loacontents
\endgroup

\pagebreak

\chapter{Introduction}
\begin{algorithm}
\caption{Pseudocode caption.}
asdf
\end{algorithm}

\end{document}