Re: math versus mathematica

*To*: mathgroup at smc.vnet.net*Subject*: [mg13833] Re: math versus mathematica*From*: "P.J. Hinton" <paulh>*Date*: Sat, 29 Aug 1998 04:41:11 -0400*Organization*: "Wolfram Research, Inc."*References*: <6s5m51$cbe@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

On 28 Aug 1998, David Epstein wrote: > Under Unix, there are two commands that invoke Mathematica. math invokes > the text-based version and mathematica invokes a notebook version. The > Mathematica book seems to claim that you get the same results whichever > you invoke. But you don't. > > The version of Mathematica which we run is Solaris 3.0 (August 21, 1997) > This is the response to $Version for both math and mathematica. > > However, the program > > txt= > StyleBox[ > RowBox[{"number ",n," ", > FractionBox["roman", > StyleBox["greek",FontSlant\[Rule]"Italic",FontSize\[Rule]24, > FontFamily\[Rule]"Times",FontColor\[Rule]Hue[0]]]}], > FontSize\[Rule]18,FontFamily\[Rule]"Arial"]; > > n=5; > > pict = Plot[Sin[x],{x,0,7},Epilog\[Rule]Text[DisplayForm[txt],{3,.7}]]; > Display["plot.eps", pict,"eps"]; > > gives rise to Postscript files that are VERY different. In particular, > under mathematica the Postscript contains several lines which refer to > italics (ignoring case), whereas under math there are no lines in the > Postscript file referring to italics. > > Is this a bug? Is there a workaround? It is far more inconvenient for me > to use the front end than the text-based version. In any case, it seems > to me that Mathematica is not living up to the claims made in the > Mathematica Book. The behavior that you are observing is due to the fact that DisplayForm[] returns different things depending on whether the kernel is connected to a front end. When a front end present, DisplayForm[] uses the StandardForm format type. When you are running the kernel standalone, DisplayForm[] uses the OutputForm format type, which does not support changes in font face and color. One of the reasons that OutputForm is used is because the kernel, by itself, is incapable of generating PostScript code from box structures. It must rely on the front end's typesetting system to do this, and this is not possible in the absence of a notebook front end. A caveat on this limitation is provided in the reference guide for Display[]: | In many cases, Display calls the Mathematica notebook front end via | MathLink. If the front end is not present, certain capabilities of | Display may not be available. -- P.J. Hinton Mathematica Programming Group paulh at wolfram.com Wolfram Research, Inc. http://www.wolfram.com/~paulh/ Disclaimer: Opinions expressed herein are those of the author alone.