@@ -226,7 +226,7 @@ withParagraphStyle _ _ [] = return empty
226226
227227inPreformattedTags :: String -> State WriterState Doc
228228inPreformattedTags s = do
229− n <- paraStyle "Preformatted_20_Text" []
229+ n <- paraStyle [("style:parent-style-name","Preformatted_20_Text")]
230230 return . inParagraphTagsWithStyle ("P" ++ show n) . handleSpaces $ s
231231
232232orderedListToOpenDocument :: WriterOptions -> Int -> [[Block]] -> State WriterState Doc
@@ -287,7 +287,8 @@ deflistItemToOpenDocument o (t,d) = do
287287inBlockQuote :: WriterOptions -> Int -> [Block] -> State WriterState Doc
288288inBlockQuote o i (b:bs)
289289 | BlockQuote l <- b = do increaseIndent
290− ni <- paraStyle "Quotations" []
290+ ni <- paraStyle
291+ [("style:parent-style-name","Quotations")]
291292 go =<< inBlockQuote o ni (map plainToPara l)
292293 | Para l <- b = do go =<< inParagraphTagsWithStyle ("P" ++ show i) <$> inlinesToOpenDocument o l
293294 | otherwise = do go =<< blockToOpenDocument o b
@@ -333,7 +334,8 @@ blockToOpenDocument o bs
333334 return r
334335 preformatted s = (flush . vcat) <$> mapM (inPreformattedTags . escapeStringForXML) (lines s)
335336 mkBlockQuote b = do increaseIndent
336− i <- paraStyle "Quotations" []
337+ i <- paraStyle
338+ [("style:parent-style-name","Quotations")]
337339 inBlockQuote o i (map plainToPara b)
338340 orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a
339341 inTags True "text:list" [ ("text:style-name", "L" ++ show ln)]
@@ -536,15 +538,14 @@ tableStyle num wcs =
536538 columnStyles = map colStyle wcs
537539 in table $$ vcat columnStyles $$ cellStyle
538540
539−paraStyle :: String -> [(String,String)] -> State WriterState Int
540−paraStyle parent attrs = do
541+paraStyle :: [(String,String)] -> State WriterState Int
542+paraStyle attrs = do
541543 pn <- (+) 1 . length <$> gets stParaStyles
542544 i <- (*) 0.5 . fromIntegral <$> gets stIndentPara :: State WriterState Double
543545 b <- gets stInDefinition
544546 t <- gets stTight
545547 let styleAttr = [ ("style:name" , "P" ++ show pn)
546− , ("style:family" , "paragraph" )
547− , ("style:parent-style-name", parent )]
548+ , ("style:family" , "paragraph" )]
548549 indentVal = flip (++) "in" . show $ if b then (max 0.5 i) else i
549550 tight = if t then [ ("fo:margin-top" , "0in" )
550551 , ("fo:margin-bottom" , "0in" )]
@@ -562,7 +563,9 @@ paraStyle parent attrs = do
562563 return pn
563564
564565paraListStyle :: Int -> State WriterState Int
565−paraListStyle l = paraStyle "Text_20_body" [("style:list-style-name", "L" ++ show l )]
566+paraListStyle l = paraStyle
567+ [("style:parent-style-name","Text_20_body")
568+ ,("style:list-style-name", "L" ++ show l )]
566569
567570paraTableStyles :: String -> Int -> [Alignment] -> [(String, Doc)]
568571paraTableStyles _ _ [] = []