git.iko.soy/typeable/pandoc
on master help sign in
Make --toc-depth work well with books in latex/pdf output.
99f4f63John MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+2−2
@@ -133,7 +133,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
133 authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
133 authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
134 let context = defField "toc" (writerTableOfContents options) $
134 let context = defField "toc" (writerTableOfContents options) $
135 defField "toc-depth" (show (writerTOCDepth options -
135 defField "toc-depth" (show (writerTOCDepth options -
136− if writerChapters options
136+ if stBook st
137 then 1
137 then 1
138 else 0)) $
138 else 0)) $
139 defField "body" main $
139 defField "body" main $
@@ -141,7 +141,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
141 defField "author-meta" (intercalate "; " authorsMeta) $
141 defField "author-meta" (intercalate "; " authorsMeta) $
142 defField "documentclass" (if writerBeamer options
142 defField "documentclass" (if writerBeamer options
143 then ("beamer" :: String)
143 then ("beamer" :: String)
144− else if writerChapters options
144+ else if stBook st
145 then "book"
145 then "book"
146 else "article") $
146 else "article") $
147 defField "verbatim-in-note" (stVerbInNote st) $
147 defField "verbatim-in-note" (stVerbInNote st) $