I have some Latex (below) which renders the algorithm environment with centered text:
This doesn't match the wikibooks Latex documentation, which shows a left-aligned block.
I'd rather not post all my Latex, since it's a big document, but I've tried to include relevant info below. Any help is appreciated!
My Latex
\documentclass[preprint]{imsart}
\RequirePackage[OT1]{fontenc}
\RequirePackage{amsthm,amsmath,amssymb}
\RequirePackage[round]{natbib}
\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
\RequirePackage{fullpage}
\RequirePackage{todonotes}
\RequirePackage{bm}
\RequirePackage{booktabs}
\RequirePackage{comment}
\RequirePackage{subcaption}
\RequirePackage{algorithm}
\RequirePackage[noend]{algpseudocode}
\RequirePackage{tcolorbox}
\RequirePackage{enumitem}
\usepackage{macros}
\usepackage[]{algorithm2e}
...
\begin{document}
...
\subsection{This is a title}
This is some text.
\begin{algorithm}[H]
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}
...
\end{document}

