Make --toc-depth work well with books in latex/pdf output.

Closes #1210.
This commit is contained in:
John MacFarlane 2014-03-31 11:08:10 -07:00
parent 361167deff
commit 99f4f636df

View file

@ -133,7 +133,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
let context = defField "toc" (writerTableOfContents options) $
defField "toc-depth" (show (writerTOCDepth options -
if writerChapters options
if stBook st
then 1
else 0)) $
defField "body" main $
@ -141,7 +141,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
defField "author-meta" (intercalate "; " authorsMeta) $
defField "documentclass" (if writerBeamer options
then ("beamer" :: String)
else if writerChapters options
else if stBook st
then "book"
else "article") $
defField "verbatim-in-note" (stVerbInNote st) $