aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-01-25 10:47:22 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-01-25 10:47:22 -0800
commit6fde073eb5d4d7bd1e597fb3eb638fd83572e01e (patch)
treecc74cf1d763fe5b4478a57840977a897f5ff11c1
parentdc645b07d55ce9bee6c626d8184c6efb83efc0ef (diff)
downloadpandoc-6fde073eb5d4d7bd1e597fb3eb638fd83572e01e.tar.gz
LaTeX/beamer: --chapters causes level 1 to be \part{..}.
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index e4844fde2..bf1ad91d9 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -437,8 +437,9 @@ sectionHeader ref level lst = do
res <- inlineListToLaTeX lstNoNotes
return $ char '[' <> res <> char ']'
let stuffing = optional <> char '{' <> txt <> char '}'
- book <- liftM stBook get
- let level' = if book then level - 1 else level
+ book <- gets stBook
+ opts <- gets stOptions
+ let level' = if book || writerChapters opts then level - 1 else level
internalLinks <- gets stInternalLinks
let refLabel lab = (if ref `elem` internalLinks
then text "\\hyperdef"
@@ -450,7 +451,9 @@ sectionHeader ref level lst = do
$$ blankline
let headerWith x y = refLabel $ text x <> y
return $ case level' of
- 0 -> headerWith "\\chapter" stuffing
+ 0 -> if writerBeamer opts
+ then headerWith "\\part" stuffing
+ else headerWith "\\chapter" stuffing
1 -> headerWith "\\section" stuffing
2 -> headerWith "\\subsection" stuffing
3 -> headerWith "\\subsubsection" stuffing