# Make List of Algorithms formatting match LOT/LOF

I'm working on my thesis, and I have a minor formatting problem with my list of algorithms.
The entry is added properly in the TOC and the font, size dotting and numbering are perfect, but for some reason, the LOA is about a centimeter lower than the LOF/LOT from the top of the page.

Here's my MWE:

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[12pt]{report}

\usepackage{setspace}
\usepackage{layout}
\usepackage{fullpage}

\usepackage{caption}
\usepackage[list=true, listformat=simple]{subcaption}

\usepackage{tocloft}

\usepackage{algorithm}
\usepackage[noend]{algorithmic}

\pagestyle{plain}

\begin{document}
\pagenumbering{roman}

\newpage
\singlespacing
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapnumwidth}{7em}
\makeatletter
\newcommand*\updatechaptername{%
\addtocontents{toc}{\protect\renewcommand*\protect\cftchappresnum{\@chapapp\ }}
}
\makeatother
\tableofcontents
\updatechaptername

\newpage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables

\newpage
\addcontentsline{toc}{chapter}{List of Algorithms}
\listofalgorithms

\doublespacing

\newpage
\pagenumbering{arabic}
\chapter{Introduction}
\label{chap:intro}

\newpage
\chapter{Content}
\label{chap:content}

\end{document}

-
add comment

## 1 Answer

The problem is due to the fact that the package float command \listof (which is loaded by package algorithms) does not format the same way as package tocloft. The following (untested with real algorithms) should work. It is a copy-paste of the \listoffigures tocloft command, suitably modified. (see also the section Known issues of the algorithms documentation)

[your mwe was lacking a \begin{document}, I cuoldn't to mention it in a comment as I don't earn enough reputation points]

\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[12pt]{report}

\usepackage{setspace}
\usepackage{layout}
\usepackage{fullpage}

\usepackage{caption}
\usepackage[list=true, listformat=simple]{subcaption}

\usepackage{tocloft}

\usepackage{algorithm}
\usepackage[noend]{algorithmic}

\makeatletter
\AtBeginDocument{%
\renewcommand{\listofalgorithms}{%
\@cfttocstart \par \begingroup
\parindent\z@ \parskip\cftparskip
\addpenalty \@secpenalty
\if@cfthaschapter \vspace*{\cftbeforeloftitleskip } \else
\vspace {\cftbeforeloftitleskip } \fi
\@cftpagestyle
{\interlinepenalty \@M
{\cftloftitlefont \listalgorithmname }%
{\cftafterloftitle }
\@mkboth {\MakeUppercase \listalgorithmname }
{\MakeUppercase \listalgorithmname }
\par \nobreak \vskip \cftafterloftitleskip \@afterheading }%
\let\l@algorithm\l@figure
\@starttoc {loa}\endgroup
\@cfttocfinish }}
\makeatother

\pagestyle{plain}
\pagenumbering{roman}

\newpage
\singlespacing
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftchapnumwidth}{7em}
\makeatletter
\newcommand*\updatechaptername{%
\addtocontents{toc}{\protect\renewcommand*\protect\cftchappresnum{\@chapapp\ }}
}
\makeatother

\begin{document}
\tableofcontents
\updatechaptername

\newpage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\newpage
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables

\newpage
\addcontentsline{toc}{chapter}{List of Algorithms}
\listofalgorithms

\doublespacing

\newpage
\pagenumbering{arabic}
\chapter{Introduction}
\label{chap:intro}

\newpage
\chapter{Content}
\label{chap:content}

\end{document}

-
Sorry for the delay, I was at a conference out of the country. I'll try this immediately and accept as soon as I got it working, thanks ! (Also, I fixed my MWE according to your comment.) –  Lexiel Mar 4 at 18:58
For those that stumble across this answer and are using algorithm2e instead, you can replace \listalgorithmname with \listalgorithmcfname to get a similar result. –  James Rohal Jun 8 at 5:52
add comment