Skip to content
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

Request: Is there a way to auto add \, when you press space while inside $$ ? #90

Closed
Eneswar opened this issue Apr 11, 2023 · 9 comments

Comments

@Eneswar
Copy link

Eneswar commented Apr 11, 2023

No description provided.

@joeyuping
Copy link
Owner

Hi! @Eneswar

sorry I wasnt really able to imagine a scenario for such a functionality.. would you kindly describe the use case that you are after?

@Eneswar
Copy link
Author

Eneswar commented Apr 11, 2023

Sure thing, very random but when I do for example $500 meters$ it comes out as 500meters, and for me personally I prefer if there was a space between, so I have to do $500\,meters$ instead. I tried to put the "meters" part outside the $$ but I dont think it looks good.

Maybe there is a way for me to add it under custom shorthand? I just dont know how to add "spacebar".

@joeyuping
Copy link
Owner

Hi @Eneswar !

I see I see... for such a use case, some might use $text{500 meters}$ instead. But as you suggest, putting a slash works too. I am not so sure which one would be more common though. I could try to make an adjustment to the custom shorthand, so that it allows "space" as the shorthand for "\ ". That way, one can press space bar twice to create a "\ ". Might this work for you?

@Eneswar
Copy link
Author

Eneswar commented Apr 15, 2023

Pressing space twice would be a very good solution, I would appreciate that very much.
This will only work inside the $$ tag right, and not outside, or outside too?

@joeyuping
Copy link
Owner

Hi!

please update to v2.6.2, and add the following custom shorthand to the setting:

:::\ ;
(note the first space, then 3 colons, a slash, a space, finally a semicolon)
This way, within the $$ tag, you can press space twice (if right after text, then press space 3 times), the slash with space will be inserted. Hope this helps improve your workflow~

@linuswalter
Copy link

@joeyuping very nice implementation! I am using now the shortcut as :::\,; to receive \,.
Super cool, thanks a lot! ❤️

@linuswalter
Copy link

Sorry for just coming back to this @joeyuping, but actually I just realized that the standard custom shorthand commands do not work anymore when putting either :::\ ; or :::\,; into the list of custom shorthands.
Can you reproduce this issue or is it only in my setup?

@joeyuping
Copy link
Owner

@linuswalter Hi!

because there was a change of syntax after certain version before, the original shorthands on your side might be in the old syntax? that is, al:\alpha with only one colon?

if thats the case, could you use the old syntax instead, and add ' :,;' to the shorthand?

@linuswalter
Copy link

Ah, I understand! I switched to the new syntax now and it works perfectly. Thank you @joeyuping 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants