3

In Linux, you can edit the source .tex file and on compilation the changes reflect in the pdf file even if pdf file is open in some pdf viewer. I tried this on kile.

But the same doesn't happen in Windows. Either i have to close the open pdf or completely delete it in order to re-compile the .tex file using MiKTeX.

Can we do something about this, so that i can have same experience of linux while using latex on Windows?

Is this the problem of MiKTeX only? Will changing the MiKTeX to say kile libraries work?

  • 7
    It depends on the PDF viewer you're using. Adobe Reader locks the pdf, while SumatraPDF, for example, doesn't. So changing your PDF viewer or using an editor that closes automatically the pdf before compiling will solve the problem. – karlkoeller Feb 17 '15 at 6:55
  • 1
    se SumatraPDF as a viewer: it doesn't lock the .pdf file and supports forward and inverse search. – Bernard Feb 17 '15 at 7:44
  • Kile doesn't have its own set of packages, binaries etc., it is just an editor, a front end. It will use MikTeX or TeX Live, depending on what is installed. But as the other commenters say, this is likely irrelevant, as your problem depends on the PDF viewer. – Torbjørn T. Feb 17 '15 at 8:11
  • MikTeX comes with the editor Texworks bundled and ready for use. Texworks has .pdf-viewer build in, and with the possibility to jump back and forth between editing and viewing. Why not use Texworks? – Sveinung Feb 17 '15 at 8:28
  • 1
    Sumatra doesn't lock the file. But e.g. the pdf-preview of the windows explorer can do it. And the adobe reader. This is not a miktex problem and miktex can't do anything about it. You will either have to avoid the application which locks the pdf or close before recompiling. – Ulrike Fischer Feb 17 '15 at 10:53
2

Apparently there are numerous feasible solutions. Of course, the best solution is the one with which you are most comfortable. Following is my preferred approach for processing files LaTex files on Windows.

  1. Edit with emacs. This is well supported on Windows. Emacs is smart and context sensitive. Initiating the compile command with Ctl C, Ctl C invokes the MikTex pdflatex command.
  2. Of course, one must have loaded MikTex for this to work. MikTex is smart and, among other things, it will automatically go out to the web to find packages that are cited in the LaTex document but not already loaded on your computer.
  3. Preview with the Sumatrapdf pdf viewer. I used to use the pdf viewer that comes with the TeX-Works package, but it no longer seems to free up the pdf for editing. You might also want to turn off Windows Explorer preview; it can also lock up the pdf from editing or over-writing.

In implementation, I open the LaTeX file with emacs and invoke pdflatex. Now that a .pdf file exists, I open that pdf with Sumatrapdf (SP). I keep that SP window open and as I edit and compile the .tex file on emacs, the SP viewer window automatically updates to reflect the changes made to the document.

Again, whatever you use most comfortably is the right answer for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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