Using proportional fonts in Emacs org mode

Posted on Jan 4, 2025

Most of my writing, prose or code, happens in the monospaced-font-by-default Emacs. While I’d been hanging on to anachronistic monospaced aesthetic, I’m coming back around to the readability of a well-kerned proportional font.

To this end, I switched this blog’s fonts from monospace to proportional fonts a few months back, and I wanted to do the same with Emacs org-mode. The built-in variable-pitch-mode renders all buffer text in a proportional font 1, but we need a more granular solution given org-mode buffers can have embedded source code blocks and header bullets.

Somewhat related: I find visual-line-mode to work well with variable width fonts as opposed to auto-fill-mode, which results in ragged margins, line twiddling, and screen width affecting wrapping 2.

To put it all together here’s an example use-package config setting the modes and fonts for org-mode:

(use-package org
  :hook ((org-mode . org-indent-mode)
         (org-mode . visual-line-mode)
         (org-mode . variable-pitch-mode))
  :config
  (set-face-attribute 'org-block nil :inherit 'fixed-pitch)
  (set-face-attribute 'org-table nil :inherit 'fixed-pitch)
  (set-face-attribute 'org-code nil :inherit 'fixed-pitch)
  (set-face-attribute 'org-indent nil :inherit '(org-hide fixed-pitch)))

Other Resources

After writing this post I came across a few other resources:


  1. You can configure your font by setting the variable-pitch face. I’ve been using Google’s Noto Sans font lately: (set-face-attribute 'variable-pitch nil :family "Noto Sans") (see manual). ↩︎

  2. Emacs 30 will introduce visual-wrap-prefix-mode, adding indicators to the wrapped lines. ↩︎