Created
March 13, 2019 04:01
-
-
Save kokobd/a73e76323b86559863875f681da93f98 to your computer and use it in GitHub Desktop.
Shake build file for Latex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env stack | |
{- stack | |
script | |
--resolver lts-13.12 | |
--package shake | |
-} | |
import Development.Shake | |
import Development.Shake.Command | |
import Development.Shake.FilePath | |
import Development.Shake.Util | |
buildDir :: FilePath | |
buildDir = "build" | |
main :: IO () | |
main = shakeArgs shakeOptions{shakeFiles=buildDir} $ do | |
want [buildDir </> "report.pdf"] | |
phony "clean" $ do | |
removeFilesAfter "build" ["//*"] | |
buildDir </> "report.pdf" %> \out -> do | |
texFiles <- getDirectoryFiles "" ["//*.tex"] | |
need texFiles | |
images <- getDirectoryFiles "" ["images//*.png"] | |
need images | |
cmd_ "latexmk -pdf -bibtex -xelatex -interaction=nonstopmode" | |
("-outdir=" ++ buildDir) | |
"-shell-escape" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment