\reDeclareMathOperator{\Re}{Re}
does not exist.
What is the recommended method in this case?
Günter
Here's an attempt at getting around your 'problem':
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\newRe}{Re}
\begin{document}
$\Re \ell$
\let\Re=\newRe
$\Re \ell$
\end{document}
Werner
I do not know if this is recommended, but one way
to do this is to `undefine' \Re:
\documentclass{article}
\usepackage{amsmath}
\let\Re\undefined
\DeclareMathOperator{\Re}{Re}
\begin{document}
$\Re z$
\end{document}
-- m
\renewcommand\Re{\opratorname{Re}}
hmm, might be an idea to a a \reDeclareMathOperator to mathtools
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html
>If I want to define a new math operator, I can use e.g.
>
> \DeclareMathOperator{\sgn}{sgn}
>
>however, if I want to re-define an existing math operator (e.g. the real
>part of a complex number with Re in roman face according to ISO 31), I
>have to realise that the command
>
> \reDeclareMathOperator{\Re}{Re}
>
>does not exist.
\renewcommand{\Re}{\operatorname{Re}}
The difference between defining a command to be
\operatorname{something} and defining it by
\DeclareMathOperator, is one level of macro
expansion. With the above definitions,
\Re --> operatorname{Re}
--> [internal code for \operatorname{Re}]
\sgn --> [internal code for \operatorname{sgn}]
This is documented (amsldoc.pdf section 5, page 14).
Dan
To reply by email, change LookInSig to luecking
>> \DeclareMathOperator{\sgn}{sgn}
>> however, if I want to re-define an existing math operator
...
>> \reDeclareMathOperator{\Re}{Re}
>> does not exist.
> \renewcommand\Re{\operatorname{Re}}
> hmm, might be an idea to add a \reDeclareMathOperator to mathtools
After looking at clsguide.pdf, I'd recommend \ReDeclareMathOperator as name.
Looking at the other replies, I would suggest something like
\newcommand{\ReDeclareMathOperator}[1]{
\let \csname #1\endcsname \undefined
\DeclareMathOperator{\csname #1\endcsname}{#1}
}
Thanks to all posters,
Günter
\newcommand{\ReDeclareMathOperator}[1]{%
\expandafter\let \csname #1\endcsname \undefined
\DeclareMathOperator{\csname #1\endcsname}%
}
would be a better bet. (note the comment marks. probably not really
necessary since the command is generally used in the preamble, but
good practice nevertheless.)
--
Robin Fairbairns, Cambridge
> however, if I want to re-define an existing math operator [but]
>
> \reDeclareMathOperator{\Re}{Re}
>
> does not exist.
Hold on. The command is "DeclareMathOperator", not
"NewMathOperator". It should not require a previously-undefined
command name, but should work like \DeclareRobustCommand.
File a bug report. (Fat chance it will change though.)
Donald Arseneau as...@triumf.ca
amsopn.sty actually *uses* \DeclareRobustCommand, but
explicitly checks with \@ifdefinable before doing so.
One need only remove that (from the definition of
\@declmathop).
Alternatively, mathtools (or some package that implements
this) should use the new/renew naming system.
Personally, I always use \re and \im instead of \Re
and \Im. Easier to type, doesn't invoke this error,
and leaves the originals available. I'm a comlex
analyst and have to type them a *lot*.
I'll keep following this thread to see what you guys end up
recommending, then I'll add that to mathtolls.
/daleif