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

Possible Duplicate:
Can I redefine a command to contain itself?

I'm trying to redefine the \int command so that it will always do \int \!. So here's my attempt at that:

\renewcommand{\int}{\int \!}

But then I'd get this error:

\! TeX capacity exceeded, sorry [input stack size=5000].
\int ->\int

On the other hand, I looked up \show\int, which got me \intop \nolimits . So I tried to use it in a \renewcommand:

\renewcommand{\int}{\intop \nolimits . foobarbaz}
% The foobarbaz is for testing if the \renewcommand is effective

But no, I don't see foobarbaz in the output.

How do I redefine math commands?

share|improve this question

marked as duplicate by David Carlisle, Ian Thompson, percusse, Marco Daniel, Loop Space Apr 26 '12 at 13:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Make a copy of the old command using \let, then use the copy to create the new command.

share|improve this answer

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