Org-roam underscore in properties drawer uses unwanted subscript

In org-roam I use an underscore in the generated ID.

:PROPERTIES:
:ID: 20211201_152904
:END:

However, the part after the underscore is rendered as subscript hanging off the baseline in smaller font size. How can I prevent this formatting, so it looks like the above?
p.s.: this is a reddit repost as I didn’t get a response over there.

@artelse

I don’t seem to be able to reproduce the issue you refer to.
Are talking about something else?

This is how it looks like. In the body of the buffer anything after an underscore becomes a subscript as well. So it looks like it is something global. I use nano-theme if that matters.
Screenshot from 2021-12-02 13-41-42

I have never seen anything like this. Interesting but I have no idea.

You can test what your Org files look like by launching Emacs with emacs -q (in your terminal, or on Windows, in Start menu). This way, you don’t load any of your configuration. My guess is you don’t have the same problem if you don’t load your configuration.

If so, it will be a matter of finding which package / part of configuration is causing this problem.

It’s possible nano-theme is doing something. Do you know how to disable it to test the idea?

It’s this, I think. Something in your config automatically turns it on.
Toggle it off.

C-c C-x ( org-toggle-pretty-entities )

https://orgmode.org/manual/Subscripts-and-Superscripts.html

Cool, indeed org-toggle-pretty-entities was causing the problem. Now that we have found out the cause, will look into the possibility to only turn it off in drawers. Thanks :slight_smile:

My hunch is that you would need to override function org-raise-scripts; it does not look complicated.

You could probably add a new xxx-p element to the unless condition clause (such as emph-p and link-p in the same way by getting a certain text prop).

Just an idea.

This requires more study for me as I have just started with Emacs and know very little Elisp (yet).

Sure. I’d turn off org-toggle-pretty-entities and not worry about a custom way to tweak it. Of course it’s up to you to pursue this path farther.

Yes, I’ve disabled org-pretty-entities in my config. Later when I get more Elisp under my belt might revisit the issue.

1 Like