I start to draw an algorithm using the algorithm package. And, I meet the problem that I can't well indent the parbox block which includes the loop, and it seems the parbox still effect the later parts:
My code is:
\documentclass[twoside, onecolumn, 11pt, a4paper]{article}
\usepackage[english,francais]{babel}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\algnewcommand{\Inputs}[1]{%
\State \textbf{Inputs:}
\Statex \hspace*{\algorithmicindent}\parbox[t]{.9\linewidth}{\raggedright #1}
}
\algnewcommand{\Outputs}[1]{%
\State \textbf{Outputs:}
\Statex \hspace*{\algorithmicindent}\parbox[t]{.9\linewidth}{\raggedright #1}
}
\algnewcommand{\Compute}[1]{%
\State \textbf{Compute:}
\hspace*{\algorithmicindent}\parbox[t]{.9\linewidth}{\raggedright #1}
}
\begin{document}
\begin{algorithm}
\begin{algorithmic}
\Inputs{$X$}
\Compute{
\For{i = 0 to I}
\State do sth in the loop
\EndFor
}
\Outputs{$Y$}
\end{algorithmic}
\end{algorithm}
\end{document}
I got a strange large indent of the content of Compute, and the Output is also with a indent seems effected by the parbox. How chould I well arrange this algorithm?