aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-02-04 13:20:36 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-02-04 13:20:36 -0800
commit3f87c4364021e37258bce8df96036444104d978d (patch)
tree620bfdb85831780093284197c0722913739508ba /src/Text/Pandoc/Readers/LaTeX.hs
parent1f90c6d7e0800621367ff72601a4f66159688ca9 (diff)
downloadpandoc-3f87c4364021e37258bce8df96036444104d978d.tar.gz
Revert "LaTeX reader: Use kpsewhich to find paths for handleIncludes."
This reverts commit 1f90c6d7e0800621367ff72601a4f66159688ca9.
Diffstat (limited to 'src/Text/Pandoc/Readers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index 990c1b7d5..41f9c40f7 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -44,8 +44,6 @@ import Data.Char (isLetter)
import Control.Applicative
import Data.Monoid
import System.FilePath (replaceExtension)
-import System.Exit (ExitCode(..))
-import System.Process (readProcessWithExitCode)
import qualified Data.Map as M
-- | Parse LaTeX from string and return 'Pandoc' document.
@@ -538,7 +536,7 @@ handleIncludes :: String -> IO String
handleIncludes [] = return []
handleIncludes ('\\':xs) =
case runParser include defaultParserState "input" ('\\':xs) of
- Right (f, rest) -> do ys <- catch (kpsewhich f >>= readFile)
+ Right (f, rest) -> do ys <- catch (readFile f)
(\e -> warn
("could not open included file `" ++
f ++ "': " ++ show e) >> return "")
@@ -570,14 +568,6 @@ verbatimEnv = do
rest <- getInput
return (r,rest)
-kpsewhich :: FilePath -> IO FilePath
-kpsewhich f = do
- (ec, ou, _) <- catch (readProcessWithExitCode "kpsewhich" [f] "")
- (\_ -> return (ExitFailure 1, f, ""))
- if ec == ExitSuccess
- then return $ trim ou
- else return f
-
-- | Parse any LaTeX environment and return a string containing
-- the whole literal environment as raw TeX.
rawLaTeXBlock :: GenParser Char ParserState String