My system: Windows 10, Mathematica 11.2
Problem: I have been using the fine MaTeX paclet to get nice symbols on my plots. As I scale the images in a TeX-document after exporting them in EPS, I need to adjust the FontSize
. So far things have worked out the way I wanted them to. But this week Mathematica has been acting up.
A command like
ec = ContourPlot[y^2 == x^3 - 5 x + 6, {x, -3.5, 3.5}, {y, -3.5, 3.5},
Frame -> False, Axes -> True,
AxesLabel -> {MaTeX["x"], MaTeX["y"]}]
works just fine, produces the expected image with nicely rendererd AxesLabels
. But when I try
ec = ContourPlot[y^2 == x^3 - 5 x + 6, {x, -3.5, 3.5}, {y, -3.5, 3.5},
Frame -> False, Axes -> True,
AxesLabel -> {MaTeX["x", FontSize -> 18],
MaTeX["y", FontSize -> 18]}]
instead, I get a strange message with a tiny garbage image followed by a text like "MapThread[...". Having isolated the problem, the next thing to do was to try the input
MaTeX["x", FontSize -> 18]
This gave the following message that is all Greek to me, but hopefully somebody here can make sense out of it. I omitted most of the contents of the GraphicsBox for it's rather long. If judged essential, I will copy/paste all of it.
MapThread[ Show[#1, ImageSize -> {#2, #3}, BaselinePosition -> Scaled[(#4 + MaTeX
Private
$psfactor)/#3]] &, {{\!\(\* GraphicsBox[ AspectRatio->Automatic, ImageSize->{12., 24.}, PlotRange->{{0., 11.97}, {0., 23.51}}]\)}, 0.996264 (2 + Interpreter`DependentTypes`PackagePrivate`coerced$5234), \ {23.5118}, {6.45585}}]
Search: It is not impossible that my problem is related to that of this question. However, Szabolcs' diagnosis does not seem to fit here given that MaTeX in the exact same notebook worked a week ago. Therefore it is unlikely that for example Scandic letters in the path name would play a role. Furthermore, the path to this notebook is all ASCII-characters anyway.
Update:
More testing:
It seems to me that the choice of FontSize plays a role.
In a virgin session, the first call to MaTeX, asking for FontSize->16
greeted me with the following:
Fold::normal: Nonatomic expression expected at position 3 in Fold[Insert[#1,{},#2]&,MapThread[Replace[#1,Failure[Interpreter
Internal
PackagePrivateargs___,Interpreter
InternalPackagePrivate
a:Blank[<<1>>]]:>Failure[InterpreterInternal
PackagePrivateargs,Join[Interpreter
InternalPackagePrivate
a,Association[<<2>>]]]]&,{<<1>>,{8.90271}}],InterpreterDependentTypes
PackagePrivate`pos$3165].
Together with a lot of messages:
Symbol::argx: Symbol called with 0 arguments; 1 argument is expected.
Next, when I asked for an 18-point font, I got the plot together with typeset strings all right. But at the bottom of that cell there was something extra starting with Show[#1, ImageSize->{#2,#3},...
Next, when I asked for a 20-point font. THERE WERE NO PROBLEMS.
So has something destroyed my collection of fonts this last week?
A clue to the above test was that copy/pasting the snippet from Szabolcs' page worked as prescribed. So Magnification -> 2
works fine.
ClearMaTeXCache[]
. I am going offline in a couple of hours and won't be around for about a week, so unfortunately I can't dig into this now. $\endgroup$