summaryrefslogtreecommitdiff
path: root/src/markdown2pdf.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-05 08:36:08 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-05 08:36:08 +0000
commit66c4f90e09a7087c4d67ff4b0787a27821271eab (patch)
treedf2aa9fac21205908306e26693bfed08ab8fe374 /src/markdown2pdf.hs
parente1e9bfc004ddea81e1082362dbd212b3b75ca5ca (diff)
markdown2pdf: always do at least two runs.
Reason: hyperref bookmarks require this. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1797 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/markdown2pdf.hs')
-rw-r--r--src/markdown2pdf.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs
index 0333b121f..d713ae263 100644
--- a/src/markdown2pdf.hs
+++ b/src/markdown2pdf.hs
@@ -3,7 +3,7 @@ module Main where
import Data.List (isInfixOf, intercalate, isPrefixOf)
import Data.Maybe (isNothing)
-import Control.Monad (unless, guard, when)
+import Control.Monad (unless, guard)
import Control.Exception (tryJust, bracket)
import System.IO (stderr)
@@ -75,6 +75,7 @@ runLatex latexProgram file = step 3
case result of
Left (Left err) -> return $ Left err
Left (Right _) | n > 1 -> step (n-1 :: Int)
+ Right _ | n > 2 -> step (n-1 :: Int)
Left (Right msg) -> return $ Left msg
Right pdfFile -> return $ Right pdfFile
@@ -201,8 +202,6 @@ main = bracket
Left err -> exit err
Right texFile -> do
-- run pdflatex
- when ("--toc" `elem` opts || "--table-of-contents" `elem` opts) $
- runLatex latexProgram texFile >> return () -- toc requires extra run
latexRes <- runLatex latexProgram texFile
case latexRes of
Left err -> exit err