3

I am using MiKTeX 2.9.

I would like to convert a LaTeX file to HTML.

I have seen here (http://access2science.com/latex/tutorial_txht.xhtml#x1-50001.2) that I can use the mzlatex command to convert this way but I get the following error:

mzlatex is not recognized as an internal or external command operable program or batch file

It is mentioned in the above link (http://access2science.com/latex/tutorial_txht.xhtml#x1-50001.2) that MiKTeX 2.9 has some problem and so I have to install version 2.8 but I do not see MiKTeX 2.8 giving following message:

MiKTeX 2.8 has been released in September 2009.This version has reached the "end-of-life" status. It will not be possible to install packages from the remote package repository.The current release is 2.9.

(http://miktex.org/2.8/status)

I am not sure What I am supposed to do now.

I tried but it is giving following error:

enter image description here

  • 1
    Does http://tex.stackexchange.com/q/60230/15925 help? – Andrew Swann Mar 11 '14 at 08:05
  • as @AndrewSwann said, mzlatex is not standalone script, you can use mk4ht mzlatex – michal.h21 Mar 11 '14 at 09:36
  • @AndrewSwann : I tried mk4ht mzlatex... but it is saying undefined control sequence... :O please have a look at my edit –  Mar 11 '14 at 10:43
  • @AndrewSwann : please have a look at http://tex.stackexchange.com/questions/164670/convert-tex-file-to-html-in-miktex this question too –  Mar 11 '14 at 10:44
  • According to your screenshot you have written the command in the wrong order, it is asking for mk4ht mzlatex yourtexfile as michal.h21 said. – Andrew Swann Mar 11 '14 at 10:59
  • @AndrewSwann : Oh yes yes... I have tried as you suggested but it is saying undefined control sequence :O –  Mar 11 '14 at 11:41
  • I am not a windows user but your file name contains special tex characters, so you probably need to quote the whole name "E:\file_name" – Andrew Swann Mar 11 '14 at 11:54
  • @AndrewSwann : I do not understand the point :O I am trying all combinations but nothing is working :( –  Mar 11 '14 at 12:01
  • The point is that tex regards _ as a special math character. The output you have now posted shows that this character in the filename is the problem. I suggested you change the name of your file so it contains only ordinary letters. – Andrew Swann Mar 11 '14 at 12:07
  • @AndrewSwann : I have changed the file name and end up with same problem... I have my miktex file in C drive and my tex files in E drive... would that be a problem? I have moved the files to C drive even then i am getting same messgae –  Mar 11 '14 at 12:19
  • You still need to either cd to the directory where your tex file is or quote the whole name... – Andrew Swann Mar 11 '14 at 13:33
  • @AndrewSwann The problem is solved now :) I got the html code... Thank you :) –  Mar 11 '14 at 15:30
  • @PraphullaKoushik: You could provide a perfect self-answer I guess. mzlatex is not known to MiKTeX, but it does not exist in TeX Live for Windows either. – Speravir Mar 11 '14 at 21:00

1 Answers1

2

Making sure the current path is that of the file test.tex to convert, use

"C:\Program Files (x86)\MiKTeX 2.9\scripts\tex4ht\htlatex" test.tex "html,mathml"

instead, as explained in TeX4ht (htlatex) on MiKTeX 2.9 to convert LaTeX into MathML, and then into Office MathML with Word 2010 and MiKTeX 2.9's tex4ht not working.

Alternatively, try

htlatex test.tex "xhtml,mozilla" "-cmozhtf",

pretty much equivalent to mzlatex, as explained in https://stuff.mit.edu/afs/athena/system/i386_deb50/os-ubuntu-9.04/usr/share/doc/tex4ht/html/.

JBloggs
  • 71