parenthesis in reactions...
- To: mathgroup at smc.vnet.net
- Subject: [mg65836] parenthesis in reactions...
- From: "Chris Chiasson" <chris.chiasson at gmail.com>
- Date: Tue, 18 Apr 2006 06:56:33 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
What is the proper way to eliminate the (output) parenthesis generated around the first molecule as it is multiplied by the number two? I could change the data structure if need be. ElementSubscript[1|1.]:=""; ElementSubscript[x_]:=x; ElementSuperscript[0|0.]:=""; ElementSuperscriptMod[1|1.]:=""; ElementSuperscriptMod[x_]:=x; ElementSuperscript[x_?NumericQ]:= RowBox[{ToBoxes@ElementSuperscriptMod@Abs@x,"+"}]/;x>0; ElementSuperscript[x_?NumericQ]:= RowBox[{ToBoxes@ElementSuperscriptMod@Abs@x,"-"}]/;x<0; ElementSuperscript[x_]:=x; ElementFormat[symblist:{{_Symbol,_Symbol}..}]:= Module[{x}, ReleaseHold[ Function[ Hold[SetDelayed[Format[#1[x_,y_]], DisplayForm[ Subsuperscript[#2,ElementSubscript[x], ElementSuperscript[y]]]]]]@@@symblist]]; Format[Molecule[blah:_Symbol[_,_]..]]:=DisplayForm[RowBox[ToBoxes/@{blah}]] elementnotations={{Hydrogen,H},{Chlorine,Cl},{Zinc,Zn}}; ElementFormat[elementnotations]; rxns[1]={2 Molecule[Hydrogen[1,0], Chlorine[1,0]]\[Rule]2 Molecule[Hydrogen[1,1]]+2 Molecule[ Chlorine[1,-1]], Zinc[1,0]+2 Hydrogen[1,1]+2 Chlorine[1,-1]\[Rule] Zinc[1,2]+2 Chlorine[1,-1]+Hydrogen[2,0], Zinc[1,2]+2 Chlorine[1,-1]+Hydrogen[2,0]\[Rule] Molecule[Zinc[1,0],Chlorine[2,0]]+Hydrogen[2,0]}