Skip to content

Commit d08e916

Browse files
authored
fix(docs): suppress spurious vertical scrollbar on equations (#1162)
MathJax v4 (Sphinx 9) display equations can inherit overflow handling from pydata-sphinx-theme that introduces a spurious vertical scrollbar. Match the theme selector, preserve horizontal scrolling for wide equations, and suppress vertical overflow. Signed-off-by: Joao Morais <jmoraispk@gmail.com>
1 parent 04ddb93 commit d08e916

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

doc/source/_static/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ div.citation > p.cite-backrefs {
109109
margin-bottom: 0.3em !important;
110110
}
111111

112+
/* MathJax v4 (Sphinx 9): the pydata theme sets `overflow: auto` on
113+
`div.math mjx-container`, which adds a spurious vertical scrollbar to every
114+
display equation. Match that selector to keep horizontal scroll for wide
115+
equations while suppressing the vertical scrollbar. */
116+
div.math mjx-container {
117+
overflow-x: auto;
118+
overflow-y: hidden;
119+
}
120+
112121
/* Rubric headings (Note, Example, Attributes, Methods, etc.): line below, consistent style */
113122
p.rubric {
114123
border-bottom: 1px solid var(--pst-color-border);

0 commit comments

Comments
 (0)