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

Fix equation numbering #1549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eebasso
Copy link

@eebasso eebasso commented Jan 17, 2024

Modify the MathJax SASS file to have equation numbers appear to the right of displayed formulas. This resolves the long-standing issue #301 while still having the header links appear, which improves upon the solution given by #301 (comment) . These changes also avoid the use of any margin manipulations, which can lead to odd behavior when hovering vs not.

An unresolved issue is the vertical alignment of the equation numbers relative to the displayed formulas. This PR leads to an upper alignment, but a middle alignment seems preferable to most users. Hopefully, PR #383 can follow up on this and resolve the vertical alignment problem.

Regardless, I think these changes are a strict improvement over the status-quo.

@eebasso eebasso requested a review from a team as a code owner January 17, 2024 04:02
@eebasso
Copy link
Author

eebasso commented Jan 17, 2024

I did find one way to obtain the vertical alignment of the equation numbers using a Y translation trick of

span.eqno
  float: right
  position: relative
  transform: translateY(50%)

  .headerlink
    position: relative
    z-index: 1

but this lead to the header links disappearing and the equation numbers overlapping the formulas for sufficiently narrow viewing windows. Therefore, I decided against adding this to the PR.

@eebasso
Copy link
Author

eebasso commented Jan 17, 2024

Example from the documentation showing the header link. Note that equation formula remains completely unmoved even when hovering over it:
no-hover
with-hover

Another example with a more narrow window width:
narrow-no-hover
narrow-with-hover

@wandadars
Copy link

Please let them merge this. The equation numbering default is just comically bad at this point.

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.

None yet

2 participants