TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Windows 7 x64 with MikTex and WinEdt. I just found latexmk has the function for continuous preview when we type latex document. I would like to know if this works if I type my latex document with WinEdt? I didn't read the manual carefully, but I don't know where I shoud add this command latexmk -pvc -pdf foo. Also, should I try to find a way for auto saving the changed document in order to make latexmk work?

share|improve this question
I have found that I have installed latexmk when I installed and updated my MikTeX 2.9. But still don't know how to add this command latexmk -pvc -pdf foo – user565739 Nov 1 '11 at 2:31
up vote 7 down vote accepted

The simplest way to run latexmk in its continuous preview mode is to start a command window, change directory to where the LaTeX document is, and then type in the command latexmk -pvc -pdf foo. Then latexmk will run continuously, regularly checking the source files for changes. To stop it, either type a control+C or close the command window.

Possibly there's a way of doing this directly from WinEdt, but an expert on WinEdt would need to tell you about that. It is also possible to set up a file association in Windows so that you can right-click on an icon for the LaTeX file and get the above command run; but I don't have a Windows 7 computer to work out the instructions.

There's no need for autosaving the file. Manual saving is better. With the above command, latexmk will compile your document shortly after you save a changed source file. (An autosave is liable to save your file in the middle of the typing of a LaTeX command, which will result in an error in the compilation, and that will probably be excessively annoying.)

share|improve this answer
Another approach to achieve continuous compiling is to use latexdameon. See william.famille-blum.org/software/latexdaemon/index.html for more details. It can be used with pdflatex, latex, and latex>dvips>ps2pdf. – Per Dec 24 '11 at 22:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.