GeneralInverse Search with Sumatra PDF and TeXnicCenter

General information and discussion about TeXnicCenter
Post Reply
TexUser12
Posts: 4
Joined: Mon Feb 11, 2013 11:43 pm

Inverse Search with Sumatra PDF and TeXnicCenter

Post by TexUser12 »

Hi,

I am trying to use Sumatra PDF with TeXnicCenter (TXC) 2.0 Beta 1 (x64) on a Windows 7 distribution. I read several related topics on this forum but could not find an answer to my quite usual problem: I do not manage to obtain an inverse search. Forward search is working fine though. Here are the parameters of my current profile.

(La)TeX
Path to the Latex compiler
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe
Command Line to pass to the Latex compiler
-synctex=-1 -max-print-line=120 -interaction=nonstopmode "%wm"

Bibtex
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\bibtex.exe
Command Line for Bibtex
"%tm"

Make index
C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\makeindex.exe
Command line to Makeindex
"%tm.idx" -t "%tm.ilg" -o "%tm.ind"

Viewer
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -inverse-search "\"C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe\" /ddecmd \"[goto(’%f’,’%l’)]\""
View Project output (DDE command)
[Open("%bm.pdf",0,1,1)]
Forward Search
[ForwardSearch("%bm.pdf","%Wc",%l,0,0,1)]

I tried several things, included putting the current TXC repository at another location. Neither "Program Files" or "Program Files (x86)" works. I assumed the space in the root is the cause of the problem. Yet, when I do not put it inside "Program Files" or "Program Files (x86)", I cannot manage to open my source files with TXC (the explorer does not recognize it as an executable program apparently).

Any help is welcome.
Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
ralfinho
Posts: 6
Joined: Fri Jan 04, 2013 12:15 pm

Re: Inverse Search with Sumatra PDF and TeXnicCenter

Post by ralfinho »

Hallo TeXUser12,

apparently you are using a 32bit Miktex (your path to Miktex shows Program Files (x86)). I haven't tried this, but I'm using Miktex 64bit and Inverse Search works.
But Ihave to admit, that I haven't controlled all your lines in detail, so of course there can be another fault.

Greets ralfinho
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: Inverse Search with Sumatra PDF and TeXnicCenter

Post by MartinC »

You need to set inverse search in sumatrapdf. See:

http://www.latex-community.org/forum/vi ... 32&t=10188
TexUser12
Posts: 4
Joined: Mon Feb 11, 2013 11:43 pm

Re: Inverse Search with Sumatra PDF and TeXnicCenter

Post by TexUser12 »

Thank you very much !! It works now. Indeed, I forgot to change the setting of Sumatra.

I would have another question. My correct setting in Sumatre is now :
"C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe" /ddecmd "[goto('%f', '%l')]"
But, each time I open a new tex file and compile it with Sumatra, this setting is changed. I have to put back the correct command each time. Do you know a way to make it remember this setting ?

Thanks a lot.
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Inverse Search with Sumatra PDF and TeXnicCenter

Post by MartinC »

Ah sorry, I hadn't seen that it was already set in your "Viewer" configuration. The problem with the line:
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -inverse-search "\"C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe\" /ddecmd \"[goto(’%f’,’%l’)]\""
in your viewer configuration is that your apostrophes are wrong. Just change them from ’ to ' and everything should be alright.
TexUser12
Posts: 4
Joined: Mon Feb 11, 2013 11:43 pm

Re: Inverse Search with Sumatra PDF and TeXnicCenter

Post by TexUser12 »

Ok, so with the following "Viewer" configuration
C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -inverse-search "C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe" /ddecmd\ "[goto('%f', '%l')]\"
I still have an error.

But if I just define the inverse search in Sumatra, it works, so I am just gonna stand with this configuration.

Thanks for your help.
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: Inverse Search with Sumatra PDF and TeXnicCenter

Post by MartinC »

Check your spelling, you did not type exactly the same as this:

C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe -inverse-search "\"C:\Program Files (x86)\TeXnicCenter\TeXnicCenter.exe\" /ddecmd \"[goto('%f','%l')]\""

Copy and paste this expression and it should work.
TexUser12
Posts: 4
Joined: Mon Feb 11, 2013 11:43 pm

Re: Inverse Search with Sumatra PDF and TeXnicCenter

Post by TexUser12 »

Indeed. Thanks a lot !
Post Reply