Results 1 to 8 of 8

Math Help - How to force unary minus (negative sign)?

  1. #1
    Senior Member
    Joined
    Jul 2006
    Posts
    364

    How to force unary minus (negative sign)?

    Sometimes latex treats some code like -0.4567 as a binary minus operator and hence adds extra spacing like 3-4, even though there is nothing to the left of the minus (in an align* environment).

    Is it possible to force less space? I know of \! but that doesn't remove as much space as the negation operator. I suppose \! doesn't look too bad though, so it's not a big deal.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member Random Variable's Avatar
    Joined
    May 2009
    Posts
    959
    Thanks
    3
     \text{-}0.4567 ?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Senior Member
    Joined
    Jul 2006
    Posts
    364
    Yeah, it works in this case, but not in:
    Code:
      \begin{align*}
      J_1(0.35)  &\approx  0 + (0.35-0)\left[0.497504+(0.35-0.2)\left[ \right.\right. \\
         & -0.0371825+(0.35-0.4)\left[\right. \\ % on this line
         & -0.05995\left.\right]\left.\right]\left.\right]\\ % and this one
         &= {} 0.172331688
      \end{align*}
    Oh, oops, I didn't see the \text. But that makes the dash smaller than usual in the math env.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member flyingsquirrel's Avatar
    Joined
    Apr 2008
    Posts
    802
    Quote Originally Posted by scorpion007 View Post
    Yeah, it works in this case, but not in:
    Code:
      \begin{align*}
      J_1(0.35)  &\approx  0 + (0.35-0)\left[0.497504+(0.35-0.2)\left[ \right.\right. \\
         & -0.0371825+(0.35-0.4)\left[\right. \\ % on this line
         & -0.05995\left.\right]\left.\right]\left.\right]\\ % and this one
         &= {} 0.172331688
      \end{align*}
    To get the unary minus sign type {-0.0371825} instead of -0.0371825.
    Code:
      \begin{align*}
      J_1(0.35)  &\approx  0 + (0.35-0)\left[0.497504+(0.35-0.2)\left[ \right.\right. \\
         & {-0.0371825} + (0.35-0.4)\left[\right. \\ % on this line
         & {-0.05995} \left.\right]\left.\right]\left.\right]\\ % and this one
         &= {} 0.172331688
      \end{align*}
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Opalg's Avatar
    Joined
    Aug 2007
    From
    Leeds, UK
    Posts
    4,041
    Thanks
    7
    Quote Originally Posted by flyingsquirrel View Post
    To get the unary minus sign type {-0.0371825} instead of -0.0371825.
    Alternatively, type \mathord{-} instead of - .
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Senior Member
    Joined
    Jul 2006
    Posts
    364
    Awesome, thanks guys! Strangely though, it messes up the alignment slightly... Oh well.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    Opalg's Avatar
    Joined
    Aug 2007
    From
    Leeds, UK
    Posts
    4,041
    Thanks
    7
    Quote Originally Posted by scorpion007 View Post
    Strangely though, it messes up the alignment slightly.
    Yes, I noticed that. The problem is that the space gets removed on both sides of the minus sign, whereas you only want to lose it on the right. The amount of space that you need to restore is what TeX calls a "thin space", which you can insert by typing backslash comma. So replace -0.05995 by \,{-0.05995} or \,\mathord{-}0.05995 and everything will look good.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Senior Member
    Joined
    Jul 2006
    Posts
    364
    Oh wow! Thanks! You're a genius.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 4
    Last Post: October 6th 2011, 06:51 PM
  2. Taking a minus sign as a factor.
    Posted in the Algebra Forum
    Replies: 3
    Last Post: October 5th 2011, 04:10 PM
  3. is the negative sign part of x?
    Posted in the Pre-Calculus Forum
    Replies: 4
    Last Post: November 21st 2009, 07:25 AM
  4. Negative Sign & Degree Symbol?
    Posted in the LaTeX Help Forum
    Replies: 3
    Last Post: June 12th 2009, 09:08 PM
  5. Congruences: stumped by minus sign
    Posted in the Number Theory Forum
    Replies: 3
    Last Post: May 3rd 2009, 01:57 PM

Search Tags


/mathhelpforum @mathhelpforum