szhorvat / MaTeX

LaTeX labels in Mathematica
http://szhorvat.net/mathematica/MaTeX
MIT License
375 stars 45 forks source link

Tick labels have weird minus signs #43

Open jdujava opened 1 month ago

jdujava commented 1 month ago

Describe the bug

Trying out the first Usage Example in the blog post results in tick labels with weird minus signs. As far as I know, I have properly installed all necessary fonts (whole Latin Modern family).

Using MaTeX to generate all tick labels is a possible workaround, but isn't very convenient. Do you have any idea how to nudge Mathematica to properly use Latin Modern font in the tick labels?

To Reproduce

Needs["MaTeX`"]
texStyle = {FontFamily -> "Latin Modern Roman", FontSize -> 12};
contour = 
 ContourPlot[x^2 + y^4 == 1, {x, -1.2, 1.2}, {y, -1.2, 1.2}, 
  BaseStyle -> texStyle, 
  Epilog -> {Arrow[{{0.1, 0.3}, {0.5, 0.80}}], 
    Inset[MaTeX["x^2+y^4=1", Magnification -> 2], {0.1, 0.3}, 
     Scaled[{0.5, 1}]]}]

results in (same weird minus signs persist when exported to PDF): image

Additional information

szhorvat commented 1 month ago

Unfortunately I'm not sure what to do here. I would suggest trying Latin Modern Math instead.

Ultimately this is an issue with Mathematica (MaTeX is not involved at all) and would be worth reporting to Wolfram.

I tried this on macOS, and it doesn't have unusual minus signs, but it does pick up the small type version of Latin Modern Roman:

image

It shouldn't look like this at 14 points. Using Latin Modern Math gives the result I'd want:

image

These are both with 14.1 on macOS.