My haskell program produces .tex output using my own module. I can't see my way around having to run 'pdflatex' everytime I want to see a result. I can hardly believe this cannot be done in a more direct manner;

Is there a way to have my code compile the .tex-file?

有帮助吗?

解决方案

Is the System.Process package what you are looking for? You can use the function

system :: String -> IO ExitCode

to perform system calls.

$ touch tempfile.txt
$ ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/   :? for help
>> import System.Process
>> system "ls"
tempfile.txt
ExitSuccess

Not particularly idiomatic, but it gets the job done.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top