Results 1 to 3 of 3

Thread: Mathematica: Converting output display for derivatives

  1. #1
    Aug 2009

    Mathematica: Converting output display for derivatives

    Hi, I am using Mathematica 6.0 and I have to convert the display of a very large output expression. But my problem can be simply put as this:

    Let's say my input is:
    Input: D[f[x, y], x, y]

    The output expression looks like this:
    Output: $\displaystyle f^{(1,1)}[x,y]$

    I want to "convert" this output to look like:
    Output: $\displaystyle \frac{\partial^2{f}}{\partial{x}\partial{y}}$

    How can I do it? I think this is more complex than it seems. Any help would be appreciated.

    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Aug 2009
    I found this package:
    Fancy Formatting of Partial Derivatives -- from Wolfram Library Archive

    Unfortunately, it does not seem to be compatible with new versions of Mathematica. I tried to come up with a quick and dirty fix, which is not particularly elegant but should work fine. Using DFormat[On] should get you what you need. Calling DFormat[Off] switches back to normal.

    denomList[nn_List, vars_List] :=
       Block[{i, result = {}},
                TrueQ[nn[[i]] == 0], Null,
                TrueQ[nn[[i]] == 1], 
        result = Join[result, {"\[PartialD]", vars[[i]]}],
                True, result = Join[result, {"\[PartialD]", nn[[i]]}] ],
              {i, 1, Length[nn]} ];
    DFormat[On] :=
      Format[Literal[Derivative[nn__][ff_][vars : (_Symbol ..)]]] :=
         If[TrueQ[Plus @@ {nn} == 1],
              SequenceForm["\[PartialD]", ff[vars]],
         SequenceForm[Superscript["\[PartialD]", Plus @@ {nn}], ff[vars]]]/
          SequenceForm @@ denomList[{nn}, {vars}];
    DFormat[Off] :=
      Format[Literal[Derivative[nn__][ff_][vars : (_Symbol ..)]]] =.;
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Aug 2009
    Actually, scratch that. With the "Notation" package, you can do it easily. I have to admit that I have not figured out how to type in these expression; MMA seems to be very bitchy about it. So I try to explain it this way:

    Load the "Notation" package:
    << Notation`

    A new window should pop up with a "Notation Palette". Click the first of the buttons in that window.

    Type in what you find in the MMA-Tutorial in the MMA-Help under Notation/tutorial/NotationSymbolizeAndInfixNotation
    You can find what you need as Input 7 in that tutorial.

    I hope that helps.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: Dec 1st 2010, 03:52 PM
  2. How to extract mathematica output
    Posted in the Math Software Forum
    Replies: 1
    Last Post: Sep 22nd 2010, 11:57 AM
  3. Replies: 4
    Last Post: May 15th 2009, 03:37 AM
  4. Display a number...
    Posted in the Math Topics Forum
    Replies: 2
    Last Post: Feb 22nd 2008, 07:54 AM

Search Tags

/mathhelpforum @mathhelpforum