MathGroup Archive 2008

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

Search the Archive

Re: display Floor in StandardForm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90168] Re: [mg90122] display Floor in StandardForm
  • From: DrMajorBob <drmajorbob at att.net>
  • Date: Tue, 1 Jul 2008 06:59:57 -0400 (EDT)
  • References: <28688943.1214820745072.JavaMail.root@m08>
  • Reply-to: drmajorbob at longhorns.com

I do it this way (in my init file):

Unprotect[Floor, Ceiling];

Floor /: MakeBoxes[Floor[expr_], StandardForm] :=
  RowBox[{"\[LeftFloor]", MakeBoxes[expr, StandardForm],
    "\[RightFloor]"}]

Ceiling /: MakeBoxes[Ceiling[expr_], StandardForm] :=
  RowBox[{"\[LeftCeiling]", MakeBoxes[expr, StandardForm],
    "\[RightCeiling]"}]

Protect[Floor, Ceiling];

Bobby

On Mon, 30 Jun 2008 03:51:03 -0500, Peter Breitfeld <phbrf at t-online.de>  
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?
>
> TIA
>
> Gruss Peter



-- 
DrMajorBob at longhorns.com


  • Prev by Date: Re: display Floor in StandardForm
  • Next by Date: Re: How to plot discontinuous functions?
  • Previous by thread: Re: display Floor in StandardForm
  • Next by thread: Draw two functions in a graph, one of them does also have a parameter.