An AppleScript to ease working with LaTeX and vim
Jan 12, '07 07:30:00AM
Contributed by: mitmit
I spend too much time editing LaTeX documents, and my editor of choice has been long been gvim. One of the harder issues of working in LaTeX is that when you review your work, you have to switch back and forth between the viewer (I use PDFView) and the editor.
I was looking for a way to make this easier. I wanted a tool that I could use to point to a word in my viewer, and it would take me to the right line in the source file. Thus, this tip came to life.
- There's a package (that came with tetex) called pdfsync. This generates a lookup file.
- The PDFView viewer knows how to read this file, and allows running a custom script with the filename and line of code (set in preferences).
- I wrote a small AppleScript that talks to an open instance of vim (and launches it if it is closed), placing the cursor on the right place.
The end result is really all I wanted. I command-click on a word in my viewer, and the cursor jumps to the right spot in my editor of choice -- how fun! Hope others can find a use for this, too.
[robg adds: I haven't tested this script, and the links to the various sites are mine, so blame me for any errors in direction!]
Comments (15)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070111095701823