1

I want my org file can be used in Emacs and logseq interchangeably (in pc Emacs, in mobile logseq)

What I want is like logseq to have other properties for the heading text, like

:PROPERTIES:
:heading: 1
:END:

and use the value of heading to determine the size of that heading text displayed in Emacs. Also when heading text contains code snippet, I want it to have same enlarge size.

In org mode I know I can enlarge the font face of eg. org-level-1, however I usually use org-level-1 as my TODO, and I don't want it being so large, and this doesn't change code snippet either.

2
  • I don't understand what you are asking. In particular, I have no idea what logseq is, so It might help to explain that and how it can use Org mode files.
    – NickD
    Jan 3, 2023 at 14:48
  • Can safely ignore the logseq part. I want org mode to display text size according to the :heading: properties, say :heading: 1 is largest, :heading: 2 a bit smaller and so on. And also it applied to code snippet. If no :heading: is specified, use default font size.
    – justakidd
    Jan 4, 2023 at 7:33

1 Answer 1

0

It might be possible to change the heading fonts via properties, but you can probably get what you want easier using more standard methods.

Why don't use the org-todo face for TODO and the org-level-n faces for headings? You can use C-u M-x what-cursor-position RET to find the face of the character under the cursor (it will be listed under "There are text properties here:"). (Try it to get the face of the code snippet you want to change.) Once you know the right face you can use set-face-attribute to change it. To apply your changes automatically in org-mode buffers, add them to org-mode-hook in your init.el file:

(defun my-org-faces ()
    (set-face-attribute 'org-todo nil :height 0.8)
    (set-face-attribute 'org-level-1 nil :height 1.2)
    (set-face-attribute 'org-level-2 nil :height 1.1))

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

If you just use the above and don't set org-code height explicitly, org-code fragments in headings will inherit the height property from the org-level-x font, so they will be the same size as surrounding text.

3
  • Thanks, your answer actually helped me improve my org mode looking. However I still can not get code snippet on heeding the same size as normal heading. It seems to me that org-code just apply to the whole buffer and doesn't adapt with org-level-*?
    – justakidd
    Jan 6, 2023 at 13:21
  • I added an edit below the code in my response. Does that help?
    – orgtre
    Jan 9, 2023 at 10:37
  • It works! Thanks!
    – justakidd
    Jan 13, 2023 at 8:52

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.