goessner / markdown-it-texmath

Support TeX math equations with your Markdown documents.
MIT License
161 stars 29 forks source link

It doesn't work when '$...$' is nested inside '$$...$$' #46

Open dreampasssser opened 1 year ago

dreampasssser commented 1 year ago

I find this usage at KaTeX website

屏幕截图 2023-01-18 153459

When I use \colorbox{aqua}{$F=ma$} or \fcolorbox{red}{aqua}{$F=ma$} , it also works in vscode, but it looks bad in browser. like this

屏幕截图 2023-01-18 154801

goessner commented 1 year ago

Hmm ... $\fcolorbox{blue}{red}{F=ma}$

works for me in VSCode grafik

and in Browser grafik

... no nesting of $'s supported ...

dreampasssser commented 1 year ago

Emm... I know what you mean. But it is different between $ nested and not. It is just only text if you don't use $ , and it doesn't support these symbols \sum $\sum$ , \prod $\prod$ . For example, if I want to add a colored background to this formulae

屏幕截图 2023-01-18 174822

I will fail.

goessner commented 1 year ago

Hmm ... you are right. According to these and these comments inherent problems with $ environment become more clear.

I'm not sure, how to deal with that inside of markdown-it-texmath. It will take some time.

dreampasssser commented 1 year ago

Well, that's all right.