Problems interpreting input cell box expressions

前端 未结 2 777
北海茫月
北海茫月 2021-02-20 02:36

How do I convert an arbitrary box specification extracted from a cell expression into an input expression?

This came up as a problem with my answer to Save Mathematica c

2条回答
  •  既然无缘
    2021-02-20 03:03

    Honestly I am not sure what you're trying to do, but I suspect you will need to use the FrontEnd itself for processing. Here is a generic example:

    FrontEndExecute@FrontEnd`CellPrint[
      BoxData[RowBox[{"StringForm", "[", RowBox[{"\"\<\!\(\*
             StyleBox[\"a\",
             FontSlant->\"Italic\"]\) = ``\>\"", ",", " ", "1"}], "]"}]]
    ]
    

    However, I don't know what format you actually want to get.

提交回复
热议问题