# How to increase pandoc equation resolution

I have provided a minimal working example below.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$x^2$
\end{document}

I processed the above LaTeX file using

pandoc --webtex -t html | pandoc -f html -o my.docx

How can I increase the resolution of the resulting embedded equation in Word when using Pandoc to convert a LaTeX file to a Word file?

• Why not go from TeX to docx directly? – Werner Dec 7 '18 at 20:45
• Indeed as @Werner mentioned pandoc -s yourdocument.tex -o your.docx results in a math image with higher resolution. – Marijn Dec 7 '18 at 20:53
• @Werner I don't want a direct conversion because Word does not correctly format many of my equations. @Marjin, as far as I can tell, running pandoc -s yourdocument.tex -o your.docx does not produce a math image but instead converts mathematical formulae to Word's native math formatting system. – Felix Garner Dec 7 '18 at 21:12

If you absolutely need your formulas as embedded images¹, you have to use a webservice, that lets you specify the output resolution.

One such service is latex.codecogs.com (it's pandoc's standard), it lets you define the solution with \dpi{<value>} where value can be 50, 80, 100, 110, 120, 150, 200, and 300.

The url to the png generator is: https://latex.codecogs.com/png.latex? The backslash (\) has to be replaced by %5C. So, if you want 300dpi output, you have to give pandoc the following argument:

--webtex='https://latex.codecogs.com/png.latex?%5Cdpi{300}'

––