FiraCode font on Jupyter

29/05/2018

The FiraCode font is an extension of the Fira Mono font containing a set of ligatures for common programming multi-character combinations. It helps to read and understand code faster.

This post explains how to use this cool font on Jupyter Notebooks.

FiraCode

First, identify your Jupyter configuration folder by running the following command in your terminal

jupyter --config-dir

In my case, that folder is ~/.jupyter.

From there, access or create a folder named custom, and create a new file (or append to an existing one) called custom.css with the following CSS code:

@font-face {
  font-family: 'Fira Code';
  src: url("https://cdn.rawgit.com/dunovank/jupyter-themes/1e851888/jupyterthemes/fonts/monospace/firacode/firacode.otf") format("opentype");
}

.CodeMirror {
  font-family: 'Fira Code';
  font-variant-ligatures: initial;
}

.cm-string {
    font-variant-ligatures: none;
}

Restart your Jupyter Notebook and enjoy the new font!




Author: Andrea Barbon


Back