1

If I start up TeXstudio by launching it normally as an app in OS X Yosemite, whenever I build and view a document, it complains kpsewhich: command not found.

However, which kpsewhich in a terminal shows it exists at /Library/TeX/texbin/kpsewhich. And echo $PATH includes /Library/TeX/texbin. So if I start up TeXstudio from the terminal the problem disappears.

I wonder if there is PATH configuration problem somewhere for TeXstudio such that it does not load /Library/TeX/texbin properly. If so, how do I fix it?

Note: my problem initially led me to this question, but I have installed the latest MacTex and updated all my packages using TexLive, so it should be safe to say the cause of my problem is different.

MLister
  • 135
  • Can you not configure paths in the settings for the editor? I'd assume that might be necessary. I have not used MacTeX for ages, but it used to use /usr/texbin. (This was a symbolic link to the directory in /Library but /Library would not typically have been in PATH.) However, I know Apple is locking out users from /usr so maybe this has changed to workaround that problem. – cfr Sep 12 '15 at 02:31
  • Certainly in earlier versions of OS X, GUI applications did *not* typically inherit PATH, and getting them to do that was a complete headache. However, I thought they had done away with at least some of the craziness of the system. – cfr Sep 12 '15 at 02:33
  • MacTeX 2014 installs links at /usr/texbin and /Library/TeX/texbin as future-proofing against the next release of OS X, which will wipe out /usr/texbin for good. Yosemite did have an environment bug that would cause problems like this, but it should be fixed as of 10.10.4 or so. How do your paths compare to this? http://tex.stackexchange.com/questions/38627/commands-paths-in-texstudio-on-mac-os-x-with-could-not-start-the-command-err – Adam Maxwell Sep 12 '15 at 03:18
  • @cfr, yes, the /usr/texbin stuff are all symbolic links, but the question is which setting(s) in TeXstudio I should adjust to fix the problem. – MLister Sep 12 '15 at 03:42
  • @AdamMaxwell, I'm running 10.10.5, and I've compared my settings in the question you referenced, they are the same. But the problem persists. – MLister Sep 12 '15 at 03:54
  • Do you know how exactly the PATH is set on your Mac? For Linux users this usually comes when people manually set path in bashrc, then things does not work in editors started from a menu. Also exactly what is listed in the TS command config for say pdflatex? – daleif Sep 12 '15 at 06:01
  • @daleif, PATH is set via '~/.bash_profileand I have little idea in terms of whether and how TeXstudio picks it up. Forpdflatex, the command config is:/usr/texbin/pdflatex -synctex=1 -shell-escape -interaction=nonstopmode %.tex` – MLister Sep 12 '15 at 06:39
  • This seems to mean that TS gas setup full paths instead of just noting the commands to be called. What does which pdflatex say? – daleif Sep 12 '15 at 06:51
  • @MLister Do programs launched from the Finder read .bash_profile? I don't think they do. – egreg Sep 12 '15 at 07:06
  • What does ls -l /usr/texbin/pdflatex give? – cfr Sep 12 '15 at 11:09
  • TeXstudio implicitly assumes that kpsewhich is in the same directory as latex. Try setting an absolute path to the latex command in Options -> Commands. – Tim Hoffmann Sep 12 '15 at 11:16
  • @daleif, which pdflatex gives /Library/TeX/texbin/pdflatex – MLister Sep 14 '15 at 20:26
  • @cfr, ls -l /usr/texbin/pdflatex gives /usr/texbin/pdflatex -> pdftex – MLister Sep 14 '15 at 20:28
  • @doed, do you mean the Commands ($PATH) field under Additional Search Paths section? At the moment it shows /usr/local/texlive/2012/bin/x86_64-darwin – MLister Sep 14 '15 at 20:31
  • Are you really using TeX Live from 2012? Change that path under Additional Search Paths to /usr/texbin. ls -l /usr/texbin/pdftex should point to something under /Library. The stuff under /Library should include symbolic links to /usr/local/texlive. – cfr Sep 14 '15 at 21:07
  • @cfr, this is very strange. I just looked up /usr/local/texlive/2012/bin/x86_64-darwin, but it didn't even exist, instead, there is /usr/local/texlive/2015/bin/x86_64-darwin, which made me think that TeXstudio hardcodes some of these paths and ignore it if not available and try to look elsewhere automatically. – MLister Sep 14 '15 at 21:30

0 Answers0