Disable subscript in siunitx macros #30
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tec/LaTeX-auto-activating-snippets#30
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Inspired by #23, we should disable subscripts within
siunitx
macros such as\qty
,\num
, and so on.It's currently painful to write exponents for numbers in these macros as they they currently expand to something like
\num{123e_3}
instead of\num{123e3}
It's basically the same issue as in #23, we need a method to check if point is inside \qty or \num etc. If we don't care about nesting it shouldn't be too hard, PRs welcome.
A possible workaround meanwhile if it's only annoying on "e" would be to advise laas-auto-script-condition to return nil if we're subscripting "e".
I think the functions
TeX-current-macro
andLaTeX-current-environment
(provided by AuCTeX) would be helping a lot in fixing this and also #23. (even #11 I think)I'm not familiar, what do they do? Would they work in Org?
They do exactly what their name implies, and I think exactly what we need here.
From the documentation of
TeX-current-macro
: "Return the name of the macro containing point, nil if there is none."Source Code:
From the documentation of
LaTeX-current-environment
:Source Code
Edit: Regarding org, I don't know, since I don't use latex heavily in my org files. Do the other AuCTeX-functions work in org?
Ok, and what about Org? Would be odd if we check for siunitx in TeX and not in Org
(Not trying to be sarcastic, sorry if it sounded like that)
I edited my comment some minutes ago (should have marked it, my fault.)
I wrote: "Regarding org, I don't know, since I don't use latex heavily in my org files. Do the other AuCTeX-functions work in org?"
(Edit: Spelling)
Oh, I don't get the edits when reading by email.
Some do, we'll need to check edge cases. laas has auctex as a dependency so if they do work we can rely on them 100%.