Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

\renewcommand{\algorithmicwhile}{\textbf{enquanto}}

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:

\renewcommand{\algorithmicand}{\textbf{e}}
\renewcommand{\algorithmicor}{\textbf{ou}}
\renewcommand{\algorithmicto}{\textbf{até}}

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

2 Answers 2

up vote 3 down vote accepted

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

\show\foo

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

\documentclass{article}

\usepackage{algorithmic}

\begin{document}

\show\algorithmicand

\renewcommand{\algorithmicand}{\textbf{e}}

\algorithmicand

\end{document}

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

\newcommand{\algorithmicand}{\textbf{and}}

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

share|improve this answer

Your Answer

 
discard

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.