econo phd
2011-05-03 10:52:00 UTC
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 folder
codes:
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" %~nx1
2. 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, , Hide
SetTitleMatchMode, 2
Loop, 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, 2
Loop, Parse, 1, \
{
IfInString, A_LoopField, .tex
{
StringReplace, lyx, A_LoopField, .tex , .lyx
IfWinExist, %lyx%
WinActivate ; use the window found above
}
}
Regards,
econophd
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 folder
codes:
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" %~nx1
2. 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, , Hide
SetTitleMatchMode, 2
Loop, 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, 2
Loop, Parse, 1, \
{
IfInString, A_LoopField, .tex
{
StringReplace, lyx, A_LoopField, .tex , .lyx
IfWinExist, %lyx%
WinActivate ; use the window found above
}
}
Regards,
econophd