Looking for a way to set the width of an algorithm environment, preferably document wide (as opposed to per-algorithm). Thought it should be fairly easy, but couldn't find a particularly good solution.
Found this one here (wrap an algorithm in a minipage in a float, which is relatively okay, but surely there's a simpler way)?
\documentclass{article}
\usepackage{algorithm}
\floatstyle{plain}
\newfloat{myalgo}{tbhp}{mya}
\newenvironment{Algorithm}[2][tbh]%
{\begin{myalgo}[#1]
\centering
\begin{minipage}{#2}
\begin{algorithm}[H]}%
{\end{algorithm}
\end{minipage}
\end{myalgo}}
\begin{document}
\begin{Algorithm}[t]{10cm}
\caption{Does work, though no nice solution.}
\end{Algorithm}
\end{document}