In Mathematica's Option Inspector I set the notebook magnification factor to be larger than 1, for example 1.12 ("Notebook Options"->"Display Options"). Accordingly contents of the Documentation Center are all magnified including the images which now look like this:

zigzag image after magnification

As shown above the lines in the images after magnification are in a zigzag fashion and ugly to look at.

So is there a way to set the notebook magnification factor above 1, without affecting the images (that is, without magnifying the images)?

  • 4
    $\begingroup$ I thought that would be enough SetOptions[ EvaluationNotebook[], {Magnification -> 1, GraphicsBoxOptions -> {BaseStyle -> Magnification -> 1} } ] but it seems I missed something. $\endgroup$
    – Kuba
    Commented Mar 11, 2016 at 12:48
  • 2
    $\begingroup$ @Kuba Your solution works very well for me (with OS X, mma 10.3.1) $\endgroup$
    – SquareOne
    Commented Mar 11, 2016 at 13:14
  • 1
    $\begingroup$ Yep, that was meant to be done by this example. You have to edit Reference Stylesheet Notebook styles similarly to: mathematica.stackexchange.com/a/81016/5478 $\endgroup$
    – Kuba
    Commented Mar 11, 2016 at 13:31
  • 1
    $\begingroup$ @User18 yes, same here, images are wrapped with GraphicsBox too so I thought it will work it doesn't. Maybe because they are handled separately by FE: What governs images resizing in the FrontEnd environment $\endgroup$
    – Kuba
    Commented Mar 13, 2016 at 8:49
  • 1
    $\begingroup$ The solution of @Kuba works for me this way, too: SetOptions[ $FrontEndSession, GraphicsBoxOptions -> {BaseStyle -> Magnification -> 1}], but, of course, that affects all notebooks throughout the session. It does have the advantage of persistence whenever you change the doc page. (OSX 10.11.5, M V10.4.1.) $\endgroup$
    – Michael E2
    Commented Jul 9, 2016 at 23:43

2 Answers 2


If you look at the BoxForm of the rasterized output in the Documentation Center by selecting it and pressing Ctrl+Shift+E, you'll see that GraphicsBox containing the rasterized plot has the option DefaultBaseStyle -> "ImageGraphics". So we can control magnification of such elements by adding to the Notebook's private stylesheet the following definition for the style "ImageGraphics":

Cell[StyleData["ImageGraphics"], Magnification->1]

This works great for any ordinary Notebook but applying this option to the Documentation Notebooks is tricky since they have the option Editable -> False and it isn't recommended to edit them. By default they have set StyleDefinitions -> FrontEnd`FileName[{"Wolfram"}, "Reference.nb", CharacterEncoding -> "UTF-8"] and hence their styles are defined in the stylesheet "Reference.nb" located in the folder

FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "Wolfram"}]

You can make a copy of this stylesheet, remove the Editable -> False and Saveable -> False options and then edit the "ImageGraphics" style (located in the "FormatType and Automatic Styles" section). Then you can copy this file to the following folder and then restart Mathematica:

FileNameJoin[{$UserBaseDirectory, "SystemFiles", "FrontEnd", "StyleSheets", "Wolfram"}]  

Stylesheets from this folder have higher priority than from the previous because it is located earlier in the StyleSheetPath global FrontEnd setting:

AbsoluteOptions[$FrontEnd, StyleSheetPath]
{StyleSheetPath -> {FrontEnd`FileName[{$UserBaseDirectory, "Autoload", _, 
     "FrontEnd", "StyleSheets"}], 
   FrontEnd`FileName[{$UserBaseDirectory, "Applications", _, "FrontEnd", 
   FrontEnd`FileName[{$BaseDirectory, "Autoload", _, "FrontEnd", 
   FrontEnd`FileName[{$BaseDirectory, "Applications", _, "FrontEnd", 
   FrontEnd`FileName[{$InstallationDirectory, "AddOns", "Autoload", _, 
     "FrontEnd", "StyleSheets"}], 
   FrontEnd`FileName[{$InstallationDirectory, "AddOns", "Applications", _, 
     "FrontEnd", "StyleSheets"}], 
   FrontEnd`FileName[{$UserBaseDirectory, "SystemFiles", "FrontEnd", 
   FrontEnd`FileName[{$BaseDirectory, "SystemFiles", "FrontEnd", 
   FrontEnd`FileName[{$InstallationDirectory, "Configuration", "FrontEnd", 
   FrontEnd`FileName[{$InstallationDirectory, "SystemFiles", "Components", _, 
     "FrontEnd", "StyleSheets"}], 
   FrontEnd`FileName[{$InstallationDirectory, "SystemFiles", "FrontEnd", 
   FrontEnd`FileName[{"C:\\Program Files\\Wolfram Research\\Mathematica\\10.4\
\\SystemFiles\\Components\\MUnit\\FrontEnd", "StyleSheets"}, 
    "PacletManager" -> True]}}

All the above operations can be completely automatized:

 FileNameJoin[{$UserBaseDirectory, "SystemFiles", "FrontEnd", "StyleSheets", 
CopyFile @@ (FileNameJoin[{#, "SystemFiles", "FrontEnd", "StyleSheets", 
       "Reference.nb"}] & /@ {$InstallationDirectory, $UserBaseDirectory});
nb = NotebookOpen[
   FileNameJoin[{$UserBaseDirectory, "SystemFiles", "FrontEnd", "StyleSheets",
      "Wolfram", "Reference.nb"}]];
SetOptions[nb, {Editable -> True, Saveable -> True}];

NotebookFind[nb, "ImageGraphics"];
cell = NotebookRead[nb];
If[TrueQ[First@cell === StyleData["ImageGraphics"]], 
 NotebookWrite[nb, Append[cell, Magnification -> 1], All]; NotebookSave[nb], $Failed]

(then restart Mathematica).

I have tested the above and it works! Screenshot:


  • $\begingroup$ This answer is a pleasant surprise to me; I thought that this problem did not have a solution, but now, after trying your method, I have really solved it. Thank you! $\endgroup$
    – User18
    Commented Aug 10, 2016 at 9:24
  • $\begingroup$ @User18 Have you restarted Mathematica after copying modified "Reference.nb" into the subdirectory of $UserBaseDirectory? I checked my solution with version 10.4.1 on Windows 7 x64 and it works perfectly, no need to replace the original file in the $InstallationDirectory. $\endgroup$ Commented Aug 10, 2016 at 9:50
  • $\begingroup$ Ah, everything worked fine after the second time I did it according to your instruction; so I deleted that error report as soon as I succeeded, which you still saw nevertheless. (I did restart Mathematica in my first attempt, so why I did not get the right result then - it is now a mystery to me.) Thank you again; the ugly zigzag lines in the magnified images are finally gone! $\endgroup$
    – User18
    Commented Aug 10, 2016 at 17:02

The solution suggested in the comments works too:

SetOptions[$FrontEnd, GraphicsBoxOptions -> {BaseStyle -> Magnification -> 1}]

But of course this affects all Notebooks, not only the Documentation Notebooks. And moreover it affects not only raster graphics but all 2D graphics in the Notebooks...

For reverting to the defaults one should evaluate

SetOptions[$FrontEnd, GraphicsBoxOptions -> {BaseStyle -> Inherited}]
  • $\begingroup$ Oh, I see. So we have two alternatives. Thank you. $\endgroup$
    – User18
    Commented Aug 23, 2016 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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