# parskip is shifting my algorithm

## Problem:

I am using parskip (only) to add customized space between paragraphs, but the package is shifting my algorithm content to the left.

If there is another (clean) way to customize the space between paragraphs or isolate the algorithm environment, it is welcome:

## How does it looks:

And here the same code without parskip

## The code:

\documentclass{report}
\usepackage{xcolor}
\usepackage{parskip}
\newcommand{\bftab}{\fontseries{b}\selectfont}
\usepackage[linesnumbered,ruled,vlined,spanish,onelanguage]{algorithm2e}

\begin{document}

\begin{algorithm}
\caption{SomeTitle}
\DontPrintSemicolon
\footnotesize
delRef(Refutation ref)\{\;
\Indp
Some code lines\;
Other one\;
\Indm
\}\;
\end{algorithm}

\end{document}


As always, thank you so much for your time :)

the documentation says that indents depend on the existing \parindent and \leftskip when the package is loaded.

so try loading parskip after algorithm2e.

Looks like the algorithm layout is assuming that \parindent is non zero. If you set it locally back to say 15pt, then the text is indented by that amount

\documentclass{report}
\usepackage{xcolor}
\usepackage{parskip}
\newcommand{\bftab}{\fontseries{b}\selectfont}
\usepackage[linesnumbered,ruled,vlined,spanish,onelanguage]{algorithm2e}

\begin{document}

\begin{algorithm}\setlength\parindent{15pt}
\caption{SomeTitle}
\DontPrintSemicolon
\footnotesize
delRef(Refutation ref)\{\;
\Indp
Some code lines\;
Other one\;
\Indm
\}\;
\end{algorithm}

\end{document}

• great, thank you. Just a little detail, the title still being shifted. Is there something for that? – onlycparra Mar 18 '16 at 16:33
• @onlycparra -- as i noted in a comment to your other question, the documentation says that indents depend on the existing \parindent and \leftskip when the package is loaded. so try loading parskip after algorithm2e`. – barbara beeton Mar 18 '16 at 16:45
• @barbarabeeton reading the documentation is cheating:-) – David Carlisle Mar 18 '16 at 16:46
• [EDITED] as I commented him back (lol) the problem still happening even without parsnip at all. EDIT: sorry, I get confused with the other question, please forget this comment. I will try it – onlycparra Mar 18 '16 at 16:47