Re: display Floor in StandardForm
- To: mathgroup at smc.vnet.net
- Subject: [mg90179] Re: display Floor in StandardForm
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Tue, 1 Jul 2008 07:01:59 -0400 (EDT)
- References: <g4a6pi$8qg$1@smc.vnet.net>
Peter Breitfeld wrote: > In TraditionalForm Floor[x] is displayed as \[LeftFloor]x\[RightFloor] > in both of the following cases > > (1) Evaluate Floor[x] then Output in pretty form > (2) Entering Floor[x] in an InputCell an then Cell/Convert to > TraditionalForm > > Now I tried to mimic this behavior for StandardForm. I did > > Unprotect[Floor, Ceiling]; > Format[Floor[x_/;!NumericQ[x]], StandardForm] := > DisplayForm[RowBox[{"\[LeftFloor]", x, "\[RightFloor]"}]] > Protect[Floor]; > > The case (1) above now works even with complicated expressions and > lists, but case (2) replaces Floor[x] with DisplayForm[...] > > Is there a possibility to make it work as in TraditionalForm? Hello Peter, Try this: MakeBoxes[Floor[x_], StandardForm] := RowBox[{"\[LeftFloor]", MakeBoxes[x], "\[RightFloor]"}]