I'm using the algorithm2e
package.
In one algorithm with several math formulae in consecutive lines I would like to increase line spacing.
I've already searched algorithm2e
's documentation but could not figure out how to change line spacing. Does anybody know?
Best Answer
I haven't found any
algorithm2e
command to do that.But this can be easily achieved with the help of the
setspace
package.You can simply add the line (adjust
1.35
to your needs)just after the
algorithm
environment has begun.Example (notice the difference between the first and the second algorithm, algorithm code taken from
algorithm2e
documentation):Output
If you want this behavior to apply globally to
algorithm
environments, add the following lines to your preamble:instead of using every time
\setstretch{1.35}
inside the environments.Also note that, if you don't want to use the
setspace
package, you can substitute\setstretch{1.35}
with\linespread{1.35}\selectfont
.