From 57fcd95e7dd61fcfc235293d7909e7b008466113 Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Tue, 24 Jun 2025 09:41:31 +0200 Subject: [PATCH] tweak(latex): don't insert braces after sub/superscript 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 "^". --- modules/lang/latex/config.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 491bc3357..97bb59a9f 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -59,8 +59,6 @@ okular and pdf-tools.") TeX-source-correlate-method 'synctex ;; Don't start the Emacs server when correlating sources. TeX-source-correlate-start-server nil - ;; Automatically insert braces after sub/superscript in `LaTeX-math-mode'. - TeX-electric-sub-and-superscript t ;; Just save, don't ask before each compilation. TeX-save-query nil)