0

I've been using TextMate and TextMate 2 for years writing LaTeX. I recently switched to Sublime Text, but still miss a key feature there.

The LaTeX package of TextMate 2 has the Watch Document function, which is "[...] a live pdf preview of the LaTeX document you're editing that automatically updates while you make changes." (Source).

These changes do not only include any Tex file included in a master document, but also extends to changes in images and other files included in the document.

I've already learned that it is possible in LaTeXTools for Sublime Text to build a project consisting of many files by including %!TEX root = MyMasterFile.tex on top of each document. However, I really do not like the tedious workflow of always triggering the build process by hand. I want LaTeXTools to rebuild my document as soon as any file associated with it changes.

My current workflow is triggering the Watch Document using Textmate 2 and then switching over to Sublime Text 3 to work on the project.

Is it possible to achieve this functionality with Sublime Text and LaTeXTools only?

2 Answers2

2

One approach is to simply launch latexmk -pvc main in your working directory. From the manual:

-pvc Run a file previewer and continually update the .dvi, .ps, and/or .pdf files whenever changes are made to source files (see the Description above).

latexmk is included in all modern TeX distributions.

Bordaigorl
  • 15,135
0

You could always just use a different ST plugin, like OnSaveBuild which would work if you change its filename_filter setting to something like "\\.tex$".

ig0774
  • 1,970
  • This is a very good idea. The solution of @Bordaigorl, however, does exactly what I want and I think that his approach is more versatile. – Paul Klemm Dec 10 '15 at 15:39