MathML equation styling for PDF exports

I ended up with class-based scaling for mathjax images that made the in-line equations appear more similar to the surrounding text and out-of-line equations appear a bit larger in the PDF exports. Here’s the CSS that eventually got me there:

/* set the scale for all mathjax elements to 80% */
img.mathjax {
transform-origin: center center;
transform: scale(0.8);
margin-top: -1%;
margin-bottom: -1%;
margin-left: -0.5%;
margin-right: -0.5%;
}

/* set the scale for equation blocks to 120% */
.equation-block img.mathjax {
transform-origin: center center;
transform: scale(1.2);
margin-top: 1%;
margin-bottom: 1%;
margin-left: 1%;
margin-right: 1%;
}

Thanks goes to Mich for the help!

1 Like