In my MWE I specify the image rendering to be width=\textwidth. I generate the epub/html with tex4ebook main.tex. The generated html for the image sets width=289 and height=289 (even tho I didn't specify a height) which doesn't render well on some eReaders. If I edit the html and delete the height and specify width='100%' it renders perfectly on the couple eReaders I tested on.
Is there a reason width shouldn't be a percentage? If not, is there a way to tell tex4ebook to render at 100% (or any percentage)?
\documentclass[ebook]{memoir}
\usepackage{graphicx}
\graphicspath{ {images/ebook} }
\begin{document}
Here's a png:\
\includegraphics[width=\textwidth]{chapter_ornament.png}
\end{document}
Here's the generated html with width and height set to 289 (instead of 100%)
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns='http://www.w3.org/1999/xhtml'>
<head><title></title>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='generator' />
<meta content='TeX4ht (https://tug.org/tex4ht/)' name='originator' />
<!-- xhtml,charset=utf-8,epub,uni-html4,html -->
<meta content='main.tex' name='src' />
<link href='main.css' rel='stylesheet' type='text/css' />
</head><body>
<!-- l. 6 --><p class='noindent'>Here’s a png:<br class='newline' /><img alt='PIC' height='289' src='./images/ebook/chapter_ornament.jpg' width='289' />
</p>
</body></html>
\Configure{Gin-percent}to mytex4ebook.cfgand rantex4ebook -l -c tex4ebook.cfg main.texand my\includegraphics[width=\textwidth]{chapter_ornament.png}line still generates a width and height of 289. I'm running TeX Live 2023 and my packages are update to date. – buttonsrtoys Apr 22 '23 at 12:20\Configure{Gin-perecent}, but\Preamble{xhtml,Gin-percent}. Or use the config file itself, because I found thatGin-percentmay not work as you would expect (it usesmax-widthinstead ofwidthCSS property). – michal.h21 Apr 22 '23 at 16:18