A (very) simple latex file watcher to auto-compile tex files.
- You will need node.js version >= 0.8 (check with
node -v
). - Install latex-watcher using npm:
npm install -g latex-watcher
- Run
latex-watcher
from your latex project directory. Check options below:
-c, --command list of commands to run. e.g latex,bibtex,pdflatex [required] [default: "pdflatex"]
-t, --tex tex file to compile on changes [required]
-b, --bib bib file used (required if bibtex is used)
The currently allowed commands are:
- latex
- pdflatex
- bibtex
- cleanup (removes temporary latex files after compilation)
The command below compiles the main.tex
file with latex, then bibtex (using main.bib
), then latex again, then pdflatex every time any .tex files are changed, added or removed.
❯ node watch.js -c latex,bibtex,latex,pdflatex -t main -b main
Watching
latex ✓
bibtex ✓
latex ✓
pdflatex ✓
The project uses gaze for file watching, colors for, er... colors, and optimist for awesome command-line argument stuff.
I've only tested and implemented this based on my own personal use. It currently works for me with Linux and OSX.