Being able to go from a line in WinEdt to the corresponding place in a compiled document is extremely useful and saves a lot of time. This has long been possible using Yap with dvi documents, but Yap is slow and ugly and the dvi files usually have to be converted to pdf before sending them to anyone else.
So I tend to use pdftexify to create pdf files directly, but I miss having synchronization between what I write and the pdf file that is created.
However, I’ve found a solution that is not too difficult to implement and seems to work well. It replaces the Adobe pdf reader with SumatraPDF. There is some fiddling of settings in WinEdt as explained in the instructions below. The information below is adapted from William Blum’s website.
- Download SumatraPDF and install it to the (default) directory
c:\Program files\SumatraPDF - For Winedt 6.0
Run WinEdt and go to Options/Execution Modes. Click on the “PDF Viewer” tab and click the “Sumatra PDF” button. Make sure the box under “Sync Tex” is ticked. Then click “OK”. That’s it! - For Winedt 5.6.
- Download Acrobat OpenDoc.edt and Sumatra-Find.edt and save them to
C:\Program Files\WinEdt Team\WinEdt\Exec - Run WinEdt and go to Options/Execution Modes. Click on the “Acrobat” tab and replace the path to the “PDF Viewer Executable” with
"C:\Program files\SumatraPDF\SumatraPDF.exe" -reuse-instance. Like this:
- Before closing the dialog box, go to the “Console Applications” tab and select “PDFTexify”. Change the switches field to
--pdf --tex-option=--synctex=-1
Similarly, for PDFLaTeX and PDFTeX, change the switches fields to--synctex=-1Then click “OK”. - In WinEdt, go to the menu ‘Option/Menu setup’. Create a new macro menu somewhere (under ‘Accessories’ for instance) and fill the options as follows:
- Name:
Sumatra FindMacro:Exe('%b\Exec\Sumatra-Find.edt');Requires File Filter:
%P\%N.pdfStart in:
%PShortcut:
Shift-F8Now when editing a .tex file in WinEdt, you can go to the corresponding line in the pdf document by pressing Shift-F8.
- Download Acrobat OpenDoc.edt and Sumatra-Find.edt and save them to
Update
- The above instructions only work with MikTeX (tested on MikTeX 2.7 and 2.8). If you use TeXLive, or some other LaTeX implementation, then you will need to figure it out for yourself.
- You should not use the
pdfsyncpackage. - Some people have reported trouble with beamer. I have had no difficulties using beamer with the above settings.
- The above instructions have now been updated (8 Sep 2009) to take account of all comments below.

#1 by George on July 30th, 2009
Quote
It has worked perfectly well. Thank you.
#2 by Prof. György SZEIDL on July 31st, 2009
Quote
the forward search does not work.
my winedt directory is
c:\winedt56
i have modified the line
“C:\Program Files\WinEdt Team\WinEdt\winedt.exe” “[Open(|%f|);SelPar(%l,8)]”
accordingly to
“C:\WinEdt56\winedt.exe” “[Open(|%f|);SelPar(%l,8)]”
and put the macro Sumatra-Find.edt into the directory
“C:\WinEdt56\exec
i get the error message unknown macro: Forward Search.
the inverse search works perfectly.
best regards
g. szeidl
#3 by y. calleecharan on July 31st, 2009
Quote
Thanks. Pressing F8 opens up the document to the page at which the document was browsed to after compilation. What am I doing wrong?
F8 is not opening at the corresponding line.
Best Regards
Y.Calleecharan
#4 by y.calleecharan on July 31st, 2009
Quote
Hello again,
Sorry about my earlier post. It works fine. I lost sight of the forest because of all the trees. I forgot to put \usepackage{pdfsync} in the preamble. Both forward and inverse search features seem to work fine.
Best Regards,
Y.Calleecharan
#5 by Rob J Hyndman on August 1st, 2009
Quote
To Y. Calleecharan: I think the problem is that you are using TeXLive rather than MikTeX. I have only tested the instructions with MikTeX 2.7. TeXLive does not have a texify command.
#6 by y.calleecharan on August 2nd, 2009
Quote
Thanks. Yes indeed I’m using TeXLive. Alex from WinEdt also explained about the texify issue. I’m now just using –synctex=-1 (without putting the pdf before) everywhere for PDFTeX, PDFLaTeX, TeXify and PDFTeXify. Now I get a .synctex file at last. And I don’t need the pdfsync package. The forward search seems to go to a position with 2-3 lines earlier to where it is supposed to point. But I can live with that. So it’s working fine now with TeXLive 2008.
I have one question. Maybe you would be kind to help here:
Starting after a clean build, every time I press F8 the Sumatra window pops up maximized at the corresponding line entry (without I need to close the PDF viewer each time). I found that if I made an inverse search, then tries forward search again then the sumatra window is not maximzed as before. But of course still, sumatra is going to the right line in the PDF file. Closing the PDF window after an inverse search resets things to normal.
Is there a way by modifying the macro parameters to every time force the sumatra window to get maximized on screen when pressing F8? Or something like closing Sumatra first and then opening it again.
One more issue: I was surprised to see that when I click on a reference entry in the bibliography at the end of the PDF document, it opens up the .bbl bibliography file at the corresponding entry. Well, is it possible to open the .bib file instead of the .bbl file? This would indeed be very convenient if changes have to be made in the .bib file.
Thanks a lot
#7 by Rob J Hyndman on September 13th, 2009
Quote
1. For TeXLive there is no pdftexify so it doesn’t matter what switches you include. For pdftex and pdflatex you need
--synctex=-1.2. I think you probably mean that the sumatra window is not in focus (i.e., on top). By default, it remains hidden behind your WinEdt window. To change this, you need to modify the file Sumatra-Find.edt. Go to line 38 and change to the following:
DDEExe('[ForwardSearch("%P%N.pdf","%q%n%t",%!l,0,0,1)]');>The only change here is the last digit is changed from 0 to 1.
3. I don’t think it is possible to create links to the bib file(s). The way BibTeX works is that the bbl file is first created, and this is used when constructing the pdf file. So any links back to the bib files are not available.
#8 by y. calleecharan on August 2nd, 2009
Quote
Thanks for your very prompt reply. I’ll answer according to your numbered answers:
1. Yes, you’re right. TeXLive is different.
2. Thanks a lot. With the change that you specified, it now works perfectly i.e. the Sumatra window can be brought at any time on the top.
3. No worries for this one. I’m just becoming lazy and want everything to do in the minimal time
.
Again, many sincere thanks for your kind help in taking time to help others. The forward- and inverse-search is indeed a big time saver. I never could make it work with Adobe Acrobat.
#9 by y. calleecharan on August 2nd, 2009
Quote
Just a comment: In the instructions listed, I found that on my machine doing step 3 or a combination of steps 3 & 4 without doing step 2 will automatically brings the required changes in Sumatra regarding the path of WinEdt in Sumatra as being done in Step 2.
#10 by Christian on September 7th, 2009
Quote
Thank you for these detailed instructions. It works with my installation of WinEdt 5.5 / MikTeX 2.7 and the latest official release of SumatraPDF (0.9.4) from its official website. Seems that the special version specified in step 1 is no longer required.
There is, however, one more thing to consider with WinEdt. When the option “Start viewer” is active in one of the execution modes (step 4), for example in PDFTeXify, then the Adobe Reader will be launched on top of SumatraPDF. To avoid this behaviour, one should consider replacing the macro “Acrobat OpenDoc.edt” by an updated version:
“http://www.winedt.org/temp/Acrobat OpenDoc.edt”
Best regards -
Christian
#11 by Rob J Hyndman on September 7th, 2009
Quote
Thanks Christian. The instructions have been amended accordingly.
#12 by Jan on September 7th, 2009
Quote
Thanks Rob and Christian. The synchronization is working nicely.
As mentioned by Christian, with the latest version of SumatraPDF (beta 0.9.4) step 2 is not necessary anymore.
Best regards,
Jan
#13 by Rob J Hyndman on September 8th, 2009
Quote
Thanks Jan. I’ve deleted the old step 2 (and subsequent steps are now renumbered).
#14 by pedalracer@googlemail.com on September 13th, 2009
Quote
Hi
great that Rob updates infos here. I knew about Blum’ site but lot of old infos are confusing there.
My question is, cause I do not understand the varibales in the macro, whether I can install summatra somwhere else?
I need it in \B: in my WinEdt program directory.
thanks alot!
#15 by Rob J Hyndman on September 13th, 2009
Quote
You can install SumatraPDF wherever you like, so long as the directory is correctly specified in Step 3. The Sumatra-Find.edt macro will find SumatraPDF using the location specified in Step 3.
#16 by pedalracer@googlemail.com on September 14th, 2009
Quote
Thank you very much Rob.
I got it now running partly. Forward search by hitting F8 in WinEdt works more or less. It aims a bit besides.
But inverse or backward search is more importan for me and is not working. It seems to work on the first page but on page 2, 3, 4 etc. it isnt no more.
I write a paper with a known structure of projects that is like this.
+ main dir
-project file.tex
+ subdir
-chapter1
-chapter2
I use the include cmd, since I read that input is no good.
%\input{content/1-firstchapter.tex}
Bingo, I realized that you have NOT to use the “search forward” option under console applications! I think it is good to mention in your FAQ that users should backup their settings and then before they start editing the above content they press the button to set DEFAULT settings
#17 by pedalracer@googlemail.com on September 14th, 2009
Quote
Hello Rob
I got it now working and am very happy.
I want to ask you whether you want to publish an article on W. Blum’s
LatexDaemon.
There is so less information on it on the web despite it is such a great tool, when you can get it to run.
best regards
#18 by Rob J Hyndman on September 14th, 2009
Quote
Good to know it’s working for you. Thanks for the pointer to LaTeXDaemon — I’ll add it to my list of things to cover.
#19 by Pedro on September 24th, 2009
Quote
Hello Rob
Thanks! Works great, except in one situation.
If I call “Sumatra Find” when the pdf file is not already open in Sumatra, WinEdt hangs (busy for ever). I looked at the edt file but I am not sure how to test for this situation and open the file in Sumatra automatically.
I am using WinEdt 5.6 Beta and MikTeX 2.8 on Vista SP 2.
Very nice and useful blog, by the way. I am an agronomist turned biologist and use both LaTeX and R regularly, and find your blog and insights very useful.
#20 by Ziv Ran on September 29th, 2009
Quote
Thanks! It works perfectly (with MikTex 2.7). SO good to get
away from Yap.
The only slight improvement I can suggest is to make Windows focus on the Sumatra window
#21 by pedalracer on September 30th, 2009
Quote
Hello
It stopped working for me. Even forward search is no longer doing its job. All looks as it looks in this guide.
I wonder if there is something else important. I must ask what option is given under options/execution mode/tex options and there under
Tex auxiliary output folder?
Since I have my project structured in subfolders I assume that there is the culprit.
What I have is that I got the project.synctex with the project.pdf but Sumatra can’t use it for forward or inverse search. So I think that it may be linked to the fact that I have my chapters in the subdir \chapters\ ?!?
#22 by Rob J Hyndman on October 1st, 2009
Quote
I haven’t tested it using subfolders. On my system, I’m using %P as the auxiliary output folder.
#23 by pedalman on October 1st, 2009
Quote
Dear Rob
thank you for the information on the aux output folder. I reinstalled my Winedt on another machine in order to check what the default setting is there. However, I changed it to %P by checking the button in the options.
Unluckily, it is not working. I deleted all working files (aux etc.) and so on but I Sumatra is saying that
There is no syncronisation info at this point….. !?!
What a pity, since there is after each PdfLatex run a thesis.synctex. So, for some reasons Sumatra is not taking this into account. However, I implemented the Sumatra.edt macro and it once worked.
Maybe, there is a link to MikTex 2.8x?
#24 by Rob J Hyndman on October 1st, 2009
Quote
I don’t think I can help further. I now have it working on three computers, all with MikTeX 2.8 and SumatraPDF v0.9.4beta. It was previously working fine with MikTex 2.7 and SumatraPDF v0.9.3. The subfolders could still be your problem.
#25 by pedalman on October 1st, 2009
Quote
Ok,
thanks in advance for your patience. The good news are I found the problem and solved it!!
I think this will be helpful for others too.
I had to change all calls for any .tex fils from my project main file into XYZ.tex from originally XYZ without tex.
So in my case it has to look like.
\input{preambel/settings.tex}
\input{preambel/preambel.tex}
\input{macros/newcommands.tex}
\input{macros/TableCommands.tex}
\input{preambel/Hyphenation.tex}
Note the file endings when using input
cheers
#26 by Rob J Hyndman on October 1st, 2009
Quote
\input is not usually recommended. The preferred method is \include{}. You might find it works better with \include{}.
Pingback: Converting eps to pdf | Research tips
#27 by Lars Relund on October 6th, 2009
Quote
Hi Rob
After some work I got it to work. I had to
1) change to DDEExe(‘[ForwardSearch("%P\%N.pdf","%p%n%t",%!l,0,0,0)]‘);> line in Sumatra-Find.edt to DDEExe(‘[ForwardSearch("%P\%N.pdf","%n%t",%!l,0,0,0)]‘);>
2) Moreover, inverse search did not work before installing William Blum’s own version of Sumatra pdf. Here you can set the commandline of inverse search. My problem was that it looked in the ‘Program Files’ folder. Mine is named ‘Programmer’ instead (Danish WinXP version).
cheers
#28 by Marc on October 31st, 2009
Quote
Thanks a lot for the detailed instructions!
Forward search works fine hitting F8, but not when clicking the PDFTexify button. Do you know of a way to also enable forward search with PDFTexify?
Inverse search works too, but only for the first two lines of a section. I guess this behavior is caused by me using soft word wrapping in WinEdt. For inverse search to work as expected one should probably resort to smart wrapping.
#29 by Cris on November 16th, 2009
Quote
I followed ypur pocedure and everything works well. The only problem that I have is with the shortkey F8. When I use it the Sumatra-Find.edt file is open and the following phase is highlighted
Run(‘%$(“AcroRead”); -reuse-instance -inverse-search “\”%B\WinEdt.exe\”
What is the trouble?
Thanks Cristina
#30 by Myriam on December 3rd, 2009
Quote
Hello!
I’m having troubles with the forward search. I did all the steps but when i am hitting the F8 key, I get an warning message saying:
Keyword expected
^^^ ÿþ/
and then nothing happen…
Any idea what could it be?
Also 2 files open with sumatra when pushing the Textify button… Is that normal?
Thanks for the help.
#31 by Rob J Hyndman on December 3rd, 2009
Quote
Both problems sound odd. I haven’t seen them before. Make sure you’re using WinEdt 5.6 and MikTeX 2.8. Otherwise I don’t know what the problems could be.
#32 by Peter on February 11th, 2010
Quote
Hi,
Thank you very much for sharing this information. It works perfectly fine for me. I though have a question : why SumatraPDF ? Does it work with Acrobat Reader ?
Best regards
#33 by Rob J Hyndman on February 11th, 2010
Quote
No, it doesn’t work with Acrobat Reader. SumatraPDF allows the pdf file to be changed externally while it is still loaded.
#34 by Phillip Li on March 1st, 2010
Quote
Hi Rob,
Thanks for the informative blog.
I followed the instructions exactly and got it to work almost perfectly. When I press F8, the entire paragraph gets highlighted in SumtraPDF instead of the line. Is this normal?
I’m using Winedt Build: 20071003 (v. 5.5) and SumtraPDF V1.0.1.
Any ideas? Thanks a lot
#35 by Rob J Hyndman on March 1st, 2010
Quote
Yes, that is normal. The sync markers are only done at paragraph level, not at line level.
#36 by Shane on March 9th, 2010
Quote
This is an excellent tutorial! Thanks for putting it up, its really helped me out!