Aligning Pseudocode In LaTeX
Answer : I have never used an algorithm package in Latex, what I'd do is use the verbatim environment and manually indent the code in the text editor. \begin{verbatim} 1 y=0 2 for i = n downto 0 3 y = a_i + x * y \end{verbatim} This will put exactly what you type in the environment in the output, including whitespace. If you need fancy Latex (like subscript and such) check the alltt package. Info on Verbatim If I were you and I was absolutely sure that the algorithmic package is not the way to go, I'd use something like this: \begin{align*} &y = 0 \\ &\text{for $i = n$ downto 0} \\ & \hspace{1cm} y = a_i + x * y \end{align*} This results in Edit 2: Sorry, from your code excerpt and another answer, I somehow thought you wanted verbatim text. I have had success using algorithmicx . It is customizable for your needs. Documentation (PDF) \usepackage{algorithm} \usepackage[noend]{algpseudocode} \begin{algorithm} \begin{algorithmic} \Stat...