Feature request: Automatic underscores for Greek letters #38

Open
opened 2022-09-12 18:50:55 +00:00 by Sinthoras7 · 4 comments
Sinthoras7 commented 2022-09-12 18:50:55 +00:00 (Migrated from github.com)

It would be useful if the automatic underscores also worked for Greek letters, such that when there is a \alpha and I type 1 not \alpha1 but \alpha_1 appears.

(This would be useful, but TBH if this is not easily doable, I would prioritize #30 over this, because this is just a feature, which would make this package more useful/better, the other one is a bug, which makes it unusable, for people, who are working a lot with siunitx/chemical environments.)

It would be useful if the automatic underscores also worked for Greek letters, such that when there is a `\alpha` and I type `1` not `\alpha1` but `\alpha_1` appears. (This would be useful, but TBH if this is not easily doable, I would prioritize #30 over this, because this is just a feature, which would make this package more useful/better, the other one is a bug, which makes it unusable, for people, who are working a lot with siunitx/chemical environments.)
ymarco commented 2022-09-12 19:03:00 +00:00 (Migrated from github.com)

The thing is, we'd need a white/blacklist, because for things like \cdot if I write \cdot1 I definitely didn't mean \cdot_1.

I have a WIP aas branch which makes a snippet data structure and lets you tag snippets, when/if I finish it we could look at the previous macro in the buffer, check if it's a snippet and if it has a "subcriptable" property and add subscripts with that.
That adds considerable complexity though, I'm not sure it'd be worth it.

The thing is, we'd need a white/blacklist, because for things like \cdot if I write \cdot1 I definitely didn't mean \cdot_1. I have a WIP aas branch which makes a snippet data structure and lets you tag snippets, when/if I finish it we could look at the previous macro in the buffer, check if it's a snippet and if it has a "subcriptable" property and add subscripts with that. That adds considerable complexity though, I'm not sure it'd be worth it.
Sinthoras7 commented 2022-09-12 19:25:54 +00:00 (Migrated from github.com)

Yeah, I also think we'd need a whitelist/blacklist. I would probably just whitelist the Greek letters and wait, if there arise any issues, which would be solved by whitelisting more. Ideally, include a method, which users can use to add things to the whitelist

This snippet-data-structure would only work, if the Greek letter was also created by an aas-macro, wouldn't it?
Without directly checking, whether the expression before is element of the whitelist, it would be pretty tricky to expand it, no matter how it was inserted, I guess.

Yeah, I also think we'd need a whitelist/blacklist. I would probably just whitelist the Greek letters and wait, if there arise any issues, which would be solved by whitelisting more. Ideally, include a method, which users can use to add things to the whitelist This snippet-data-structure would only work, if the Greek letter was also created by an aas-macro, wouldn't it? Without directly checking, whether the expression before is element of the whitelist, it would be pretty tricky to expand it, no matter how it was inserted, I guess.
ymarco commented 2022-09-12 19:32:56 +00:00 (Migrated from github.com)

This snippet-data-structure would only work, if the Greek letter was also created by an aas-macro, wouldn't it?
Without directly checking, whether the expression before is element of the whitelist, it would be pretty tricky to expand it, no matter
how it was inserted, I guess.

Right, yeah

> This snippet-data-structure would only work, if the Greek letter was also created by an aas-macro, wouldn't it? > Without directly checking, whether the expression before is element of the whitelist, it would be pretty tricky to expand it, no matter > how it was inserted, I guess. Right, yeah
Sinthoras7 commented 2022-11-12 18:14:00 +00:00 (Migrated from github.com)

A solution for users, who use the Unicode symbols, would be to create a variable, where the user can whitelist certain chars for the auto underscores.
Then, one could add the Unicode symbols for the Greek letters, f.e. 𝛼, 𝛽, 𝛾, 𝛿, etc..

A solution for users, who use the Unicode symbols, would be to create a variable, where the user can whitelist certain chars for the auto underscores. Then, one could add the Unicode symbols for the Greek letters, f.e. 𝛼, 𝛽, 𝛾, 𝛿, etc..
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tec/LaTeX-auto-activating-snippets#38
No description provided.