# Add line before Begin algorithm 'Début' [closed]

This is a follow-up question to Option in the algorithm with Latex. This is my algorithm:

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


-

## closed as too localized by Stephan Lehmke, Gonzalo Medina, Thorsten, Stefan Kottwitz♦Oct 11 '12 at 6:01

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

How did you define \Debut and \Fin? –  Gonzalo Medina Oct 10 '12 at 22:09
Then define \Donnees in a similar way: \algnewcommand{\Donnees}{\Statex\textbf{Donn\'ees}\pushindent} –  Gonzalo Medina Oct 10 '12 at 22:12
thank you Gonzalo :) –  researcher Oct 10 '12 at 22:27

\algnewcommand{\Donnees}{\Statex \textbf{Donn\'ees}}


you can now obtain

\begin{algorithm}
\caption{My algorithme}
\begin{algorithmic}[1]
\Donnees: My data
\Statex% Blank line
\Debut
\LState $r\gets a\bmod b$
\While{$r\not=0$}\Comment{We have the answer if r is 0}
\LState $a\gets b$
\LState $b\gets r$
\LState $r\gets a\bmod b$
\EndWhile\label{euclidendwhile}
\LState \textbf{Retour} $b$\Comment{The gcd is b}
\Fin
\end{algorithmic}
\end{algorithm}
\end{document}


The use of \Statex inserts a blank line, depending on whether you need a separation between the algorithm and the input.

The above code snippet uses the same preamble as in Option in the algorithm with LaTeX.

-
Please i have one more question: when i divide the algorithm after an IF and before an EndIF, i have an error , have you an idea please? –  researcher Dec 11 '12 at 16:11