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.

As discussed here pdflatex preview problem: white pdf pages with only hyperref-rectangles visible during compile? when working on my dissertation which takes a long time to compile (even when compiling single chapters with includeonly it takes 1..3 minutes to compile with latexmk, I can not view the last version of the pdf to continue working during compiling time which breaks my workflow and makes me wasting time waiting while I could continue editing my document.

I'm working with TeXShop 2.43 on MacOS 10.6.8 with TeXLive 2011. The question is

  • how can I keep browsing my pdf (in the last compiled version) as long as pdflatex compiles
  • and how can I use synctex for jumping from the source file to the pdf and back?

A first suggestion (thanks, jonalv) was

latexmk -pdf text.tex && mv text.pdf viewMe.pdf

However synctex will not be working with the changed file name, especially as it is different from the name of the main file. Is there a way to do it with synctex working?

share|improve this question
    
It sounds pretty stupid but why not dividing into more pieces until you get reasonable compile times? I can imagine that you might be processing images, though. –  percusse Jan 17 '12 at 16:04
add comment

2 Answers

I'm using the following lines for pdflatex and for the previewer in my .latexmkrc file

$preview_prefix="__preview__";
$preview_file = "$preview_prefix%R__.pdf";
$sync_file = "$preview_prefix%R__.synctex.gz";

$pdflatex="pdflatex -synctex=1 %O %S; cp %R.pdf $preview_file; cp %R.synctex.gz $sync_file";
$pdf_previewer = "start okular %O $preview_file > /dev/null 2>&1";

If your main file name is e.g. main.tex, then it will copy after pdflatex has finished processing your tex file the resulting main.pdf and main.synctex.gz into __preview__main.pdf and __preview__main.synctex.gz and start the previewer with __preview__main.pdf. Works fine for me under Linux: by shift+clicking in okular I get back to my editor (after setting up okular correctly) and further, also for pretty large documents copying is usually fast enough, so that I don't have any lags in viewing.

share|improve this answer
1  
+1: I wasn't aware of the preview_prefix setting, pretty cool!. Some while ago I tried to getting something like this running with latexmk, but miserably failed and therefore switched to a Makefile-based approach. –  Daniel Oct 31 '13 at 9:08
add comment

If you are on a Mac, TeXShop Version 2.43 (not sure if this is available on other platforms) seems to exhibit the behaviour exactly as you desire.

After compiling the PDF file is opened and I can use Sync to open the corresponding source form the PDF. This feature still seems to function while a new version is begin compiled (if you don't delete the .aux file between subsequent runs). Of course if the source is changed such that the corresponding location of the source is changed all bets are off.

share|improve this answer
    
did you read the linked question and answers here: tex.stackexchange.com/questions/40477/… Unfortunately with my thesis I can not view the pdf during compiling in TeXShop. For some documents it works for me as you describe, but unfortunately not for the one I'm working on. I assume that it is because of the file size of the pdf (2..>20 MB) which will not be kept in the memory of the pdf viewer. –  Martin Jan 18 '12 at 1:05
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.