Message
knows how to convert an expression (taken as an argument) into a string before it is spliced into an actual message:
If I run the following in my terminal and in the front end
temp::mystr = "The symbol: `1`";
Message[temp::mystr, Pi];
the symbol Pi
is rendered differently:
I would like to directly enter an expression into the message string so that it renders appropriately depending on where it is issued: (in the terminal -> OutputForm
, or in the front end notebook -> StandardForm
). temp::mystr2 = "The symbol: \!\(Pi\)";
doesn't render correctly in the front end, while temp::mystr2 = "The symbol: \[Pi]";
renders incorrectly in the terminal. Does anyone know how to do it correctly [I need a solution that works in Mathematica 8 through 11]?
MeijerG::usage
. $\endgroup$Pi::usage
and found that it is simply"Pi is \[Pi], ..."
and prints like that in the terminal. I'm not sure this is possible within a String alone. It's easy elsewhere usingFormat
but I cannot see how to apply that to messages. $\endgroup$