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.

user26807
  • 11
  • 1
  • 2
  • 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 Mar 04 '13 at 00: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 Mar 04 '13 at 01:01
  • versions: sumatra 2.2.1, TexMaker 3.5.2, MikTex 2.9 – user26807 Mar 04 '13 at 01:03
  • Sorry. Adding another "%.pdf" after the second -reuse-instance did not work. Thank you for the suggestion though. – user26807 Mar 04 '13 at 01:09
  • Also, if the path was not correct, I would assume that I would not open the PDF file in one instance correctly. – user26807 Mar 04 '13 at 01:10
  • @user26807 Did you see the issue tracker of TeXmaker ? – texenthusiast Mar 04 '13 at 01:51
  • @user26807 Tick the button 'options-->configure-->QuickBuild-->' Don't launch a new instance of viewer if the dvi/ps/pdf already opened – texenthusiast Mar 04 '13 at 02:17
  • I have checked the corresponding box. It does not appear to help. – user26807 Mar 04 '13 at 02:28
  • The following works: "C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe" -invert-colors -reuse-instance "#.pdf" -forward-search "#.tex" @ I guess I had to change: ? ---> # . – user26807 Mar 05 '13 at 00:40
  • 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. – texenthusiast Mar 05 '13 at 00:54
  • issue 420 was deleted (why??), but you can see it in the web archive: http://web.archive.org/web/20130610162215/http://code.google.com/p/texmaker/issues/detail?id=420 – matth Jul 02 '15 at 13:53
  • 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 –  May 20 '19 at 15:36

1 Answers1

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.

Mensch
  • 65,388
  • 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 –  May 20 '19 at 15:36