From b103f829f0d14055744998a6a6f624797fbd0d40 Mon Sep 17 00:00:00 2001
From: Jesse Rosenthal <jrosenthal@jhu.edu>
Date: Fri, 1 Jul 2016 01:14:16 -0400
Subject: [PATCH] Docx writer: set paragraph to FirstPara after display math

We treat display math like block quotes, and apply FirstParagraph style
to paragraphs that follow them. These can be styled as the user
wishes. (But, when the user is using indentation, this allows for
paragraphs to continue after display math without indentation.)
---
 src/Text/Pandoc/Writers/Docx.hs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index a841e1b66..8cfe24199 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -1045,6 +1045,7 @@ inlineToOpenXML opts (Math mathType str) = do
   let displayType = if mathType == DisplayMath
                        then DisplayBlock
                        else DisplayInline
+  when (displayType == DisplayBlock) setFirstPara
   case writeOMML displayType <$> readTeX str of
         Right r -> return [r]
         Left  _ -> inlinesToOpenXML opts (texMathToInlines mathType str)