aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-03-19 09:25:33 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-03-19 09:25:33 -0700
commit29c8f1554b412a46bee83e224b72e5931f172cb9 (patch)
tree82bdd8b106d2b98f1241bb78f6e3e871caabd488
parent2894df7b76776c0418be217539e27a9acb67f7fa (diff)
downloadpandoc-29c8f1554b412a46bee83e224b72e5931f172cb9.tar.gz
PDF: Run latex at least two times.
This ensures that the PDFs will have hyperlinked bookmarks (PDF table of contents that can be displayed in the sidebar).
-rw-r--r--src/Text/Pandoc/PDF.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index 59cce2e45..4f3f38a14 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -57,8 +57,8 @@ tex2pdf' :: FilePath -- ^ temp directory for output
-> IO (Either ByteString ByteString)
tex2pdf' tmpDir program source = do
let numruns = if "\\tableofcontents" `isInfixOf` source
- then 3
- else 1
+ then 3 -- to get page numbers
+ else 2 -- 1 run won't give you PDF bookmarks
(exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source
let msg = "Error producing PDF from TeX source."
case (exit, mbPdf) of