diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-12-18 15:05:21 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-12-18 15:05:21 -0800 |
commit | 89bf3127654f152c1386014ab5b1588f6e80fc6f (patch) | |
tree | ce7188479a9c672a0984a5bf4d39864d2e18b7be /src/Text/Pandoc | |
parent | 543aa28c3895d4dc7d3d659b652237efb41661b0 (diff) | |
download | pandoc-89bf3127654f152c1386014ab5b1588f6e80fc6f.tar.gz |
LaTeX writer: Use \paragraph, \subparagraph for level 4,5 headers.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 1afc55f4a..5a203fd23 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -228,15 +228,16 @@ blockToLaTeX (Header level lst) = do return $ char '[' <> res <> char ']' let stuffing = optional <> char '{' <> txt <> char '}' book <- liftM stBook get - return $ case (book, level) of - (True, 1) -> text "\\chapter" <> stuffing <> char '\n' - (True, 2) -> text "\\section" <> stuffing <> char '\n' - (True, 3) -> text "\\subsection" <> stuffing <> char '\n' - (True, 4) -> text "\\subsubsection" <> stuffing <> char '\n' - (False, 1) -> text "\\section" <> stuffing <> char '\n' - (False, 2) -> text "\\subsection" <> stuffing <> char '\n' - (False, 3) -> text "\\subsubsection" <> stuffing <> char '\n' - _ -> txt <> char '\n' + let level' = if book then level - 1 else level + let headerWith x y = text x <> y <> char '\n' + return $ case level' of + 0 -> headerWith "\\chapter" stuffing + 1 -> headerWith "\\section" stuffing + 2 -> headerWith "\\subsection" stuffing + 3 -> headerWith "\\subsubsection" stuffing + 4 -> headerWith "\\paragraph" stuffing + 5 -> headerWith "\\subparagraph" stuffing + _ -> txt <> char '\n' blockToLaTeX (Table caption aligns widths heads rows) = do headers <- if all null heads then return empty |