Not sure if this has come up before, but a cursory search of recent posts did not turn up anything.
Frequently after running PDFLaTeX on the current file and viewing the output on Adobe Reader, I forget to close Adobe Reader. After further editing, I try to run PDFLaTeX again but because I did not close Adobe Reader, PDFLaTeX aborts because it cannot write to the open PDF file. Is there a simple way to ensure that if the current file has a PDF file open, that it is closed before PDFLaTeX is executed? Something like a command line switch in the profile?
General ⇒ Close Adobe Reader before Compilation
Close Adobe Reader before Compilation
Last edited by dltx on Mon Jan 16, 2012 9:38 pm, edited 1 time in total.
Close Adobe Reader before Compilation
Not really my cup of tea, but maybe this post on the LaTeXEditor forum is helpful.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
Follow howtoTeX on twitter
Re: Close Adobe Reader before Compilation
thanks for the reply. this is exactly what i'd like to do, but i'd like to do it in texniccenter. the solutions provided in that thread all seem to be achieved by running a script that closes the pdf viewer before latex compilation. but texniccenter does not seem to offer the possibility of running a preprocessor (it offers only the option of a postprocessor) in defining output profiles, or am i mistaken? maybe i'll have to figure a hack to do this, but wondered if anybody else using texniccenter had already found an easy solution.
Re: Close Adobe Reader before Compilation
just for closure, for those interested in doing something similar, i got the following hack to work. i write the pdf output to a different temporary filename (so not the default faultname) using the pdflatex switch, job-name. this allows me to do post-processing on the temporary filename in a batch file. in the batch post-processing, i taskkill the reader (acrord32.exe), delete the original file, then rename the temporary filename back to the original filename, so the end result is as if i didn't do anything. not necessarily the most elegant hack, but it looks like it works.
Re: Close Adobe Reader before Compilation
You would be much better using sumatrapdf as a pdf reader. You don't have to close the file *and* you get forward and inverse search.
Re: Close Adobe Reader before Compilation
i was tempted to install the sumatra reader in trying to solve this, but i didn't really want to install another piece of software. but certainly for most, using the sumatra reader might be the easiest solution.