# latex algorithm displaying problems: lines are overlapped

duplicate I am using algorithm package (built with pdflatex -shell-escape -synctex=1 -interaction=nonstopmode under TexStudio) to draw my algorithm. It works well on a template, but when I switch to another template, it is presented with lines overlapped as below.

\documentclass[journal,article,submit,moreauthors,pdftex,10pt,a4paper]{Definitions/mdpi}

\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage[noend]{algpseudocode}

\firstpage{1}
\makeatletter
\setcounter{page}{\@firstpage}
\makeatother
\pubvolume{xx}
\issuenum{1}
\articlenumber{1}
\pubyear{2018}
\history{Received: date; Accepted: date; Published: date}
\Title{Title}
% Author Orchid ID: enter ID or remove command
\newcommand{\orcidauthorA}{0000-0000-000-000X} % Add \orcidA{} behind the author's name
%\newcommand{\orcidauthorB}{0000-0000-000-000X} % Add \orcidB{} behind the author's name

% Authors, for the paper (add full first names)
\Author{Firstname Lastname $^{1,\dagger,\ddagger}$\orcidA{}, Firstname Lastname $^{1,\ddagger}$ and Firstname Lastname $^{2,}$*}

% Authors, for metadata in PDF
\AuthorNames{Firstname Lastname, Firstname Lastname and Firstname Lastname}

$^{1}$ \quad Affiliation 1; e-mail@e-mail.com\\
$^{2}$ \quad Affiliation 2; e-mail@e-mail.com}
\corres{Correspondence: e-mail@e-mail.com; Tel.: +x-xxx-xxx-xxxx}
\secondnote{These authors contributed equally to this work.}
\begin{document}
\section{Hello}
\begin{algorithm}[t]
\caption{algorithm caption}
\hspace*{0.02in} {Input:}
input parameters A, B, C\\
\hspace*{0.02in} {Output:}
output result
\begin{algorithmic}[1]
\State some description
\For{condition}
\State ...
\If{condition}
\State ...
\Else
\State ...
\EndIf
\EndFor
\While{condition}
\State ...
\EndWhile
\State \Return result
\end{algorithmic}
\end{algorithm}
\end{document}


I have set up an git project on github, please feel free to clone it and try compiling it with pdflatex,

git clone https://github.com/qorost/latex-demo-algorithm.git

Any suggestions to increase the space between lines? any reply are appreciated!

• Please make a small example document and add it inline to your question. this question and its answers are archived forever and will not make sense unless you also keep that github project unchanged forever. – David Carlisle Jul 5 '18 at 6:38
• @DavidCarlisle Just updated this question with my demo tex code as well as a link to download the template files. The styling files are too big and it is beyond my ability to make it inline. – Qoros Jul 5 '18 at 6:52
• better thanks (a MWE would be better still, but this will do:-) incidentally \bf isn't supposed to be used in latex – David Carlisle Jul 5 '18 at 6:57
• @DavidCarlisle Thanks for the suggestions. updated with \bf removed. – Qoros Jul 5 '18 at 7:13

It's some strange interaction with setspace package and the other settings used. I didn't trace everything but you can reset the baselineskip so it isn't so cramped:
\section{Hello}