I have found this question very helpful in my configuration of images. Inspired by tex4ht's capabilities (it's so much more powerful than I thought!) I'm wondering if I could have image width configured in em units instead of pt units.
Here are examples of my tex and cfg files:
mwe.tex:
\documentclass{article}
\usepackage[]{graphicx}
\usepackage[]{amsmath}
\begin{document}
EPS file (0.3 textwidth)
\begin{center}
\includegraphics[width=0.3\textwidth]{plot.eps}
\end{center}
PNG file: (0.5 textwidth)
\begin{center}
\includegraphics[width=0.5\textwidth]{plot.png}
\end{center}
\end{document}
my_mwe.cfg:
\Preamble{html}
\Configure{graphics*}
{eps}
{%
\Picture[pict]{\csname Gin@base\endcsname\PictExt
\space width="\the\dimexpr \expandafter\the\csname Gin@req@width\endcsname *3/2"
}%
}
\Configure{graphics*}
{png}
{%
\Picture[pict]{\csname Gin@base\endcsname .png
\space width="\the\dimexpr \expandafter\the\csname Gin@req@width\endcsname *3/2"
}%
}
\begin{document}
\EndPreamble
Running
htlatex mwe.tex "my_mwe.cfg"
produces images with widths of 155pt and 258pt, respectively, which look great in my pc browser but not a tablet or phone browser: I'd much rather have the width in em units or percentage. (As a follow up to a comment on the linked question, I found that "...\endcsname *1.5" did not work, but "...\endcsname *3/2" does.)
Being originally drawn to tex4ht in order to produce both html and pdf documents, I'd like to be able to take advantage of the responsiveness of html.
Is there hope that this is configurable? Thanks.
