In Mathematica versions up to 10.1 we could get string representation of given boxes by passing them to ToString
with InputForm
:
$Version
(* "10.1.0 for Linux x86 (64-bit) (March 24, 2015)" *)
ToString[SuperscriptBox["x", "2"], InputForm]
(* "\\(x\\^2\\)" *)
This is first example from linked tutorial, which is also used as last example in "Examples > Scope" section of ToString
documentation.
It no longer works in v10.2:
$Version
(* "10.2.0 for Linux x86 (64-bit) (July 6, 2015)" *)
ToString[SuperscriptBox["x", "2"], InputForm]
(* "SuperscriptBox[\"x\", \"2\"]" *)
How can we get string representation of boxes, known from previous versions, in v10.2?
This issue has been brought to my attention by baryonicnonsense in a bug report.
It was reported to WRI as [CASE:3419732].
InputForm
of a box expression will no longer use linear syntax, it will be the expression itself. The linear syntax can still be read for backward compatibility, but is not generated any more. Unfortunately, the documentation did not get updated, and that is a bug. $\endgroup$::usage
messages should be defined in the next release (actually defining::usage
messages currently is still huge headache)? $\endgroup$