fix(math): add KaTeX CDN and fallback for radical SVG overflow

KaTeX renders square roots using a 400em-wide SVG that relies on CSS
`overflow: hidden` to clip to the correct length. Without the KaTeX
stylesheet, this SVG extends across the entire page.

Changes:
- Add KaTeX CDN stylesheet link to base.html for fonts and layout
- Add .katex-display local margin/overflow overrides
- Add .hide-tail svg max-width fallback for file:// CORS blocking

The CDN provides full KaTeX styling when accessible. The SVG constraint
serves as a fallback when CDN is blocked (e.g., local file:// access).
This commit is contained in:
Timothy DeHerrera
2026-01-31 18:06:27 -07:00
parent 013786faa6
commit 1dd91a407b
2 changed files with 12 additions and 0 deletions

11
docs/static/style.css vendored
View File

@@ -127,6 +127,17 @@ a:hover {
color: var(--accent-hover);
}
/* KaTeX display math - local overrides */
.katex-display {
margin: 1rem 0;
overflow-x: auto;
}
/* Fallback: constrain radical SVG when CDN blocked */
.hide-tail svg {
max-width: 100% !important;
}
/* Code */
code {
font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;