# How to get string representation of boxes in v10.2?

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].

• As far as I know, this was an intentional change. The 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. – ilian Sep 10 '15 at 1:18
• @ilian Does it mean that we should expect fundamental changes in how for example ::usage messages should be defined in the next release (actually defining ::usage messages currently is still huge headache)? – Alexey Popkov Sep 10 '15 at 1:39
• You could consider adding some of your packages at PackageData[]. – Szabolcs Sep 12 '15 at 13:29
• @Szabolcs I added two of them already. Problem is that, the more I learn Mathematica, the sillier my old packages seem to me. I feel some of them need serious refactoring before I do something that will attract more attention to them. – jkuczm Sep 12 '15 at 19:17