I found out about variable-pitch-mode
through a thread here on StackOverflow, and it's very handy when writing in org-mode
, easier on the eyes and everything. But using tables in org is close to worthless when using proportional fonts. And being able to use tables is one of the strengths with org-mode
:-(
Is there any way to have proportional fonts for text, headings etc. but a monospace font for tables in org-mode
?
See if this works,
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
You may use C-u C-x = to see which face is in effect at a particular point.
This code will make tables and ascii art and source code blocks to be displayed in monospace font, while preserving other font attributes for tables (such as color blue) and so on. Code is based on the other answer, the only difference is preservation.
(defun my-adjoin-to-list-or-symbol (element list-or-symbol)
(let ((list (if (not (listp list-or-symbol))
(list list-or-symbol)
list-or-symbol)))
(require 'cl-lib)
(cl-adjoin element list)))
(eval-after-load "org"
'(mapc
(lambda (face)
(set-face-attribute
face nil
:inherit
(my-adjoin-to-list-or-symbol
'fixed-pitch
(face-attribute face :inherit))))
(list 'org-code 'org-block 'org-table 'org-block-background)))
If you'd like to learn how this works and how to apply this to other situations (such as Info mode), read my post on the subject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With