michal-h21 / make4ht

Build system for tex4ht
141 stars 15 forks source link

How can I vertically align svg equations inline on html page inside a paragraph? #156

Open burakertr opened 1 week ago

burakertr commented 1 week ago

I use make4ht for generating svg equations to inject into my html page paragraphs but it is always vertically align bottom to bottom. I need to calculate and give a vertical padding to align it into paragraph. Is there any chance if library can help me on this?

sscb

Thanks in advance.

michal-h21 commented 1 week ago

Can you post a MWE for this? Anyway, you can try the "pic-m,svg" options, like this:

$ make4ht -f html5+dvisvgm_hashes -m draft filename.tex "pic-m,svg"

The pic-m option will make images for the whole contents of the inline math. It shoul also try to calculate the vertical alignment. svg option is needed for SVG images instead of PNG, which should look better. -f html5+dvisvgm_hashes will reuse images between compilations, which should be much faster.

Better output for math is MathML or MathJax though, as it will create much better looking output, and it is also better for the accessibility. Try these commands:

$ make4ht -m draft filename.tex "mathml,mathjax"

or

$ make4ht -m draft filename.tex "mathjax"