10

Today I just upgrade my Mathematica to 12.1 under Ubuntu 19.04.

Everything works fine but the font size is too small. As a result, I set the zoom level to 150%. Even though the font in the editor zone is big enough, the font size in the Context-Sensitive Autocompletion pop-up window is still too small to read.

I wonder how to increase the font size in the Context-Sensitive Autocompletion.

Thank you.

P.S. Resolution of my monitor is 4k Ultra HD.

PureLine
  • 1,310
  • 7
  • 20
  • 1
    Before modding anything, I would try setting ScreenResolutionCompatibilityMode->False and see if that helps. You can find it in the Options Inspector under System Configuration. If that doesn't help, send something to tech support with the output from SystemInformation[] attached. – ihojnicki Mar 19 '20 at 12:21
  • @Kuba I edited Core.nb as Cell[StyleData["CodeAssistCharCompletion", StyleDefinitions -> StyleData[ "CodeAssistCompletion"]], **FontSize->24**, ...] . But the software startup failed. – PureLine Mar 19 '20 at 14:03
  • @ihojnicki This solution does not work. – PureLine Mar 19 '20 at 14:04
  • @Kuba I also found a webpage https://mathematica.stackexchange.com/questions/101641/font-size-for-help-drop-down-menu-in-input-cell . And I have work it out. The problem is I can understand how you edit the stylesheet in this webpage. – PureLine Mar 19 '20 at 14:39

6 Answers6

7

Suggested by @ihojnicki, another solution is:

  1. create a file named ~/.Mathematica/FrontEnd/frontend.css;

  2. append the following configuration to frontend.css:

    * { font-size:16pt; font-family:"Griffy"; }
    
  3. done.
PureLine
  • 1,310
  • 7
  • 20
  • It does not work for me. Maybe add something else? – nail May 16 '20 at 15:56
  • @nail Please try my other solutions within this post. All of them work for me. – PureLine Jun 01 '20 at 02:37
  • The QT_SCALE_FACTOR=1.5 Mathematica is working for me, only. But it is very inconvenient because this option enlarge the window of the Mathematica also. I really very surprised why the solution with frontend.css is working for you but not for me. – nail Jun 02 '20 at 11:26
  • @nail my platform is Mathematica 12.1 under Ubuntu 19.04. – PureLine Jun 05 '20 at 12:07
  • I use Mathematica 12.1 under Linux MInt 18 (based on ubuntu 18). I'm tired of fighting this problem and came back to Mathematica 11.1 where changing the fonts and font size is very simple. – nail Jun 06 '20 at 16:04
  • @nail Just give-up it. 囧rz... – PureLine Jun 08 '20 at 08:27
  • this does not work for me either -- nothing changes – Mary O Aug 04 '20 at 13:41
  • this worked for me; I'm using Mathematica 13.1 on Fedora 36 – xdavidliu Sep 07 '22 at 00:32
5

Inspired by the solution from Font size for help drop down menu in input cell, my solution is as followed:

  1. Go to menu Format / Edit Stylesheet. this will open the style configuration similar as the left of the following image.

  2. Open Core.nb in $InstallationDirectory/SystemFiles/FrontEnd/Stylesheets. This doc looks as the right of the following image.

  3. Copy the cells "CodeAssistCompletion" and "CodeAssistCompletionHighlight" from Core.nb to the opened window in 1., and format these two cells by configuring menu -> Fromat -> Size.

Done. This configuration increases the font size only for this notebook, not for global setting.

I am still looking forward to a permanent global setting.

enter image description here

PureLine
  • 1,310
  • 7
  • 20
  • 4
    I think you would be better off creating a custom Qt stylesheet for the FrontEnd to use. ~/.Mathematica/FrontEnd/frontend.css. That should also make the font size of the menus larger as well. Which are probably small too. – ihojnicki Mar 19 '20 at 17:01
  • @ihojnicki very cool to know that exists – b3m2a1 Mar 19 '20 at 19:56
  • @ihojnicki I have given up to customize the GUI interface. To learn Qt stylesheet is too much work. 囧rz.. – PureLine Mar 22 '20 at 13:24
  • 3
    @PureLine I wouldn't have expected it to be more than... * { font-size:16pt; font-family:"Griffy"; } – ihojnicki Mar 22 '20 at 15:31
  • 1
    @ihojnicki Fancy! It works. – PureLine Mar 22 '20 at 15:53
  • @ihojnicki Actually, * { font-size:13pt} alone seems to be sufficient, modulo weird looking main menu bar with too large entries (but I can live with that). I'd still prefer you guys to fix this via a paclet update or at least in 12.2, though. Anyway, many thanks for this workaround, now I can finally switch to 12.1. – vsht Mar 31 '20 at 15:47
  • BTW, is there some documentation on customizing the FrontEnd look using css? – vsht Mar 31 '20 at 16:07
  • @vsht, it was an example for what can be done. We don't document it. I'm not sure it will be necessary in the next version. We'll see. You can find out more here. – ihojnicki Apr 01 '20 at 18:56
  • i have been looking for a solution to enlarging menu fonts for a year now, and this is the best one...but it STILL does not change the font of the menus at the top of the notebook even with style='All'->Format->Size=big_num!!! What is wrong with the Mathematica UI developers?!?! – Mary O Aug 04 '20 at 13:48
5

Launch Mathematica from the terminal in Ubuntu 19.04 with the following command:

 QT_SCALE_FACTOR=1.5 Mathematica

The font size in the Context-Sensitive Autocompletion increases, except for the font in the pop-up window blurs.

PureLine
  • 1,310
  • 7
  • 20
1

Some supplement to PureLine's answer.
(works for Mathematica 12.0 on Ubuntu 20.04 LTS)
To make it work permanently, I mainly follow the official tutorial https://support.wolfram.com/29974?src=mathematica.
1.open a new notebook, click "Format->Edit Stylesheet" and edit the private stylesheet as mentioned by PureLine
2.click "File->Save As" and save to be $UserBaseDictionary/SystemFiles/FrontEnd/StyleSheets/Default.nb
3.click "Format->Option Inspector",change selection->global option (if necessary), search for DefaultStyleDefinition and set to be the .nb saved in step 2
done (re-open a notebook and see changes

Kevin Sun
  • 11
  • 1
1

Based on @PureLine's answer and many other answers to related questions, I test my Mathematica for maybe 4h to learn the following things. And I will give the maybe untimate method to do this (At least works for my Mathematica 13.1).

The problem also arised when I got my new computer with relatively high screen resolution(2.5k). That's the code-assistant-popup fonts is too small, not zoomed to the ratio of the other normal texts. Even, I use other stylesheet instead of Default. So the problem become more complex.

Phenomena I encounter includes:

  1. Don't know what terms control only the code-assistant popup font.
  2. When I find out the answer, it's found that it doesn't save the change I make. i.e. I do successfully change the font, but when I close and reopen the .nb, it come back to the original status.

So here is the solutions:


Case A. You use Default stylesheet.

  1. Go to menu Format / Edit Stylesheet. This open the first window which is going to (futher)modify your current stylesheet. It's first line is "Inheriting base definitions from style sheet Default.nb"Here I've used some other stylesheet so it shows the stylesheet's name "Dracula.nb"

  2. Open the Core.nb, find the following terms (depends on your need). Copy them one by one to the first window mentioned before. Append them in the next several lines, as follows: (I suggest to set them in the same size, a little smaller than the code in the notebook.) As for the meaning of these 5 terms, just change it to a big font and try typing some code (e.g. Table) and you will understand. (It's so hard to describe sorry.)

  3. Change them to the font style you wants. For examples, 12 pts heavy.

  4. In the top of the window, click "Export" and name it. Then this is your stylesheet in which fonts are correctly(as you want) shown.

  5. Apply it to your current notebook or set as default.


Case B. You use some other stylesheet.

ATTENTIONS!!! Before going into next steps, DESELECT it from the "DefaultStyleDefinitions"! Otherwise it will fail.

After this prior preparation, open your stylesheet file (e.g. my "Dracula.nb"). Go to the 2. and 3. steps mentioned before. And the 4th step is, save the file. Finally step 5----set it again as the default stylesheet by going to Ctrl+Shift+O(see Additional knowledge 1.).

Additional knowledge:

  1. How to set stylesheet .nb file as default. : Press Ctrl+Shift+O, in "Show option values" select "Global Preferences". Search in "Lookup" for "DefaultStyleDefinitions". Change it to your stylesheet .nb file. Reboot Mathematica.
  2. There is a bug here. That's why you need to deselect original stylesheet before successfully update it. The phenomena that it goes inaccurately: a. Ctrl+S doesn't save the file and when you close the window you receive a warning asking whether to save it. Actually even though you tap "Save" it doesn't work. b. You reopen the stylesheet file. You will find all your changes have disappeared.
Handger
  • 19
  • 4
0
  1. Go to Format / Option Inspector
  2. Show Option Values: change from Selection to Global Preferences
  3. Go to Global Options / System Configurations / ScreenResolutionCompatibilityMode - False
  4. Restart Mathematica