[tex4ht] tex4ht does not resize SVG image when using width=\columnwidth in mutlicolumn environment

Nasser M. Abbasi nma at 12000.org
Wed Feb 3 11:53:12 CET 2016

I use make4ht and use SVG for images. This works well, and I can use

\includegraphics[width=\textwidth]{p1} or
\includegraphics[width=\paperwidth]{p1} or
\includegraphics[width=0.6\textwidth]{p1} etc... and it will adjust
image size correctly. I am using some magic configuration
code in my .cfg file by Michal to do this.

But for some reason, \includegraphics[width=\columnwidth]{p1}
did not scale the image to the columnwidth. pdflatex
and lualatex do.

I can easily workaround this for now, by using


when using 2 columns, or


when using 3 columns and so on. But it will be better if tex4ht
did it automatically like with \textwidth and \paperwidth.

Here is a MWE. I put the needed code from the .cfg inside the
latex file, so it is self contained and everything in one file:



\ifx\HCode\undefined \else
\newcommand\CalcRem[1]{\strip at pt\dimexpr(#1)/\emwidth}
   {\Picture[pict]{\csname Gin at base\endcsname.svg
   \space style="width:\CalcRem{\Gin at req@width}em;"
   \special{t4ht+ at File: \csname Gin at base\endcsname.svg}









Compiled with

make4ht --lua -u foo.tex "htm"

Here is screen shot of the result in HTML


And this is in pdf


The image p1.svg and p1.pdf used in the above MWE, are in this zip file


Using TL 2015 on linux. Is it possible to make tex4ht adjust image
to columnwidth automatically also?


More information about the tex4ht mailing list