User-Defined Operators

Jerzy Karczmarczuk karczma@info.unicaen.fr
Thu, 17 Jul 2003 18:16:31 +0200


Wolfgang Jeltsch wrote:
> On Thursday, 2003-07-17, 09:08, CEST, Johannes Waldmann wrote:

>>A similar discussion sometimes surfaces in mathematics - where they have
>>"user-defined" operators all over the place, and especially so since LaTeX.
> 
> 
> Well, for the most part, LaTeX only provides common operators. One problem, I 
> came across some weeks ago, is that it is *not* possible to define his/her own 
> operators (or, at least, that Lamport's "LaTeX - A Document Preparation 
> System" doesn't tell you how you can define them).

I am sorry, but it is simply a countertruth. You can define \mathop with all
the \limits, \nolimits etc. properties. You have \mathchardef's etc. How do you
think the AMS package has been constructed? Everything is written in a standard
way, your liberty to create the most disgusting operators is unlimited. Some
Haskell-related papers dealing with lenses, bananas and barbed-wires exploited
already this possibility.


/// in another posting,commenting the "graphical" ways to make operator-like
     icons, from posting by Robert Ennals///

> I think, in both cases you don't define an *operator*. LaTeX probably won't 
> use the correct spacing around the symbol.
> 
> A related problem is that I cannot see a way to define a new "log-like 
> function" (as Lamport names them), i.e., a function with a name consisting of 
> several letters which have to be set in upright font with no spaces between 
> them. Examples are log, min, max, sin, cos and tan.


What's wrong with $ ...  \mathrm{brumble}(2\cdot x) ...$  ?

How do you think, the existing "standard ones" have been manufactured?

\def \arctan {\mathop {\rm Arctan}}

You can also put \hbox'es inside a math environment, which will prevent the
automatic choice of \mathitalic.

Read something about families, about \mathchardef, and about such options
as \displaystyle \scriptstyle, etc., in order to choose automatically the
correct size of the math. fonts. Also read something about big operators
useful to define objects like sum, product, etc.

Cheer up. YOU CAN DO EVERYTHING YOU WISH, and much more.


Jerzy Karczmarczuk






Jerzy Karczmarczuk