latex-software-ms-word

In our previous article, we introduced the open conversion tool Pandoc to convert files and discussed a few essential concepts, including layman of Markdown language. Pandoc has excellent support for file formats. It enables you to convert file formats, such as convert filesfrom LaTex to MS Word. And in a survey, it is found that researchers, academics, and even developers love writing papers and documentations in LaTex. One drawback of using LaTex is that collaborators do not widely know it, and its syntax is little clumsy as compared to writing in Microsoft Word or OpenOffice. And with recent updates, you can add comments and keep track of changes while writing in Ms Word. 

The whole picture

A good analogy would be that we can relate LaTex as the pre-production phase of writing, and MS Word is usually considered after production phase of writing. And people around the globe prefer Microsoft Word over any other syntax based or a sophisticated writing tool. And if you ever come across converting LaTex documents into MS Word documents, you are already aware of the pain, which is time-consuming and painful. In this article, you will learn how to

Why Use Pandoc To Convert Files?

There are a bunch of softwares available in the market, can do the job, but those are mostly paid, and results are not very satisfactory. Is there a better solution that can do the job precisely? Yes, Pandoc is the answer, that is open source and can deal with conversion between LaTex and Word documents pretty quickly.

How To Convert Files From LaTex To MS Word Using Pandoc?

You can follow our last article on “How To Convert Files On Linux Command Line Using Pandoc?” to get started with Pandoc. In that article, you can get step-by-step details to configure Pandoc in a Linux based distribution such as Ubuntu, Fedora, and others. 

Convert from LaTex to Ms Word

We are assuming that you already have the LaTex file you are trying to convert to the MS Word format. If you do not have the LaTex file, you can download the below file to try out this tutorial,

Download link: Click this link to download the sample LaTex file

Command: pandoc sample.tex -o sample.docx

Decode the syntax:

  • pandoc: Name of the converting tool
  • sample.tex: From file name in LaTex format
  • -o: For output to a file. You can use –output
  • sample.docx: To file name in MS Word format
How To Convert From Latex To MS Word Using Pandoc

The above command will convert the sample.tex LaTex file into sample.docx MS Word format. 

Problems with Equations

Currently, Pandoc is capable of handling LaTex Equations efficiently. All the LaTex equations are directly converted into Word equation editor without needing any third-party tools such as MathType.

It is time consuming to edit the numbering of equations. And yes there is an alternative to this,

  • Create a three-column table in MS Word
  • Put the equation in the second column
  • Put the equation number in the right column

Citations:

Due to the limitations of Pandoc, sometimes, the citations are not correctly converted into Word files. But as always, there is a good fix for this; you can use pandoc-citeproc, which comes with Pandoc installation.

Command: pandoc sample.tex –bibliography=ref.bib -o sample.docx

Decode the syntax:

  • -bibliography: To refer the bib file containing references

Word Styles

You can specify the resulting MS Word document’s style by using a reference-docx option during the conversion. For example, you want to submit a research paper to a publication website, and you want to make sure that your document matches all the styling standards and requirements. Again Pandoc comes to the rescue, let us go through an example,

Command: pandoc sample.tex –bibliography=ref.bib –reference-docx=template.doc -o sample.docx

Decode the syntax:

  • –reference-docx: Reference to the template doc file

Cross Reference

To handle the numbering of equations, figures, tables during the conversion, you need to use a filter named pandoc-crossref. You can download this tool using the git link. You can follow the documentation to complete the setup for pandoc-crossref. Let us go through the command for the same,

Command: pandoc sample.tex –filter pandoc-crossref –bibliography=myref.bib –reference-docx=template.doc -o sample.docx

Decode the syntax:

  • pandoc-crossref: Filter used for cross-referencing

Conclusion

In this article, we have walked you through steps to convert file from LaTex to MS Word file. We have discussed a few essential filters that would make your life a lot easier during the conversion process. In short, Pandoc is a potent open-source conversion tool available today, and you should give a try.

About 

Harsit Mohapatra is a full-time Software Engineer passionate and hungry for tech updates and knowledge. Besides being a crazy software developer, he is an avid traveller and loves capturing the things that give him a perception through his lenses

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.