I'm converting a document to html (or possibly xhtml) using htlatex. I find that the output is ok, but the equations are too small. I have tried making them bigger by adding the following to my configuration file:


This successfully makes math bigger, but for both equaton environments and inline math expressions, which therefore no longer look good with the text. How can I make only non-inline math bigger in the output from htlatex?

I also prefer this to be done using a method easily portable and not requiring local configuration changes to my tex installation, as I move from computer to computer and also expect multiple people to work on the document.

  • I think you are going about this the wrong way. A much better way to do all of this, is to use mathml and not default images for math, and then use mathjax to render the math. See this mathjax.org/demos/scaling-math about how mathjax scales math. What this means is that you do not need to use \DeclareMathSize at all. Just configure tex4ht to use mathml and mathjax will be a better solution than having to deal with sizing math images.
    – Nasser
    Feb 1 '14 at 7:46

This approach does not give arbitrary control over the size of display math, but allows it to be set larger, based on the built-in LaTeX size macros, such as \Huge. The good news is that it should be portable.

This is a $w = xyz_1$ inline test
w = xyz_1
and now without the equation environment
w = xyz_1

enter image description here

  • This worked thanks, for others info, I put it in my tex4ht configuration file between \Preamble{xhtml} and \begin{document}
    – crobar
    Feb 10 '14 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.