4

I am using texstudio on mac os x. Each time I change some sentences in my .tex file and I need to see the results, I have to close the previous .pdf (if it is already opened) and regenerate the .pdf. Is it possible to update the pdf automatically without doing each time close open.thanks.

  • 2
    Which PDF viewer are you using? – Paul Gessler Mar 4 '14 at 22:11
  • @PaulGessler I use Acrobat professional reader – BetterEnglish Mar 4 '14 at 22:18
  • 1
    I don't use texstudio, so I can't test this or help much further, but this may help. The problem is that Adobe software locks the PDF file, so nothing can open it for writing while it's open in any Adobe software. The workaround described in the link (and others for other IDEs I've seen) uses dynamic data exchange (DDE) commands for interprocess communication. The idea is to have the IDE/editor tell Adobe to close the file, then run pdf(La)TeX/whatever else, and then signal Adobe to re-open the file. – Paul Gessler Mar 4 '14 at 22:39
  • 1
    The alternative, of course, is to switch PDF viewers to one which doesn't lock the file. – Paul Gessler Mar 4 '14 at 22:45
  • @PaulGessler thanks! how can I change the viewer on latex studio. May be I can use preview on mac os. – BetterEnglish Mar 4 '14 at 22:54
12

I'd recommend you to use the internal PDF viewer because it allows more accurate synchronization between PDF and source. Also, it does not have the closing issue. Check that you have the following settings internal PDF Viewer configuration

If you have a good reason to stay with Adobe Acrobat, here is a description how to setup DDE to automatically close the PDF before compilation: https://sourceforge.net/p/texstudio/feature-requests/650/

| improve this answer | |
2

If it works the same as on Windows, it's Options -> Configure TeX Studio -> Build -> PDF Viewer, and also ... -> \Build -> Default Viewer. For both, you have the choice between Internal PDF Viewer (Embedded), Internal PDF Viewer (Windowed) and External PDF Viewer.

| improve this answer | |
  • I changed the three values. But It did not works. – BetterEnglish Mar 5 '14 at 1:48
  • I modified slightly my answer; there's also a Default Vieweritem to check. Did you save the new settings? – Bernard Mar 5 '14 at 2:25
0

Have a small script in python which does the following:

import time
import os
while (True):
        os.system("xelatex yourOptionsHere youfile.tex")
        time.sleep(5)

But I can tell you, doing so sucks the processor !!

| improve this answer | |

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.