Results 1 to 10 of 30

Thread: HOWTO: Evince + SyncTeX + vim/emacs/scite/lyx/kile/$EDITOR + forward/backward search

Threaded View

  1. #1
    Join Date
    Nov 2008
    Beans
    5

    HOWTO: Evince + SyncTeX + vim/emacs/scite/lyx/kile/$EDITOR + forward/backward search

    Hi!

    For all of you who didn't get forward/backward search to work. Here is my solution. Thanks to José Aliste who wrote gedit-synctex-plugin:

    Preamble

    1. Download these files
    2. deflate them to ~/bin (or something within $PATH)


    Backward Search (Evince → Editor)

    1. Adopt the first line of »~/bin/evince« (EDITORCMD) to your needs. (run »evince_backward_search« to get help for possible entries)
    2. Compile your .tex File with synctex (»pdflatex -synctex=1 myfile.tex«)
    3. Run »evince myfile.pdf« (The script should run evince_backward_search and evince)
    4. click on some text in evince with »Ctrl+leftclick«
    5. the editor should jump to the corresponding line


    Forward Search (Editor → Evince)

    1. you have to tell your editor, to run »evince_forward_search $PDFFILE $LINE $TEXFILE« when pressing some key.
    2. go to some line in your editor and press the key
    3. evince should mark the corresponding line



    in my case (using vim-latexsuite), I wrote in ~/.vim/after/ftplugin/tex.vim:

    Code:
    function! Tex_ForwardSearchLaTeX()
      let cmd = 'evince_forward_search ' . fnamemodify(Tex_GetMainFileName(), ":p:r") .  '.pdf ' . line(".") . ' ' . expand("%:p")
      let output = system(cmd)
    endfunction
    Afterwards you can do forward search in vim with \ls

    Ben

    edit: thanks to hugmenot, I changed the code according to your comment
    edit: changed .vim/ftplugin to .vim/after/ftplugin (thanks to jorges00)
    Last edited by Ben___; July 21st, 2011 at 12:44 AM. Reason: adopted to jorges00 advice

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •