I am running LyX 2.0.2 in Ubuntu 12.04 and using the default PDF viewer Evince.
I want to setup SyncTeX to go back and forth between the document and the source, at the right position in the text.
I found this in the LyX website, but it doesn't give the Evince viewer.
http://wiki.lyx.org/LyX/SyncTeX
Does anybody know how to set it up?
Best Answer
It seems there's no easy way to do this, yet.
Modifying Scripts
evince
toevince-synctex
. (To be sure that this file will be started because/usr/bin/evince
will be found first inPATH
.)Open this file (
evince-synctex
) and replace the second line (starting withEDITORCMD
) toIn file
evince_backward_search
, replace the linecmd = re.sub("%f",input_file,self.editor)
withBe sure that this text aligns with the text of the lines afterwards. (That change is needed because it seems that LyX can't handle filenames starting with "file://".)
Move all three files (
evince-synctex
,evince_backward_search
,evince_forward_search
) to/usr/local/bin
(needs root rights). (That's the place where user scripts should be stored.)Extra for Evince 3.4.0 (= Ubuntu 12.04)
In file
evince_forward_search
, replace the last line (starting withwindow.SyncView(
) withSetting up LyX
evince_forward_search $$o $$n $$t
evince-synctex
.Backward Search (Evince -> LyX)
Forward Search (LyX -> Evince)