Files
hexo-theme-butterfly/source/css
T
LoveApple f5a043e38e fix(mathjax): keep MathJax 4 inline formulas on one line
MathJax 4 emits an inline formula as several <svg> chunks separated by
<mjx-break> elements. The theme renders every non-display container as
`display: inline-grid`, which turns each chunk into a grid item, so the
chunks are stacked into 2-4 rows instead of flowing inline.

Neither column flow nor flex keeps the MathJax layout: grid/flex ignore the
per-chunk `vertical-align` (all chunks get top-aligned) and drop the space
provided by <mjx-break>; `inline-block` would turn the scroll container's
baseline into the bottom margin edge and inflate the line box.

Keep the container inline -- the only layout that preserves chunk spacing,
per-chunk vertical-align and the text baseline -- and use `white-space:
nowrap` so MathJax's own inline line breaking cannot split it. Horizontal
scrolling moves to the enclosing paragraph/list item, which only becomes a
scroll container when it actually holds an inline formula, so overlong
formulas scroll instead of widening the page. MathJax 3 output (a single
<svg>) and display math are unaffected.

Verified with the real theme CSS + hexo-filter-mathjax 0.11.1 output in
headless Edge at 1280/430 px, against MathJax 3.2.2 as a regression check.
f5a043e38e · 2026-11-10 22:52:35 +08:00
History
..
2026-08-04 22:52:53 +08:00
2026-08-04 22:52:53 +08:00
2025-09-09 15:40:08 +08:00
2025-02-16 20:38:17 +08:00
2025-02-16 20:38:17 +08:00
2025-08-19 14:49:39 +08:00