Generalneed help defining new operations with indices

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
matt_at_uva
Posts: 1
Joined: Thu Feb 08, 2007 7:25 pm

need help defining new operations with indices

Post by matt_at_uva »

I am trying to define a new operation that will accept an index (like \min) so that the index will appear beneath the operator in math display mode. Does anyone know how to do this?
thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Kris
Posts: 56
Joined: Sun Jan 14, 2007 4:04 pm

need help defining new operations with indices

Post by Kris »

Hi,

something like this?

Code: Select all

\documentclass{article}
\newcommand{\NewOperator}[1]{\mathbf{NewOperator}_{#1}}
\begin{document}
$\NewOperator{\min} + 1 = \max$
\end{document}
Regards
Kris
Last edited by Kris on Thu Feb 08, 2007 7:40 pm, edited 1 time in total.
User avatar
Kris
Posts: 56
Joined: Sun Jan 14, 2007 4:04 pm

need help defining new operations with indices

Post by Kris »

Hi Matt,

okay, now I understand...You can achieve this
by using the amsmath-package:

Code: Select all

\documentclass{article}
\usepackage{amsmath}                  % loading amsmath-package
%...
\DeclareMathOperator{\test}{test}     % declare operator \test with sub- and superscript indices
\DeclareMathOperator*{\eff}{eff}      % declare operator \eff with above and below indices
%...
\begin{document}
\[
\test_u \neq \eff_u                   % testing new operators in math-display mode...
\]
\end{document}
You can declare new Operators with the two commands
\DeclareMathOperator and \DeclareMathOperator*.
The first one will give You sub- and superscript indices,
the one with '*' produces indices above and below the new operator...

Hope this helps!

Greetings
Kris
Post Reply