2

I am trying to write my algorithm in french language. I found this solution which works for me but with errors.

The errors are:

\algorithmicendelsif undefined
\algorithmicendif undefined
\algorithmicendfor undefined

I use the code provided by David Carlisle and I changed \newcommand to \renewcommand as he suggested. Everything is fine except with those errors. I mean the for changed to pour, do to faire, etc. But I still have errors and fin for instead of fin pour

1 Answer 1

3

Ok. I think this is the solution to my errors.

Change \newcommand to renewcommand except for those lines

\newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif}
\newcommand{\algorithmicendif}{\algorithmicend\ \algorithmicif}
\newcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor}

So, I have to do this:

\renewcommand{\algorithmicrequire}{\textbf{Entrée:}}
\renewcommand{\algorithmicensure}{\textbf{Sortie:}}
\renewcommand{\algorithmiccomment}[1]{\{#1\}}
\renewcommand{\algorithmicend}{\textbf{fin}}
\renewcommand{\algorithmicif}{\textbf{si}}
\renewcommand{\algorithmicthen}{\textbf{alors}}
\renewcommand{\algorithmicelse}{\textbf{sinon}}
\renewcommand{\algorithmicfor}{\textbf{pour}}
\renewcommand{\algorithmicforall}{\textbf{pour tout}}
\renewcommand{\algorithmicdo}{\textbf{faire}}
\renewcommand{\algorithmicwhile}{\textbf{tant que}}
\newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif}
\newcommand{\algorithmicendif}{\algorithmicend\ \algorithmicif}
\newcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .