goessner / markdown-it-texmath

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

Whitespace disapears after render for inline math #25

Closed dinhanhthi closed 3 years ago

dinhanhthi commented 3 years ago

I've used the default settings. After rendering, aaa $x$ aaa should become aaa x aaa. However, it becomes aaaxaaa. For a temporary solution, I added a css eq{margin: 0 5px;} but it's not good! Any idea about this problem?

dinhanhthi commented 3 years ago

I think I see the problem. It comes from <eq> tag you use for inline math. I've changed it to <span class="eq"> instead and everything works fine. Please consider to check again.

grtlr commented 3 years ago

I'm experiencing the same problem.

@dinhanhthi Where did you change this?

dinhanhthi commented 3 years ago

@grtlr I downloaded + modified + used it locally (i.e. inside my 11ty website). You can check the tut here. In short, I changed <eq> tags to <span> tags and all eq css to .eq css.

grtlr commented 3 years ago

That’s great, thank you!

goessner commented 3 years ago

I am not able to reproduce with version 0.9 ...

thanks

dinhanhthi commented 3 years ago

@goessner I don't use 0.9, I keep using 0.8 and it works fine. What's your exact problem? And why you wanna use version 0.9?

goessner commented 3 years ago

In fact I couldn't verify your issue with version 0.8 either. If it works fine for you, you might go on using it. With version 0.9 there are only some few issues fixed / enhancements added. See Changelog.

thanks

dinhanhthi commented 3 years ago

@goessner I'm sorry, I don't recognize you (the author), I got you as another persone who uses this plugin. Thanks for your suggestion. If there are problems with 0.8, I will try with 0.9.

marcinwrochna commented 2 years ago

I had the same issue. Turns out it's not related to markdown-it-texmath, but posting here in case someone had the same. it's actually a html-minifier that removed the whitespace, probably not recognising the custom <eq> and <eqn> tags that katex produces. I had to disable collapse_whitespace in kangax's html-minifier that I used.

goessner commented 2 years ago

good catch ... thanks a lot.