MathGroup Archive 2011

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

Search the Archive

Re: Getting TraditionalForm to put in a multiplication sign.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120804] Re: Getting TraditionalForm to put in a multiplication sign.
  • From: Simon <simonjtyler at gmail.com>
  • Date: Wed, 10 Aug 2011 06:49:13 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <j1lomg$nmi$1@smc.vnet.net>
  • Reply-to: comp.soft-sys.math.mathematica at googlegroups.com

I thought there must be an option for this... but couldn't find it.
(AutoMultiplicationSymbol seems to only be for numbers...)
Instead, here's a quick hack that relies on the fact that in the box form of expressions, a single space is almost always used to denote multiplication. 

ClearAll[TradFormX]
SetAttributes[TradFormX, HoldFirst]
TradFormX[expr_, cellStyle_String:"Output", outForm_: TraditionalForm] := 
 CellPrint[Cell[ToBoxes[HoldForm[expr], outForm] /. " " -> "*", cellStyle]]

In[]:= (3 2 a + b) f[x + 2 y]//TradFormX
Out[]= (3*2*a + b)*f(x + 2*y)




  • Prev by Date: Re: Textbook recommendation?
  • Next by Date: How to merge images that are exterior to each other?
  • Previous by thread: Re: Getting TraditionalForm to put in a multiplication sign.
  • Next by thread: Re: Getting TraditionalForm to put in a multiplication sign.