reitzig / ltx2any

Yet another LaTeX build wrapper, with one or two nifty features
GNU General Public License v3.0
59 stars 4 forks source link

When failing to create the final pdf, ltx2any should output a warning instead of failing #62

Closed koppor closed 8 years ago

koppor commented 8 years ago

System: Windows 10

When I open the PDF file with Acrobat Reader, it is write locked.

When runnig ltx2any.rb, I get following output:

> ruby c:\git-repositories\ltx2any\ltx2any.rb -ep "-shell-escape --synctex=-1" diss-kopp
[ltx2any] Initialising ... Done
[ltx2any] Copying files to tmp ... Done
[ltx2any] PdfLaTeX(1) running ... Done
[ltx2any] Biber running ... Done
[ltx2any] makeindex running ... Error
[ltx2any] PdfLaTeX(2) running ... Done
[ltx2any] PdfLaTeX(3) running ... Done
[ltx2any] There were 1 error and 238 warnings.

[ltx2any] ERROR: Permission denied @ rb_sysopen - C:/Users/Oliver/Documents/disstext/diss-kopp.pdf (see diss-kopp.err for details)

Expected behavior:

> ruby c:\git-repositories\ltx2any\ltx2any.rb -ep "-shell-escape --synctex=-1" diss-kopp
[ltx2any] Initialising ... Done
[ltx2any] Copying files to tmp ... Done
[ltx2any] PdfLaTeX(1) running ... Done
[ltx2any] Biber running ... Done
[ltx2any] PdfLaTeX(2) running ... Done
[ltx2any] PdfLaTeX(3) running ... Done
[ltx2any] There were 1 errors and 238 warnings.
[ltx2any] ERROR: Permission denied @ rb_sysopen - C:/Users/Oliver/Documents/disstext/diss-kopp.pdf (see diss-kopp.err for details)
[ltx2any] Assembling log files ... Done
[ltx2any] Log file generated at diss-kopp.log.md
[ltx2any] Took 1 min  1 sec
akerbos commented 8 years ago

This is a rather low-level error. Such are caught in a big bucket and assumed to be fatal and unfixable, hence ltx2any stops without looking at what actually happened (which can be any of a myriad of things). Thus, this is intended behaviour.

In your case, since Acrobat Reader locks the file (d'oh) ltx2any can not copy the new PDF in its place. That means you will never see any updates. That's clearly an error that prevents a normal work flow. So I think that stopping is correct in this case, too.

Acrobat Reader + background recompilation apparently don't go together. You need to close the viewer before rebuilding, use another viewer, or use Acrobat only to view a copy. (If you have another fix, I'm all ears.)

koppor commented 8 years ago

Normally, I'm using Sumatra PDF because of this. I only quickly clicked on the PDF and run ltx2any and wondered whether there is an easy workaround.