Forward searching (in this context) is the process of editing a latex file and by a keypress and some magic you are catapulted into your pdfviewer to the exact same point that your cursor was pointing to in your editor.
Backward searching is the reverse process, where you click on some place in the pdf viewer and you are then referred to the source of this text within your favourite latex viewer.
Requirements:
Vim/MacVim and latex-suite; some pdfviewer (skim here) with pdfsync support and one of the two latex/tex packages pdfsync/synctex.
To make it work in Skim you need to open the preferences, goto the sync tab and enter:
Preset: CustomDrop this code into a file in your path and make it executable
Command: mvim
Arguments: --remote-silent +":%line;foldo!" "%file"
Then put this into your vimrc file:#!/bin/sh
/Applications/Skim.app/Contents/SharedSupport/displayline -r "$2" "$1" "$3"
This was the only way i could get it to work under vim and macvim simultaneously. Then you just need one last line in every tex file you want it to work to set everything up:let g:Tex_ViewRule_pdf = 'pathtofile'
let g:Tex_ViewRule_ps = 'pathtofile'
let g:Tex_TreatMacViewerAsUNIX = 1
It's really that easy. Now in order to jump from vim to skim you need to type \ls and to get from skim to vim you would Shift+Command-Click\usepackage{pdfsync}
Try it; its grand. Enjoy!
Dumb question: What do you mean "drop this code into a file in your path"?
ReplyDeleteOK, I think you mean in any path referred to in the 'pathtofile' ... hoping to get this to work for months. now "\ls" won't do anything
ReplyDeletewhoah, it was just that I used a comma for mapping. It now works! This is an epic moment for me.
ReplyDeletethanks so much for this page!
ReplyDelete