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

Negative kerning in \operatorname #2830

Closed
rudolf-adamkovic opened this issue Feb 5, 2022 · 3 comments
Closed

Negative kerning in \operatorname #2830

rudolf-adamkovic opened this issue Feb 5, 2022 · 3 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.2
Milestone

Comments

@rudolf-adamkovic
Copy link

Issue Summary

Negative kerning does not seem to work inside of the \operatorname.

Steps to Reproduce:

  1. Typeset \operatorname{V{\kern-2pt}ar} with MathJax.

Expected: "V" adn "ar" typeset closer together.
Actual: "Missing dimension or its units for \kern" error.

Note: Positive values (e.g. 2pt) work, negative (e.g. -2pt) do not.

Technical details:

  • MathJax Version: 3.2.0
  • Client OS: macOS 12.1 (21C52)
  • Browser: Firefox 96.0.3 (64-bit)
@dpvc
Copy link
Member

dpvc commented Feb 21, 2022

Yes, MathJax's implementation of \operatorname{} isn't quite as sophisticated as LaTeX's. As I recall, the LaTeX version uses \catcode to adjust the meaning of - so that things like \operatorname{ab-cd} use a text dash for the - rather than a minus sign. MathJax doesn't implement \catcode, and so tries to mimic this behavior by replacing - in the argument of \operatorname by \text{-}. That means in you case that the argument becomes V{\kern\text{-}2pt}ar, which is the source of the error message (since it looks like \kern has no following dimension).

One work around for now would be to use

\newcommand\kernminustwo{\kern-2pt}
\operatorname{V\kernminustwo ar}

though I know that is ugly. I'll see if I can think of a better approach, but it is an edge case, and may not be addressed.

@dpvc
Copy link
Member

dpvc commented Mar 11, 2022

There is a PR (linked above) that resolves the issue, and it should be in the next release.

@dpvc dpvc added this to the 3.2.1 milestone Mar 11, 2022
@rudolf-adamkovic
Copy link
Author

@dpvc Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.2
Projects
None yet
Development

No branches or pull requests

2 participants