You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hides Katex (one of the most popular ways of displaying Latex on a webpage) square root symbols.
This is because Katex uses an svg to render the square root symbol, and the height: auto makes it invisible. One fix is to add this rule to custom.css:
/**This CSS fixes issue where \sqrt{} was not being rendered in Katex, due to a Starlight Css svg height rule*/
.katex-htmlsvg {
height: inherit;
}
Katex does not give you the ability to add the .not-content class to the parent equation containers, that would have been my first choice for a fix. Perhaps this selector can be modified in Starlight to avoid Katex?
I’m not sure if there’s a good out-of-the-box approach we can take. Both MathJax and Katex are custom features, so it feels wrong to add styles to handle them when many sites don’t use them. And on the other hand the existing styles are designed to make a simple ![](./diagram.svg) dropped in a Markdown file work as expected.
Going to close this for now as I don’t think it’s necessarily unreasonable to expect some custom markup solutions to also require some custom styles. Although happy to revisit if we have some further ideas about how to approach this.
I’ll also note that eventually styling will be even easier with #2322 removing the need for !important in style declarations.
What version of
starlight
are you using?0.28.3
What version of
astro
are you using?4.15.12
What package manager are you using?
npm
What operating system are you using?
Windows
What browser are you using?
Chrome
Describe the Bug
The Starlight CSS rule:
hides Katex (one of the most popular ways of displaying Latex on a webpage) square root symbols.
This is because Katex uses an
svg
to render the square root symbol, and theheight: auto
makes it invisible. One fix is to add this rule tocustom.css
:Katex does not give you the ability to add the
.not-content
class to the parent equation containers, that would have been my first choice for a fix. Perhaps this selector can be modified in Starlight to avoid Katex?Link to Minimal Reproducible Example
https://blog.mbedded.ninja/test/
Participation
The text was updated successfully, but these errors were encountered: