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

Error when using super/subscript embellishments #157

Open
jdujava opened this issue Jul 26, 2024 · 1 comment
Open

Error when using super/subscript embellishments #157

jdujava opened this issue Jul 26, 2024 · 1 comment

Comments

@jdujava
Copy link
Contributor

jdujava commented Jul 26, 2024

Command definition macros in https://ctan.org/pkg/usrguide (\NewDocumentCommand) support so called "embellishments".
One can choose for such an embellishment ^ or _, for example

\NewDocumentCommand{\cder}{s e{_}}{
    \IfBooleanT{#1}{\mspace{-3mu}}
    \bm{\nabla}\IfValueT{#2}{_{\mspace{-5mu}#2}\mspace{2mu}}
}

This however results in error, since as of now, grammar requires curly_group/letter/command name after ^/_.

Having following curly_group/letter/command be optional would seem to fix the issue. I just want to ask, if this would be acceptable (will post PR in that case), or there can be some side-effects, or perhaps more efficient fix.

@jdujava
Copy link
Contributor Author

jdujava commented Jul 26, 2024

This is turning out harder than I thought, since naive implementation (making curly_group/letter/command optional, with superscript/subscript node having right associativity) causes regressions similar to #132. If I understand correctly, this is due to lexical precedence of word compared to letter..

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

1 participant