Working on LaTeX documents while continuously rebuilding in the background on changes and displaying can be done using latexmk:

latexmk -pvc main.tex