[Tex/LaTex] How to open a pdf file in the TexMaker internal PDF viewer using a user-defined quick build sequence

pdftexmaker

I'm trying to write a document with a bibliography, and none of the default Quick Build presets have a BibTex parsing step. It's easy enough to make a sequence of commands that run PdfLaTeX, BibTex, PdfLaTeX, PdfLaTeX, but I cannot see how to use the internal PDF viewer to then display the generated PDF file.

I saw that someone else reported this same problem on the TexMaker issue tracker but the author appears to have just dismissed it as already implemented. I've tried calling view %.pdf, view pdf, view pdf %.pdf (as the person who originally reported the issue tired) and had about the same results. Calling viewpdf with or without arguments gives the exact same results (nothing).

I can easily just click "View PDF" in the toolbar after the build process has finished but it's extra interaction required on my part that should easily be avoidable…

Does anyone know what command I need to use in the user defined quick build section in order to launch the built in PDF viewer automatically?

I'm running TexMaker 3.0.2 on Windows 7 with MikTex 2.9. I also use TexMaker on Ubuntu 10.10 so something that will work cross platform would be great.

Best Answer

It may sound quite strange, but you have to use exactly the same command as you use to open the external PDF viewer! This is because the code to run the external programs (the function Texmaker::RunCommand located in texmaker.cpp, ll.5433-5596 in the sources) checks if the command to be executed is the PDF viewer, and runs the internal viewer instead of the external program if it is activated.

In order to use the internal PDF viewer, you have to select Pdf Viewer->Built-in Viewer and disable the Embed checkbox in the Options->Configure Texmaker->Commands menu. Now you'll be able to launch Texmaker's viewer by using the same command in the Quick Build->User input field as stated in Commands->Pdf Viewer->External Viewer.

No program you use in your Quick Build command line must exit with an error, otherwise the execution will be aborted and the viewer won't be shown.

Related Question