Message Boards Message Boards

Issue when exporting plots with Text having a dash or space

Posted 11 months ago

I generated a RegionPlot with an overlying label, e.g.

Epilog -> Text[Style["Lyman-\[Alpha]", 14, RGBColor[0.65, 0., 0.], 
  FontFamily -> "Cambria Math"]]

Generating this plot inline in Mathematica looks just fine. However, I noticed that when I export this plot, for all FontFamily I tried, and for file formats such as .pdf, .svg, or .eps, the generated file fails to properly reproduce the text label; the text gets chopped in the "y". This issue also happens if there is a space in the Text. The presence or absence of a Greek character also causes an issue. The issue does not appear when exporting to .jpg. Right-clicking to save the plot to pdf also has the same issue. I can confirm I have the same issue in Mathematica 13.2.1.0 and 13.3.0.0. I attached the .pdf exports for "Lyman" (no space, dash, Greek character), "Lyman-" (dash), "Lyman[Alpha]" (Greek character), and "Lyman [Alpha]" (Greek character and space).

I would appreciate any ideas for addressing the issue.

POSTED BY: Marianne Moore

I tried exporting this

RegionPlot[x^2 + y^3 < 2, {x, -2, 2}, {y, -2, 2}, 
 Epilog -> 
  Text[Style["Lyman-\[Alpha]", 14, RGBColor[0.65, 0., 0.], 
    FontFamily -> "Latin Modern Roman"]]]

to pdf with Mathematica 13.3 on a Macintosh, and the exported picture looks fine.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract