From 5b2c38a07db87318382efbcb94da2c349cb0a589 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 21 Dec 2017 12:46:38 -0500 Subject: PowerPoint writer: Add ability to force size. This replaces the more specific blockQuote runProp, which only affected the size of blockquotes. We can use this for notes, etc. --- src/Text/Pandoc/Writers/Powerpoint.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/Powerpoint.hs b/src/Text/Pandoc/Writers/Powerpoint.hs index c13b32d49..9743b8bc3 100644 --- a/src/Text/Pandoc/Writers/Powerpoint.hs +++ b/src/Text/Pandoc/Writers/Powerpoint.hs @@ -302,6 +302,7 @@ data RunProps = RunProps { rPropBold :: Bool , rLink :: Maybe (URL, String) , rPropCode :: Bool , rPropBlockQuote :: Bool + , rPropForceSize :: Maybe Pixels } deriving (Show, Eq) instance Default RunProps where @@ -313,6 +314,7 @@ instance Default RunProps where , rLink = Nothing , rPropCode = False , rPropBlockQuote = False + , rPropForceSize = Nothing } -------------------------------------------------- @@ -385,7 +387,7 @@ blockToParagraphs (CodeBlock attr str) = -- TODO: work out the format blockToParagraphs (BlockQuote blks) = local (\r -> r{ envParaProps = (envParaProps r){pPropMarginLeft = Just 100} - , envRunProps = (envRunProps r){rPropBlockQuote = True}})$ + , envRunProps = (envRunProps r){rPropForceSize = Just blockQuoteSize}})$ concatMapM blockToParagraphs blks -- TODO: work out the format blockToParagraphs (RawBlock _ _) = return [] @@ -1098,7 +1100,9 @@ paraElemToElement (Run rpr s) = do let attrs = if rPropCode rpr then [] - else (if rPropBlockQuote rpr then [("sz", (show $ blockQuoteSize * 100))] else []) ++ + else (case rPropForceSize rpr of + Just n -> [("sz", (show $ n * 100))] + Nothing -> []) ++ (if rPropBold rpr then [("b", "1")] else []) ++ (if rPropItalics rpr then [("i", "1")] else []) ++ (case rStrikethrough rpr of -- cgit v1.2.3