Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix #301, make equation numbers appear on the right #1549

Open
wants to merge 4 commits 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.

Edit: this just comes directly from the Sphinx basic theme. It shouldn't take 7+ years to figure this out!

@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.

@SebastienGarciaAissa
Copy link

I also support the merging of this fix.

The equation numbering is the only bad feature I found in the rtd-theme. But if not fixed I will need to change for another theme, even if I think that this theme is perfect on all other points.

@eebasso eebasso changed the title Fix equation numbering Fix #301, make equation numbers appear on the right Jul 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants