[OS X TeX] Staying on the right PATH (or something)

Maarten Sneep maarten.sneep at xs4all.nl
Wed Nov 14 22:03:49 CET 2007


On 14-nov-2007, at 15:50, Morten Høgholm wrote:

> On Windows, latex and friends are added to the PATH by MiKTeX and  
> so one can call it as
>   latex %.tex
> This works on *nix as well but not on OS X even though latex is of  
> course in the PATH. Can anybody explain to me why this is?

This depends a bit on how you call latex here. The application itself  
will not inherit the users' $PATH from their $SHELL (just request the  
PATH environment variable in your application and print it somewhere,  
I got just "/usr/bin:/bin/usr/sbin:/sbin"). That is restricted. So  
the fact you you have customised  your terminal, means squat for a  
Cocoa or GUI application.

> TeXShop expects the path to the executable as well, right?

TeXshop has a setting where tex & friends are to be found, and where  
ghostscript can be found. Beyond that you can specify the application  
that will be used for pdftex and pdflatex there, and the simpdftex &  
co. The actual calling of (la)TeX is done from short shell scripts,  
"engines". Some experimentation tells me that TeXShop offers a  
modified environment to these scripts, adding the elements from the  
preferences to the path environment variable.

> And what does an application like Aquamacs do differently, since it  
> just has a call to latex and doesn't care where it is located?

It probably alters the environment with the default locations, or  
asks the users' shell, and runs the accompanying startup scripts for  
itself.

> I would appreciate it if someone could enlighten me in this matter.

Please avoid the .MacOSX/environment.plist route.

Maarten


More information about the macostex-archives mailing list