Dear LyX documentators,

an addition to the LyX Math guide section 
10.4 Self-defined Operators:

How to define a custom math operator in a Math-Macro?


\DeclareMathOperator{}{} sorgt für korrekte Abstände, aber kann nur in
der Preambel verwendet werden. Die Funktion \operatorname macht das
gleiche, aber geht auch im Document (und damit in Math-Makros)::

\begin_layout Standard
\begin_inset FormulaMacro
\renewcommand{\sgn}{\operatorname{sgn}}
{\textrm{sgn}}
\end_inset

\end_layout

\operatorname kann auch zur Umdefinierung von Befehlen verwendet werden
(\ReDeclareMathOperator gibt es nicht)::


Real- und Imaginärteil mit lateinischen Buchstaben à la ISO 31

\begin_inset FormulaMacro
\newcommand{\Re}{\operatorname{Re}}
{\mathrm{{\color{green}Re}}}
\end_inset

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). 

One more suggestion (as the star variant is not confined to BIG
operators):

- To define a big operator a * is set behind the command. All self-defined
- big operators can have limits as described in [sub:Operator-Limits].

+ Operators defined with \DeclareMathOperator* can have limits as described
+ in [sub:Operator-Limits]. In Math-Macros use \operatorname*.

Günter

Reply via email to