Hello, I am new here and I am not even sure I set up my user name correctly. I have been using Sumatra with WinEdt for about 15 years and no problem. But I got a new laptop, reinstalled all the programs. Everything seems to be fine so far, but the only trouble is that the inverse search does not work. Any suggestions folks? I have the feeling I need to change a symbol somewhere, but where? Thanks. M
Home / Inverse search with winedt
Well a lot has changed over those years EXCEPT the inverse code in SumatraPDF, however the suggested method of use has changed.
Supposedly IF SumatraPDF was installed before WinEdt it was as far as I know able to configure itself accordingly. but if you have installed WinEdt and customized parts its probably not wise to uninstall and reinstall in case I am wrong (long time since using the two).
The marriage is not a troublesome one but can be done several ways and suggestions to do it wrong are all over the web. Basically check the relevant doc suggestions at WinEdt help/web pages (do not look elsewhere) that should ensure it calls SumatraPDF the correct way.
“a more TeX-friendly viewer is Sumatra. Click on the Help button at WinEdt’s Options → Execution Modes| PDF Viewer for details (and check out the Help topic, Adobe Blues; use the Index).”
Now the tricky part is I have no idea what that is or where the inverse call needs to be directed.
So check its working forwards as expected with both a PDF and synctex file generated together in the same folder and double click the PDF text in SumatraPDF should trigger the inverse function, then we can take it from there if not working well.
I will need to know where WinEdt.exe is located to check any backwards miscalling
Thanks for replying. WinEdt was installed first. Sumatra give
"C:\Program Files\WinEdt Team\WinEdt 10\WinEdt.exe" -C="WinEdt 10.3" "Open(|%f|);SelPar(%l,8);]"
for inverse search and WinEdt uses this C:\Users\user\AppData\Local\SumatraPDF\SumatraPDF.exe to look for Sumatra, and that’s where it is.
OK the reverse call should generally work even though old school DDE method, However on checking MyNotes is still my recommended solution. for test I suggest download https://github.com/GitHubRulesOK/MyNotes/raw/master/AppNotes/SumatraPDF/LATeX%20and%20Reverse-Search.zip as a known set of working files for testing.
Extract a copy of the 4 files clearly the version number of WinEdt has changed but the call mentioned was version-less and needs the full path to the .exe
WinEdt =
"\editor\winedt.exe" "[Open(|%f|);SelLine(%l,8)]"`
on miktex pdf viewer set syctex options.
using the copy of the pdf in a folder with both .tex and . synctex a double click on text in that PDF “SHOULD” open the tex file in WinEdt editor!
NOTE there is a difference in that my example ends with SelLine
where your ends SelPar
so unsure if that’s a factor %l
should be a line number at run time.
Done as ordered and the inverse search seems to work just fine with your files, albeit it’s only one page. So why doesn’t it work with mine?
I changed SelPar to SelLine and it seems to work on another file of mine. But still does not work on the first file.
The reason the test files work are they were all correctly built in one session, A problem not instantly obvious to a user is if the PDF file time of building is not the same as the time the synctex file is written. they MUST be generated in the same pass. Also the position index in the synctex is an estimation of the zone of interest for the reverse search so sometimes that is not correctly defined for some types of /input or /include. That may change by using Select Paragraph rather than Select Line so I am uncertain why WinEdt uses that definition but may be based on their experience.
The files were produced at the same time. I make all the files while running PdfTextify. As I said, two other files seem to work OK. The only difference between the two files with working inverse search and the file with non-working inverse search is that the latter uses \href. Could \href affect inverse search?
I figured out and what a mystery! I removed \pagecolor and now the inverse search seems to work OK. I did not have this problem before. But why? I have used \pagecolor for years, to make pages darker, it’s easier on eyes. Home come it doesn’t work now? I tired different versions of Sumatra but only one WinEdt, so it must be WinEdt. That’s a drag.
if \pagecolor is a whole of page object and assigned a synctex entry that confuses or masks the other indexed page entries it may be newer synctex behaviour. SumatraPDF still uses an older version but unlikely WinEdt rather a change in PDFLaTeX/Synctex, if you can add that as a last enhancement after edits then that could be a workaround.
Thank you. I think I just edit the settings file to make a dark theme. Bye