yochju / latex-makefile

Automatically exported from code.google.com/p/latex-makefile
Other
0 stars 0 forks source link

Okular and kpdf do not reload file #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In Okular, there is an option to watch the pdf file, and reload it if it
changes (similar to the 'watch file' feature in gv). This seems to only
work if the pdf file is deleted before its regenerated. It breaks using
latex-makefile, since latex-makefile overwrites it using 'mv'.

This isnt a bug in latex-makefile, but the workaround is simple (patch for
2.1.26):

Index: Makefile
===================================================================
--- Makefile    (revision 1739)
+++ Makefile    (working copy)
@@ -1637,6 +1637,7 @@
    $(QUIET)$(call make-pdf,$<,$@.temp,$@.log,$*.embed.make); \
    if [ x"$$?" = x"0" ]; then \
        $(if $(VERBOSE),$(CAT) $@.log,:); \
+       $(RM) '$@'; \
        $(MV) '$@.temp' '$@'; \
    else \
        $(CAT) $@.log; \
@@ -1651,6 +1652,7 @@
            $(firstword $(shell $(CAT) $*.paper.make))); \
    if [ x"$$?" = x"0" ]; then \
        $(if $(VERBOSE),$(CAT) $@.log,:); \
+       $(RM) '$@'; \
        $(MV) '$@.temp' '$@'; \
    else \
        $(CAT) $@.log; \

Original issue reported on code.google.com by paul.biggar on 6 Aug 2009 at 4:31

GoogleCodeExporter commented 9 years ago
Naturally, I advocate fixing these tools, since a file doesn't have to be 
removed to 
change, and that's just a rather obvious bug.

I'm a bit concerned that this change, while good for Okular and kpdf, might 
break 
things that *do* work, like xpdf (though I haven't tried it).

If it doesn't break xpdf, then I'm happy applying the patch.  Unfortunately, my 
time is 
pretty constrained right now, so I'm going to lean on your good graces to test 
that for 
me :-)

Original comment by shiblon on 7 Aug 2009 at 7:23

GoogleCodeExporter commented 9 years ago
I reported the problem upstream (via the #okular IRC channel), and they said 
they
would try and fix it. They were the ones who diagnosed the problem and 
suggested the
workaround.

xpdf 3.02 works fine with this change (that is, it reloads the PDF when I 
change the
page, which I think is what its supposed to do).

For (some meaning of) completeness, I tried gv too. It also still works.

Original comment by paul.biggar on 7 Aug 2009 at 7:37

GoogleCodeExporter commented 9 years ago
Actually, I think that Mac's Preview app is broken in this way, too.  Thanks 
for doing the 
testing for me - that really helps.  Patch applied (with the additional -f flag 
for $(RM)), 
and available in r52, which will be uploaded as 2.1.27 very soon.

Original comment by shiblon on 7 Aug 2009 at 8:08

GoogleCodeExporter commented 9 years ago
Version 2.1.27 is uploaded and available as a feature download.  Marking fixed 
- please 
verify, then return to mark Verified.

Original comment by shiblon on 7 Aug 2009 at 8:10

GoogleCodeExporter commented 9 years ago
I've verified this, but I don't see anywhere to mark it as verified.

Original comment by paul.biggar on 7 Aug 2009 at 8:47

GoogleCodeExporter commented 9 years ago
I went ahead and marked it.  When you make a comment, several fields appear 
below it.  
One of them is status.  Clicking there shows "Verified" as an option.  Thanks 
for looking 
at it!

Original comment by shiblon on 7 Aug 2009 at 10:24

GoogleCodeExporter commented 9 years ago
Yeah, but it doesn't appear. I fiddled with things and it still didnt appear. Oh
well, its sorted anyway :)

Thanks for the quick turnaround.

Original comment by paul.biggar on 7 Aug 2009 at 10:29