12

Well, finally, after decades of Mathematica rendering notebooks incorrectly in Windows, and after many years of Mathematica not supporting high-resolution displays in Windows, finally version 12.1 fixes these problems. Well, almost

Here's the fly in the ointment: Now the fonts chosen in the documentation are too big: They're using 15-point fonts for default text, which is ridiculously large. This is probably because in the bad old days, before 12.1, Mathematica would render fonts too small (by a factor of 72/96), so the good folks at Wolfram simply upped the font size to make the documentation readable. Which means that now, with fonts suddenly rendered correctly, that size is too large. So, how to fix this?

The easiest solution I can see (short of waiting another 25 years for Wolfram to get those damn font sizes right…) would be to have Mathematica render all of the documentation at a magnification of 0.75, say. So here is my question:

Is it possible to force Mathematica to display all of the notebooks for its documentation at a 0.75 magnification? I figured out that those notebooks use the style sheet "Reference.nb" which I could edit, in principle (after copying it into my user folder hierarchy). I'm just not sure if it is possible to define the magnification of a notebook as a whole in its style sheet, and if so how to do it. I could of course change the magnification for each of the various kinds of cells that are described in Reference.nb, but that's a ton of work, and who knows what I might break by doing so.

Can this be done?

I guess what I am looking for is a statement along the lines of

Cell[StyleData[All], Magnification->0.75]

to be inserted into "Reference.nb" which would cause all content using that style sheet to be displayed at the specified magnification. I tried that, and was almost successful with it, but now the formatting of the initial documentation page (the one with the pretty colored boxes does not work any more, with text cut off and such.

Quick update: After realizing that, unsurprisingly, all style sheets distributed with Mathematica 12.1 use ridiculously large font sizes (standard text is 15pt), I have sent Wolfram my feedback asking them to fix the issue. I won't hold my breath, though; given the history of this issue I expect a fix to appear on a timescale of decades…

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
Pirx
  • 4,139
  • 12
  • 37
  • 3
    go to Preferences/Interface/Global Magnification (on the top) – rmw Mar 22 '20 at 09:56
  • That’s not a viable solution since it will change the magnification of all notebooks. We need a way to only change it for Mathematica’s documentation. – Pirx Mar 22 '20 at 14:02
  • The following code SetOptions[InputNotebook[], Magnification -> 0.75], when executed, changes the magnification of the current notebook to 0.75 (1 is the default). Maybe you can try to execute this code for documentation notebooks only? – Victor K. Mar 22 '20 at 17:26
  • Another idea is to look at what code is being executed when "F1" is pressed, and inject SetOptions there. – Victor K. Mar 22 '20 at 17:36
  • Hmm, that one is interesting: What I would need is some initialization code that checks if the notebook that's about to be opened resides below the "Documentation" hierarchy of Mathematica's installation folder, and if that is the case set its magnification to what I want it to be. Now all I need to do is figure out how to code this… – Pirx Mar 22 '20 at 17:53
  • Here is some more plays for you to explore: I discovered, through @szabolcs website, how to define your own shortcuts: http://szhorvat.net/pelican/pages/mathematica.html. The same folder has a file called MenuSetup.tr which has definitions for various menu commands. Maybe you can torture one of them to do what you need? – Victor K. Mar 22 '20 at 17:55
  • 2
    Funny, I'd like them at 125% by default! – Chris K Mar 23 '20 at 02:54
  • Up to Mathematica 12.0 you had to set the notebook magnification to 125% in order to see fonts rendered at the correct size. If you did that as a general setting, however, then the Documentation would have fonts that were too large (since those had been designed to work with the incorrect font scaling). Now, with 12.1, fonts are rendered at the correct size when using 100% magnification, but since the fonts in the documentation still haven't been fixed we're stuck with fonts that are too large. – Pirx Mar 23 '20 at 03:00

1 Answers1

0

After spending some quality time with this issue over the weekend, I have come to the conclusion that there's no good solution at this point. I guess we'll have to live with having to fiddle with the notebook magnification every time we open Mathematica's help. Wolfram just doesn't seem to ever be able to get those details right. Perhaps another twenty years from now they'll be there.

P.S.: As an aside, the built-in palettes are also using font sizes that are far too large. In this case the problem can be solved, however, since there's only a small number of these, and by making them editable, changing their magnification and then saving the fixed versions we can convert them into versions that use reasonable font sizes.

Pirx
  • 4,139
  • 12
  • 37
  • 4
    Have you tried changing the Reference.nb style definitions? – Michael E2 Mar 23 '20 at 03:15
  • 1
    You can do even fancier things: https://mathematica.stackexchange.com/a/46894/5478 – Kuba Mar 23 '20 at 07:33
  • Yes, I have tried that, and this almost works, except for the main "Wolfram Language Documentation Center" page. This ends up with a tiny font in the search field at the top (incidentally, that font is too small even with the standard Reference.nb style), and all of the tiles are messed up, I was thinking of looking at the corresponding notebook, but I can't even find it. The content it displays may be generated dynamically in some fancy way, so I decided this might be too hard of a nut to crack. Too much work for too little benefit… – Pirx Mar 23 '20 at 10:53
  • @Pirx all of these styles can be adjusted with style definitions. You're right that the toolbar is semi-dynamically generated (it can be queried from FrontEndResource["FEExpressions", "HelpViewerToolbar"]) but the InputField explicitly inherits from "ControlStyle" and so you can modify it there. You can also shrink the entire bar by setting the Magnification for the "DockedCell" style and there are a number of the InputFieldBoxOptions that may be set in "DockedCell" as well to control that. It's all doable, the only question is how much the large font size bothers you. – b3m2a1 Apr 26 '21 at 05:27