-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Added most symbols to cmd_symbols for concealment #386
base: main
Are you sure you want to change the base?
Conversation
6d0b253
to
f0edbc8
Compare
Does Mathjax have a Edit: guess not. |
They do. https://github.com/mathjax/MathJax-src/blob/master/ts/input/tex/base/BaseMappings.ts Yeah wasn't sure how to implement bug/hack free yet. First thought was to add another variable to the conceal_maps.ts with format Also have to convert their unicode back into Tex commands but that shouldn't be a problem. |
09cde21
to
40ee73d
Compare
using edit: |
added almost all macros from mathjax that can be concealed. inf was added back since now the next character is checked for a alphabet character.
40ee73d
to
548dce4
Compare
okay I think I have tracked down all the commands that can be concealed with the current format. |
Thank you for your work! I'll try to take a look soon. |
Added most symbols from mathjax's Charactermaps to the concealments.
Some symbols used in the concealments were different then the ones in mathjax.
I think the ones from mathjax are more accurate and should be used, but I can revert if need be.
I sorted it case insensitive to preserve git history somewhat but its still not a full match so the differences between
mathjax and the original are shown below.
the left object is from mathjax and the right from the current map.
edit: not all mappings work like
\Subset
. Not sure whyedit2: almost fixed it. unicode is not fully supported.
for example
becomes
hello worlda
(github markdown doesn't seem to support\def
).where as
\def\aä
does work normally.But to avoid regex taking
\S
over\Subset
for the string\Subset
I added a negative lookahead for any letter (\\pu{L}
)and this doesn't account for when the previous character is a special letter and the next is a normal letter.
But this already so niche that I don't think we're ever gonna encounter that.
edit3: sorted the keys by length instead. Forgot that lookahead is not supported yet on ios.
It should now fully work for every macro.