Anki Latex Issue with Differing Front and Back Background Colors

I use Latex instead of Mathjax because I use an add-on to export Anki cards to html, which does not support Mathjax unfortunately. Please don’t suggest I switch to Mathjax.

My front and back templates have different colors which require different font colors (see pic).

For the latex output, I have the svg option in Anki checked.

The Latex output works well on the front template (white latex text on mint background), but also displays as white latex on the white background.

How can I have the latex output color adjust based on my front/ back background color?

See pic (look closely and you see the white on white latex in the back side):

You can disable the default night mode inversion by wrapping a field in a div, and adding the following to your styling:

<div class=noinvert>{{Back}}</div>
.noinvert .latex { filter: invert(0); }
1 Like

Exactly the solution I needed! Thank you so much you don’t know how much this helps me!!!