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

Thanks a lot! Got it working with LyX 2.1 and SumatraPDF.
A little improvement: Your download link has the wrong file extension but
links to a .bin file, which is in fact the 7zip file. 

Reply via email to