14

What's the simplest way of forcing Emacs org-mode to use the same fixed-width Font Family and Height everywhere (but keeping other properties distinct, like Foreground)?

I could make all org-level-n faces inherit from fixed-pitch, or make variable-pitch actually reference a fixed-width font, for instance, but that would be cumbersome, I guess.

Thanks in advance.

6
  • 1
    Hello. Are you using a custom theme or the Emacs default? Some themes change certain faces, e.g. Org headings. Also, have you changed the default Emacs font or tweaked some faces? By default Emacs sets a fixed-width/monospace font.
    – undostres
    Nov 26, 2014 at 21:56
  • Hey @undostres, I'm using Bozhidar Batsov's Solarized for Emacs.
    – rsenna
    Nov 27, 2014 at 11:06
  • 3
    Hmm, just as I thought. That theme introduces more "intrusive" changes than others. The README file in the repository shows some variables you can change to avoid some modifications, but if I recall correctly the variable-width font can't be changed. A workaround: use another Solarized implementation like this one or this one. But if you don't want to switch themes, you'll need to apply some face changes above Batsov's theme.
    – undostres
    Nov 27, 2014 at 15:31
  • 1
    Sure! NP. I'm an Org heavy user and had the same issue with that theme. Finally decided to changed it instead of trying some hack (which can be done, nevertheless).
    – undostres
    Nov 27, 2014 at 17:05
  • 1
    Set some settings in Theme specific settings to disable font size changes. Jun 29, 2015 at 10:04

2 Answers 2

11

Some themes change faces for no good reason.

For example, if you are using Solarized theme add code below before loading it.

(setq solarized-use-variable-pitch nil
      solarized-scale-org-headlines nil)
4

I would use face-remap-add-relative; see the Face Remapping section of the Emacs Lisp manual.

Here's a hook that sets the "family" property of the default face in Org mode buffers to "Monospace", effectively turning default into fixed-pitch.

(add-hook 'org-mode-hook
          (lambda () (face-remap-add-relative 'default :family "Monospace")))
2
  • Funny. For me, that had the opposite effect: all org fonts are now proportional (both headings and list items). Before that at least the list items were displayed with a monospace font.
    – rsenna
    Nov 27, 2014 at 11:23
  • I use face-remap-add-relative too, and it works for me (I don't have "Monospace" but use "Input Sans Mono" instead). There are also several other faces you might want to mess with, all named org-something.
    – amitp
    Nov 27, 2014 at 15:54

Your Answer

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

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