Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\raisebox not working in math environment?

1,563 views
Skip to first unread message

Tariq

unread,
Mar 21, 2009, 2:22:11 PM3/21/09
to
Hi,

I am trying to typeset a symbol that has caret (^) sitting right on
top of the equal sign (=). When I try the following:

$\stackrel{textstyle\textasciicircum}{=}$

The output has ^ sitting a bit too high above = sign. I thought that I
could use \raisebox to lower ^ sign. When I use \raisebox command
like:

$\stackrel{\raisebox{-0.5ex}{\ensuremath\textstyle\textasciicircum}}
{=}$


I see no effect at all. No error is generated either. How can I
achieve the desired effect, i.e., lower ^ a little bit? I would
appreciate some help. Regards,

Tariq

Tariq

unread,
Mar 21, 2009, 2:32:10 PM3/21/09
to
I must add to the above post that if I use something like

$\stackrel{\raisebox{-3ex}{\ensuremath\textstyle\textasciicircum}}{=}
$

i.e., -3ex rather than -0.5ex, then the entire line containing the
symbol shifts down. However, if I use positive value for \raisebox
like:

$\stackrel{\raisebox{2ex}{\ensuremath\textstyle\textasciicircum}}{=}$

then ^ does shift up and the rest of the line is shifted down.
Obviously, I am missing some important point here. I would really like
for someone to help me understand what is going on and how to solve
the problem. Thanks for any solution to this. Regards,

Tariq

Enrico Gregorio

unread,
Mar 21, 2009, 2:49:57 PM3/21/09
to
Tariq <tariq....@gmail.com> wrote:

There are many errors in your input. First of all \textasciicircum
is invalid in math mode, as per the message printed by LaTeX (after
adding a backslash before "textstyle").

In your second example, LaTeX gives no warning, since \ensuremath
applies only to the following token: an equivalent way to write
your code would be

$\stackrel{\raisebox{-0.5ex}{$\textstyle$\textasciicircum}{=}$

(you probably meant \ensuremath{\textstyle\textasciicircum}, which
is wrong either).

The effect is not what you expect either, since the "-0.5ex" pushes
down also the equals sign.

Did you try $a\mathrel{\hat{=}}b$ or $a\mathrel{\widehat{=}}b$?

Ciao
Enrico

Tariq

unread,
Mar 21, 2009, 3:01:37 PM3/21/09
to
On Mar 21, 2:49 pm, Enrico Gregorio <grego...@math.unipd.it> wrote:

Enrico,

Thanks for the suggestions. I tried \hat and \widehat as you
suggested. However, they do not seem to produce the desired shape of
the symbol. Is there no way to use ^ to do it? Granted my code is
wrong, I would like to see if it can be corrected. I would appreciate
your input. Regards,

Tariq

Enrico Gregorio

unread,
Mar 21, 2009, 3:03:26 PM3/21/09
to
Enrico Gregorio <greg...@math.unipd.it> wrote:

There's also another solution, with the measure of the hat in
between:

\newcommand{\hateq}{%
\mathrel{\ooalign{$=$\cr\hfil\textasciicircum\hfil}}}
...
$a\hateq b$

Ciao
Enrico

Tariq

unread,
Mar 21, 2009, 3:08:14 PM3/21/09
to
On Mar 21, 3:03 pm, Enrico Gregorio <grego...@math.unipd.it> wrote:
> Enrico Gregorio <grego...@math.unipd.it> wrote:

> There's also another solution, with the measure of the hat in
> between:
>
> \newcommand{\hateq}{%
>   \mathrel{\ooalign{$=$\cr\hfil\textasciicircum\hfil}}}
> ...
> $a\hateq b$

Enrico,

Thanks; I think we are getting closer to the solution! Since ^ clashes
with the = sign in this code, can we raise the ^ just a little bit?
This should give me exactly what I want. Regards,

Tariq

Tariq

unread,
Mar 21, 2009, 3:49:41 PM3/21/09
to
On Mar 21, 3:03 pm, Enrico Gregorio <grego...@math.unipd.it> wrote:
> Enrico Gregorio <grego...@math.unipd.it> wrote:

>
> There's also another solution, with the measure of the hat in
> between:
>
> \newcommand{\hateq}{%
>   \mathrel{\ooalign{$=$\cr\hfil\textasciicircum\hfil}}}
> ...
> $a\hateq b$

Hi Enrico,

Here is how I have modified your code to get ^ and = signs not to
clash with each other.

\newcommand{\hateq}{%
\mathrel{\ooalign{\raisebox{-0.45ex}{$=$}\cr\hfil\textasciicircum
\hfil}}}%%

I get the desired output. Do you see any problem with this code?
Something that I might have missed? I really appreciate you helping me
out on this. Regards,

Tariq

Enrico Gregorio

unread,
Mar 21, 2009, 6:00:26 PM3/21/09
to
Tariq <tariq....@gmail.com> wrote:

I don't see any clash; maybe you are using the "mathpazo" package,
where the \textasciicircum symbol is just horrible and clearly not
suitable for a nice result. I'd suggest

\newcommand{\hateq}{%
  \mathrel{\ooalign{$=$\cr

\hfil\fontfamily{cmr}\selectfont
\textasciicircum\hfil}}}

Ciao
Enrico

Donald Arseneau

unread,
Mar 21, 2009, 6:24:43 PM3/21/09
to
On Mar 21, 10:22 am, Tariq <tariq.per...@gmail.com> wrote:

> I am trying to typeset a symbol that has caret (^) sitting right on
> top of the equal sign (=).

So what is wrong with \hat=?

To get relation spacing, you need

$A\mathrel{\hat=}B$

Donald Arseneau

Tariq

unread,
Mar 22, 2009, 4:50:37 PM3/22/09
to
On Mar 21, 6:00 pm, Enrico Gregorio <grego...@math.unipd.it> wrote:
> Tariq <tariq.per...@gmail.com> wrote:

> > On Mar 21, 3:03Êpm, Enrico Gregorio <grego...@math.unipd.it> wrote:
> > > Enrico Gregorio <grego...@math.unipd.it> wrote:
>
> > > There's also another solution, with the measure of the hat in
> > > between:
>
> > > \newcommand{\hateq}{%
> > > Ê \mathrel{\ooalign{$=$\cr\hfil\textasciicircum\hfil}}}

> > > ...
> > > $a\hateq b$
>
> > Enrico,
>
> > Thanks; I think we are getting closer to the solution! Since ^ clashes
> > with the = sign in this code, can we raise the ^ just a little bit?
> > This should give me exactly what I want. Regards,
>
> I don't see any clash; maybe you are using the "mathpazo" package,
> where the \textasciicircum symbol is just horrible and clearly not
> suitable for a nice result. I'd suggest
>
> \newcommand{\hateq}{%
> Ê \mathrel{\ooalign{$=$\cr

>     \hfil\fontfamily{cmr}\selectfont
>     \textasciicircum\hfil}}}
>
> Ciao
> Enrico

Enrico

You are right on the mark: I am using the mathpazo family that is
default in ArsClassica package. I have adopted your solution using he
cmr fontfamily as suggested and I like the result. Thanks a lot for
answering all my queries and walking me through the solution. Regards,

Tariq

Tariq

unread,
Mar 22, 2009, 4:54:01 PM3/22/09
to

Hi Donald,

Thanks for the suggestion. I tried the \hat but found it to be a bit
too small. It looks a bit odd sitting above the = sign. Both glyphs
look different enough in size not to form a unit. I appreciate your
suggestion. At least now I know that there is a command \mathrel and
what it does. Regards,

Tariq

jfh

unread,
Mar 22, 2009, 9:34:04 PM3/22/09
to

Other possibilities using mathpazo:

\documentclass[12pt]{article}
\usepackage{mathpazo}
\newcommand{\wedgeq}{\stackrel{\wedge}{=}}
\begin{document}
$a\widehat= b$ $a \mbox{\^=} b$ $a\wedgeq b$
\end{document}

John Harper

Donald Arseneau

unread,
Mar 23, 2009, 1:42:25 AM3/23/09
to
On Mar 22, 12:54 pm, Tariq <tariq.per...@gmail.com> wrote:
> On Mar 21, 6:24 pm, Donald Arseneau <a...@triumf.ca> wrote:
> > So what is wrong with \hat=?
>
> Thanks for the suggestion. I tried the \hat but found it to be a bit
> too small. It looks a bit odd sitting above the = sign.

No problem. I didn't (and still don't) know what symbol or
appearance you are looking for. Note that there is
$\widehat=$ as well, just in case that is closer to what
you need.

Donald Arseneau as...@triumf.ca

Martin Berggren

unread,
Mar 23, 2009, 3:48:36 AM3/23/09
to
> Donald Arseneau                                     a...@triumf.ca

Also in "normal" circumstances, when attaching a hat to a variable, I
usually find the \hat symbol too small for my liking and \widehat too
big... Well, maybe that's a calculated design decision, since it
encourages the author to find a notation that avoids too many hats and
tildes!

Martin

Dan Luecking

unread,
Mar 23, 2009, 12:53:09 PM3/23/09
to

Even with mathpazo I see no clash. In fact Enrico's
original code, and the command \mathrel{\hat=} seem to
produce identical results. I suspect you are using other
packages, or perhaps there are other changes wrought by
arsclassica.

You should create the proverbial minimal document
(smallest set of packages) that illustrates the problem.


Dan
To reply by email, change LookInSig to luecking

Tariq

unread,
Mar 23, 2009, 3:48:23 PM3/23/09
to
On Mar 23, 12:53 pm, Dan Luecking <LookIn...@uark.edu> wrote:

> Even with mathpazo I see no clash. In fact Enrico's
> original code, and the command \mathrel{\hat=} seem to
> produce identical results. I suspect you are using other
> packages, or perhaps there are other changes wrought by
> arsclassica.
>
> You should create the proverbial minimal document
> (smallest set of packages) that illustrates the problem.

Dan

Thanks for looking into this. I, however, have noticed the clash
between the two glyphs. Here is the minimal example using mathpazo
package that reproduces the clash between the two symbols on my
system.

%%%%%%%%%%%%%%
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}

%% Code from Enrico
\newcommand{\hateq}{%


\mathrel{\ooalign{$=$\cr\hfil\textasciicircum\hfil}}}

\begin{document}

$a\hateq b$

\end{document}

%%%%

Regards,

Tariq

Dan Luecking

unread,
Mar 23, 2009, 5:37:10 PM3/23/09
to
On Mon, 23 Mar 2009 12:48:23 -0700 (PDT), Tariq
<tariq....@gmail.com> wrote:

>On Mar 23, 12:53 pm, Dan Luecking <LookIn...@uark.edu> wrote:
>
>> Even with mathpazo I see no clash. In fact Enrico's
>> original code, and the command \mathrel{\hat=} seem to
>> produce identical results. I suspect you are using other
>> packages, or perhaps there are other changes wrought by
>> arsclassica.
>>
>> You should create the proverbial minimal document
>> (smallest set of packages) that illustrates the problem.
>
>Dan
>
>Thanks for looking into this. I, however, have noticed the clash
>between the two glyphs.

Because (as I *clearly* suggested) you are using other
packages. Namely:

>\usepackage[T1]{fontenc}

which was not previously mentioned (and whence the need
for a minimal document).

This apparently switching to T1 encoding causes mathpazo
to change \textasciicircum to a large circumflex. Why it
would do that, I don't know. I don't know any use for a
circumflex (especially an ASCII one) other than as an
accent. And an accent should be smaller and already raised.

Also, lowering the equal looks wrong, better to raise
the circumflex IMHO.

Tariq

unread,
Mar 23, 2009, 6:07:21 PM3/23/09
to

Dan

You have pointed out something that I did not know about. I always
thought that font families were supplied with specific encoding (only
one encoding according to mu understanding). Hence I had the
impression that use of mathpazo needs T1 specification as I did in my
minimal example. What other encoding can I use for mathpazo? How do I
determine what other encodings are available for a given font family?

I agree that I do not need \textasciicircum. I have switched to suing
\wedge that seems fine for my purpose. Thanks for your helpful
comments. Regards,

Tariq

Dan Luecking

unread,
Mar 24, 2009, 1:22:36 PM3/24/09
to

If a package requires a particular endoding, it should
invoke that change itself (but I don't think all do).
If it supports a range of font encodings, its documentation
should report which ones are supported. If nothing is said,
it should support at least OT1 encoding (latex's default).

Mathpazo is part of the psnfss bundle of files. The files
that perform at least part of the encoding support
implementation are the *.fd files in tex/latex/psnfss/
These files have names of the form
<encoding><fontfamily>.fd

The Palatino families are named "ppl", "pplj" (oldstyle
figures) or "pplx" (small caps). The extra fonts for math
have family name zpple. These files indicate support for several
encodings:

8rppl.fd
Math support:
omlppl.fd
omlzpple.fd
omsppl.fd
omszpple.fd
omxzpple.fd
ot1zpple.fd
Old Tex encoding OT1 (default):
ot1ppl.fd
ot1pplj.fd
ot1pplx.fd
New Tex encoding (\usepackage[T1]{fontenc}):
t1ppl.fd
t1pplj.fd
t1pplx.fd
Text symbols (\usepackage{textcomp}):
ts1ppl.fd
ts1pplj.fd
ts1pplx.fd

Tariq

unread,
Mar 24, 2009, 1:45:42 PM3/24/09
to
On Mar 24, 1:22 pm, Dan Luecking <LookIn...@uark.edu> wrote:
> On Mon, 23 Mar 2009 15:07:21 -0700 (PDT), Tariq
>
>
>

Dan

Very kind of you to respond with such useful information even although
I am a bit confused about some issues. I know that understanding fonts
in LaTeX is not that easy. I'll try to learn more about this topic. I
am sure I am going to have a lot of questions and will need to ask for
help on the forum.

Now to my original topic: indeed when I tried using mathpazo package
without explicitly calling for T1 encoding, the two symbols = and ^
did not clash with each other, the result you had also observed.
However, use of T1 encoding does produce the clash. I am glad that you
sorted it out for me. Thanks a lot. Regards,

Tariq

0 new messages