I reproduce the issue with version 13.0.0 on Windows 10 x64 (screenshot). With version 12.3.1 on the same machine it looks OK on 100% Magnification
, but with Magnification
125% it is also partially cut off: screenshot. Hence it strongly depends on the Magnification
setting. With version 8.0.4 installed on the same machine, the problem doesn't reproduce independently on the Magnification
.
The simplest workaround is to not use inline cells:
CellPrint[Cell[
BoxData[RowBox[{"This is some text. Consider the function ",
FormBox[RowBox[{RowBox[{"f", "(", "x", ")"}], "=", SuperscriptBox["x", "2"]}],
TraditionalForm], "."}]], "Text", FontFamily -> "Times New Roman"]]
It is worth to point out that the size of the text in the FromBox
is determined incorrectly:
CellPrint[Cell[
BoxData[RowBox[{"This is some text. Consider the function ",
FormBox[RowBox[{RowBox[{"f", "(", "x", ")"}], "=", SuperscriptBox["x", "2"]}],
TraditionalForm, BaseStyle -> {Background -> Yellow}], "."}]], "Text",
FontFamily -> "Times New Roman"]]
Apparently this is the reason why the first character is cut off in the inline cell.
Since incorrect determination of the sizes of textual elements is a well-known "unsolvable" problem of Mathematica, I think the default behavior for cell rendering should be do not cut off textual elements going beyond the cell. Currently they are cut off not only for inline, but also for ordinary cells:
CellPrint[Cell[
BoxData[FormBox[RowBox[{RowBox[{"f", "(", "x", ")"}], "=", SuperscriptBox["x", "2"]}],
TraditionalForm]], "Text", FontFamily -> "Times New Roman"]]
It is interesting that version 8.0.4 installed on the same machine has no such problem independently on the Magnification
:
CellPrint[
Cell[BoxData[
FormBox[RowBox[{RowBox[{"f", "(", "x", ")"}], "=",
SuperscriptBox["x", "2"]}], TraditionalForm]], "Text",
FontFamily -> "Times New Roman", Magnification -> 3]]
I think current behavior should be considered as a regression bug in rendering of Cell
s (both inline and ordinary). Reported it to the support as [CASE:4900891]. Here is the response:
Thank you for taking the time to send your report.
It does appear that CellPrint is not behaving properly. I have
forwarded an issue report to our developers with the information you
provided, and added your contact information to the report so that you
can be notified when it is resolved.
As one can see from the response, the subject-matter expertise of the support engineer isn't good in this case (it is not CellPrint
, but FrontEnd's rendering of Cell
is not proper). But it is good that the issue is registered.