1

I am trying to configure TexMaker with SumatraPDF.

This has previously been discussed
Configure forward search with Texmaker + SumatraPDF
but the solutions did not work for me.

Under "Options >> Configure TexMaker >> Commands >> PDF viewer", I have entered the following

"C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe"  -invert-colors -reuse-instance "%.pdf" -reuse-instance -forward-search "%.tex" @

This "almost works". When I build and view the output, I get two PDFs. One PDF is the document I wish to view. This PDF also has the correct source links so I can do an inverse search from sumatra. But SumatraPDF also tries to the same PDF file, but from the following location:

C:\users\mattlorig\documents

which is not where the document is located.

Also, I use the -invert-colors option so that I get a black PDF with white letters.

12
  • FYI, I know I have put -reuse-instance twice. This appears to be the only way to get the forward search and inverse search to work properly.
    – user26807
    Commented Mar 4, 2013 at 0:37
  • Texniccenter is my default LaTex Editor. But, I don't see why that should make a difference. I am compiling the TeX document from TexMaker Versions:
    – user26807
    Commented Mar 4, 2013 at 1:01
  • versions: sumatra 2.2.1, TexMaker 3.5.2, MikTex 2.9
    – user26807
    Commented Mar 4, 2013 at 1:03
  • Sorry. Adding another "%.pdf" after the second -reuse-instance did not work. Thank you for the suggestion though.
    – user26807
    Commented Mar 4, 2013 at 1:09
  • 2
    it's mentioned already in issue tracker. If it works, you should add it as a comment to first original thread with help of some moderator and make this thread as duplicate to tidy up the forum. Commented Mar 5, 2013 at 0:54

1 Answer 1

1

It's much of a comment rather than a full pledged answer here by Matth

  1. Double use of -reuse-instance was not needed to resolve your problem

  2. Starting from Version 3.2.1 "- an additional parameter (#) for the current file name is available for the commands (required for pdf synchronization with the sumatra pdf viewer)"

  3. You have missed # it your command line arguments, which was mentioned by Matth

    "C:/Programme/SumatraPDF/SumatraPDF.exe" -reuse-instance "%.pdf" -forward-search "#.tex" @
    
  4. Hence forward-inverse search works when you remove multiple -reuse-instance and replace the % to #

Note: % is for filename without extension. For forward-inverse interaction # takes over the precedence. Both might work along as # is used for #.tex.

1
  • 1
    UPDATE NOTE 2019 there is NO general reason for any reuse-instance (it's for DDE which is depreciated) the editor should not attempt to call it the preferred syntax call is a variant of -forward-search file.tex line file.pdf
    – user170109
    Commented May 20, 2019 at 15:36

You must log in to answer this question.

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