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.

My current project layout looks like this:

Mainfile.tex with \begin{document} including

  • preamble (\documentclass, packages, newcommands, etc) and
  • chapters, split into separate subfiles.

I'm using the following .latexmkrc to compile with latexmk -pvc -pdf Mainfile.tex:

$pdflatex = "xelatex -src-specials -synctex=1 -interaction=nonstopmode %O %S";
$pdf_previewer = "evince %O %S";
$pdf_update_method = 0;
$sleep_time = 1;

push @cus_dep_list, "nlo nls 0 nlo2nls";
sub nlo2nls {
    system("makeindex $_[0].nlo -s nomencl.ist -o $_[0].nls -t $_[0].nlg");
}

The document compiles perfectly without errors, but latexmk never recompiles it no matter whether I change the main file or one of the included subfiles.

Any ideas?

Edit: John Collins' right. Not using "start" was the culprit here.

share|improve this question
1  
The line setting the pdf_previewer needs to be $pdf_previewer = "start evince %O %S"; with 'start' in front of 'evince'. Otherwise latexmk starts evince and waits for it to terminate. –  John Collins Dec 24 '11 at 20:09
    
@JohnCollins your comment should have been an answer. ;) Scratched my head over this for a few hours. –  Alex Dec 25 '11 at 10:34
1  
@Alex: The current form of your question is confusing, as the edited script doesn't produce (anymore) the behaviour you describe. I suggest to undo the last edit and either to either wait for John Collins to write an answer or to write a separate (self-)answer. –  lockstep Dec 25 '11 at 10:42
    
@lockstep Yes, that sounds reasonable. –  Alex Dec 25 '11 at 17:54
    
@JohnCollins Please turn your comment into an answer. –  lockstep Dec 25 '11 at 17:59
add comment

1 Answer 1

up vote 8 down vote accepted

The line that sets $pdf_previewer needs to be

$pdf_previewer = "start evince %O %S";

with 'start' in front of 'evince'. Otherwise, when latexmk runs evince, it waits for evince to terminate, instead of running evince detached

(I probably ought to change latexmk's behavior so that it does the detaching of a previewer automatically when it's in continuous preview mode.)

share|improve this answer
add comment

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.