For Programmers: Free Programming Magazines  


Home > Archive > Tex > September 2006 > Spacing problems when combining two math symbols









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 Spacing problems when combining two math symbols
Erik Quaeghebeur

2006-09-27, 7:07 pm

Hi,


I am trying to create a \wedgedot symbol (which exists predefined in
MnSymbols, I'm working with lmodern, fourier, and mathpazo, but I prefer a
font-independent solution) as a combination of a \wedge and . (a period,
to be centered under the wedge), by adding some negative space between and
some positive space after, i.e.,

\newcommand{\wedgedot}{\wedge\mspace{-Xmu}.\mspace{Ymu}}

This gives spacing problems (period shifts around) when the combined
symbol is used in different contexts.

How do I best solve this problem in LaTeX?


Erik
Enrico Gregorio

2006-09-27, 7:07 pm

Erik Quaeghebeur <equaeghe@nospammail.net> wrote:

> Hi,
>
>
> I am trying to create a \wedgedot symbol (which exists predefined in
> MnSymbols, I'm working with lmodern, fourier, and mathpazo, but I prefer a
> font-independent solution) as a combination of a \wedge and . (a period,
> to be centered under the wedge), by adding some negative space between and
> some positive space after, i.e.,
>
> \newcommand{\wedgedot}{\wedge\mspace{-Xmu}.\mspace{Ymu}}
>
> This gives spacing problems (period shifts around) when the combined
> symbol is used in different contexts.
>
> How do I best solve this problem in LaTeX?


Here is my attempt. If you don't need the symbol in different sizes for
sub/superscripts, then

\newcommand{\wedgedot}{%
\mathbin{\ooalign{\hfil$\wedge$\hfil\cr\
hfil.\hfil\crcr}}}

should suffice.

Ciao
Enrico
Dan

2006-09-28, 7:05 pm


Erik Quaeghebeur wrote:
> Hi,
>
>
> I am trying to create a \wedgedot symbol (which exists predefined in
> MnSymbols, I'm working with lmodern, fourier, and mathpazo, but I prefer a
> font-independent solution) as a combination of a \wedge and . (a period,
> to be centered under the wedge), by adding some negative space between and
> some positive space after, i.e.,
>
> \newcommand{\wedgedot}{\wedge\mspace{-Xmu}.\mspace{Ymu}}


An example file, showing us what you tried would help...

>
> This gives spacing problems (period shifts around) when the combined
> symbol is used in different contexts.


.... showing us the "different contexts" and describing what
you think is wrong with them. Also, which ones look the way
you want them to, so we know what we're trying for.

> How do I best solve this problem in LaTeX?


See
http://www.tex.ac.uk/cgi-bin/texfaq...bel=askquestion
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
for starters.


Dan

Erik Quaeghebeur

2006-09-28, 7:05 pm

On Wed, 27 Sep 2006, Enrico Gregorio wrote:
>
> Erik Quaeghebeur <equaeghe@nospammail.net> wrote:
>
>
> Here is my attempt. If you don't need the symbol in different sizes for
> sub/superscripts, then
>
> \newcommand{\wedgedot}{%
> \mathbin{\ooalign{\hfil$\wedge$\hfil\cr\
hfil.\hfil\crcr}}}
>
> should suffice.


Thank you very much, Enrico, that produces the symbol nicely (I do not
need different sizes). It seems my TeX knowledge is lacking for
understanding this macro, though; I should read the TeXbook...

The only problem I'm facing now is that LaTeX chokes when I try to put it
in a symbol index using a custom \symindexd{#1} command (shorthand for
\index[symbol]{#1|drop}, where \drop does nothing). It seems the \wedgedot
macro gets expanded too soon (before putting it in the symbol.ind file);
playing around with \noexpand was unsucessful.

I will post a question about custom index macro design (did not find
anything on-line).

Erik
Enrico Gregorio

2006-09-28, 7:05 pm

Erik Quaeghebeur <equaeghe@nospammail.net> wrote:

> On Wed, 27 Sep 2006, Enrico Gregorio wrote:
>
> Thank you very much, Enrico, that produces the symbol nicely (I do not
> need different sizes). It seems my TeX knowledge is lacking for
> understanding this macro, though; I should read the TeXbook...
>
> The only problem I'm facing now is that LaTeX chokes when I try to put it
> in a symbol index using a custom \symindexd{#1} command (shorthand for
> \index[symbol]{#1|drop}, where \drop does nothing). It seems the \wedgedot
> macro gets expanded too soon (before putting it in the symbol.ind file);
> playing around with \noexpand was unsucessful.
>
> I will post a question about custom index macro design (did not find
> anything on-line).


\DeclareRobustCommand{\wedgedot}{...} or simply \symindexd{\protect#1}
should be sufficient.

The use of \ooalign is borrowed from the TeXbook. Maybe more elegant
would be

\newcommand{\wedgedot}{%
\mathbin{\ooalign{$\wedge$\crcr\hidewidt
h.\hidewidth}}}

Ciao
Enrico
Sponsored Links







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

Copyright 2008 codecomments.com