This is my algorithm:
\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}
How can I specify which instruction have applied this option: [1]
?
I'd like to delete the number before "Début" and before "Fin", I'd like also add spacing before "ch" and "po"
Best Answer
The optional argument to
algorithmic
([1]
in this case), provides the line numbered at every line. A numbering modulo 2 would be obtained using[2]
, and so forth.Here's a slight variation of Is it possible to have connecting loop lines (like
algorithm2e
) inalgorithmic
? - usingalgpseudocode
(fromalgorithmicx
) - to insert Début and Fin as keywords. Others still need to be translated to French:\State
provides a "regular line" (with number), while\Statex
provides an unnumbered line. As such, I've defined both Début and Fin to be of\Statex
.Adding the macro
allows you to print an unnumbered line. Now you can use it as follows: