I'm using .css file to style my R Quarto reports to render using the font Aktiv Grotesk. However, when I insert an equation I'd like to use a different font because the square root symbol renders like this:
This is my Quarto file:
---
format:
html:
css: styles2.css
---
Tilt magnitude is calculated using $Mag = \sqrt{N^{2} + W^{2}}$.
This is my styles2.css
file:
p {
font-size: 11pt;
font-family: 'Aktiv Grotesk';
color:black
}
* {
font-family: 'Aktiv Grotesk', Times, serif ;
}
Is there a .css command that will allow me to style the equation font separately? If not, how can I achieve a textbook equation without changing the report font?
The relevant css
selectors which you could use are
span.math.inline
or, for excluding things, span:not(.math.inline)
,span.math.display
or, for excluding things, span:not(.math.display)
.In your example, we could disable the css
with the special font and set a separate color like this:
---
format:
html:
css: styles2.css
---
Tilt magnitude is calculated using $Mag = \sqrt{N^{2} + W^{2}}$.
p, span:not(.math.inline) {
font-size: 11pt;
font-family: 'Aktiv Grotesk';
color:black
}
span:not(.math.inline) {
font-family: 'Aktiv Grotesk', Times, serif ;
}
span.math.inline {
color: red;
}