git.iko.soy/typeable/pandoc
on master help sign in
Fixed layout bug in ConTeXt and LaTeX writers.
3e52691John MacFarlane
src/Text/Pandoc/Writers/ConTeXt.hs+2−2
@@ -70,7 +70,7 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
70 then return ""
70 then return ""
71 else liftM (render colwidth) $ inlineListToConTeXt date
71 else liftM (render colwidth) $ inlineListToConTeXt date
72 body <- mapM (elementToConTeXt options) $ hierarchicalize blocks
72 body <- mapM (elementToConTeXt options) $ hierarchicalize blocks
73− let main = (render colwidth . cat) body
73+ let main = (render colwidth . vcat) body
74 let context = writerVariables options ++
74 let context = writerVariables options ++
75 [ ("toc", if writerTableOfContents options then "yes" else "")
75 [ ("toc", if writerTableOfContents options then "yes" else "")
76 , ("body", main)
76 , ("body", main)
@@ -119,7 +119,7 @@ elementToConTeXt _ (Blk block) = blockToConTeXt block
119elementToConTeXt opts (Sec level _ id' title' elements) = do
119elementToConTeXt opts (Sec level _ id' title' elements) = do
120 header' <- sectionHeader id' level title'
120 header' <- sectionHeader id' level title'
121 innerContents <- mapM (elementToConTeXt opts) elements
121 innerContents <- mapM (elementToConTeXt opts) elements
122− return $ cat (header' : innerContents)
122+ return $ vcat (header' : innerContents)
123
123
124-- | Convert Pandoc block element to ConTeXt.
124-- | Convert Pandoc block element to ConTeXt.
125blockToConTeXt :: Block
125blockToConTeXt :: Block
src/Text/Pandoc/Writers/LaTeX.hs+2−2
@@ -117,7 +117,7 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
117 else return blocks'
117 else return blocks'
118 body <- mapM (elementToLaTeX options) $ hierarchicalize blocks''
118 body <- mapM (elementToLaTeX options) $ hierarchicalize blocks''
119 biblioTitle <- liftM (render colwidth) $ inlineListToLaTeX lastHeader
119 biblioTitle <- liftM (render colwidth) $ inlineListToLaTeX lastHeader
120− let main = render colwidth $ cat body
120+ let main = render colwidth $ vcat body
121 st <- get
121 st <- get
122 let biblioFiles = intercalate "," $ map dropExtension $ writerBiblioFiles options
122 let biblioFiles = intercalate "," $ map dropExtension $ writerBiblioFiles options
123 citecontext = case writerCiteMethod options of
123 citecontext = case writerCiteMethod options of
@@ -166,7 +166,7 @@ elementToLaTeX _ (Blk block) = blockToLaTeX block
166elementToLaTeX opts (Sec level _ id' title' elements) = do
166elementToLaTeX opts (Sec level _ id' title' elements) = do
167 header' <- sectionHeader id' level title'
167 header' <- sectionHeader id' level title'
168 innerContents <- mapM (elementToLaTeX opts) elements
168 innerContents <- mapM (elementToLaTeX opts) elements
169− return $ cat (header' : innerContents)
169+ return $ vcat (header' : innerContents)
170
170
171-- escape things as needed for LaTeX
171-- escape things as needed for LaTeX
172stringToLaTeX :: Bool -> String -> String
172stringToLaTeX :: Bool -> String -> String