[tex4ht] two figures in one row

Michal Hoftich michal.h21 at gmail.com
Wed Jan 27 14:46:05 CET 2021

Hello Tomáš,

>in the configuration file, which I adopted. Nevertheless, in some cases 
>the figures can't be automatically converted to SVG, so I made the 
>conversion to PNG manually and for such figures I use this code
>\includegraphics{fig_1.png} & \includegraphics{fig_2.png}
>It works rather well, but there are two issues:

It is not a good idea to have markup like this in your document. Instead 
of \ifpdf, I would use custom command that can be redefined in the .cfg 


And in the .cfg file, you can use

some code

This way you don't need to change code in your document when you find 
that something don't work well :)

>1. what is the best way to scale the figures for the HTML document? I 
>played with [scale=XX] option of includegraphics, but it does a bit 
>tricky and not always leading to expected results

Maybe try to create the .xbb files for png images:

$ ebb -x *.png

Without .xbb file, TeX4ht doesn't know dimensions of images, so scaling 
cannot work, I think.

>2. as some tables contain a lot of maths, I prefer to use pic-tabular 
>option. Nevertheless, it clashes with the figures within the tabular 
>environment. Is there any other way to achieve two PNG files to 
>display in one row? The above mentioned configuration command does not 
>seem to help in these cases....

I would output some HTML and CSS for the \twoimages command I introduces 
earlier. For example:


\Css{.twoimages img{width: 40\%; height:auto}}

Best regards,

More information about the tex4ht mailing list.