Created
June 19, 2016 14:23
-
-
Save wulingyun/26425c543a2d39111514b3654b33fc10 to your computer and use it in GitHub Desktop.
Using Sumatra with WinEdt, add the following code to "WinEdt\Exec\Acrobat OpenDoc.edt", before the line: // GSView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sumatra? | |
FindInString(`%$('AcroRead')`,'SumatraPDF',1,2,1000,1); | |
IfOK(!"Relax;",!"JMP('not_sumatra')"); | |
Run('%$("AcroRead"); -reuse-instance -inverse-search "\"%B\WinEdt.exe\" \"[Open(|%%f|);SelPar(%%l,8);]\"" "%P\%N.pdf"','%P',0,0,'%N.pdf - SumatraPDF',1,1); | |
DDEOpen('',"SUMATRA","control",1); | |
// send a DDE command to perform forward-search | |
// the format of the DDE command is [ForwardSearch("<pdffilepath>","<sourcefilepath>",<line>,<column>[,<newwindow>, <setfocus>])] | |
// if newwindow = 1 then a new window is created even if the file is already open | |
// if focus = 1 then the focus is set to the window | |
// e.g. [ForwardSearch("c:\file.pdf","c:\folder\source.tex",298,0)] | |
DDEExe('[ForwardSearch("%P\%N.pdf","%q%n%t",%!l,0,0,0)]'); | |
DDEClose; | |
RestoreRegisters(1111111111); | |
Exit; | |
:not_sumatra:: =================================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment