minad / org-modern

:unicorn: Modern Org Style
GNU General Public License v3.0
1.55k stars 48 forks source link

Table formatting is shifted when the table contains a divider line. #155

Closed mok0 closed 1 year ago

mok0 commented 1 year ago

Like the subject line says: table formatting is shifted when the table contains a divider line. I enclose a screen dump of how it looks in my Emacs. I am running under macOS Ventura 13.6 (22G120), and I have compiled Emacs v. 29.1 using the build scriptjimeh/build-emacs-for-macos.git here on github.

Screenshot 2023-10-28 at 11 33 36

minad commented 1 year ago

This is likely a font problem caused by variable pitch fonts. We would need pixel alignment to fix this. If you suspect a different problem, please provide a minimal reproducible example based on emacs -Q with only org-modern loaded and no other configuration.

mok0 commented 1 year ago

When I launch a mininal Emacs with only org-moderne loaded and using the default font that comes with Emacs, the problem does not appear, the table looks fine. So you are right, it must be the variable pitch fonts creating this. I guess the goto solution is to not use divider lines in tables. Or perhaps I can try to have Org-mode use fixed-pitch font in tables. Thanks for your quick reply!

CVanmarcke commented 6 months ago

I had the same problem, caused by variable pitch (I use mixed-pitch to set this automatically). The problem persisted even if the org-table face had a fixed pitch. To fix it I had to add the following to my org-modern configuration:

(setq org-modern--table-sp '((space :width 1)
                             (space :width 1)))

The divider line however is still the same height as the rest of the text (instead of a thin horizontal line), but I don't mind too much.

oantolin commented 4 months ago

Wow, @CVanmarcke, that is magic! I will add it to my configuration without attempting to understand what the issue was.