[Tex/LaTex] Problem with TexMaker and Sumatra PDF

texmaker

When I do quick build with Texmaker, it is also trying to open the output file from desktop and giving

error loading C:\Users\UserName\Desktop\pdfname.pdf

error. But it is also opening original file thus producing two output files for same tex file (one with error). I configured Texmaker as mentioned in the following link: Configure forward search with Texmaker + SumatraPDF (I used first and third solutions. Both gave the same error.)

What am I missing?

EDIT:- Now I got the issue. If another pdf file is opened(say 'some.pdf' file on the desktop), then sumatra is trying to open newly built pdf from desktop. That's why I am getting the error.

How to rectify this weird behavior?

Best Answer

Finally, I found the solution by doing a bit of research in the commands. Actually you have to type following command while using sumatra and texmaker in the path to pdf viewer. Here "!" indicates current directory.

"C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe " -reuse-instance   "!\%.pdf"  -forward-search  #.tex @
Related Question