<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi,<div><br></div><div>Instead of launching TeXworks by double clicking the icon, you can open a terminal window and execute</div><div><br></div><div><div>/Applications/TeX/TeXworks.app/Contents/MacOS/TeXworks&</div><div><br></div><div>Then TeXworks will access any tool currently available in the terminal.</div><div>I personnel use that with the minted package that needs access to python.</div><div><br></div><div>If necessary, you can change "/Applications/TeX" to fit your needs.</div><div>The final & is optional, it means to run TeXworks in the background of the terminal.</div><div><br></div><div>Jérôme LAURENS</div><div><br><blockquote type="cite"><div>Le 27 oct. 2024 à 14:36, Duncan Murdoch <murdoch.duncan@gmail.com> a écrit :</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">On 2024-10-27 9:14 a.m., Duncan Murdoch wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">On 2024-10-27 8:46 a.m., Joseph Wright wrote:<br><blockquote type="cite">On 27/10/2024 12:42, Duncan Murdoch wrote:<br><blockquote type="cite">On 2024-10-27 6:03 a.m., Duncan Murdoch wrote:<br><blockquote type="cite">For one of the typesetting tools I'm using, I need access to ghostscript<br>for graphics file format conversion.  My copy of gs is in /opt/<br>homebrew/bin.<br><br>I am having trouble adding /opt/homebrew/bin to the typesetting path,<br>because the preferences dialog opens a file dialog for changes, and /opt<br>isn't showing up.  If I open / in the Finder, it shows opt as a grayed<br>out entry, presumably indicating some sort of hidden attribute, but I<br>don't see it at all in the TeXWorks dialog.<br><br>Any suggestions how to add it to the typesetting path?  I suuppose Iis a<br>could link to gs from an existing directory in the path, but I'd prefer<br>a cleaner solution.<br></blockquote><br>I found a solution to this:  if I open / in the TeXworks dialog, and<br>also in a Finder window, I can drag /opt from Finder to the TeXworks<br>dialog and it will open.  Then I can add my /opt/homebrew/bin entry.<br><br>HOWEVER, this doesn't help.  gs is still not being found.  If my<br>typesetting tool prints the PATH that it sees, it shows a minimal path:<br><br>    /usr/bin:/bin:/usr/sbin:/usr/local/bin<br><br>If I start TeXworks from a shell, then it sees the full path that was<br>active in the shell, and things are fine.<br><br>So now my question is:  how do I change the PATH environment variable<br>that typesetting tools see?<br><br>Duncan Murdoch<br></blockquote><br>You can't - as TeXworks is cross-platform, it doesn't have a special<br>feature to address the way macOS deals with the path for GUIs<br>(basically, they don't get one), cf. macOS-specific tools like TeXshop.<br><br>You have to arrange that whatever tools you need are visible inside the<br>'correct' paths - here, MacTeX should have arranged that GhostScript is<br>inside /usr/local/bin, so I'm wondering why you are trying to use one<br>from HoneBrew.<br></blockquote>I'm not using MacTeX, I'm using a different minimal install of TeXLive.<br>But this isn't really a MacOS specific issue.  I think often the<br>typesetting tools would want a different PATH than the system PATH.  I<br>thought that was what the "Paths for TeX and related programs" section<br>of the TeXworks preferences was for.  So what does it actually do?<br></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Okay, I see now.  Every typesetting command runs a single executable, not a script.  TW uses the "Paths" setting to find that executable, it doesn't set the PATH to find it.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">So I guess a suggestion would be to do both things:  set the path as requested, then run the executable.</span><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Duncan Murdoch</span></div></blockquote></div><br></div></div></body></html>