LaTeX-auto-activating-snippets
LaTeX-auto-activating-snippets copied to clipboard
Maximum two characters in exponent auto curly wrap
Expected Behavior
-
a^123
->a^{123
-
a^123
->a^{123}
-
a^-33x
->a^{-33x}
Should the power include non-numeric characters (ex. variable names, ;
)? That runs the risk of consuming too much, but I vote that the exponent should be considered incomplete until a whitespace character is typed.
Current Behavior
-
a^123
->a^{12}3
-
a^123
->a^{12}3
-
a^-33x
->a^{-3}3x
(tested in org-mode)
Just tested, cannot reproduce, and I don't see a snipped here for ^
.
Should the power include non-numeric characters (ex. variable names, ;)? That runs the risk of consuming too much, but I vote that the exponent should be considered incomplete until a whitespace character is typed.
Theortically I'm OK with having a variable to switch between these two behaviors. However, I don't think we can add the general-case of a^{12}X => a^{12X} without binding a snippet for each and every letter x, with a condition would check for sub/superscripts on each keypress. The easier way to do it is with another post-self-insert-hook, but that's beyond the bounds of aas and laas.
...Meanwhile I'm fine with expanding the 1-9 and ii/jj snippets to check script bounds more thoroughly, and would accept a PR.
Just tested, cannot reproduce, and I don't see a snipped here for
^
. laas-subscript-snippets is the snippet list in question.
Closing because of staleness, I'd still accept a PR for a_{12}3
→ a_{123}