aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal2
-rw-r--r--src/Text/Pandoc/PDF.hs7
2 files changed, 8 insertions, 1 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index b99eb5420..bbf963672 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -243,6 +243,8 @@ Library
cpp-options: -DEMBED_DATA_FILES
-- Build-Tools: hsb2hs -- not yet recognized by cabal
other-modules: Text.Pandoc.Data
+ if os(windows)
+ Cpp-options: -D_WINDOWS
Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind
Ghc-Prof-Options: -auto-all -caf-all -rtsopts
Default-Language: Haskell98
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index 360338f8f..39442854d 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -149,7 +149,12 @@ runTeXProgram program runsLeft tmpDir source = do
let programArgs = ["-halt-on-error", "-interaction", "nonstopmode",
"-output-directory", tmpDir, file]
env' <- getEnvironment
- let texinputs = maybe (tmpDir ++ ":") ((tmpDir ++ ":") ++)
+#ifdef _WINDOWS
+ let sep = ";"
+#else
+ let sep = ":"
+#endif
+ let texinputs = maybe (tmpDir ++ sep) ((tmpDir ++ sep) ++)
$ lookup "TEXINPUTS" env'
let env'' = ("TEXINPUTS", texinputs) :
[(k,v) | (k,v) <- env', k /= "TEXINPUTS"]