From 29c8f1554b412a46bee83e224b72e5931f172cb9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 19 Mar 2012 09:25:33 -0700 Subject: 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). --- src/Text/Pandoc/PDF.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3