[categories] [index] [all (553)] [latest]
Avec les paquetages algorithmic et algorithm.
%%% francisation des algorithmes
\renewcommand{\algorithmicrequire} {\textbf{\textsc{Entrées:}}}
\renewcommand{\algorithmicensure} {\textbf{\textsc{Sorties:}}}
\renewcommand{\algorithmicwhile} {\textbf{tantque}}
\renewcommand{\algorithmicdo} {\textbf{faire}}
\renewcommand{\algorithmicendwhile}{\textbf{fin tantque}}
\renewcommand{\algorithmicend} {\textbf{fin}}
\renewcommand{\algorithmicif} {\textbf{si}}
\renewcommand{\algorithmicendif} {\textbf{finsi}}
\renewcommand{\algorithmicelse} {\textbf{sinon}}
\renewcommand{\algorithmicthen} {\textbf{alors}}
\renewcommand{\algorithmicfor} {\textbf{pour}}
\renewcommand{\algorithmicforall} {\textbf{pour tout}}
\renewcommand{\algorithmicdo} {\textbf{faire}}
\renewcommand{\algorithmicendfor} {\textbf{fin pour}}
\renewcommand{\algorithmicloop} {\textbf{boucler}}
\renewcommand{\algorithmicendloop} {\textbf{fin boucle}}
\renewcommand{\algorithmicrepeat} {\textbf{répéter}}
\renewcommand{\algorithmicuntil} {\textbf{jusqu'à}}
\floatname{algorithm}{Algorithme}
\let\mylistof\listof
\renewcommand\listof[2]{\mylistof{algorithm}{Liste des algorithmes}}
% pour palier au problème de niveau des algos
\makeatletter
\providecommand*{\toclevel@algorithm}{0}
\makeatother
%\listofalgorithms % pour lister les algos (après la toc)
...
\begin{algorithm}
\caption{Algorithme d'Euclide}
\begin{algorithmic}
%%-----------------------------------------------
\REQUIRE $a, b \in {\mathbb N}$ % demande le paq. amssymb
\ENSURE le pgcd de $a$ et $b$
\STATE $x \leftarrow \textrm{max}(a,b)$
\STATE $y \leftarrow \textrm{min}(a,b)$
\WHILE {$y \neq 0$}
\STATE $x \leftarrow y$
\STATE $y \leftarrow x \mod y$ % demande le paq. amsmath
\ENDWHILE
\STATE Retourner $x$.
%%-----------------------------------------------
\end{algorithmic}
\end{algorithm}