I use


to create an algorithm, I'd like to change "algorithm, begin, end while ..." to French. Is that possible?

This is my example with the package \usepackage{algorithmic}:

\Begin{ \For{$x\in X$}{ $NbSuccInS(x) 
\longleftarrow 0$\; $NbPredInMin(x) 
\longleftarrow 0$\; $NbPredNotInMin(x) 
\longleftarrow |ImPred(x)|$\; 
} } 
\caption{My Algorithm} \label{alg:test} 

I have these errors: undefined control sequence \Begin \for, \newcommand ....

  • please make this a complete document showing all packages used Commented Sep 30, 2012 at 18:01
  • Those errors are unrelated to the translation to French problem, you wuld get them even without the redefinition from For to Pour (which would need to be \renewcommand not \newcommand . It is much easier to answer questions if they contain a single code section starting \documentclass and ending \end{document} If your question had a working document using english keywords someone could show you how to redefine the commands to make it use French keywords. algorithmic appears to define \FOR not \For and doesn't define \Begin as far as I can see. Commented Sep 30, 2012 at 21:33
  • thank you for answer but i can't find in the list Algorithm --> Algorithme have you an idea please ?
    – researcher
    Commented Sep 30, 2012 at 22:01
  • That's from algorithm.sty not algorithmic \newcommand{\ALG@name}{Algorithm} \newcommand{\listalgorithmname}{List of \ALG@name s} to rename \ALG@name you need \makeatletter \makeatother but please post a _complete_example that works in English then it is easy to post an answer using French.then Commented Sep 30, 2012 at 22:04
  • i add this \renewcommand{\ALG@name}{Algorithm} \renewcommand{\listalgorithmname}{List of \ALG@name s} \makeatletter \makeatother in \begin{document} ?
    – researcher
    Commented Sep 30, 2012 at 22:15

3 Answers 3


The package defines all the fixed text words using simple macros that you can redefine with \renewcommand so for example

\newcommand{\algorithmicelsif}{\algorithmicelse\ \algorithmicif}
\newcommand{\algorithmicendif}{\algorithmicend\ \algorithmicif}
\newcommand{\algorithmicforall}{\textbf{for all}}
\newcommand{\algorithmicendfor}{\algorithmicend\ \algorithmicfor}

if you change \newcommand to \renewcommand and change the English words to French to redefine these commands after loading the package it should all work I think.

  • have you an idea please ?
    – researcher
    Commented Sep 30, 2012 at 17:50
  • Please edit the question to have a complete document that shows the problem. Commented Sep 30, 2012 at 17:52

Pour avoir “algorithme” au lieu de “algorithm” et “Liste des algorithmes” au lieu de “List of algorithms”, ajouter juste french comme option dans use packages comme suit:

In order to get “algorithme” in place of “algorithm” and “Liste des algorithmes” in place of “List of algorithms”, just add french as option for the package as follows:

\usepackage[lined,boxed,commentsnumbered, ruled,vlined,linesnumbered, french]{algorithm2e}
  • 1
    Welcome to SE! You will have more lack if you ask in English language :-)
    – Zarko
    Commented Mar 5, 2016 at 11:38



My humble contribution to the French translation (thanks @David-Carlisle):

\renewcommand{\listalgorithmname}{Liste des algorithmes}
\renewcommand{\Not}{\textbf{non}\ }
\renewcommand{\And}{\textbf{et}\ }
\renewcommand{\Or}{\textbf{ou}\ }
\renewcommand{\algorithmicforall}{\textbf{pour tout}}
\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 .