I want to create a textual style that has some CellEvaluationFunction
that processes the contents of the cell a certain way. Particularly, it has to do something with the contents of inline cells (formulas in the middle of the text).
The problem is that it seems the CellEvaluationFunction
receives an already parsed string (something like what you would get when you "copy as input", so I lose the inline cells.
If the cell is one of those that start with an empty box, boxdata, like in StandardForm or TraditionalForm, then the function does get the box structure, but then the writing is not the same: spaces become boxes, it formats as formulas, and inline cells get formatted as text.
How could I solve this?
Basic example
Cell[TextData[{
"hello ",
Cell[BoxData[
FormBox[
FractionBox["3", "x"], TraditionalForm]],
FormatType->"TraditionalForm"]
}], "myText", CellEvaluationFunction->myEvalFun, Evaluatable->True]
suppose I want it turned into the string "hello PP\frac{3}{8}PP", and in general, the textual part remaining the same and the inline cells wrapped in PP in TeXForm