econo phd <econophd <at> gmail.com> writes: > > > Hello,I have been using LyX quite for a while. Thanks to all who contributed. LyX 2 is great.But I had difficulty in configuring and using inverse and forward-search features for SumatraPDF.I developed my own solution, perhaps you might be interested.1. I was annoyed by command windows popoping up everytime i use inverse search from sumatra pdf to lyx. So I have two compiled exe files for this. > > lyxeditor.exe does similar to lyxeditor.bat described in documentation > lyxswitch.exe switchs correctly back to lyx after inverse search > 2. Configuring lyx for inverse and forward search is quite cumbersome, for some reason inverse search was not working since sumatrapdf was called from "C:\Program Files\Lyx20\bin". > I added SumatraPDF folder in LyX:Preferences:Paths:PATH prefix > SumatraView.bat as PDF viewer under file formats, pdf (pdflatex) as viewver > > All files are attahced and below you can find codes. > Inverse and Forward search works seamlessly. If you have a large screen, put lyx on left and sumatra on right side, it is great to work.You should put all files under your default SumatraPDF foldercodes: > 1. SumatraView.bat (for configuring inverse search and making forward search work correctly)start "" /D"%~dp1" /B "SumatraPDF.exe" -reuse-instance -inverse- search "lyxeditor.exe %%f %%l" %~nx12. lyxeditor.exe (lyxeditor.ahk, compiled using http://www.autohotkey.com/)Run %comspec% /q /c echo LYXCMD:revdvi:server- goto-file-row:%1% %2%> \\.\pipe\lyxpipe.in&&type \\.\pipe\lyxpipe.out, , HideSetTitleMatchMode, 2Loop, Parse, 1, \{ IfInString, A_LoopField, .tex { StringReplace, lyx, A_LoopField, .tex , .lyx IfWinExist, %lyx% WinActivate }}2. lyxswitch.exe (lyxswitch.ahk, compiled using http://www.autohotkey.com/)SetTitleMatchMode, 2Loop, Parse, 1, \{ IfInString, A_LoopField, .tex { StringReplace, lyx, A_LoopField, .tex , .lyx IfWinExist, %lyx% WinActivate ; use the window found above }}Regards,econophd > > Attachment (LyX_SumatraPDF.7z): application/octet-stream, 213 KiB
Hello, Thank you! It worked fine here! But, there is a small problem with lyxeditor. It does not work for lines whose number are less than 10. but I solved it. You just have to put the whole string that has to be sent to the lyxpipe in parentheses, like that: Run %comspec% /q /c (echo LYXCMD:revdvi:server-goto-file-row:%1% %2%)> \\.\pipe\lyxpipe.in&&type \\.\pipe\lyxpipe.out, , Hide that's it. thank's again. best regards, --Daniel