[tex4ht] Question on using .cfg and \DeclareGraphicsExtensions

Michal Hoftich michal.h21 at gmail.com
Wed Oct 10 21:15:25 CEST 2018

Hi Nasser,

> The use of \DeclareGraphicsExtensions{.svg,.png} is needed
> to allow the code below it to work.
> The above works well, as long as I make sure to
> add
> \usepackage{graphicx}
> in each Latex file which is being compiled by make4ht,
> otherwise will get an error

you can use \@ifpackageloaded{graphicx} for test of its presence. The
full configuration file is bellow:



%this below to make it resize the SVG image, if it is there, to
%what is in the includegraphics.
%thanks to @Michal.h21 for this trick
\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}
        TeX: {
  MAXBUFFER: 40*1024,
  Macros : {
relax: "{}",
setlength: ["{}", 2],
allowbreak: "{}",

\regex_replace_all:nnN{ \x{23}\x{23}}{\x{23}}{\mymathjaxconf}

type="text/x-mathjax-config"> \mymathjaxconf</script>}}


Best regards,

More information about the tex4ht mailing list