mbarkhau / markdown-katex

Adds KaTeX support for Python Markdown
MIT License
16 stars 10 forks source link

Rendering of square root in weasy print #5

Closed julianstirling closed 3 years ago

julianstirling commented 3 years ago

Hi,

I am having problems with square roots, even when I try to follow the instructions in the README. I am just running the test formula

f = \sqrt{\frac{2}{3}}

In the browser the square root only appears if I don't set 'no_inline_svg': True,. In WeasyPrint the square root does not appear for no_inline_svg being True or False.

Details

OS
Kubuntu 20.04

Python
Python 3.7.10

Packages

WeasyPrint==52.5
Markdown==3.3.2
markdown-katex==202105.1031

Edited to add

It seems that the issue is my CSS. Specifically object-fit being set to contain. It would be good to not have to add classes to every other image as this ruins the simplicity of markdown. The fix I can do in the browser is to change the katex css to

.katex img {
    object-fit: fill;
    padding: unset;
}

I will open an MR adding these to the inline CSS.

julianstirling commented 3 years ago

It can be fixed in my css too...

mbarkhau commented 3 years ago

Is it possible to do this in markdown-katex?

The option 'insert_fonts_css': True injects inline css into the html output (I guess the naming is not ideal). Is the idea here to use different/custom css?

mbarkhau commented 3 years ago

Fixed by #7