[tex4ht] two figures in one row

Tomas Davidek Tomas.Davidek at cern.ch
Wed Jan 27 11:47:47 CET 2021


I've found a relatively easy solution - manually rescale the png images 
so that they fit into one row. Of course it also depends on the width of 
the browser window, but this won't be a problem.

The scale parameter works well for EPS files. Scaling down the PNG 
images results in very small pictures, that's why the manual rescaling 
should be done. It is also better since it lowers the amount of 
transferred data, I guess.

Cheers,

                    Tomas

On 1/26/21 2:16 PM, Tomas Davidek wrote:
> Hello,
>
>    I am still investigating how to place two figures in one row in the 
> resulting HTML. Originally, my LaTeX code looked like
>
> \begin{figure}
>
> \centering
>
> \includegraphics[width=0.49\linewidth]{fig_1.eps} 
> \includegraphics[width=0.49\linewidth]{fig_2.eps}
>
> \end{figure}
>
> For the processing with make4ht, Michal Hoftich suggested the use
>
> \Css{figure.figure img { display: inline; }}
>
> 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
>
> \begin{figure}
>
> \centering
>
> \ifpdf
>
> \includegraphics[width=0.49\linewidth]{fig_1.eps} 
> \includegraphics[width=0.49\linewidth]{fig_2.eps}
>
> \else
>
> \begin{tabular}{cc}
>
> \includegraphics{fig_1.png} & \includegraphics{fig_2.png}
>
> \end{tabular}
>
> \fi
>
> \end{figure}
>
> It works rather well, but there are two issues:
>
> 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
>
> 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....
>
> Thanks a lot for any hint,
>
> best regards,
>
>                          Tomas
>


More information about the tex4ht mailing list.