1

When using the xAct package xCoba to compute a Lie derivative, is there a simple way to adjust the accepted answer here (reproduced below) so that the components will display in the same way (eg $\frac{\partial f}{\partial\phi}[\theta,\phi]$ instead of $f^{(0,1)}[\theta,\phi]$ for a function $f[\theta,\phi]$ appearing in such a computation)?

Derivative /: 
 MakeBoxes[Derivative[α__][f1_][vars__?AtomQ], 
  TraditionalForm] := Module[{bb, dd, sp},
  MakeBoxes[dd, _] ^= 
   If[Length[{α}] == 1, "\[DifferentialD]", "∂"];
  MakeBoxes[sp, _] ^= "\[ThinSpace]";
  bb /: MakeBoxes[bb[x__], _] := RowBox[Map[ToBoxes[#] &, {x}]];
  TemplateBox[{ToBoxes[bb[dd^Plus[α], f1]], 
    ToBoxes[Apply[bb, 
      Riffle[Map[
        bb[dd, #] &, (Pick[{vars}, #]^Pick[{α}, #] &[
          Thread[{α} > 0]])], sp]]], 
    ToBoxes[Derivative[α][f1][vars]]}, "ShortFraction", 
   DisplayFunction :> (FractionBox[#1, #2] &), 
   InterpretationFunction :> (#3 &), Tooltip -> Automatic]]    
  • Please make your question self-contained by adding the relevant code from the other answer. Also add your expression as Mathematica code rather than latex, and any attempts you have made so far. – MarcoB Oct 05 '22 at 11:38
  • I added the relevant code. As for the LaTeX, I'm talking about how the output is displayed by mathematica, which is precisely what is seen in my question (whether or not I used LaTeX to produce it), so I don't really see an issue. And I know next to nothing about mathematica in general, and when it comes to things like this in particular, so I don't even know where to start to achieve this myself. – Rosa Luxemberg Oct 05 '22 at 13:19

0 Answers0