I need to scale some math using tex4ht. I assume this will only work when compiling latex to HTML when telling tex4ht to use svg for math equations and not mathjax.
ps. (if math can scale using mathjax mode, then that would be even better, but when I tried the MWE below with make4ht and using mathjax mode, it also did not scale, I think this is because mathjax does not support these scaling commands).
But I am not able to get it to work. I tried \scalebox
and \resizebox
and \adjustbox
. None of them worked. But they all work in PDF with lualatex.
Am I doing something wrong, or is this just not supported in tex4ht? Here is MWE and the command and the .cfg I used
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{adjustbox}
\newcommand*{\mycell}{%
\begin{minipage}{\linewidth}
\begin{align*}y''+(y')^{2}+y' + y''+(y')^{2}+y'+y''+(y')^{2}+y' +y'' + (y')^{2}+y' + y''+(y')^{2}+y' + y''+(y')^{2}+y'+y''+(y')^{2}+y' +y''+(y')^{2}+y' &= 0
\end{align*}
\end{minipage}
}
\begin{document}
\mycell
\scalebox{0.3}{\mycell}
\resizebox{2in}{!}{\mycell}
\adjustbox{width=3in}{\mycell}
\end{document}
Now lualatex foo2.tex
gives
So it worked. Now compiled to HTML using
make4ht -ulm default -a debug -c svg.cfg foo2.tex "htm"
Where svg.cfg is small version of my old svg.cfg file I used to used before switching to mathjax for math, which I am not sure now it needs any changes or not.
\Preamble{ext=htm,charset="utf-8",p-width,pic-align}
\DeclareGraphicsExtensions{.svg,.png,.jpg}
\Configure{Picture}{.svg}
\Configure{VERSION}{}
\Configure{DOCTYPE}{\HCode{<!DOCTYPE html>\Hnewline}}
\Configure{HTML}{\HCode{<html>\Hnewline}}{\HCode{\Hnewline</html>}}
\Configure{@HEAD}{}
\Configure{@HEAD}{\HCode{<meta charset="utf-8"/>\Hnewline}}
\DeclareGraphicsExtensions{.svg,.png}
%need this below for MATH.
\Configure{Picture}{.svg}
\begin{document}
%add any custome \Css or HTML commands here as needed.
%These to tell tex4ht to make inline math images also
\Configure{$}{\PicMath}{\EndPicMath}{}
\Configure{PicMath}{}{}{}{class="math";align="absmiddle"}
The generated HTML shows the math as svg images, but all the math is same size. No scaling was done as when compiled to pdf.
Question is: Does tex4ht supports scaling of math equations, even if one is using images for math and not mathjax?
TL 2021 on Linux.