readthedocs / sphinx_rtd_theme

Sphinx theme from Read the Docs
https://sphinx-rtd-theme.readthedocs.io/
MIT License
4.81k stars 1.74k forks source link

equation number is not aligned to right #301

Open tk0miya opened 8 years ago

tk0miya commented 8 years ago

In sphinx default, the equation number is aligned right. but this theme does not do that.

in sphinx/themes/basic/static/basic.css_t, the element is styled as following:

span.eqno {
    float: right;
}
partofthething commented 7 years ago

Anything I can do to help get this fix (https://github.com/rtfd/sphinx_rtd_theme/pull/383) merged? Very willing to help.

rdzman commented 2 years ago

New user here fighting with the same bug, apparently still in 1.0.0. Any suggested workaround, as it seems there has been no action on #383 in years?

My best solution so far is to just add an additional CSS file via html_css_files with ...

.eqno {
    float: right;
}

This makes the header link invisible, but at least it looks better.

Any better workarounds appreciated.

romintomasetti commented 1 year ago

Hi there! We too are affected by this bug. The label of each equation is put on top of the equation instead of "to its right".

We therefore resort to the fix proposed by @rdzman in https://github.com/readthedocs/sphinx_rtd_theme/issues/301#issuecomment-1205755904.

A fix in the theme itself would be more than appreciated :smile:

eebasso commented 10 months ago

After some testing, I've found that the following addition to one's .css file aligns the equation number to the right and makes the header link appear:

span.eqno {
    float: right;
}
span.eqno a.headerlink {
    position: relative;
    z-index: 1;
}

I think this would be straight-forward to implement in the _theme_mathjax.sass as shown in PR #383. It would be really great if this could finally be resolved after 7+ years.

Edit: this just comes directly from the Sphinx basic theme.