Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the default font for StandardForm I/O from 'New Courier' to 'Consolas'?

I've searched without finding an exact solution for this... Does anyone know how to override Mathematica's default Monospaced font so all StandardForm Input/Output, including in the help browser, render in 'Consolas'?

The option inspector isn't helping much (probably because I don't know what I'm looking for?). There is also a 'font substitutions' list --- which I find confusing because of what appear to be circular references (i.e., includes things like: Courier -> New Courier and New Courier -> Courier)

Here's a screenshot comparing the two fonts at 125%.

enter image description here

like image 878
telefunkenvf14 Avatar asked Apr 02 '11 17:04

telefunkenvf14


2 Answers

The Input and Output cell types get their font from the StandardForm cell style (in Core.nb, inherited by Default.nb), so you'd need to make or edit that style cell in the desired stylesheet, for example:

Cell[StyleData["StandardForm"],
 FontFamily->"Consolas",
 FontSize->12,
 FontWeight->"Plain",
 FontSlant->"Plain"]

Example:

editing a StyleSheet

You don't have to paste in the Cell expression, you can insert the desired type with the dropdown menu or enter the name in the "Enter a style name" box and then style the select the resulting cell and use the Format menu to adjust the style to your whims.

like image 92
Michael Pilat Avatar answered Oct 31 '22 03:10

Michael Pilat


Open the notebook you want to change.

Go to Format > Edit Stylesheet...

Paste this into the bottom of that window (change Verdana to whatever you want):

Cell[
    StyleData["Input"], 
    PrivateFontOptions -> {"FontPostScriptName" -> "Verdana"}
]

You should get a pop-up asking if you want to "interpret the text." Click yes.

Save and reload your notebook.

If you want to do this for all notebooks, then you should edit the Default.nb style sheet.

like image 23
Mr.Wizard Avatar answered Oct 31 '22 04:10

Mr.Wizard