MathGroup Archive 2007

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

Search the Archive

Re: TraditionalForm ordering

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80213] Re: TraditionalForm ordering
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Wed, 15 Aug 2007 04:10:02 -0400 (EDT)
  • References: <acbec1a40708140620l1b3f28f0pf8156fc60aa6b84c@mail.gmail.com>

Here is a somewhat heavy handed way to accomplish the first part. It
also affects the ordering of terms outside of a held expression
(though one would be hard pressed to notice this since Plus has the
orderless attrbiute (meaning the kernel sorts its arguments)).

overrideTraditionalFormPlusOrder=True
MakeBoxes[Plus[args__]/;Length@Unevaluated@args>1&&overrideTraditionalFormPlusOrder,TraditionalForm]:=RowBox[Riffle[Function[Null,MakeBoxes[#,TraditionalForm],HoldAllComplete]/@Unevaluated@{args},"+"]]

On 8/14/07, Chris Chiasson <chris at chiasson.name> wrote:
> Is there some way to retain TraditionalForm, but have held expressions
> maintain their original order? For instance, it would be useful if I
> could make the expression below print as b+a instead of a+b. Are there
> any secret options to TraditionalForm that do that?
>
> TraditionalForm@HoldForm[b+a]
>
> Bonus points:
> Explain the output of this command in terms of the pattern matching of
> FormatValues, Attributes, and DefaultValues of Times.
>
> Grid[Outer[HoldForm@Times[1,##,1]&,{2,a,1},{2,a,1}],Dividers->All]
>
> --
> http://chris.chiasson.name/
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: A different font size for each line in PlotLabel
  • Next by Date: Re: problem using Ersek's RootSearch
  • Previous by thread: Re: TraditionalForm ordering
  • Next by thread: dynamic values in docked cells