1

My codes are follows:

\documentclass{book}
\usepackage{amsmath}

\begin{document}

This is for test $a+b=c$
\begin{align}
\sum+\prod=\int
\end{align}

\end{document}

I need to convert the inline math into standard HTML+Unicode format (which comes correctly), but all the display math should convert into SVG format, generally, I'm using the below command to convert from TeX to HTML:

htlatex filename "xhtml" " -cunihft" " -cvalidate -p"

Please advise

2
  • Since MathML support has recently (finally) been added to Chromium, it is available in all major web browsers. So is using SVG for math on the web really relevant anymore?
    – Gaussler
    Commented Jan 19, 2023 at 15:36
  • @Gaussler This is an intention request
    – MadyYuvi
    Commented Jan 19, 2023 at 16:07

1 Answer 1

1

You can request conversion to SVG pictures using the svg option. You need also some additional options to request align and other environments to pictures, see pic-align and following options in the documentation.

There is also issue with your command. One issue is that htlatex is deprecated, you should use make4ht instead. The other issue is the -p option that you use in your last argument. It blocks conversion of pictures, so no picture will be created even if you use correct options.

So the correct command is something like:

$ make4ht -m draft -a debug  filename.tex "xhtml,svg,pic-align"

The -m draft option is used for faster conversion, -a debug will print full LaTeX output and other info, if you are interested in that.

This is the result:

enter image description here

16
  • This works well, just for a clarification, is this any possibility to do this conversion by using htlatex?
    – MadyYuvi
    Commented Jan 19, 2023 at 16:08
  • 1
    @MadyYuvi yes, something like htlatex filename.tex "xhtml,svg,pic-align" should work.
    – michal.h21
    Commented Jan 19, 2023 at 16:31
  • It's working fine, how can include the option -m draft in htlatex? Please advise
    – MadyYuvi
    Commented Jan 20, 2023 at 11:13
  • 1
    @MadyYuvi htlatex doesn't support the draft mode and other features.
    – michal.h21
    Commented Jan 20, 2023 at 14:09
  • Much thanks for the confirmation, it's really helpful a lot
    – MadyYuvi
    Commented Jan 20, 2023 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .