11

I am using org-mode on Macintosh GNU Emacs version 24.5.1 in GUI mode and the headers are enlarged. I would like to disable this feature so they rendered in the default font size.

I have tried this...

(with-eval-after-load "monokai-theme"
  (custom-theme-set-faces
    'monokai
    '(org-level-1 ((t (:weight semi-bold :height 1.0))))
    '(org-level-2 ((t (:weight semi-bold :height 1.0))))
    '(org-level-3 ((t (:weight semi-bold :height 1.0))))
    '(org-level-4 ((t (:weight semi-bold :height 1.0))))))

Though this clobbers the theme and the colors are no loner rendered.

Should I accomplish it a different way?

Muihlinn
  • 2,576
  • 1
  • 14
  • 22
lookyhooky
  • 949
  • 7
  • 18
  • Try experimenting with different themes. – Kaushal Modi May 27 '16 at 17:14
  • **Very** closely related: http://emacs.stackexchange.com/q/19286/115 Just find the face you need to tweak and tweak it. – Kaushal Modi May 27 '16 at 17:15
  • @KaushalModi I dug a little deeper and found you are right. The theme I am using, monokai-emacs, sets the face attribute `:height` of the `org-level`s to a larger size. Manually reseting them is the only way I have found. – lookyhooky Jun 01 '16 at 00:05

4 Answers4

15

Okay I found a solution that worked for me.

(defun my/org-mode-hook ()
  "Stop the org-level headers from increasing in height relative to the other text."
  (dolist (face '(org-level-1
                  org-level-2
                  org-level-3
                  org-level-4
                  org-level-5))
  (set-face-attribute face nil :weight 'semi-bold :height 1.0)))

(add-hook 'org-mode-hook #'my/org-mode-hook)

This preserved the other face-attributes and did not clobber the theme like my original attempt. Also as a bonus it is not dependent on a single theme.

Stefan
  • 26,154
  • 3
  • 46
  • 84
lookyhooky
  • 949
  • 7
  • 18
8

Org headings are controlled by the faces org-level-1, org-level-2 etc. You can get to them via M-x customize-face. Unselecting the height attribute should set them to the default font size.

Tyler
  • 21,719
  • 1
  • 52
  • 92
  • Placing the point over the text for which you want to know the applied face(s) and then doing `C-u C-x =` would help. – Kaushal Modi May 27 '16 at 17:17
  • 1
    @KaushalModi yes, or more directly, `M-x describe-face`, which provides a link to the customize page. – Tyler May 27 '16 at 17:29
  • Tyler and @KaushalModi both of those commands helped me see the attributes applied to the font. This was my first attempt to modify Emacs faces, and those commands will be vital if I do any more work with it. – lookyhooky May 27 '16 at 18:29
4

If you happen to be using spacemacs, the theming layer supports overriding themes.

  1. Add theming to dotspacemacs-configuration-layers
  2. Add this to dotspacemacs/user-init substituing zenburn for the theme in question:
(setq theming-modifications
      '((zenburn
        (org-level-1 :height 1.0)
        (org-level-2 :height 1.0)
        (org-level-3 :height 1.0)
        (org-level-4 :height 1.0)
        (org-level-5 :height 1.0))))
Muihlinn
  • 2,576
  • 1
  • 14
  • 22
Peter Hoeg
  • 151
  • 2
2

Add this to the end of your config file.

(custom-set-faces
  '(hl-line ((t (:background "#476047604760" :height 1.0))))
  '(org-level-1 ((t (:inherit header-line :height 1.0))))
  '(org-level-2 ((t (:inherit header-line :height 1.0))))
  '(org-level-3 ((t (:inherit header-line :height 1.0)))))
Muihlinn
  • 2,576
  • 1
  • 14
  • 22
haruhi-s
  • 21
  • 1