[texworks] Adding to typesetting path on MacOS

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Oct 27 13:46:01 CET 2024


On 27/10/2024 12:42, Duncan Murdoch wrote:
> On 2024-10-27 6:03 a.m., Duncan Murdoch wrote:
>> For one of the typesetting tools I'm using, I need access to ghostscript
>> for graphics file format conversion.  My copy of gs is in /opt/
>> homebrew/bin.
>>
>> I am having trouble adding /opt/homebrew/bin to the typesetting path,
>> because the preferences dialog opens a file dialog for changes, and /opt
>> isn't showing up.  If I open / in the Finder, it shows opt as a grayed
>> out entry, presumably indicating some sort of hidden attribute, but I
>> don't see it at all in the TeXWorks dialog.
>>
>> Any suggestions how to add it to the typesetting path?  I suuppose I
>> could link to gs from an existing directory in the path, but I'd prefer
>> a cleaner solution.
>
> I found a solution to this:  if I open / in the TeXworks dialog, and
> also in a Finder window, I can drag /opt from Finder to the TeXworks
> dialog and it will open.  Then I can add my /opt/homebrew/bin entry.
>
> HOWEVER, this doesn't help.  gs is still not being found.  If my
> typesetting tool prints the PATH that it sees, it shows a minimal path:
>
>    /usr/bin:/bin:/usr/sbin:/usr/local/bin
>
> If I start TeXworks from a shell, then it sees the full path that was
> active in the shell, and things are fine.
>
> So now my question is:  how do I change the PATH environment variable
> that typesetting tools see?
>
> Duncan Murdoch

You can't - as TeXworks is cross-platform, it doesn't have a special
feature to address the way macOS deals with the path for GUIs
(basically, they don't get one), cf. macOS-specific tools like TeXshop.

You have to arrange that whatever tools you need are visible inside the
'correct' paths - here, MacTeX should have arranged that GhostScript is
inside /usr/local/bin, so I'm wondering why you are trying to use one
from HoneBrew.

Regards,

Joseph



More information about the texworks mailing list.