2

This StackOverflow question shows how to put equations into the GitHub's markdown and the given solution is to use codecogs or iTex2Img.

I use a dark theme in my GitHub and I can't see the equations with the transparent background. I put a solid white background on the equations to make them visible for these with dark theme and white theme, but having many white boxes in the middle of the text is annoying.

The question is: Is there a way to change the equation's text color to match the user's theme? That is, put black text color when the user's background is white and put white text color when the user's background is black.

Carlos Adir
  • 452
  • 3
  • 9

2 Answers2

0

Here you are I've create you a simple gist what shows you how to achieve changing color of the math equations

https://gist.github.com/zozobalogh0817/c8985655b5f4864b0239bece23b2ffa5

But you simple just need to change a property in the original URL like

![equation](http://www.sciweavers.org/tex2img.php?eq=1%2Bsin%28mc%5E2%29&bc=White&fc=Black&im=jpg&fs=12&ff=arev&edit=)

This way the font color will be black

![equation](http://www.sciweavers.org/tex2img.php?eq=1%2Bsin%28mc%5E2%29&bc=White&fc=Green&im=jpg&fs=12&ff=arev&edit=)

This way it will be green

I'm just simply changing the fc=Black property in the URL!

Zoltán Balogh
  • 188
  • 2
  • 11
  • Thank you for the answer. Unfortunately, It changes the text color permanently just like changing the text color option in ```iTex2Img```'s site. – Carlos Adir Oct 30 '21 at 09:56
0

Since May 2022, GitHub's markdown accepts equations in LaTeX form by using $ symbol.

It solves the theme matching problem of this question.

Carlos Adir
  • 452
  • 3
  • 9