-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faster numeric subscripts #14
Comments
Hi tecosaur, I am not planning to implement that, it is too specific.
|
Hey Carsten, to be honest, I don't think this is as niche as you think. I encountered this wish multiple times on the internet. (Probably one thing, that popularized this idea was this blogpost https://castel.dev/post/lecture-notes-1/). I myself switched from Vim to Emacs, and I am missing this feature indeed. Because of this, I suggest that you reconsider this. Of course, you don't have to implement it, and I don't want to demand anything, as I am really grateful for your work and active communication! |
Hey, More feasible would be to have a command that looks at what you have just typed make make the change. For example x 1 1 C-c i Is this really much better than x _ 11 TAB ? I can see it would be faster if you just had to type x 1 to get x_1. but wiht several digits that gets messy quickly. I am not saying that what tecosuar proposes is not a good idea - I just think it might be better to have this as a separate minor mode. |
Yeah, I see the point. I don't think the implementation - especially for just a single digit, which is enough 95% of the time - would be that hard, compared to other things in cdlatex (like the cdlatex-math-modify-method, or the overloaded tab key), but this automatic expanding is a different style and might really be more fitting in another minor mode. |
Thanks for your message. OK, so I am not going to take an action inside
cdlatex. Maybe I could try to implement it separately, it is an
interesting challenge, but I would have to find a bit of time.
Cheers
Carsten
…On Wed, Sep 7, 2022 at 9:03 PM Sinthoras ***@***.***> wrote:
Yeah, I see the point. I don't think the implementation - especially for
just a single digit, which is enough 95% of the time - would be that hard,
compared to other things in cdlatex (like the cdlatex-math-modify-method,
or the overloaded tab key), but this automatic expanding is a different
style and might really be more fitting in another minor mode.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAIABJ7FTZ4WIIVGWGJ6Q3V5DRGRANCNFSM4LBMLVLQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Hi, I have reopened this issue. I tried to implement this feature and I do think I have a testable version. You need to switch to the "electricindex" branch. There you will find a file electricindex.el that implements a minor mode electricindex mode. It does the following x 1 turns into x_1 etc. This mode uses texmathp to activate this functionality only in LaTeX math mode. I am considering to distribute this minor mode with cdlatex, but as a separate file, electric index.el. I would be interested in comments and opinions. Thanks. Carsten |
Hi, that seems great. Is there a reason, for having those whitespaces in between? I mean, it is one keystroke more than letting x1 turn into x_1 and x123 into x_{123}. |
FYI this functionality (and more) currently exists in https://github.com/tecosaur/LaTeX-auto-activating-snippets. |
By the way: I discovered this other package 1 which also contains this subscript functionality. Actually this is a whole snippet-engine and I abuse it just for the subscripts (through setting the variables, containing the snippet-lists to nil) and it works fine. |
Hi,
does this mean that the implementation I made is no longer required?
Carsten
…On Fri, Sep 16, 2022 at 3:00 PM Sinthoras ***@***.***> wrote:
By the way: I discovered this other package 1
<https://github.com/tecosaur/LaTeX-auto-activating-snippets> which also
contains this subscript functionality. Actually this is a whole
snippet-engine and I abuse it just for the subscripts (through setting the
variables, containing the snippet-lists to nil) and it works fine.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAIABO3VTTB76R2YX4GKXTV6RVPPANCNFSM4LBMLVLQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I think so? |
Hey, |
Well, the effort is done, I think. The question is: Do I leave move it
into the main branch of the cdlatex github repository.
Carsten
…On Fri, Sep 16, 2022 at 7:44 PM Sinthoras ***@***.***> wrote:
Hey,
I think it is not useless, since the other implementation is bound to a
whole snippet engine, (and has still some small bugs) while this one is
clean and short, but it's probably not worth the effort.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAIABMO2FNYD3BPQMGPJLTV6SWXBANCNFSM4LBMLVLQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I don't really see a reason not to. The question is whether to turn it on by default, but I would probably not have it turned on by default, but let the user activate it themself. |
Out of curiosity: Was there a reason for having the whitespace between the char and the number for the expansion to happen? |
Yes, of course.
Thanks for the feedback.
Earlier you said something about the whitespaces in between the typing?
That was just for clarity of reading, they are not required of course. You
do type x123 to get x_{123}.
…On Fri, Sep 16, 2022 at 10:02 PM Sinthoras ***@***.***> wrote:
I don't really see a reason not to. The question is whether to turn it on
by default, but I would probably not have it turned on by default, but let
the user activate it themself.
—
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAIABMDBJQT44F24IZOHA3V6TG5DANCNFSM4LBMLVLQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Now the question is (to everyone reading this issue thread): Should I put this minor mode into cdlatex, or are these other packages you mention better or goon-enough? Opinions, please. |
I think, you should put it in, since the other implementation is bound to a whole snippet engine which maybe not everyone wants to use and users of this other package could deactivate this functionality of cdlatex, if you implement a boolean variable for it. |
Hello, me again :)
When trying to quickly write out some maths whenever I type a (latin/greek) letter followed by a numeral, 95% of the time I'm doing a subscript (e.g.
x
and0
to makex_0
). Something I have tried (in another editor) and found very convenient is having a numeral immediately following a letter/symbol automatically form a subscript, (i.e.x0
→x_0
, andx11
→x_{11}
).If it would be possible to have this functionality in cdlatex that would be marvellous!
Thanks 😃
The text was updated successfully, but these errors were encountered: