@@ -619,12 +619,12 @@ writeOpenXML opts (Pandoc meta blocks) = do
620 title <- withParaPropM (pStyleM "Title") $ blocksToOpenXML opts [Para tit | not (null tit)]
620 title <- withParaPropM (pStyleM "Title") $ blocksToOpenXML opts [Para tit | not (null tit)]
621 subtitle <- withParaPropM (pStyleM "Subtitle") $ blocksToOpenXML opts [Para subtitle' | not (null subtitle')]
621 subtitle <- withParaPropM (pStyleM "Subtitle") $ blocksToOpenXML opts [Para subtitle' | not (null subtitle')]
622− authors <- withParaPropM (pStyleM "Author") $ blocksToOpenXML opts $
622+ authors <- withParaProp (pCustomStyle "Author") $ blocksToOpenXML opts $
623 map Para auths
623 map Para auths
624 date <- withParaPropM (pStyleM "Date") $ blocksToOpenXML opts [Para dat | not (null dat)]
624 date <- withParaPropM (pStyleM "Date") $ blocksToOpenXML opts [Para dat | not (null dat)]
625 abstract <- if null abstract'
625 abstract <- if null abstract'
626 then return []
626 then return []
627− else withParaPropM (pStyleM "Abstract") $ blocksToOpenXML opts abstract'
627+ else withParaProp (pCustomStyle "Abstract") $ blocksToOpenXML opts abstract'
628 let convertSpace (Str x : Space : Str y : xs) = Str (x ++ " " ++ y) : xs
628 let convertSpace (Str x : Space : Str y : xs) = Str (x ++ " " ++ y) : xs
629 convertSpace (Str x : Str y : xs) = Str (x ++ y) : xs
629 convertSpace (Str x : Str y : xs) = Str (x ++ y) : xs
630 convertSpace xs = xs
630 convertSpace xs = xs
@@ -693,14 +693,14 @@ blockToOpenXML opts (Header lev (ident,_,_) lst) = do
693 ,("w:name",bookmarkName)] ()
693 ,("w:name",bookmarkName)] ()
694 let bookmarkEnd = mknode "w:bookmarkEnd" [("w:id", id')] ()
694 let bookmarkEnd = mknode "w:bookmarkEnd" [("w:id", id')] ()
695 return [mknode "w:p" [] (paraProps ++ [bookmarkStart, bookmarkEnd] ++ contents)]
695 return [mknode "w:p" [] (paraProps ++ [bookmarkStart, bookmarkEnd] ++ contents)]
696−blockToOpenXML opts (Plain lst) = withParaPropM (pStyleM "Compact")
696+blockToOpenXML opts (Plain lst) = withParaProp (pCustomStyle "Compact")
697 $ blockToOpenXML opts (Para lst)
697 $ blockToOpenXML opts (Para lst)
698-- title beginning with fig: indicates that the image is a figure
698-- title beginning with fig: indicates that the image is a figure
699blockToOpenXML opts (Para [Image alt (src,'f':'i':'g':':':tit)]) = do
699blockToOpenXML opts (Para [Image alt (src,'f':'i':'g':':':tit)]) = do
700 setFirstPara
700 setFirstPara
701 paraProps <- getParaProps False
701 paraProps <- getParaProps False
702 contents <- inlinesToOpenXML opts [Image alt (src,tit)]
702 contents <- inlinesToOpenXML opts [Image alt (src,tit)]
703− captionNode <- withParaPropM (pStyleM "Image Caption")
703+ captionNode <- withParaProp (pCustomStyle "ImageCaption")
704 $ blockToOpenXML opts (Para alt)
704 $ blockToOpenXML opts (Para alt)
705 return $ mknode "w:p" [] (paraProps ++ contents) : captionNode
705 return $ mknode "w:p" [] (paraProps ++ contents) : captionNode
706-- fixDisplayMath sometimes produces a Para [] as artifact
706-- fixDisplayMath sometimes produces a Para [] as artifact
@@ -712,8 +712,8 @@ blockToOpenXML opts (Para lst) = do
712 _ -> False
712 _ -> False
713 pSM <- gets stParaStyles
713 pSM <- gets stParaStyles
714 let paraProps' = case paraProps of
714 let paraProps' = case paraProps of
715− [] | isFirstPara -> [mknode "w:pPr" [] [(pStyle "First Paragraph" pSM)]]
715+ [] | isFirstPara -> [mknode "w:pPr" [] [pCustomStyle "FirstParagraph"]]
716− [] -> [mknode "w:pPr" [] [(pStyle "Body Text" pSM)]]
716+ [] -> [mknode "w:pPr" [] [pStyle "Body Text" pSM]]
718 modify $ \s -> s { stFirstPara = False }
718 modify $ \s -> s { stFirstPara = False }
719 contents <- inlinesToOpenXML opts lst
719 contents <- inlinesToOpenXML opts lst
@@ -741,7 +741,7 @@ blockToOpenXML opts (Table caption aligns widths headers rows) = do
741 let captionStr = stringify caption
741 let captionStr = stringify caption
742 caption' <- if null caption
742 caption' <- if null caption
743 then return []
743 then return []
744− else withParaPropM (pStyleM "Table Caption")
744+ else withParaProp (pCustomStyle "TableCaption")
745 $ blockToOpenXML opts (Para caption)
745 $ blockToOpenXML opts (Para caption)
746 let alignmentFor al = mknode "w:jc" [("w:val",alignmentToString al)] ()
746 let alignmentFor al = mknode "w:jc" [("w:val",alignmentToString al)] ()
747 let cellToOpenXML (al, cell) = withParaProp (alignmentFor al)
747 let cellToOpenXML (al, cell) = withParaProp (alignmentFor al)
@@ -752,8 +752,7 @@ blockToOpenXML opts (Table caption aligns widths headers rows) = do
752 [ mknode "w:tcBorders" []
752 [ mknode "w:tcBorders" []
753 $ mknode "w:bottom" [("w:val","single")] ()
753 $ mknode "w:bottom" [("w:val","single")] ()
754 , mknode "w:vAlign" [("w:val","bottom")] () ]
754 , mknode "w:vAlign" [("w:val","bottom")] () ]
755− let emptyCell = [mknode "w:p" [] [mknode "w:pPr" []
755+ let emptyCell = [mknode "w:p" [] [pCustomStyle "Compact"]]
756− [mknode "w:pStyle" [("w:val","Compact")] ()]]]
757 let mkcell border contents = mknode "w:tc" []
756 let mkcell border contents = mknode "w:tc" []
758 $ [ borderProps | border ] ++
757 $ [ borderProps | border ] ++
759 if null contents
758 if null contents
@@ -801,9 +800,9 @@ blockToOpenXML opts (DefinitionList items) = do
802definitionListItemToOpenXML :: WriterOptions -> ([Inline],[[Block]]) -> WS [Element]
801definitionListItemToOpenXML :: WriterOptions -> ([Inline],[[Block]]) -> WS [Element]
803definitionListItemToOpenXML opts (term,defs) = do
802definitionListItemToOpenXML opts (term,defs) = do
804− term' <- withParaPropM (pStyleM "Definition Term")
803+ term' <- withParaProp (pCustomStyle "DefinitionTerm")
805 $ blockToOpenXML opts (Para term)
804 $ blockToOpenXML opts (Para term)
806− defs' <- withParaPropM (pStyleM "Definition")
805+ defs' <- withParaProp (pCustomStyle "Definition")
807 $ concat `fmap` mapM (blocksToOpenXML opts) defs
806 $ concat `fmap` mapM (blocksToOpenXML opts) defs
808 return $ term' ++ defs'
807 return $ term' ++ defs'