8
$\begingroup$

Is there any option Mathematica's preferences to change the font for the whole notebook? I know how to change the font of individual cells.

$\endgroup$
5
  • $\begingroup$ You mean the text cells, or the input and output cells too? The latter will be a problem, because you would need a font that has all of Mathematica's symbols in order to work fine. $\endgroup$ Oct 25, 2013 at 20:10
  • $\begingroup$ One would think that SetOptions[InputNotebook[], FontFamily -> "Calibri", StyleDefinitions -> False] does this, but no ... $\endgroup$ Oct 25, 2013 at 21:36
  • $\begingroup$ Ok! I remark that there is a lot of not confortable things in mathematica like CTRl-Z and so on. But I like this software! $\endgroup$
    – phdstudent
    Oct 25, 2013 at 21:48
  • $\begingroup$ To take the question a bit less literally, you can change the appearance of nearly everything in the notebook by changing the style sheets. Go to Format->StyleSheet and pick one of the sheets. Of course you can make up your own. $\endgroup$
    – bill s
    Oct 25, 2013 at 22:17
  • $\begingroup$ Stylesheets inherit but it appears that you cannot switch off core.nb being the top level parent so therefore you would need to set the font on a cell type by cell type basis because font type would be defined "locally" for each cell type in the core.nb therefore setting a type at the notebook level won't override unless you switch off core.nb(somehow) $\endgroup$ Oct 25, 2013 at 23:55

3 Answers 3

7
$\begingroup$

Stylesheets (as "bill s" said) seem the best idea to me. Just modify the font of the type of cells(Title, section, subsection...) you want on the stylesheet (using the writing assistant palette, for instance) and the changes will be applied to the same cell types on the notebook.

Edit1:

Here are more detailed steps (tested in mathematica 9 front-end):

  • Go to "Format"-> "Edit Stylesheet"
    • This opens the "Private style definitions" stylesheet, whose definitions override the base stylesheet all notebooks have by default.
  • From the "Choose style" drop-down menu select the style you want to modify.
    • A new cell will be created with the contents: "Local definition for style "stylename"" and below: "stylename" formatted according to that particular style.
  • With the "Writing Assistant" palette change the desired feature (text size, color, font...)
    • Note that only the features you set will be overriden, all the other will be inherited from the base stylesheet.
    • You can also modify the cell expression directly if you know how (Ctrl+Shift+e to toggle it on the current cell)

Also, note that the cells in the stylesheet are not regular cells, thus you can't just insert a regular cell in it, use the dropdown "Choose style" instead.

This is what the expression of a stylesheet cell for "Title" looks like (you can toggle between displaying a cell in normal mode and expression mode with Ctrl+Shift+e ): Cell[StyleData["Title"]]. If we changed the color to blue, it would look like this: Cell[StyleData["Title"], FontColor->RGBColor[0, 0, 1]]

And this is what a regular (blank) title cell expression looks like: Cell["", "Title"] (The empty string is the content of the cell)

$\endgroup$
2
$\begingroup$

Look there:

(1) Open a notebook, in the menu choose "Format" -> "Edit Stylesheet".

(2) Choose a style to change. For example, "Text", in the menu at the top left.

(3) Modify fonts, etc.

(4) Save this stylesheet to a .nb file. Optionally one can also click Install StyleSheet so that the stylesheet can be found at "Format" -> "Stylesheet..." menu.

(5) Open menu "Format" -> "Option Inspector", make sure "Global Preference" is selected (where the default is "Selection") in the popup menu.

(6) Search for DefaultStyleDefinitions, change it to the saved stylesheet file. Click apply.

Close Mathematica and launch it again. The default font is changed.

$\endgroup$
2
  • 4
    $\begingroup$ This makes global changes, not restricted to given notebook. I'm not sure if this if what OP needs but if so then this topic would be a duplicate of another one you've answered: mathematica.stackexchange.com/a/140010/5478 $\endgroup$
    – Kuba
    Mar 14, 2017 at 9:59
  • $\begingroup$ At least on Wolfram Desktop 13.2 for macOS, on step (6), you can search for "Font" instead, and change the StyleHints option values under "Formatting Options > Font Options". In my case, I wanted the Notebook cells to be changed from "Source Sans Pro" to "Courier", and that was the only setting change that made the difference (without having to create a stylesheet). Within the option value, there is a key called CodeFont that pointed to the font name (i.e., <|"CodeFont" -> "Source Sans Pro",). As noted in the other comment, this change applies globally. $\endgroup$ May 21 at 23:49
-2
$\begingroup$

You can refer to this post, which has the method of customizing various fonts by modifying the core.nb file.

enter image description here

$\endgroup$
1
  • 3
    $\begingroup$ (-1) Another careless answer of yours. 1. The linked post is also about editing stylesheet, which is already elaborated by other answers. 2.The screenshot is not related at all. $\endgroup$
    – xzczd
    Oct 2, 2020 at 4:58

Your Answer

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

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