Microsoft Word for scientific texts? No, thanks.

I am often using LibreOffice, which is far from ideal text editor. But it allows to work with genuine LaTeX equations, thanks to the TexMaths extension.

It allows to add and edit equations in the LaTeX format fairly easily. All the beautiful TeX typographic is retained. And the document can be shared with those who use Microsoft Word, frankly, the majority. Then, the equations appear as embedded graphics in the Word file. Not bad, because not everyone is ready to accept pure LaTeX files and work with them.

However, most of those using LaTeX will sooner or later face the challenge of developing a document in Word, because of the requirements of a project leader or funding organization, or just because there is no chance that some of the team members will use LaTeX in their collaborative writing effort. [1]

When this situation occurs, it is time to use LibreOffice with TexMaths and share the docx format document.

TexMaths

Weirdly enough, not all journals and publishers accept LaTeX files. Then, Word with TexMaths-generated equations as graphics work well during the peer review.

Once the manuscript is accepted, the production needs the final text with all equations in some editable format: if it is Microsoft Equation (in Word) or genuine LaTeX. But sometimes they do not accept LaTeX and ask for Word.

Microsoft Word now declares support for LaTeX equations. So converting equations from raw LaTeX code to the weird Microsoft format should be as easy as select and click. If there are many equations in the text, one needs to make sure nothing is missed. This can be trivially done by delimiting the LaTeX code into some symbols. Two dollar signs $$ look convenient because it is used by some software to delimit embedded LaTeX code and very unlikely to conflict with other text.

$$ MAPE=1/n  \sum ( \left\lvert  O_i-P_i  \right\rvert / \left\lvert O_i \right\rvert ) $$

Further, to make the LaTeX pieces to stand out, it is convenient to use highlighting or colour. In LibreOffice and all decent text editors, this is trivial to do using regular expressions. Just find and select the text pattern, then change formatting. (In LibreOffice this can be done in a single step with "Find All".)

The pattern to select is simple. To find any text within $$ but not including any $ symbol within, one can use this: \$\$ .[^\$]* \$\$.

Select regular expressions

Regular expressions is a super powerful tool to work with text. See LibreOffice documentation for details.

Converting LaTeX code back into nice rendered equations is super easy in LibreOffice: just find select regular expression text \$\$ .[^\$]* \$\$ and click for converting to equation (the 'pi' button):

Select and render

(Although, unfortunately, converting equations must be done individually for each).

But this does not work in Microsoft Word, the "most advanced text processor." Nope.

Regular expressions cannot be searched in the Find menu. And this is despite Microsoft VBScript library supports regular expressions from years ago (it was part of Internet Explorer 5.5).

Then, it is not easy to do without first highlighting all $$ delimited test in LibreOffice first. Fortunately, visually locating bright yellow highlights is easy even in the Microsoft product.

Now, it is the order to click for LaTeX!

Word, no LaTeX

Oh, no. Microsoft Word does support only the most trivial LaTeX code. If you need a matrix, then no, it does not work: "This expression is currently unsupported".

And the genuine TeX typographics is much better in LibreOfice:

LaTex in Libreoffice

... than in Microsoft Word:

LaTex in Word

What? Microsoft Office from multi-billion dollar company does not support regular expressions in 2025? And no LaTeX?

(Note that regular expressions for matching text patterns first appeared in computer-based text editors in ... the sixties!)

Microsoft Word for scientific texts? No, thanks.

References

  1. Mamishev, A., Sargent, M., 2013. Creating research and scientific documents using Microsoft Word. Microsoft Press, Redmond.