1 example for latexmk
# Compiles targeted latex file whenever it detects a change, and updates the pdf as you do so.
latexmk -pdf -pvc your_file
# Compiles targeted latex file whenever it detects a change, and updates the pdf as you do so.
latexmk -pdf -pvc your_file