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

Improve spacing between accents and their bases, and handle under- and overlines more like TeX. #619

Merged
merged 9 commits into from
Mar 19, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Mar 10, 2021

This PR changes the character used for \overline and \underline to be U+2015 (HORIZTONAL LINE) and makes them both have accent="true" (only \overline had that originally) so that the results for both are consistent both in spacing and thickness. It also adds detection of these accents so that the spacing between the line and the base as well as the horizontal placements will match TeX's algorithm, and it adds a bit more space between math accents and the base (since on screen they were getting a bit tight).

This resolves issue mathjax/MathJax#2633.

@dpvc dpvc requested a review from zorkow March 10, 2021 20:52
@dpvc
Copy link
Member Author

dpvc commented Mar 10, 2021

PS, this PR replaces #611.

@pkra
Copy link
Contributor

pkra commented Mar 11, 2021

dpvc wants to merge 1 commit into tex-stretchy-accents from underline-overline

That seems odd since underline-overline's PR #611 was closed.

@pkra
Copy link
Contributor

pkra commented Mar 11, 2021

That seems odd since underline-overline's PR #611 was closed.

Oops, read this the wrong way around. Sorry for the noise.

// Check if the base is a mi or mo that needs italic correction removed
//
if (('noIC' in core) && !(this.constructor as CommonScriptbaseClass).useIC) {
if (this.baseIsChar && (this.isMathAccent || this.node.isKind('msubsup'))) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: This test isn't right, but is fixed in the mathaccent-ic branch.

Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

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

lgtm.

Fix handling of italic correction for munderover and msubsup combinations.
Base automatically changed from tex-stretchy-accents to develop March 19, 2021 18:12
@dpvc dpvc merged commit 7ad8d83 into develop Mar 19, 2021
@dpvc dpvc deleted the underline-overline branch March 19, 2021 18:12
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.

3 participants