[texworks] LaTeXmk issue with Mac OS X Yosemite (new OS)

Stefan Löffler st.loeffler at gmail.com
Sun Oct 19 16:50:46 CEST 2014


Hi,

unfortunately, I don't have a Mac, so I can't test.

On 18.10.2014 22:47, Guillaume Cabanac wrote:
> It is as if pdflatex (invocated from latexmk.pl) was not found in the PATH.
>    ---> sh: pdflatex: command not found
>
> Compiling from the terminal with latexmk works, though.
>
> Could it be that when TeXworks launches latexmk.pl in a process, the environment is not set?  -- a change in how OSX handles processes?
>
> Here are seemingly related info -> https://github.com/SublimeText/Issues/issues/388

Indeed, your problem seems related to the one mentioned on the github
issue page you linked. In fact, I can confirm that Tw calls whatever
tool you specified by its absolute path (it has to, otherwise you
couldn't specify different directories in the preferences). So it does
seem as though the environment is not passed on properly. Unfortunately,
Tw relies on Qt to do that, (by calling setEnvironment() on the
process), so maybe this is a Qt bug (or even quite generally a popen bug)?

Anyway, to test, could you save the following script, make it
executable, install it as a new tool in Tw, and use it for typesetting:
#!/bin/sh
env


This should print the environment a tool gets in the output console. If
that's empty (or just a few default values), there seems to be a
fundamental issue with the passing of the environment. If that's the
case and if there is a ~/.bashrc or ~/.profile file or similar on the
Mac, you could try sourcing that at the beginning of the script and see
if the values change. I.e., change the script to read
#!/bin/sh
source ~/.profile
source ~/.bashrc
env

HTH
Stefan


More information about the texworks mailing list