I have a tex file created by someone else which redefines commands of the algorithmic package to translate them to the Portuguese language. For example:


Is used to replace the word while by enquanto, which is the translation of while to Portuguese.

However, I am getting errors when I invoke \renewcommand for the following lines:


Here's the error for the first line:

! LaTeX Error: \algorithmicand undefined.

Do I get this error because \algorithmicand, \algorithmicor, and \algorithmicto are not included the algorithmic package? Is it ok for me to use the \newcommand instead of \renewcommand in this case?

2 Answers 2


You may look up the definition of a command \foo (including if it is defined at all) with


A test for \algorithmicand reveals that it is indeed defined by the algorithmic package. Redefining it also works.








You should provide a minimum example that produces the error described by you.


Updating the algorithmic package helps. Earlier versions, such as that one of 2006/06/02, don't provide that command yet, as you can see following the link. The current version defines


and further similar commands right after \algorithmicreturn, which is already contained in the older version.

You must log in to answer this question.

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