-
Notifications
You must be signed in to change notification settings - Fork 1.8k
CSS: Restrict center-alignment to nested <p> in "math" class #686
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
base: master
Are you sure you want to change the base?
Conversation
What is the unintended consequence in the link you provided? That the formula is left-aligned rather than centered? |
@jessetan Sorry, I should have clarified that, it's not obvious ... The example uses an extension that uses additional CSS to left-align class It's about the third output with mixed text and math. This should be left-aligned instead of centered. |
Math is centered everywhere in this theme. Do you feel that left aligning math is always better than centering? Or are you more bothered by the inconsistent look in your output? |
No, that's not what I'm saying. I'm just suggesting that the RTD theme should do the same as the default Sphinx themes and all 3rd party themes. Display math will still be centered, as it was intended. I'm sorry about my example above, it's really not obvious, but you shouldn't worry too much about it. Just forget it. The point is: The default themes and all 3rd party themes are using this CSS, so there is no reason not to do the same. There is really no downside, so what are you worried about? |
@jessetan Do you still have doubts? Can this please be merged? |
In the current state of the theme, this left-aligns the equation label instead of centering it for display math. |
@jessetan OK, I see. This is because right now the math CSS is completely broken, and I agree that it is important to fix #383 ASAP. Once it is fixed, my suggestion here will also work. I've left a comment over there (#383 (review)), probably everything can be fixed in one go. |
I like the suggestion to simply include this in the work combined effort in #383 |
This is how the built-in Sphinx themes do it:
https://github.com/sphinx-doc/sphinx/blob/eb44c73b81ff4e603d9452018d145ff3c204f71f/sphinx/themes/basic/static/basic.css_t#L642-L644
I hope this is actually correct SASS ...
In case you are wondering, one example where the unrestricted centering of the
math
class has unintended consequences is here: https://nbsphinx.readthedocs.io/en/latest/code-cells.html#Math.