For Programmers: Free Programming Magazines  


Home > Archive > Tex > September 2006 > How to create \mathbin variants in LaTeX









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to create \mathbin variants in LaTeX
Erik Quaeghebeur

2006-09-27, 7:07 pm

Hi,


\mathbin, \mathrel, \mathord, and \mathpunct add a specific type of
spacing around a math symbol. How do I create my own variant, with spacing
determined myself?


Erik
Dan

2006-09-27, 7:07 pm


Erik Quaeghebeur wrote:
> Hi,
>
>
> \mathbin, \mathrel, \mathord, and \mathpunct add a specific type of
> spacing around a math symbol. How do I create my own variant, with spacing
> determined myself?


If it is a fixed amount of space, just define a command that
places the given amount of space. For example,
\newcommand{\mathxx}[1]{\,#1\,}

If the amount shold vary depending on what comes before and
after, you'll need to become familiar with the table on page
170 of the TeXbook. You can get something that reacts like a
parentheses on the left and a binary operator on the right (if
that is what you want) with
\newcommand{\mathxx}[1]{\mathopen{}#1\ma
thbin{}}
Except there may also be interaction between #1 and
things you've added to left and right. You may need spacing
commands around #1 to cancel these. Continuing with the above
example
\newcommand{\mathxx}[1]{%
\mathopen{}\mathord{#1}\nonscript\mskip-\medmuskip\mathbin{}}
where
1. there is no space added between Open and Ord so nothing to
cancel
2. between Ord and Bin \medmuskip is added except in
sub/superscripts. We \mskip the negative (except in scripts)
to cancel that.

If what you want doesn't fit anything in that table, I am afraid
there is no interface for creating new types of math atoms.


Dan

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com