@@ -192,8 +192,15 @@ writeOpenDocument opts (Pandoc meta blocks) =
192192 listStyles = map listStyle (stListStyles s)
193193 automaticStyles = inTagsIndented "office:automatic-styles" $ vcat $
194194 reverse $ styles ++ listStyles
195+ fontFaceDecls = inTagsIndented "office:font-face-decls" $ vcat $
196+ [selfClosingTag "style:font-face" [
197+ ("style:name", "Courier New")
198+ , ("style:font-family-generic", "modern")
199+ , ("style:font-pitch", "fixed")
200+ , ("svg:font-family", "'Courier New'")]]
195201 context = defField "body" body
196202 $ defField "automatic-styles" (render' automaticStyles)
203+ $ defField "font-face-decls" (render' fontFaceDecls)
197204 $ metadata
198205 in if writerStandalone opts
199206 then renderTemplate' (writerTemplate opts) context
@@ -373,18 +380,18 @@ inlineToOpenDocument o ils
373380 | Subscript l <- ils = withTextStyle Sub $ inlinesToOpenDocument o l
374381 | SmallCaps l <- ils = withTextStyle SmallC $ inlinesToOpenDocument o l
375382 | Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
376− | Code _ s <- ils = preformatted s
383+ | Code _ s <- ils = withTextStyle Pre $ inTextStyle $ preformatted s
377384 | Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
378385 | Cite _ l <- ils = inlinesToOpenDocument o l
379386 | RawInline f s <- ils = if f == "opendocument" || f == "html"
380− then preformatted s
387+ then withTextStyle Pre $ inTextStyle $ preformatted s
381388 else return empty
382389 | Link l (s,t) <- ils = mkLink s t <$> inlinesToOpenDocument o l
383390 | Image _ (s,t) <- ils = return $ mkImg s t
384391 | Note l <- ils = mkNote l
385392 | otherwise = return empty
386393 where
387− preformatted = return . inSpanTags "Teletype" . handleSpaces . escapeStringForXML
394+ preformatted s = handleSpaces $ escapeStringForXML s
388395 mkLink s t = inTags False "text:a" [ ("xlink:type" , "simple")
389396 , ("xlink:href" , s )
390397 , ("office:name", t )
@@ -524,7 +531,8 @@ paraTableStyles t s (a:xs)
524531 [ ("fo:text-align", x)
525532 , ("style:justify-single-word", "false")]
526533
527−data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC deriving ( Eq,Ord )
534+data TextStyle = Italic | Bold | Strike | Sub | Sup | SmallC | Pre
535+ deriving ( Eq,Ord )
528536
529537textStyleAttr :: TextStyle -> [(String,String)]
530538textStyleAttr s
@@ -538,5 +546,8 @@ textStyleAttr s
538546 | Sub <- s = [("style:text-position" ,"sub 58%" )]
539547 | Sup <- s = [("style:text-position" ,"super 58%" )]
540548 | SmallC <- s = [("fo:font-variant" ,"small-caps")]
549+ | Pre <- s = [("style:font-name" ,"Courier New")
550+ ,("style:font-name-asian" ,"Courier New")
551+ ,("style:font-name-complex" ,"Courier New")]
541552 | otherwise = []
542553