Dear Hans Georg, On Thu, Jan 7, 2016 at 11:08 AM, Hans Georg Schaathun <[email protected]> wrote: > Dear all, > > I have a number of externally created vector graphics objects > which I need to include in TeX document to be compiled with > tex4ht. The problem is that the resulting pixmap graphics (PNG) > has inadequate resolution. Does anyone have a working fix for this?
You can change the resolution with `graphics-<res>` option for
tex4ht.sty, so you can try
htlatex graphcis.tex "xhtml,2,mathml,graphics-144,charset=utf-8" "
-cmozhtf -utf8" \
"-cvalidate"
for example. But it changes only calculation of the dimensions in the
<img> element, you need also to change resolution of the png image
itself. You can change it in tex4ht.env, but easier is to use make4ht
build file. See graphcis.mk4, in particular line:
Make:image("png$",
"dvipng -bg Transparent -T tight -o ${output} -D 144 -pp ${page} ${source}")
dvipng is used for graphics conversion, -D option passes the
resolution. To translate your options to make4ht, call
make4ht -u graphcis.tex "xhtml,2,mathml,graphics-144" "" " -cvalidate"
>
> I would normally have an original file.pdf and a converted file.eps,
> both of which look like vector graphics, and then use:
> \usepackage{graphicx}
> \includegraphics{file}
> This works well with pdflatex, and except for the poor pixmap
> resolution, ok with htlatex.
>
> The preferred solution would be to use SVG vector graphics on the web
> page. Whether tex4ht does the PDF->SVG conversion or I do it separately
> matters little. I have tried to google, but all the hits seems to be
> concerned with generating SVG from tikz and maths, which is not
> quite the problem.
You can convert your images to svg using inkcape:
inkscape -z fplot.eps --export-plain-svg=fplot.svg
but you need to configure tex4ht to include svg images, see attached
file hej.cfg. You can change the value in `\emwidth` command to
influence the displayed image size.
Best regards,
Michal
graphics.mk4
Description: Binary data
hej.cfg
Description: Binary data
