I can create a text cell with text like this:

    "this is a function call: f[x,y]",

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:

enter image description here


1 Answer 1


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:

        "This is a function call ",
            BoxData[FormBox[RowBox[{"f", "[", RowBox[{"x", ",", "y"}], "]"}], TraditionalForm]],
    CellChangeTimes->{{3.7781587877405243`*^9, 3.778158805740602*^9}}

and if you CellPrint the above you get the desired output.

  • $\begingroup$ Thank you, creating a MakeBoxes version of the inner Cell does the generalization to any inline math expression inside a text cell. $\endgroup$
    – user13892
    Sep 22, 2019 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.