How to limit mathjax to window width?

Especially on mobile, mathjax equations on my cards overflow beyond the screen width. I am looking for a solution that scales down the equation so that it fits the screen width.

I tried this:

mjx-container { font-size: 4vw !important ; }

However, there are a few problems with this.

  • It applies to both block and inline mathjax. I want something that applies to block mathjax only.
  • It doesn’t scale according to the length of the equation.
  • On large screens (desktop), the font size becomes very large.

An old related request: MathJax Long Equation Scaling

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.