I have updated my OS to macOS 10.14 Mojave. I found whenever I export a plot into a PDF file, the font of the label and ticks are automatically replaced into a bold font. I use Mathematica 11.3.

Any idea to fix it?

In the notebook, the figure looks like

enter image description here

In the exported PDF file, it becomes

enter image description here

  • 2
    $\begingroup$ This started happening to me only after upgrading to macOS 10.14. On my Mac that still runs 10.13.6 (with the same version of M) I do not experience this, with identical graphics. I'd report this to Wolfram, it looks like Mojave caused a regression. $\endgroup$
    – ktm
    Oct 3 '18 at 22:31
  • 2
    $\begingroup$ Just to confirm, I have the same problem. Using Mma and Mac OS 10.14. $\endgroup$
    – abwatson
    Oct 15 '18 at 21:37
  • $\begingroup$ Also see a discussion here mathematica.stackexchange.com/questions/183488/… $\endgroup$ Oct 22 '18 at 23:49
  • $\begingroup$ I also have this same problem. Under Mac OSX High Sierra there was no problem $\endgroup$
    – hippo3773
    Oct 25 '18 at 17:07
  • 2
    $\begingroup$ It seems as if this problem has been fixed with Mathematica 12. At least on my machine (running macos 10.14.4), it works as expected. $\endgroup$ Apr 29 '19 at 6:22

Too long for a comment: I wrote MMA support and they got back to me with this answer:

It does appear as though there is an incompatibility between Mathematica 11.3 and macOS Mojave in regards to exporting PDFs. I was able to reproduce the issue in this environment, but not with earlier versions of macOS.

I have found one potential workaround, which instead of Exporting the graphics as a PDF, might be to save the graphic as a PDF from the Print dialog. To do so:

1) Create your graphic in the notebook

2) Select the graphic, go to File -> Print Selection, and from the lower left of the dialog, select "Save as PDF"

3) Use the Save dialog to save the created PDF somewhere on your computer.

This seems to prevent the extra bold fonts from my tests.

We are working to address this issue in our next release.

  • 1
    $\begingroup$ How does one manipulate this command so that it prints exactly in size of the graphics selected? I'm getting the right fonts, but cut pdf's using this method. $\endgroup$
    – Ranza
    Nov 22 '18 at 14:01
  • 1
    $\begingroup$ This works. Spent at least 10 hours changing settings trying to fix this. I thought I accidentally changed something and that was causing the issue. Messed up all my student lectures. I should have checked here first. Ugh. It would be nice to get an email from wolfram and a date for the fix when stuff like this happens. : (. It makes me think twice about depending on wolfram at work. $\endgroup$
    – B flat
    Dec 17 '18 at 14:15
  • 2
    $\begingroup$ That's true, I had to convert all my notebooks for my articles figure generation to script, so that I could run them remotely on my lab linux machine which is not affected by this bug. But clearly it's not convenient... Sometimes I don't get (probably because I don't know much about it) how wolfram can so amazing introducing amazing features but so slow in fixing well-known bugs (say for example the error in the position of any plot marker that is not the standard circle, which has been there since I can remember...) $\endgroup$
    – Fraccalo
    Dec 21 '18 at 9:34

Here's a way to use the OS-level Print > Save As PDF mechanism to get proper PDFs out, the only issue is that it's a truly horrible hack:

getPrintNotebookExpr[expr_] :=
   getPrintNotebookExpr@Cell[expr, "Output"],
   getPrintNotebookExpr[Cell[expr, "Text"]],
getExprDims[expr_] :=
  Rasterize[expr, "RasterSize"];
Options[printPDFExport] =
   "MediaBoxPadding" -> 3,
   "ScratchFile" -> "~/Desktop/fig.pdf",
   "BasePageSize" -> {612, 792},
   "PrinterPointScaling" -> .72
  pdf_String?(StringEndsQ[#, ".pdf"] &), 
  ops : OptionsPattern[]
  ] :=
   nb = StringReplace[pdf, ".pdf" -> ".nb"],
   targetFile = OptionValue["ScratchFile"],
   mag = OptionValue["PrinterPointScaling"],
   initSize = OptionValue["BasePageSize"],
   boxPad = OptionValue["MediaBoxPadding"]
  nbex = getPrintNotebookExpr[expr];
  dims = getExprDims[expr];
  exists = FileExistsQ@nb;
  pageSize = mag*dims;
  pageDiff = initSize - pageSize;
  {pdfMarginL, pdfMarginB} = Floor[pageDiff/2];
  nbobj =
     Visible -> False,
     WindowSize -> dims,
     PrintingOptions -> {
       "FirstPageFooter" -> False,
       "FirstPageHeader" -> False,
       "RestPagesFooter" -> False,
       "RestPagesHeader" -> False,
       "PageSize" -> pageSize,
       "PaperSize" -> pageSize/mag,
       "PrintingMargins" -> {{0, 0}, {0, 0}}(*Floor[{{pdfMarginL, 
       0}, {pdfMarginB, 0}}*.72]*)
     WindowElements -> None,
     NotebookFileName -> nb,
     StyleDefinitions ->
        Cell[StyleData[StyleDefinitions -> "Default.nb"]],
         CellMargins -> {{0, 0}, {0, 0}},
         ShowCellBracket -> False
     WindowTitle -> FileBaseName[pdf]
  NotebookPrint[nbobj, Interactive -> True];
  If[! exists, Quiet@DeleteFile[nb]];
   RenameFile[targetFile, pdf, OverwriteTarget -> True];
   openR = OpenRead[pdf, BinaryFormat -> True];
   str = ReadString[pdf];
   openW = OpenWrite[pdf, BinaryFormat -> True];
     Shortest["/MediaBox " ~~ "[" ~~ __ ~~ "]"] :> 
      "/MediaBox [ " <>
         {pdfMarginL, pdfMarginB} - boxPad,
         {pdfMarginL, pdfMarginB} + pageSize + boxPad
        ] <> " ]"]

You must save the file from Save as PDF to the path specified in the "ScratchFile" option, which has a horribly botched page size by default no matter what I try. So then I literally edit the PDF text so the "MediaBox" setting is the right size.

As I say, it's a terrible hack, but until WRI pushes a paclet to fix this we're stuck.

On the plus side, this does work, so I don't need to find a way to revert my OS upgrade to get working PDFs again.


What solved the problem for me was deactivating the bold font weight:

Close Mathematica -> go to Applications -> Font Book -> deactivate the Bold font weight by selecting "Disable ..." from the options for "Bold" in the dropdown menu (see screenshot attached below).

After exporting your figures, you can just reactivate the font weight.


  • 1
    $\begingroup$ This worked for me; however, in Mojave Font Book does not allow disabling system- or application-installed fonts. I had to resort to the technique described here: apple.stackexchange.com/a/338056/86933 $\endgroup$ Feb 18 '19 at 7:15

I experienced the same issue using mathematic 11.1.1. By changing the BaseStyle of the plot to bold, I get normal fonts by exporting as pdf. For example:

BaseStyle -> {FontFamily -> "Latin Modern Roman", FontSize -> 9, Bold}
  • $\begingroup$ that solves it for me. thanks ! $\endgroup$
    – jrekier
    Aug 27 '19 at 12:21

Not sure if this issue is solved now in v12, but after struggling with using few suggestions here, I found that exporting EPS and than converting to PDF using e.g. epstopdf, works ok for me.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.