git.iko.soy/typeable/pandoc
on master help sign in
PDF: run latex 3 times if --toc specified.
1ab2153John MacFarlane
src/Text/Pandoc/PDF.hs+1−1
@@ -57,7 +57,7 @@ tex2pdf' :: FilePath -- ^ temp directory for output
57 -> IO (Either ByteString ByteString)
57 -> IO (Either ByteString ByteString)
58tex2pdf' tmpDir program source = do
58tex2pdf' tmpDir program source = do
59 let numruns = if "\\tableofcontents" `isInfixOf` source
59 let numruns = if "\\tableofcontents" `isInfixOf` source
60− then 2
60+ then 3
61 else 1
61 else 1
62 (exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source
62 (exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source
63 let msg = "Error producing PDF from TeX source."
63 let msg = "Error producing PDF from TeX source."