Generalsync with Sumatra pdf config

General information and discussion about TeXnicCenter
murraye
Posts: 34
Joined: Sat Aug 15, 2009 6:25 pm

sync with Sumatra pdf config

Post by murraye »

I'm confused about the Viewer "Path of executable" setting in the profile to allow inverse search from Sumatra PDF. Specifically, I'm unsure what the tutorial "How_to_Sumatra_EN.pdf" is saying about the punctuation there: "If you copy the command lines and paths from e.g. Adobe Reader an apostrophe (right)
gets an accent (wrong). This breaks functionality. Therefore you have to replace them."

Which is correct for the single-quotes in the inverse-search flag there (or is it some other version?):

Code: Select all

-inverse-search "\"D:\WP\TeXnicCenter\TEXCNTR.EXE\" /ddecmd \"[goto(’%f’,’%l’)]’\""

Code: Select all

-inverse-search "\"D:\WP\TeXnicCenter\TEXCNTR.EXE\" /ddecmd \"[goto('%f','%1')]'\""
My keyboard has a left single-quote (`) and an upright single-quote (').
Last edited by cgnieder on Wed Aug 21, 2013 10:59 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
latexian
Posts: 19
Joined: Wed Aug 05, 2009 7:57 am

Re: sync with Sumatra pdf config

Post by latexian »

maybe no body use sumatra here.
so they cannot help you to solve it.
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

sync with Sumatra pdf config

Post by MartinC »

You must use the upright quotes, like this:

Code: Select all

-inverse-search "\"C:\Program Files\TeXnicCenter\TEXCNTR.EXE\" /ddecmd \"[goto('%f', '%l')]\""
murraye
Posts: 34
Joined: Sat Aug 15, 2009 6:25 pm

sync with Sumatra pdf config

Post by murraye »

OK, I can now search backwards from the pdf file in Sumatra to the source tex file in TeXnicCenter by double-clicking at some point in the pdf document. However:
  1. In Sumatra there's now a strange blue band of color going across the first page several lines down from the top of the document. And this blue band has a little purple square in it.
  2. How do I search from the tex source to the pdf? (I presume this is what is meant by "forward search".
Of course my document includes \usepackage{pdfsync}.

This is with MiKTeX 2.7.
Last edited by cgnieder on Wed Aug 21, 2013 11:02 pm, edited 2 times in total.
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

sync with Sumatra pdf config

Post by MartinC »

  1. This is the line that indicates the place you were searching.
  2. Do not use the pdfsync package. Use the synctex option instead, i.e.

Code: Select all

latex --synctex=-1 foo.tex
For forward search, you need to set the DDE command like this:

[ForwardSearch("%bm.pdf","%Wc",%l,0)]

server: SUMATRA topic: control

See also:

http://william.famille-blum.org/blog/
murraye
Posts: 34
Joined: Sat Aug 15, 2009 6:25 pm

sync with Sumatra pdf config

Post by murraye »

MartinC wrote:
  1. This is the line that indicates the place you were searching.
  2. Do not use the pdfsync package. Use the synctex option instead, i.e.

Code: Select all

latex --synctex=-1 foo.tex
For forward search, you need to set the DDE command like this:

[ForwardSearch("%bm.pdf","%Wc",%l,0)]

server: SUMATRA topic: control

See also:

http://william.famille-blum.org/blog/
No that blue band appears arbitrarily at a fixed position in the pdf file, no matter where I subsequently search.

OK, I am NOT using the pdfsync package now, and I DO have the output profile settings the same as what you say....
  • I still get that blue band.
  • How do I do search from the tex source to the pdf document?
MartinC
Posts: 153
Joined: Wed Jan 17, 2007 10:09 pm

Re: sync with Sumatra pdf config

Post by MartinC »

The blue band will always be there, it indicates the line corresponding to the forward search you did. The blue band will not print, however.

To search from the tex source to the pdf document, you just click on the "View Output" icon (F5 shortcut).
murraye
Posts: 34
Joined: Sat Aug 15, 2009 6:25 pm

sync with Sumatra pdf config

Post by murraye »

MartinC wrote:The blue band will always be there, it indicates the line corresponding to the forward search you did. The blue band will not print, however.

To search from the tex source to the pdf document, you just click on the "View Output" icon (F5 shortcut).
Thank you! Is all that documented anywhere in SumatraPDF or TeXnicCenter? (I hadn't found it there.)
willsh
Posts: 8
Joined: Mon Jan 04, 2010 10:59 pm

sync with Sumatra pdf config

Post by willsh »

I have been trying to get forward and inverse search to work with TeXnicCenter and Sumatra but so far have not had success following the tutorial on TeXnicCenter's site.

I have no clue what is not working or how to debug it. I tried following the instructions carefully in the tutorial mentioned above several times in succession to make sure I did not have a typo and also tried some variations on the commands that I saw on some other forums, but I always get the same errors.

When I try to "Build and view the current file," I get the error:

Code: Select all

"[ForwardSearch("%bm.pdf","%Wc",%l,0,0,1)]

Cannot execute the command."
If I then double click inside the Sumatra window, I get "Synchronization file cannot be opened"

Any ideas on what I should try to do next to get sync working? I just installed MikTeX 2.8, TeXnicCenter, and Sumatra today so everything should be up to date. Also, I chose "yes" for "Install missing packages on the fly" in MikTeX because I saw on another forum that choosing "Ask me" could lead to errors.
Last edited by cgnieder on Wed Aug 21, 2013 11:06 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

sync with Sumatra pdf config

Post by localghost »

willsh wrote:I have been trying to get forward and inverse search to work with TeXnicCenter and Sumatra but so far have not had success following the tutorial on TeXnicCenter's site. [...]
Got to the TXC Tutorials section where you can find a document with instructions how to make TXC and SumatraPDF work together.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply