# Pandoc LaTeX to .docx, change font size

I am using Pandoc to convert a LaTeX document to .docx, but i have not been able to figure out how to change the font size. An MWE looks like this

\documentclass[10pt]{article}
\begin{document}
Hello world
\scriptsize
Hello world
\end{document}


Compiling the MWE with pdflatex produces an output where the two "Hello world" statements appear in different font sizes. Converting with pandoc, i get a document where both statements have the same font size. How do i get them to appear in different sizes in the word document?

Pandoc supports only a small subset of LaTeX commands and \scriptsize is not one of them. Why does it work anyway? Because unrecognized LaTeX (or ConTeXt or HTML) commands are passed unchanged to the LaTeX (or ConTeXt or HTML) writer. If you want to use pandoc to convert LaTeX to .docx, then you should stick to those commands that can be represented in pandoc's own markdown format.

Nevertheless: If you want to modify the produced .docx you can save the reference file using: pandoc --print-default-data-file reference.docx > custom-reference.docx

In custom-reference.docx you can change the following styles (be sure to actually change the style defined in the document, not just the sample text!):

paragraph

• Normal
• Body Text
• First Paragraph
• Compact
• Title
• Subtitle
• Author
• Date
• Abstract
• Bibliography
• Block Text
• Footnote Text
• Definition Term
• Definition
• Caption
• Table Caption
• Image Caption
• Figure
• Figure With Caption

character

• Default Paragraph Font
• Body Text Char
• Verbatim Char
• Footnote Reference
You can use the changed reference file by adding the option --reference-doc=custom-reference.docx.
• Great hint to modify the reference.docx, I would not have thought to look for that option in the help/manpage. – Damian Vogel Dec 17 '18 at 12:49