Converting TeX to Word
30th August 2022Introduction
Lately, I've been working on the final touches of my PhD thesis -- which also should explain why my online activity has temporarily receded a bit ;). Being a mathematical biologist, it's not uncommon for me to exchange manuscripts with biologist -- who usually prefer working with MS Word over using LaTeX, which I am myself am a huge fan of. Luckily, after some googling and trying different things I recently found a simple and elegant way to convert TeX files to MS Word, which I want to quickly jot down here for future reference.
Enter pandoc
Pandoc, "a universal document converter", is a tool perfectly suited for the task. Indeed, the whole conversion boils down to a single line:
pandoc sourcefile.tex -o outfile.docx --bibliography=references.bib
The bibliography parameter is required because apparently pandoc is not able to recognise the bibliography file by itself from the tex file (or I missed something ovious). In addition, I also had to use the biblatex package with the folowing configuration (in which most options actually should not matter, as far as I can tell), to make it work perfectly:
\usepackage[
backend=bibtex,
style=nature,
isbn=false,
date=year
]{biblatex}
\bibliography{references.bib}
\AtEveryBibitem{
\clearfield{pubstate}
\clearfield{issue}
}
Conclusions
No obvious conclusions here. Except for maybe: "Googling around for a bit is overall way more efficient and way smoother than trying to do it by hand" ;-).