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.

When we use TeXworks as editor is there any point in using -pvc argument of latexmk?

share|improve this question
add comment

2 Answers

That depends. latexmk has both the -pv (run previewer after compilation), which TW already does. But -pvc is something more. It is continuous preview mode, in which latexmk will listen for changes in the source files/included files in your project, including gfx, packages, the class etc. When a change is detected (it looks every few seconds) it will automatically start compiling. Start a previewer and go back to listening afterwards.

This is actually my preferred way of using LaTeX, I've reconfigured it slightly such that it does not halt on error and such that it does not spawn/reload a previewer since my Evince is not supported anyway.

I'm not sure if -pvc will work with TW, because it might look to see if latexmk has terminated and then it will update the previewer. But in -pvc latexmk never terminates.

Just for the record here is the don't halt an error that I have placed in my .latexmkrc:

$pdflatex = "pdflatex -synctex=1  -halt-on-error %O %S";
share|improve this answer
    
I guess therefore 'it depends on your workflow': I tend only to save when I Ctrl-T to typeset, so for me it wouldn't be very helpful :-) –  Joseph Wright Aug 6 '13 at 8:46
    
Not really no. Not that I don't call latexmk from my editor either. It have it running in a terminal under my editor. –  daleif Aug 6 '13 at 8:52
    
OK, makes sense: I did some tests, see my answer. –  Joseph Wright Aug 6 '13 at 9:48
add comment

I think the answer here is 'no'. Following daleif's answer, testing using a command-line latexmk run

latexmk -pvc -pdf -view=none <filename>

shows that the TeXworks PDF viewer does not update automatically: you need to force it to reread the PDF file by for example closing the viewer window and reopening.

Setting up latexmk -pvc as a typesetting option in TeXworks gives the problem daleif suggested: as the run never stops, TeXworks doesn't try to load the PDF and so you never see anything.

I guess if you do want this workflow, you really need to pick a different editor: at present it's not possible to use the TeXworks editor window 'tied' to a different PDF viewer. (You could just not let TeXworks open its PDF view, but then you've got no SyncTeX between the edit and view windows, which seems a bit of a pain.)

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.