Equations in colored box with light/dark mode #2553
willymcallister
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
Glad you got it working! Something like the following should also work with your setup (instead of using the $\htmlClass{colorbox}{\boxed{v_{tot} = (\text V_0 - \text V_\text S)\,e^{-t/\text{RC}} + \text V_\text S}}$ |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I posted this question in #2531.
"With \colorbox the color specification appears to be hard coded. The allowable arguments are #hexcodes and standard HTML color names. Can you think of a way to make the color responsive to dark/light mode?"
@edemaine made this suggestion,
... \htmlClass is probably what you're looking for. See https://katex.org/docs/supported.html#html
\htmlClass
seemed over my head. I worked out a different way, using a new class in main.scss,The background color, --box-color, is sensitive to dark/light mode, as defined at the top of the same main.scss file,
And the last step is to reference the new class by appending
{: .colorbox :}
on the line after the equation in a markdown file,The result,
Beta Was this translation helpful? Give feedback.
All reactions