Last active
December 23, 2015 18:19
-
-
Save silppuri/6674856 to your computer and use it in GitHub Desktop.
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
/* | |
* Runs pdflatex and bibtex on filechange. | |
* This assumes you have main.tex | |
* in the folder where command is run. | |
* | |
* Usage: node change-wathcer.js somedir & | |
*/ | |
'use strict'; | |
var fs = require('fs'), | |
exec = require('child_process').exec, | |
dir = process.argv[2], | |
command = "./compile.sh"; | |
fs.watch(dir, function(event, filename) { | |
exec(command, function(err, stdout, stderr) { | |
console.log(stdout); | |
}); | |
}); |
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
#!/bin/bash | |
pdflatex main.tex | |
bibtex main.aux | |
pdflatex main.tex | |
pdflatex main.tex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment