TexStudio, MiKTeX and Sumatra; Compilation Issue
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.
- Options (in the menu bar) -> Configure TeXstudio ... -> The Commands Label
- Modify the value of
External PDF Viewer
to"path\to\SumatraPDF.exe" -reuse-instance -forward-search "?am.tex" @ -fwdsearch-permanent 1 "?am.pdf"
- The Build Label
- Select
External PDF Viewer
for PDF Viewer in Meta Command area. - Click
OK
at the bottom of the window
That's it.
Enjoy TeX and TeX.SX. : )
If you want both forward and inverse search in one command it can also be done.
- Options (in the menu bar) -> Configure TeXstudio ... -> Commands (tab on the left)
- 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