0

Emacs initiate here, I've just now added different heading sizes for org-mode to my init file, according to the answer on this page: Setting for org-mode bullet font size

(custom-set-faces
 '(org-level-1 ((t (:inherit outline-1 :height 2.0))))
 '(org-level-2 ((t (:inherit outline-1 :height 1.8))))
 ;; etc...
 )

It works fine:

enter image description here

However, I've noticed that the styling for the TODO prefix doesn't take this into account, it just uses the default size.

enter image description here enter image description here

The DONE prefix even less so, as it applies styling to the whole heading. Obviously I'd prefer it if the whole heading had the same font-size, including TODO, DONE or other custom states. Is there a way to make the TODO prefixes scale alongside the rest of the heading?

1
  • If I'm not mistaken, this should already happen out of the box on a recent Org. Can you report what you get from M-x org-version?
    – gusbrs
    Dec 24, 2021 at 14:35

2 Answers 2

0
  • for face of DONE heading, (setq org-fontify-done-headline nil) to make it inherit normal heading style. otherwise it uses face org-headline-done.
  • sytles of todo keywords like TODO|DONE are controlled by org-todo-keyword-faces. Guess you cannot make 'em inherit the default heading style.
0

TODOs styles have to be specified specifically. As an example, here is my config:

* States
** States names:
#+BEGIN_SRC emacs-lisp
  (setq org-todo-keywords
    '((sequence
       "INBOX(i)"
       "BACKLOG(b)"
       "NEXT(n)"      
       "MEETING(m)"
       "RECURRENT(r)"
       "STARTED(s)"
       "WAITING(w)"
       "DELEGATED(l)"
       "|"
       "DONE(d)"
       "DEFERRED(f)"
       "CANCELLED(c)"
  )))
#+END_SRC
** States colors & fonts (works best on night themes)
#+BEGIN_SRC emacs-lisp
  (setq org-todo-keyword-faces '(
                 ("INBOX" . (:family "DejaVu Sans Mono" :foreground "#b8e4f9" :bold t :weight bold)) ; light blue
                 ("BACKLOG" . (:family "DejaVu Sans Mono" :foreground "#8d4eff" :bold t :weight bold)) ; light purple
                 ("RECURRENT" . (:family "DejaVu Sans Mono" :foreground "#ae81ff" :bold t :weight bold)) ; purple
                 ("NEXT" . (:family "DejaVu Sans Mono" :foreground "#ff84c9" :bold t :weight bold)) ; pink
                 ("STARTED" . (:family "DejaVu Sans Mono" :foreground "#ffa8d9" :bold t :weight bold)) ; light pink
                 ("DELEGATED" . (:family "DejaVu Sans Mono" :foreground "#f47b20" :bold t :weight bold)) ; orange
                 ("WAITING" . (:family "DejaVu Sans Mono" :foreground "#ffcc00" :bold t :weight bold)) ; yellow
                 ("MEETING" . (:family "DejaVu Sans Mono" :foreground "#00ffc0" :bold t :weight bold)) ; light green
                 ("DEFERRED" . ( :family "DejaVu Sans Mono":foreground "#4577d7" :bold t :weight bold)) ;blue
                 ("CANCELLED" . (:family "DejaVu Sans Mono" :foreground "gray55" :bold t :weight bold)) ; grey
                 ("DONE" . (:family "DejaVu Sans Mono" :foreground "gray65" :bold t :weight bold)) ; grey
                 ))
#+END_SRC
** Add a =CLOSED: [YYYY-MM-DD Day HH:MM]= line when the task is =DONE=
#+begin_src emacs-lisp 
(setq org-log-done 'time)
#+end_src

Headings styles can be configured at the theme level, especially if you use built-in modus-themes. Example:

(use-package modus-themes
     :after (perfect-margin)
     :config
  (setq modus-themes-to-toggle
       '(modus-operandi-deuteranopia modus-vivendi-deuteranopia) ; Sets 2 themes from modus-themes-items
       modus-themes-common-palette-overrides; Override all modus-themes
       '((fg-heading-1 "RoyalBlue1"); Set Level 1 heading color
     (fg-heading-2 "SlateBlue1"); Set Level 2 heading color
     (fg-heading-3 blue-warmer); Set Level 3 heading color
     (fg-heading-4 blue); Set Level 4 heading color
     (fg-heading-5 cyan-warmer); Set Level 5 heading color
     (fg-heading-6 cyan-faint); Set Level 6 heading color
     (fg-heading-7 fg-dim); Set Level 7 heading color
     (fg-heading-8 pink); Set Level 8 heading color
     )
       modus-themes-headings
       '((1 . (1.4)); Set Level 1 heading size
         (2 . (1.3)); Set Level 2 heading size
         (3 . (1.2)); Set Level 3 heading size
         (4 . (1.1)); Set Level 4 heading size
         (t . (1.0))); Set Level 5 to 8 headings size
        )
  (load-theme 'modus-vivendi-deuteranopia :no-confirm)
  (define-key global-map (kbd "<f5>") #'modus-themes-toggle)
  )

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.