mathics-core icon indicating copy to clipboard operation
mathics-core copied to clipboard

formatted text in strings

Open mmatera opened this issue 3 years ago • 1 comments

Description

In WMA, a string can produce a text equivalent to a boxed expression. For example,

"Power: \!\(a \^ b\)"

produces the same formatted text as the Boxed expression

Row[{"Power", Superscript[a, b]}]

See https://reference.wolfram.com/language/tutorial/TextualInputAndOutput.html#28564 for details of the syntax.

In mathics, on the other hand, the string is taken literally.

Motivation for fixing it

To reproduce the WMA behavior would be helpful, among other things, for improving the support of online help using ::usage strings associated with symbols. This also would contribute to having a more compatible interface for dealing with formatted text.

mmatera avatar Mar 26 '22 02:03 mmatera

I believe I have seen a number of packages that require this form too.

It seems like this should be pretty straightforward thing to do in the parser.

If I had known about that link, I probably looked at it earlier.

rocky avatar Mar 26 '22 02:03 rocky