5

I am new to TeXmaker and all its tools. I have my thesis template in LaTeX which I am trying to work on and am using Adobe Reader to view it. The problem is that Texmaker is generating a pdf file for the first time (which is OK), but does not generate it anytime later. When I delete the old pdf file (for deleting the pdf file, I need to close Texmaker every time), then again it generates the new pdf file. But once a pdf file is already there, it shows the same pdf file.

Shafi
  • 245
  • 4
    Is the PDF open when you're trying to compile a second time? And do you happen to use Adobe Reader to view PDFs? (Reader locks the PDF, so you can't compile if the PDF is opened there.) If not, does the messages/log panel show any errors when you try to compile? – Torbjørn T. Nov 09 '12 at 08:52
  • Adding a minimal working example (MWE) will help us see what is happening. – hpesoj626 Nov 09 '12 at 09:20
  • Yes the adobe reader in my laptop is always open, but with different files. I also tried using embed flag in texmaker. That also doesnt work. The log messages dont show anything. – Shafi Nov 09 '12 at 09:33
  • @hpesoj626: I created a sample file with just 3 tags \documentclass{article} \begin{document} and \end{document} and it does not work in this case too. – Shafi Nov 09 '12 at 09:45
  • 1
    @Shafi Why aren't you using the PDF viewer incorporated in Texmaker? It's a well known problem that Adobe Reader locks the PDF it's reading. – egreg Nov 09 '12 at 10:37
  • On windows, if you are using an external viewer, you always have to close the pdf document in order to compile your sources. And you can't delete a document (pdf, tex, ...) that is already opened by a program (texmaker and/or acrobat reader). Use the internal viewer or switch to linux (that does not have these lock problems). BTW, if you don't modify have save your sources, the new PDF will always be the same as the older... – Lionel MANSUY Nov 09 '12 at 10:53
  • 2
    @LionelMANSUY Only Adobe Reader locks the file, there are many other viewers for Windows, and e.g. Sumatra PDF will work nicely with Texmaker: http://tex.stackexchange.com/q/37327/8569 – matth Nov 09 '12 at 12:09
  • @matth Sorry, I wasn't aware of this; should I remove my comment? – Lionel MANSUY Nov 09 '12 at 12:27
  • Guys, thanks for your valuable feedbacks. The problem was locking of the pdf, as many of you correctly spotted. I would request one of you to post this as an answer, so i can accept it as a solution and close this post. Thanks. – Shafi Nov 09 '12 at 17:01
  • If you are viewing the pdf in Adobe Reader, any run with TeX will fail while you view the file in AR. I seriously doubt that TeXmaker hides that fact from you (i.e. that it does not show you some error message); if it does, file a bug with it's author. Anyway you should learn to read the logfile of your TeX run. – Martin Schröder Nov 10 '12 at 19:42
  • @MartinSchröder: Sure i will try to get familiar with tex logs. Thanks for your feedback. – Shafi Nov 11 '12 at 11:29

2 Answers2

7

A problem with using Adobe Reader to view the PDFs generated from a LaTeX-file, is that Reader locks the PDF-file so it cannot be edited. As a result, if you try to compile a LaTeX-document whose PDF is open in Reader, the compilation won't work.

The easiest way to avoid the issue is to not use Adobe Reader as long as you're working on the document. Texmaker has a built in PDF-viewer that you can use instead, active this by going to Options --> Configure Texmaker, and select "Built-in Viewer". If you really want to use Adobe Reader, you would have to close the PDF every time you compile the document.

If using windows 8.1 Adobe reader APP when closing the reader APP itself the file on the reader is still technically open.

To clarify, when in the APP reader right click and close the window corresponding to the file you are trying to update.

Torbjørn T.
  • 206,688
1

I just had the same problem the thread starter described. In my case the cause of the problem was the windows explorer preview of the output pdf file. Disabling the preview did the trick for me ;-)

Kai
  • 143