latexmk -pvc can compile tex files continuously and update the pdf viewer, but how can I stop it from invoking the pdf viewer automatically?

  • Have you tried just switching the viewer off after passing -pvc to countermand just the viewer? No idea if that would work, mind, but you don't say you've tried anything and that seems an obvious experiment. – cfr Apr 21 '16 at 1:48
  • @cfr It's just annoying to always need to turn it off... – xuhdev Apr 21 '16 at 8:35
  • Make an alias, then, and you won't have to pass -pvc either. – cfr Apr 21 '16 at 22:19
  • @cfr I don't see why I don't need to pass -pvc... – xuhdev Apr 22 '16 at 3:03
  • 1
    What I meant was that you could make an alias for latexmk -pvc -view=none. – cfr Apr 22 '16 at 12:36

Just use latexmk -pvc -view=none.

  • When calling latexmk from arara, how can I stop the continuous preview in the background on my Windows PC? – Diaa Aug 28 '18 at 14:35

As a complement to Johns answer, here is some of the stuf I have in my latexmk default configuration file:

$latex = "latex -synctex=1  -halt-on-error %O %S";
$pdflatex = "pdflatex -synctex=1  -halt-on-error %O %S";
$sleep_time = 1;
$view = 'none';
$pdf_mode = 1;

The -halt-on-error is very handy in pvc mode, it makes latex stop at the first error and them latexmk is able to go back and wait for the next change to be saved

Addition: might be better to add options to @extra_pdflatex_options eventhough it is not documented.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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