TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.