6

Each time I compiled a LaTeX document with Texmaker, the latter steals the focus. Is there any way to avoid that?

I have several monitors: when Texmaker compiles a document on one monitor, I often use another monitor to do some writings (emails, taking notes in a Google document on what remains to be done, StackExchange, etc.). Once Texmaker is done compiling, since Texmaker steals the focus, anything I am currently writing suddenly gets written in my LaTeX document.

I use Quick Build:

enter image description here

The "View PDF" step is the one that steals the focus.

I use Texmaker 4.1.1 (willing to upgrade is needed) with Windows 7 SP1 x64 Ultimate.

8
  • 3
    Texmaker steals focus from what? Wouldn't Texmaker have focus at the time you compile anyway? Commented Aug 30, 2014 at 19:39
  • @PaulGessler I edited the question to make it clearer. Commented Aug 30, 2014 at 19:43
  • Are you using Quick Build? If yes, it runs pdflatex+view pdf and then TeXMaker lost focus. Try only press F6 to run pdflatex only. If you have the pdf viewer opened somewhere it automatically will refresh.
    – Sigur
    Commented Aug 30, 2014 at 19:50
  • @Sigur Good point, I use Quick Build. F6, which only compiles the document, doesn't steal the focus. I guess it's the "view PDF" step (which is included in the Quick Build) that steals the focus then. Is there any way to avoid that? Commented Aug 30, 2014 at 19:56
  • @FranckDernoncourt, you can use only F6 to compile. The pdf will refresh. But if you want to change the behavior of Quick Build, use the options as you edited or go to Commands part (see you figure) to change some.
    – Sigur
    Commented Aug 30, 2014 at 20:04

2 Answers 2

1

You can just choose the 'user' option in 'Quick Build' and open the wizard to select the sequence you want. Just select in the left hand list and press the arrow to the right. You should choose PdfLaTeX, then BibTeX, and the PdfLaTeX twice. Accept and you'll have something like this automatically:

pdflatex -synctex=1 -interaction=nonstopmode % | bitex % | pdflatex -synctex=1 -interaction=nonstopmode % | pdflatex -synctex=1 -interaction=nonstopmode %

If you are using biblatex, you should first change the 'Bib(la)tex' command in the 'Commands' tab from bibtex % to biber %, and you'll get:

pdflatex -synctex=1 -interaction=nonstopmode % | biber % | pdflatex -synctex=1 -interaction=nonstopmode % | pdflatex -synctex=1 -interaction=nonstopmode %

It's like the option you have choosen, but without the last 'View Pdf'. Equivalent to manually doing F6 + F11 + F6 + F6. Then, when you are done with your e-mail, answering stackexchange... yo can just switch (alt+tab) to Texmaker and press F7, which will steal focus to load and show the pdf.

0

As obvious from your screenshot, you're using Adobe Reader to view the compiled pdf. I'm only using TexMaker on Mac and Linux, but as far as I know, Adobe Reader locks open files. This prevents the file from beeing reloaded automatically.
My setup on Mac is TeXMaker and "Skim" or built-in "Preview", which does not lock files. Therefore the opened pdf on the second monitor is reloaded automatically after compiling the tex-file.
Using a "non-locking" Reader should solve your problem. As mentioned here on superuser.com a pdf viewer which does not lock opened files is Sumatra PDF.

2
  • 2
    He is not using an external viewer. He is using the embedded PDF viewer inside Texmaker. The Adobe Reader command line you see in the screenshot is for Asymptote files only, not the typical compile-view cycle. Commented Aug 31, 2014 at 15:46
  • @PaulGessler: Sorry, I misunderstood his question. And you're definitely right concerning the Asymptote files. It's not the pdf Viewer that steals "Focus" from TeXMaker as I thought. The problem is that TeXMaker itself is stealing the foucs from other applications on the second monitor. Sorry for that...
    – albert
    Commented Aug 31, 2014 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .