3

All is in place: latest version of TexStudio, latest version of MiKTeX (I chose the installation for my 64x windows 8.1), and latest version of SumatraPDF. I installed every package by hand which TexStudio told me to, using the package manager of MiKTeX, the updater of MiKTeX and refreshed using the Setting option of MiKTeX.
My problem: I press F6 to compile my document, TexStudio writes "Process exited normally" but SumatraPDF doesn't automatically open. The new document is created but I would like SumatraPDF to open automatically like it usually did.
I also looked through Google, replaced MiKTeX by TeXLive, and reinstalled over and over again. Nothing helped so far.

4

The shortcut F6 in TeXstudio is 'Compile', and F5 is 'Compile and view', or F1 prior to version 2.12.2. That is, if you press F5, TeXstudio will compile the TeX source file and then (if no error occurs) open the PDF viewer. If you want to open the generated PDF file automatically, use F5 rather than F6.

In order to use SumatraPDF as the default PDF viewer, you have to use the external PDF viewer and set it to SumutraPDF. Here is a step-by-step guidance.

  1. Options (in the menu bar) -> Configure TeXstudio ... -> The Commands Label
  2. Modify the value of External PDF Viewer to "path\to\SumatraPDF.exe" -reuse-instance -forward-search "?am.tex" @ -fwdsearch-permanent 1 "?am.pdf"
  3. The Build Label
  4. Select External PDF Viewer for PDF Viewer in Meta Command area.
  5. Click OK at the bottom of the window

That's it.

Enjoy TeX and TeX.SX. : )

  • Default shortcuts has changed in current version (2.12.2). Compile and View is now on F5 key. – asif Mar 5 '17 at 13:31
3

If you want both forward and inverse search in one command it can also be done.

  1. Options (in the menu bar) -> Configure TeXstudio ... -> Commands (tab on the left)
  2. Set "External PDF Viewer" to "C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe" -reuse-instance -inverse-search "\"C:/Program Files (x86)/TeXstudio/texstudio.exe\" \"%%f\" -line %%l" -forward-search "?c:am.tex" @ "?am.pdf"

Remember to change the paths to Sumatra and Texlive.

Sources: https://github.com/sumatrapdfreader/sumatrapdf/wiki/Command-line-arguments http://texstudio.sourceforge.net/manual/current/usermanual_en.html#SECTION37

  • 1
    This works perfectly. But when Sumatra is already open I get the message that the process was terminated with errors. Everything seems to work but the message is displayed every time i recompile my tex. – Sebastian Widz Jun 20 '16 at 13:36

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.