Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use Skim to view TeX source in TeXShop UNIX
Recently, someone asked me how they could use Skim as his TeXShop previewer. That is, he really liked Skim and wanted to be able to use its PDFSync support to bring up a line of TeX source inside TeXShop. So I put together a shell script that mainly consists of the following:
fileName="$1"
lineNumber="$2"
gotoString=""

[ "${fileName:0:1}" == "/" ] || fileName="${PWD}/${fileName}"
[ "${lineNumber}" == "" ] || gotoString="goto line ${lineNumber}"

exec osascript \
  -e "set texFile to POSIX file "${fileName}"" \
  -e "tell application "TeXShop"" \
    -e "activate" \
    -e "open texFile" \
    -e "tell front document" \
      -e "refreshtext" \
      -e "${gotoString}" \
    -e "end tell" \
  -e "end tell"
If you save this script as texshop in your PATH (e.g, as /usr/local/bin/texshop) and chmod it 0755 (e.g., chmod 0755 /usr/local/bin/texshop), then you can go into the Skim LaTeX preferences and set the Preset to Custom, with the Command set to texshop, and the Arguments set to "%file" %line. I hope some other people find this useful

[robg adds: I haven't tested this one.]
    •    
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[9,107 views]  

Use Skim to view TeX source in TeXShop | 2 comments | Create New Account
Click here to return to the 'Use Skim to view TeX source in TeXShop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use Skim to view TeX source in TeXShop
Authored by: ars on Jul 18, '07 09:29:06AM
This hint, plus a couple of other scripts, seem to be also on the Skim wiki pages:
http://skim-app.sourceforge.net/wiki/index.php/LaTeX_and_PDFSync

[ Reply to This | # ]
Use Skim to view TeX source in TeXShop
Authored by: Soliman on Jul 18, '07 12:04:43PM
You might want to add a shebang like #!/bin/bash at the start of the script, and maybe replace all the -e by a simpler

osascript << END
command...
command...
END

---
Sylvain

[ Reply to This | # ]