Closed aisejohan closed 5 years ago
I'm not sure that it works 100% with really wide equations, but then again, those get too much scrolling space anyway.
Beautiful! Dank je wel.
A particularly bad example is tag 00V1 because you can see how on the next line the text is indented for no reason... I tried changing the css in tag.css to bring it in line with the way thinks work in kerodon-website but that didn't work.
So the issue is that MathJax rendering happens after the browser decides to place things via the CSS stylesheet. As a result, the placement is correct when the page is first loaded, when MathJax has not finished working yet, but when the mathematics is rendered and displayed, math that is long in LaTeX but not long when compiled now takes much less room than before, and when the text is reflowed, for some reason, the span element corresponding to the equation label is does not move with it.
To see what I mean, in any of the examples, you can try inspecting the equation labels after the mathematics is rendered and then toggling the padding-top
property. That will snap the equation label into the expected place.
One possible fix would be to add a hook to the MathJax processor that adjusts the padding-top
property for #equation-label
only after it is done rendering mathematics.
OK, I edited the file tag.css
and now it looks better online. The diff of what is online now versus current git is attached here tag.css.txt
I think the following might be a good solution:
div.html div.equation {
display: flex;
align-items: center;
}
div.html div.equation span.equation-label {
float: left;
margin-right: 1rem;
}
I'll check some more cases now.
With
p + div.equation {
margin-top: -1rem;
}
added in the mix it seems to be fine. Shall I commit this, so that you can test this live?
Yes, please! Don't forget to push to github! Thanks very much to both of you!
Unfortunately this doesn't quite work as now the actual content of the equation is no longer centered horizontally.... Sigh!
Ah yes, good point! I left align my equations usually, so I didn't notice :).
It seems to be fine now, and it seems to work interact correctly with overflow etc. (but I didn't check every possible equation in the Stacks project).
OK, wonderful! An example where it now look great is this page. Thanks very much!
OK, I have made a change in gerby website in order to deal with some fallout from these changes to the vertical spacing around equations. See 0d311dc07988482794b3219e70ac5c6aeabf8e6d
It is not at the same height as the content of the equation. A good example is 0EM1.