Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

HoldForm, TraditionalForm Bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88664] HoldForm, TraditionalForm Bug?
  • From: "David Park" <djmpark at comcast.net>
  • Date: Mon, 12 May 2008 04:43:46 -0400 (EDT)

Here is a polynomial. Mathematica rearranges the order of the terms.

x y - x^3 - 1
-1 - x^3 + x y

I would like to display the polynomial without rearranging the order. So I 
use a HoldForm.

HoldForm[x y - x^3 - 1]
x y-x^3-1

But then I would also like to display it with TraditionalForm to obtain the 
single character italics. So I use:

HoldForm[x y - x^3 - 1] // TraditionalForm
-x^3+y x-1          (actually TraditionalForm but the terms rearranged)

I regard it as a bug that Mathematica rearranges the order of the terms in 
this expression. Furthermore, if the expression were used in a Plot label, 
TraditionalForm is now automatically used and the terms will be rearranged.

A workaround is to use:

Style[HoldForm[x y - x^3 - 1], SingleLetterItalics -> True,
 FontFamily -> "Times"]
x y-x^3-1                    (looks like TraditionalForm)

If I try to use this in a plot it is quite convoluted!

ContourPlot[x y - x^3 + 1 == 0, {x, -5, 5}, {y, -10, 15},
 Exclusions -> {x == 0},
 PlotLabel -> (Style[HoldForm[V[x y - x^3 - 1]],
     SingleLetterItalics -> True, FontFamily -> "Times"] //
    StandardForm)]


-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/




  • Prev by Date: Re: Solving on mathematica
  • Next by Date: graphic text style setting
  • Previous by thread: Re: Null Return for a Module
  • Next by thread: Re: HoldForm, TraditionalForm Bug?