# XeTeX and xdvipdfmx problem in Texstudio (2)

I'm issuing the same problem like in this question, but unfortunately it was closed for whatever reason: XeTeX and xdvipdfmx problem in Texstudio

When I try to compile the .tex file from the commandline it works with no errors, it seems that Texstudio doesn't use the same PATH variable as my shell does.

I can reproduce this error by removing the TeX folder from my PATH variable and execute:

simon$/usr/texbin/xelatex table.tex This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013) restricted \write18 enabled. entering extended mode (./table.tex LaTeX2e <2011/06/27> ======= some latex processing stuff ======= Overfull \hbox (15.0pt too wide) in paragraph at lines 39--40 [][] [1] (./table.aux) ) sh: xdvipdfmx: command not found (see the transcript file for additional information) Error 32512 (driver return code) generating output; file table.pdf may not be valid. Transcript written on table.log. seims-lappi:LatexTable simon$


I think that Xelatex causes this error by calling xdvipdfmx instead of ./xdvipdfmx internally, because other TeX Tools work fine, even without PATH variable set.

Version of Xelatex is:

simon$/usr/texbin/xelatex -v XeTeX 3.1415926-2.5-0.9999.3-2013061817 (TeX Live 2013) kpathsea version 6.1.1 Copyright 2013 SIL International and Jonathan Kew. There is NO warranty. Redistribution of this software is covered by the terms of both the XeTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the XeTeX source. Primary author of XeTeX: Jonathan Kew. Compiled with ICU version 51.1; using 51.1 Compiled with zlib version 1.2.7; using 1.2.7 Compiled with FreeType2 version 2.4.11; using 2.4.11 Compiled with Graphite2 version 1.2.1; using 1.2.1 Compiled with HarfBuzz version 0.9.15; using 0.9.15 Using Mac OS X Core Text, Cocoa & ImageIO frameworks  ## 1 Answer The Mac version of TeXstudio automatically adds a directory to the PATH, but it's set to /usr/local/texlive/2012/bin/x86_64-darwin/ by default. If you click Show Advanced Options in the Preferences page, under Build > Build Options > Additional Search Paths, change Commands ($PATH) to /usr/texbin and it should work, even if you upgrade MacTeX or TeX Live.

Edit: In Mac OS 10.11 El Capitan, users can't put anything in /usr/ anymore so MacTeX symlinks to /Library/TeX/texbin instead.