I have taken to adding a <style> .katex { font-size: 1.08em; }</style> to the top cell of notebooks, because otherwise the math font is dramatically and distractingly bigger than the text font. Unfortunately this seems to cause the cells to go out of alignment, which gets progressively worse going down a long page.
Here’s a screenshot of the notebook I have been working on today, which shows the issue I am talking about:
Changing the style of the page from one cell - changing the code size from one cell that affects all the rest, means that cell ‘C’ changes, but cells ‘A’ and ‘B’ change height
There is, thankfully, a browser API for detecting height changes like this: ResizeObserver. We use it to catch this case and correctly resize cells when they change height indirectly - essentially when other elements affect their height.
Unfortunately, ResizeObserver isn’t supported in Safari, so that’s what you’re seeing - changing the style node doesn’t correctly update the other cells in Safari.
And more unfortunately, this usually isn’t an issue when notebooks are loaded fresh, only when they’re edited, but I’m seeing misalignment even on refresh of your notebook. I’ll dig around and see if there’s any way to fix this issue without needing to polyfill ResizeObserver.
Seems like this made my page-specific CSS stop working? Now all the math fonts are too big for my taste on my pages.
(I find 1.1em still looks noticeably bigger than the text font; I found 1.08em to look best to my taste, but it might depend a bit on browser etc. Personally I want the block font to also be the same size, but I can see where you are coming from.)
Edit: seems like you folks are using more specific CSS selectors. I updated mine.