3

I currently compile .pdf files using TeXnicCenter with the following settings in Build -> Define Output Profiles -> Viewer -> Close document before running LaTeX:

Server: AcroViewR11  Command: [AppExit]  Topic: control

When TeXnicCenter compiles and views output, this closes all of the open instances of Adobe Reader (for example: two Acrobat windows open, each with a single PDF shown - one window contains the document being compiled, the other contains the reference document), compiles the new PDF, then opens the new file.

Although this works perfectly well for some jobs, it does close all instances of Adobe Reader including the other .pdf files open in the background. Many workflows involve composing a file using LaTeX whilst also referencing a separate .pdf file which should be kept open.

Can someone suggest a different command that would close only the instance of Adobe Reader that relates to the current document being compiled?

  • I'm not sure since I don't use Adobe but I guess that you can compile without closing the pdf. – Sigur Oct 9 '15 at 14:02
  • I'm using version 2.02 set up to use [DocClose("%bm.pdf")] as a DDE command (whatever that means). It only closes the file specified. – John Kormylo Oct 9 '15 at 14:14
  • 1
    @JohnKormylo I never got that to work with v11 of Acroread - had to do as OP. I agree this is a frustrating issue. I have now switched to TeXworks for various reasons, ability to retain Adobe Reade windows up and running being one of them! – FionaSmith Oct 9 '15 at 14:30
  • You could also use Sumatra PDF as your viewer in TeXnicCenter. Doesn't need to be closed on rebuild, since it doesn't lock the PDF file. – Mike Renfro Oct 9 '15 at 17:41
  • This may work but installing new software is only a workaround and not the solution being asked. This will not work in some situations: e.g. when using a work PC with no control over software installation. An even simpler workaround I had considered before posting the question was to open the reference PDF in a separate viewer, and continue using Adobe with the [AppExit] command (this doesn't require any alteration of TeXnicCenter settings). The objective here is to find a command that will simply shut the correct window - it must be possible, and it has worked with previous versions. – someone Oct 10 '15 at 13:22
1

In your case I see two problems:

  1. Adobe Acrobat (Professional)
  2. AppExit

To 2:

I do not know the mentioned AppExit you call in TeXnicCenter, but are you sure it does, what you think? Perhaps this AppExit causes the closing of all open windows of Acrobat? Have you tried to call Acrobat without AppExit? Result?

To 1:

Adobe has changed the possibility for Acrobat Reader to be called by other programs in a (in my opinion) bad way: First version could be called without problems, higher versions are changed to make it harder to be used/included by other programs. For example: First versions had not to be closed while compiling, the newer versions had to be closed. If you compile for example file mwe.tex in TeXnicCenter, but you have opend an earlier compiled version of mwe.pdf outside of TeXnicCenter you get a 3 error message, because TeXnicCenter is not able to close a Acrobat window not opend in TeXnicCenter.

Knowing this, I think that your used App AppExit causes the problem you have. TeXnicCenter is not allowed (by programming of Adobe) to close windows not opend in TeXnicCenter (or Adobe has changed this behaviour of Acrobat).

Because Acrobat makes a lot of trouble the last years I personaly do not use Acrobat longer for viewing compiled LaTeX documents. TeXnicCenter works perfect with SumatraPDF including the inverse search.

PS: For the right configuration of TeXnicCenter calling Acrobat reader see this question!

  • Thank you, this has guided me to the correct solution. The problem was caused by the viewer and forward search being configured with command line arguments, so even with the correct DDE command - [DocClose("%bm.pdf")] - TeXnicCenter was unable to close the window. Switching all settings to DDE commands as shown in the other question you link to works well. – someone Oct 12 '15 at 10:57
  • About AppExit: yes, I believe it does shut all open windows - I used it because I was unable to close only the relevant pdf, and shutting everything was easier than doing things manually with my current workflow. – someone Oct 12 '15 at 10:58

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.