# How to prevent indent on \listofalgorithms?

How can I prevent the \listofalgorithms from being indented? I tried everything I could find on the internet, but the index of my algorithms refused to be aligned along with the title.

Here is a MWE:

\documentclass{article}
\usepackage{nomencl}
\usepackage{mathtools}
\usepackage{algorithm}
\usepackage{algpseudocode}
\numberwithin{algorithm}{section}
\begin{document}
\renewcommand{\nomname}{List of Algorithms}
\listofalgorithms
\newpage
\section{Introduction}\noindent
Text\\
\begin{algorithm}[H]
\caption{Caption}
\label{algo:caption}
\begin{algorithmic}[1]
\State hello world
\end{algorithmic}
\end{algorithm}
\end{document}


Any help is appreciated. Thanks!

-

The indentation is due to how the \listof macro works; it's provided by float that's loaded by algorithm. The easiest way to remove the indent is to patch that command:

\usepackage{etoolbox}
\patchcmd{\listof}{1.5em}{0pt}{}{}


The definition of \listofalgorithms is

\newcommand{\listofalgorithms}{\listof{algorithm}{\listalgorithmname}}


and \listof is

\newcommand{\listof}[2]{%
\@ifundefined{ext@#1}
{\float@error{#1}}
{\@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%

So once we know that \@dottedtocline is responsible for the typesetting of the line and 1.5em is the initial indent, we're done.