set styling using CSS & HTML? #3409
-
I've noticed that inline math will inherit some styling from its parent HTML element, e.g.,
however, other styling elements, notably the font-weight, are not inherited. Is this configurable behaviour? N.B. I'm not a programmer -- I'm the main content creator on a very small project, where our dev team is swamped, so I just offered to start looking into the this issue, to save them a bit of work 😃 We'd like to set things up so that math included in |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I think the short answer is "no, it's not configurable". I've wanted bold inheritance in my own projects too, and what I do in that case is optionally wrap the relevant math in If you're using renderMathInElement(document.body, {
ignoredTags: ["script", "noscript", "style", "textarea", "pre", "code", "option", "h1"] // added h1 to the default list
});
document.querySelectorAll('h1').forEach((header) => {
renderMathInElement(document.body, {
preProcess: (math) => `\\boldsymbol{${math}}`
});
}); |
Beta Was this translation helpful? Give feedback.
-
We were able to get this working on our setup by setting |
Beta Was this translation helpful? Give feedback.
We were able to get this working on our setup by setting
font-weight: inherit
in our local CSS.katex
class.