[OS X TeX] kpsewhich and TeXShop

Luis Sequeira lfsequeira at fc.ul.pt
Mon Jan 7 11:25:11 EST 2008


>
> On comp.tex.text the following script was recommended to me for
> easily viewing sty and cls files within packages:
>
> #!/bin/sh
> emacs -f toggle-read-only `kpsewhich $*`  &
>
> Is there a way to modify it to open the file in TeXShop instead of
> emacs?
>

You may try the following variation:

#!/bin/sh
open -a TeXShop `kpsewhich $*`  &



The kpsewhich command is used to find the relevant cls or sty file,  
and the back quotes are used to substitute the *output* of this  
command as a list of arguments.
The first version is thus passing it as arguments to (the command line  
version of) emacs. Since, AFAIK, there is no standard command line  
call to launch TeXShop, I used the open command to invoke it.
This works as expected in my mac, but I offer no warranty. It should  
do no harm, though.

Don't forget to save the script in an adequate place and to make it  
executable: chmod 755 <script name here>

Luis Sequeira




More information about the MacOSX-TeX mailing list