I want to increase line spacing between statements in algorithm
environment. I used the setspace
package as here, but it also affects the space between line breaks that is not wanted. The following is a sample code
\begin{algorithm}
\begin{algorithmic}[1]
\State lines are long so I get line breaks. I want to increase space between statements, but not between different lines of the same statement.
\State lines are long so I get line breaks. I want to increase space between statements, but not between different lines of the same statement.
\end{algorithmic}
\end{algorithm}
In preamble I have:
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\algrenewcommand\alglinenumber[1]{{\sf\footnotesize#1}}
\usepackage{setspace}
\let\Algorithm\algorithm
\renewcommand\algorithm[1][]{\Algorithm[#1]\setstretch{1.2}}
Best Answer
Here's one possibility; internally,
algorithmic
uses a\list
, so we can use thexpatch
package to patch this list adding a desired value for\itemsep
(in the example I used2ex plus2pt
):The patching can also be done with the help of
etoolbox
instead ofxpatch
: