Skip to content

Avoid negative space in \bmod.#984

Merged
edemaine merged 3 commits intoKaTeX:masterfrom
edemaine:bmod
Nov 27, 2017
Merged

Avoid negative space in \bmod.#984
edemaine merged 3 commits intoKaTeX:masterfrom
edemaine:bmod

Conversation

@edemaine
Copy link
Member

This is a workaround for #836 for the command case of using \bmod, without changing any spacing (and making the code and generated output slightly more efficient). In particular, fixes #982.

This is a workaround for KaTeX#836 for the command case of using \bmod,
without changing any spacing (and making the code and generated output
slightly more efficient).  In particular, fixes KaTeX#982.
@k4b7
Copy link
Member

k4b7 commented Nov 24, 2017

Looks like the mod screenshots need to be regenerated.

Copy link
Member

@k4b7 k4b7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

// “\nonscript\mskip-\medmuskip\mkern5mu”
// “\nonscript\mskip-\medmuskip\mkern5mu”, where \medmuskip is
// 4mu plus 2mu minus 1mu, translates to 1mu space in
// display/textstyle and 5mu space in script/scriptscriptstyle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a bit to grok what's going on, but it makes sense.

@edemaine
Copy link
Member Author

edemaine commented Nov 24, 2017

Hmm, seems there's more investigation to do. Here's the diff between old and new screenshots (green is new):

mod-firefox-diff

More clear is to look at the texdiff. Before this PR is near-perfect in the top left:

mod-old

After this PR is worse:

mod-new

Not sure why. Maybe adding kerns is not equivalent...

@edemaine
Copy link
Member Author

Turns out I just failed to properly add the muspace CSS rule. (Alternatively, we could add 1mu as a manual style value instead of using a CSS rule.) I believe the Mod screenshots are now unaffected; this will be confirmed once Travis finishes.

Copy link
Member

@k4b7 k4b7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@edemaine edemaine merged commit f6a377b into KaTeX:master Nov 27, 2017
edemaine added a commit to edemaine/KaTeX that referenced this pull request Mar 3, 2018
Fix KaTeX#984

The screenshot test is still somewhat defective, showing a space before
the "post" text (a period).  This seems limited to the screenshotter, however,
as it works fine in the tester via
http://localhost:7936/?text=%5Cfbox%7B%5C%241%2C%5C!000%2C%5C!000%7D%5CKaTeX&display=0&after=.
edemaine added a commit to edemaine/KaTeX that referenced this pull request Mar 6, 2018
Fix KaTeX#984

The screenshot test is still somewhat defective, showing a space before
the "post" text (a period).  This seems limited to the screenshotter, however,
as it works fine in the tester via
http://localhost:7936/?text=%5Cfbox%7B%5C%241%2C%5C!000%2C%5C!000%7D%5CKaTeX&display=0&after=.
k4b7 pushed a commit that referenced this pull request Mar 9, 2018
* Work around negative space bug in Chrome

Fix #984

The screenshot test is still somewhat defective, showing a space before
the "post" text (a period).  This seems limited to the screenshotter, however,
as it works fine in the tester via
http://localhost:7936/?text=%5Cfbox%7B%5C%241%2C%5C!000%2C%5C!000%7D%5CKaTeX&display=0&after=.

* Update screenshots

* Switch to inherited `width: min-content`
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

Successfully merging this pull request may close these issues.

\bmod in inline math mode adds extra following space

2 participants