Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using latexmk on a Red Hat 5 machine. I use it as:

latexmk -pdf -pvc

I would like to have my PDF reader automatically update the PDF as it is changed. What PDF reader do I need for this? What settings should I use?

share|improve this question

7 Answers 7

up vote 3 down vote accepted

You can get automatic updating with xpdf by setting the following in ~/.latexmkrc:

$pdf_previewer = "start xpdf -remote %R %O %S";
$pdf_update_method = 4;
$pdf_update_command = "xpdf -remote %R -reload";

These settings are straight out of the latexmk documentation. I've found this works very well, and is my preferred solution at the moment. It has the advantage that xpdf doesn't update its screen until told to do so by latexmk, which is after it has finished making the pdf file.

(I used to use gv -watch, but, particularly with big files, gv regularly tried to do a screen update before the viewed file was completely made, which resulted in a mess.)

share|improve this answer

Evince and Okular will auto-reload when the file being viewed changes. So does another option: Zathura.

That said, my recommendation would still be MuPDF instead, though it'll take some more work to set up. The reason is that MuPDF in general is a much faster program, and will reload faster. It doesn't auto reload like these do, but this can be solved with the help of xdotool.

I don't use latexmk personally, but if memory serves, there's a way of make it call a certain command at the end of a successful command. You can set it up to make xdotool send the "r" refresh key to the MuPDF window on a successful complilation. I do something similar for my vim live latex plugin.

Here's it in action:

enter image description here

share|improve this answer
2  
Another good suggestion. I'm intrigued by your LaTeX/Vim integration. I'll give it a try. –  Jeremy Sep 19 '11 at 22:06
1  
The link to your plugin seems to be dead :-( –  Harish Kumar Jun 4 '13 at 0:42
1  
Yeah, PhilTeX disappeared. Hopefully it will reappear if the owner renews the registration. Temporarily, I changed the link the ArchLinux AUR page, from which you can find related info. –  frabjous Aug 13 '13 at 19:13

The most commonly used are Evince and Okular (whether you are respectively using GNOME/XFCE or KDE).

share|improve this answer
    
Thanks for the suggestion. I have Evince, but I need to update it. –  Jeremy Sep 19 '11 at 22:06

I'd also give TeXworks and its built-in pdf viewer a shot. Whether you compile your input from the command line or via a click on the green button on the top-left of the TeXworks window, its built-in pdf viewer will update right away. TeXworks runs on multiple platforms, including Linux, and is part of the TeXLive distribution.

share|improve this answer

It may not be as fancy as the newer programs, but GV (aka the renovated "GhostView") has the ability to "watch" files. Although thought of as a PostScript viewer, it can also display PDF. Invoke as:

gv --watch file.pdf
share|improve this answer

zathura is a highly customizable and functional document viewer. It provides a minimalistic and space saving interface as well as an easy usage that mainly focuses on keyboard interaction. It offers a vim-like experience and most settings can be customized.

Main features:

  • automatic document reloading
  • supports PDF, PostScript and DjVu
  • mouse-free navigation
  • quickmarks support
  • bookmarks support

zathura

share|improve this answer

I settled on using xpdf. It's not the prettiest, but it was already available on my system. The way things are set up here at work, it is very difficult if not impossible to build something new, so using something that already existed was the easiest solution.

To get xpdf to update, you simply have to push r and it will refresh. I can live with that. I would have liked to use TeXworks, but compiling on the system was way too difficult.

share|improve this answer
2  
while I realize that this solved your problem. I think that this answer doesn't answer your question. I am compelled to give it a -1. –  Yossi Farjoun Oct 5 '11 at 14:49
    
Under the constraints I have (difficulty in installing software) xpdf works just fine. Perhaps I should have stated that in my original question. –  Jeremy Oct 5 '11 at 22:23
    
I still think that you are accepting this answer because that's what you ended up doing. However, what you ended up doing is not a solution to the question you asked. it would be like me asking how to type an integral and then realize that I actually wanted a sum so I write that as an answer and accept it... –  Yossi Farjoun Oct 6 '11 at 14:56
    
xpdf has a -reload command line argument. It's not automatic but it can easily be hooked into the TeX compilation workflow to update the PDF after a successful compilation. –  Marco May 22 '13 at 16:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.