2

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.

3
  • Do you know how to use a command line? Or terminal? Basic computer stuff?
    – Johannes_B
    May 19, 2018 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, 2018 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, 2018 at 9:16

1 Answer 1

4

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.

4
  • This command is no longer working.
    – B Furtado
    Oct 15, 2019 at 14:24
  • @BFurtado it should work. Do you get some errors?
    – michal.h21
    Oct 15, 2019 at 14:33
  • I was using an old version. And took me some time to learn I had to install miktex to get the new version. Anyway, because I use memoir and a fancy cover, the ODT results in error and don't open. HTML worked fine, though. Thank you!
    – B Furtado
    Oct 15, 2019 at 17:28
  • @BFurtado I can look at this isssue if you post it as a new question. these bugs can be usually fixed with some effort
    – michal.h21
    Oct 15, 2019 at 18:40

You must log in to answer this question.

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