I can create a text cell with text like this:
CellPrint@Cell[
"this is a function call: f[x,y]",
"Text"
]
This produces:
this is a function call: f[x,y]
But I want f[x,y] to be in inline math form within the text cell, like below:
Why not create the output you want in a text cell using ctrl+9, and then use the menu command Cell | Show Expression to see what it looks like? When I do this, I see:
Cell[
TextData[{
"This is a function call ",
Cell[
BoxData[FormBox[RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], TraditionalForm]],
FormatType->"TraditionalForm"
],
":"
}],
"Text",
CellChangeTimes->{{3.7781587877405243`*^9, 3.778158805740602*^9}}
]
and if you CellPrint the above you get the desired output.
MakeBoxesversion of the innerCelldoes the generalization to any inline math expression inside a text cell. – user13892 Sep 22 '19 at 19:51