I have written my master thesis in latex and got beautiful pdf. Now I want to publish it in a journal for which I need to convert it to html to convert it to word. I now that there options out there like tex4ht and htlatex, but I don't understand how to use them and none of the tutorials help. Do I need to install a package? I am using TexStudio. I thought that htlatex is a command like pdflatex that I have to run. But it does not show up under the commands.

If htlatex is a command, do I need to install a package, if I don't have the command available? I would really appreciate your help.

  • Do you know how to use a command line? Or terminal? Basic computer stuff? – Johannes_B May 19 '18 at 8:52
  • 2
    With pandoc, a free program program for the command line (no buttons), the instructions are clear and you can convert directly from LaTeX to Word but I warn you: any conversion have problems. Be prepared to lost time fixing the output of whatever conversion program. – Fran May 19 '18 at 9:04
  • 1
    You can import the PDF into Word. That's not perfect and pandoc is certainly the better option, but it's there off the shelf. – vaettchen May 19 '18 at 9:16

tex4ht is a system for conversion from TeX to many different output formats, such as HTML, ODT or Epub. The system consists from several different programs, which are executed by a compilation script. The basic compilation script is htlatex, but it was superseded by make4ht. The whole system is included in both major TeX distributions, TeX Live and Miktex, so you don't need to install anything.

For Word inclusion, it is best to use the ODT format, which can keep some features like footnotes. Word can handle this format, but it's support is buggy, so it is best to convert the ODT files to DOCX using LibreOffice.

The ODT format can be requested using this command:

make4ht -f odt filename.tex

It will create a filename.odt file, which needs to be converted do DOCX using LibreOffice. I am sure it is possible to add custom commands to TeXstudio, see it's documentation.

It is possible that you will run into some issues, because the conversion process isn't really straight-forward. It all depends on used packages, custom commands, etc.

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.