Skip to content

Conversation

@real-or-random
Copy link
Contributor

This avoids inserting braces when you type "a_", so you end up typing "a_i" instead of "a_{i}".

The official LaTeX manual says that braces are correct, but it doesn't matter for many cases, e.g., when the sub/superscript is just a single token like "i". It's simply a matter of taste in these cases.

And I think if it is a matter of taste, then the sane default is to avoid any magic that gets in the way of users. Anyone who prefers braces can still enable this argument, but people who do not like them won't get upset every time they type "_" or "^".


  • I searched the issue tracker and this hasn't been PRed before.
  • My changes are not on the do-not-PR list for this project.
  • My commits conform to Doom's git conventions.
  • My changes are visual; I've included before and after screenshots.
  • I am blindly checking these off.
  • Any relevant issues or PRs have been linked to.
  • This a draft PR; I need more time to finish it.

Note that I skipped the linter due to #8425.

This avoids inserting braces when you type "a_", so you end up typing
"a_i" instead of "a_{i}".

The official LaTeX manual says that braces are correct, but it doesn't
matter for many cases, e.g., when the sub/superscript is just a single
token like "i". It's simply a matter of taste in these cases.
 - Frank Mittelbach, a LaTeX maintainer, says that he types "a_i":
   https://tex.stackexchange.com/questions/82329/how-bad-for-tex-is-omitting-braces-even-if-the-result-is-the-same#comment176261_82331
 - David Carlisle, another LaTeX maintainer, says that a_i "arguably
   improves the look of the source code":
   https://tex.stackexchange.com/a/82337
 - Joseph Wright, yet another LaTeX maintainer, says that he "would
   always use braces here, so favour a_{i}":
   https://tex.stackexchange.com/a/1929

And I think if it is a matter of taste, then the sane default is to
avoid any magic that gets in the way of users. Anyone who prefers braces
can still enable this argument, but people who do not like them won't
get upset every time they type "_" or "^".
@real-or-random real-or-random requested a review from a team as a code owner June 24, 2025 07:58
@hlissner hlissner added is:tweak Code changes that affects user-facing behavior module:lang/latex Pertains to Doom's :lang latex module labels Jun 25, 2025
@hlissner hlissner added this to the modules v25.07 milestone Jun 25, 2025
@hlissner hlissner merged commit 57fcd95 into doomemacs:master Jun 26, 2025
@hlissner
Copy link
Member

LGTM! Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

is:tweak Code changes that affects user-facing behavior module:lang/latex Pertains to Doom's :lang latex module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants