Bug introduced in 10.0.0 and fixed in 10.0.1
In Mathematica version 10, HoldForm
no longer produces the same results as in version 8 (edit: I only have versions 10 and 8 installed, so can't compare to version 9 directly). Here are some examples (on Mac OS X):
Formatting of \[ScriptCapitalE]
This symbol is output correctly:
InputForm[ℰ]
ℰ
But when wrapped as follows, I get gibberish:
HoldForm[InputForm[ℰ]]
â °
Arguments in HoldForm
aren't held
Why would I want to use InputForm
inside HoldForm
in the first place? Here is one example, using the constant E
. I would like it to be displayed as E
:
HoldForm[InputForm[E]]
E
On the other hand, the constant is formatted differently if I leave out InputForm
:
HoldForm[E]
𝕖
So why not use InputForm
without HoldForm
? Because then I can't write assignments like this:
HoldForm[InputForm[E = 1]]
E = 1
Here, I get no error because of HoldForm
. So far, so good. But now things become inconsistent again if I put the same construct into a Plot
:
Plot[x^2, {x, -2, 2}, AxesLabel -> {x, HoldForm[InputForm[E = 1]]}]
This used to work in version 8, but now it throws an error. The resulting plot is still correct, but the messages seem to indicate that HoldForm
was ignored at some stage.
Indeed, I then proceeded to do a more basic test:
Clear[x];
Plot[Sin[x], {x, 0, 1}, AxesLabel -> {"x", HoldForm[x = 3]}];
x
3
Yes, that's right. HoldForm
was completely ignored.
What can be done to fix this?
Edit
I tried to report the issue, but am currently receiving web form errors at the Wolfram site, so will have to try again later.
HoldForm
when they added the newInactivate
. $\endgroup$Hold[x = 3]
forHoldForm[x = 3]
. Global x still set to 3 after evaluation. $\endgroup$HoldForm[InputForm[ℰ]]
renders the same gibberrish for me in V9 as V10 $\endgroup$HoldForm[InputForm[ℰ]]
works as expected. I don't get the gibberish. $\endgroup$