1

Please, how can i increase spacing in an algorithm, between instruction 1 et instruction 2 ?

 \usepackage{algorithm}
 \usepackage{algorithmic}
 \begin{document}
 \begin{algorithm}[H]
 \caption{My algo}
 \begin{algorithmic}[1]
 \STATE instruction 1
 \STATE instruction 2
 \end{algorithmic}
 \end{algorithm}
 \end{document}

i'd like also to increase spacing between line and first instruction (see figure) enter image description here

please just another question: is it possible to add the option [vlined] with

\usepackage{algorithm} 
\usepackage{algorithmic} ?
5

set \setstretch{1.4} to any value you like

\documentclass{article}
 \usepackage{algorithm}
 \usepackage{algorithmic}
 \usepackage{setspace}
\let\Algorithm\algorithm
\renewcommand\algorithm[1][]{\Algorithm[#1]\setstretch{1.4}}

\begin{document}
 \begin{algorithm}[H]
 \caption{My algo}
 \begin{algorithmic}[1]
 \STATE instruction 1
 \STATE instruction 2
 \end{algorithmic}
 \end{algorithm}
\end{document}
  • i edit my question – researcher Oct 1 '12 at 10:28
  • use \caption{\strut My algo} – user2478 Oct 1 '12 at 10:36
  • thank you for answer but i'd like have a spaing between the second line and the first instruction 1: – researcher Oct 1 '12 at 10:39
  • \STATE \strut instruction 1 The command \strutis the height of the character "(" but without a width. It can be used to get some more space, if needed – user2478 Oct 1 '12 at 10:49
  • thank you so much , my question about vlined i post it in a new question ? – researcher Oct 1 '12 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.