Is there an equivalent to latexmk in Context? I want the script to watch my source files for changes and continuously recompile them.

Here is how I would do it with latexmk:

latexmk -bibtex -pdf -pvc document.tex

EDIT: I am on windows. Preferably this should be cross-platform (just like Context :-)

  • Try the atchange program that is written in Perl and would work on Windows as well.
    – Aditya
    Mar 6, 2013 at 7:23

1 Answer 1


I don't know latexmk, but if you just want to trigger a new ConTeXt run if you modify the source file you can use inotify (assuming you use Linux). This mechanism is not ConTeXt related. Here's a simple example watching the file somefile.tex.

while inotifywait --event modify "$file"; do
  context --batchmode "$file"

You can also watch an entire directory tree, for instance if you use a project structure.

Edit: On MacOS and other BSDs the kqueue mechanism provides a similar functionality.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .