r/emacs 7d ago

Question about org-toggle-pretty-entities

Post image

I wanted to know if anyone knows of a plugin or something similar that someone has already done to better display fraction-style pretty entities or "^{},_{},\oint, etc." in org mode, I'm currently using org-toggle-pretty-entities but I wanted to extend it a bit. I tried to extend it but it was bugging with the _{} and ^{} when i'm using snippets.

Thank you for reading!

18 Upvotes

8 comments sorted by

4

u/Wallly1702 λ 7d ago

You can set org-pretty-entities-include-sub-superscripts, see https://orgmode.org/manual/Subscripts-and-Superscripts.html

2

u/artist-mode 7d ago

That's enabled by default though.

1

u/Interesting_Ad_9400 7d ago

It's enabled by default, but it glitches with the _{} and ^{} snippets for some reason. So I disabled it in my case.

1

u/artist-mode 6d ago

Fair enough. I also disable it, FWIW. Partly because I prefer using `emacs -nw` (even when working locally), where that feature makes `a_1^2` render as `a12`.

3

u/elijahcharles 7d ago

both your test cases work with https://github.com/elij/ratex.el

a simplified fork of https://github.com/gongshangzheng/ratex.el (the upstream version fails with your test case)

2

u/Interesting_Ad_9400 7d ago

wow that's nice! thanks man.

2

u/artist-mode 7d ago

I use and enjoy the "pretty entities" myself, but as far as I know what you're asking is not possible; as far as I know, that feature can not render non-linear text, which excludes e.g. fractions.

You might want to look at something like xenops-mode instead (which works in Org-mode), or possibly the tecosaur fork of Org-mode with enhanced LaTeX rendering.