How to Convert LaTeX Equations in Word Mail Merge
Question details
LaTeX equations inserted into Word mail-merge fields display as raw syntax instead of formatted math equations, and manual conversion does not apply to all recipients.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Generating letters or emails using a mail merge that relies on a data source containing LaTeX equation syntax.
- Observed behavior
- The generated documents output the raw LaTeX code instead of properly rendering the mathematical equations. Converting one result manually works, but subsequent recipient fields revert to raw code.
Ensure your LaTeX syntax is fully correct in your data source and test your mail merge with a small sample of 2-3 recipients to verify the output formatting before processing a large batch.
Finish the Merge to a New Document and Convert
Since Word struggles to convert LaTeX dynamically during the merge, generating a static document first allows you to convert all equations at once.
Microsoft Word's mail merge engine processes incoming data as raw text and does not automatically trigger the LaTeX equation converter for each recipient. By finishing the merge to a new document, you create a static file where the LaTeX converter can recognize and format the equations normally.
Go to the 'Mailings' tab on the Word ribbon, click on 'Finish & Merge', and select 'Edit Individual Documents'.
Choose 'All' in the prompt box and click 'OK'. This generates a single, continuous new document containing all the merged recipient letters.
In the newly created document, highlight the raw LaTeX text, navigate to the 'Equation' tab, and click 'Convert' to format the math correctly across all the pages.

Use Equation Images or Formatting Add-ins
For automated email merges where generating a single intermediate document isn't feasible, you must pre-format the equations or use third-party tools.
Try WPS Office for Seamless Document Management
If Microsoft Word's limitations with complex formatting and mail merges are slowing you down, consider switching to WPS Office. It provides a lightweight, highly compatible alternative for handling professional documents, spreadsheets, and presentations without the heavy subscription fees.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to set up the office suite.
- 3. Open Your Document: Launch WPS Writer and open your existing .docx mail merge document to continue your work with a familiar, easy-to-use interface.

Frequently Asked Questions
Why doesn't Word convert LaTeX equations dynamically in mail merge?
Word's mail merge process treats incoming data from sources like Excel as plain text. It skips the dynamic rendering step required to turn LaTeX syntax into formatted equation objects during the merge.
Can I use Word macros to automatically convert LaTeX after the merge?
Yes, you can write a VBA macro to search for LaTeX strings in the newly merged document and automatically trigger the equation conversion. This is highly recommended if your merged document contains hundreds of pages.
Does merging directly to PDF fix the LaTeX equation issue?
No, merging directly to PDF from Word will simply freeze the raw LaTeX code into the PDF file. You must first merge to a new Word document, convert the equations, and then export that finalized document to PDF.




