Closed vsht closed 4 months ago
@vsht, thanks for the report.
This seems to be an inconsistency in how Mathematica produces TraditionalForm
. In particular consider the following screenshot:
When the number of integrals is larger than a certain value, the TraditionalForm
works incorrectly. This boundary (72 on the screenshot) is different for different machines!
The traditional form of j[...] is defined in LiteRed as
MakeBoxes[j[nm_,inds__],TraditionalForm]:=InterpretationBox[SubsuperscriptBox["j",RowBox[ToBoxes[#,TraditionalForm]&/@{inds}],ToBoxes[nm,TraditionalForm]],j[nm,inds]]
For a simpler definition, e.g.,
MakeBoxes[f[x_], TraditionalForm] := InterpretationBox[SubscriptBox["f", ToBoxes[x, TraditionalForm]], f[x]]
I observe a similar effect, although starting with larger value (e.g. TraditionalForm[Array[f, {397}]]
work incorrectly on the present machine). I believe, this problem has something to do with InterpretationBox
wrapping, as I could not observe the incorrect behavior when I remove it. But InterpretationBox
is needed for consistent copying of the output. So a quick fix (in case you don't want to copy the output) woud be to replace the InterpretationBox[SubsuperscriptBox["j",RowBox[ToBoxes[#,TraditionalForm]&/@{inds}],ToBoxes[nm,TraditionalForm]],j[nm,inds]]
with SubsuperscriptBox["j",RowBox[ToBoxes[#,TraditionalForm]&/@{inds}],ToBoxes[nm,TraditionalForm]]
in the code above (which can be located in LiteRed2xxx.m file). Or even simple unset the definition with MakeBoxes[j[nm_,inds__],TraditionalForm]=.
But I am not sure I would want to give up possibility to copy the output just because of the Mathematica incorrect treatment of InterpretationBox
, especially, given that it might only move up the boundary for the incorrect behavior.
I've already met bugs in Mathematica related to different behavior when the size exceeds some boundary. Look, for example at https://redmine.wolfram.com/redmine/issues/1259
This bug remains unfixed since MMa11!
Best, Roman.
I see, thanks for the explanation.
I have to say that I don't have much experience with InterpretationBox
. In FeynCalc I only use MakeBoxes
and ask people to use exp//StandardForm
if they want to copy something. Of course, the number of symbols there if also sufficiently higher as compared to LiteRed.
Hi,
I'm using Mma 14.0 and have my standard cell output format set to TraditionalForm. With the latest LiteRed2 from the repository I'm getting typesetting errors upon using
LoweringDRR
. With the codeI get
Am I doing something wrong here?
Cheers, Vlad