texbuilder 0.1.1.3 → 0.1.2.0
raw patch · 4 files changed
+23/−9 lines, 4 files
Files
- ChangeLog.md +5/−0
- TexBuilder/Engine.hs +6/−6
- TexBuilder/ViewThread.hs +11/−2
- texbuilder.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for tex-builder +0.1.2.0+---+* Avoid calling external executables by hard coded path,+ improving portability across platforms.+ 0.1.1.3 --- * Adjust wrong lower bound for base in cabal file.
TexBuilder/Engine.hs view
@@ -93,7 +93,7 @@ luaLaTex :: EngineImpl luaLaTex outDir texfile extraArgs = do (exCode,out,err) <- readProcessWithExitCode- "/usr/bin/lualatex" args ""+ "lualatex" args "" pure $ case exCode of ExitSuccess -> Right $ outDir </> jobname <.> "pdf" ExitFailure _ -> Left out@@ -110,7 +110,7 @@ pdfLaTex :: EngineImpl pdfLaTex outDir texfile extraArgs = do (exCode,out,err) <- readProcessWithExitCode- "/usr/bin/pdflatex" args ""+ "pdflatex" args "" pure $ case exCode of ExitSuccess -> Right $ outDir </> jobname <.> "pdf" ExitFailure _ -> Left out@@ -127,7 +127,7 @@ xeLaTex :: EngineImpl xeLaTex outDir texfile extraArgs = do (exCode,out,err) <- readProcessWithExitCode- "/usr/bin/xelatex" args ""+ "xelatex" args "" pure $ case exCode of ExitSuccess -> Right $ outDir </> jobname <.> "pdf" ExitFailure _ -> Left out@@ -145,7 +145,7 @@ xeLaTexMk :: EngineImpl xeLaTexMk outDir texfile extraArgs = do (exCode,out,err) <- readProcessWithExitCode- "/usr/bin/latexmk" args ""+ "latexmk" args "" pure $ case exCode of ExitSuccess -> Right $ outDir </> jobname <.> "pdf" ExitFailure _ -> Left out@@ -162,7 +162,7 @@ luaLaTexMk :: EngineImpl luaLaTexMk outDir texfile extraArgs = do (exCode,out,err) <- readProcessWithExitCode- "/usr/bin/latexmk" args ""+ "latexmk" args "" pure $ case exCode of ExitSuccess -> Right $ outDir </> jobname <.> "pdf" ExitFailure _ -> Left out@@ -177,7 +177,7 @@ pdfLaTexMk :: EngineImpl pdfLaTexMk outDir texfile extraArgs = do (exCode,out,err) <- readProcessWithExitCode- "/usr/bin/latexmk" args ""+ "latexmk" args "" pure $ case exCode of ExitSuccess -> Right $ outDir </> jobname <.> "pdf" ExitFailure _ -> Left out
TexBuilder/ViewThread.hs view
@@ -5,13 +5,15 @@ import TexBuilder.Utils.BinSem import Data.Functor+import Data.Maybe import Control.Monad+import Control.Applicative import Control.Concurrent import System.Posix.Types import System.Posix.Signals import System.Process import System.Process.Internals-+import System.Directory mupdfView :: FilePath -- ^ The path of the file to view@@ -20,11 +22,18 @@ -- pdf view should be updated. -> IO () mupdfView pdffile sem = do- ph <- spawnProcess "/usr/bin/mupdf" [pdffile]+ ph <- do+ mupdfPath <- getMupdfPath+ spawnProcess mupdfPath [pdffile] Just pid <- getPid ph tid <- forkIO $ signalThread pid sem exCode <- waitForProcess ph killThread tid+ where+ getMupdfPath :: IO FilePath+ getMupdfPath = fromMaybe (error "mupdf not found")+ . foldr (<|>) Nothing+ <$> mapM findExecutable [ "mupdf", "mupdf-x11" ] signalThread :: ProcessID -> BinSem -> IO () signalThread pid sem = do
texbuilder.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: texbuilder-version: 0.1.1.3+version: 0.1.2.0 synopsis: View your latex output while editing description: This program allows you to view your latex document in your pdf viewer while