I'm using the algorithmicx
package and would like to fully left justify the text when not using line numbers. Here's an example:
Notice how only the Require
and Ensure
clauses are fully pushed to the left. How can I make the rest of the code be fully left justified as well?
Here's a minimal example:
\documentclass[a4paper,11pt]{article}
\usepackage{algorithmicx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{amsmath}
\begin{document}
\begin{algorithm}
\caption{Algorithm Name}
\begin{algorithmic}
\Require some input
\Ensure some output
\Statex
\State \textbf{something}
\State more text
\begin{enumerate}
\item list item 1
\item an equation
\begin{equation*}
f(n) = \begin{cases}
1 & i = 1\\
f(n-1) + f(n-2) & i > 1
\end{cases}
\end{equation*}
\item third item
\end{enumerate}
\State last line
\end{algorithmic}
\end{algorithm}
\end{document}
enumerate
. I recommend the packageenumitem
and than use\begin{enumerate}[leftmargin=0pt]
– Marco Daniel May 2 '12 at 20:23enumerate
part was not really my main focus, i.e. I just added it for this example. See also my comment to @Werner's answer. – hakoja May 2 '12 at 21:14