9

When I am trying to 'quick build' my document in TeXstudio 2.1 on Mac OS X 10.6.8, I am getting and error: could not start the command (with 'quick build' options being LaTeX + DviPdf + PdfViewer). I know that this question has resonated across different forums:

and I realized that the key to solution is to set the right commands paths in options > configure texstudio > commands - the image below shows exactly how I set it up. So I set ALL command paths to /usr/texbin/latex, Now, the error disappears, TeXstudio starts the compilation process, but never finishes - it simply freezes in the compilation process.

I have to add I compiled the document in TeXShop and it works fine, so... it must be something I messed up with the command paths...

screen capture texshop commands paths

  • 2
    /usr/texbin is fine, but it must be followed by the right tool; for PdfLaTeX it should be pdflatex, for instance. – egreg Dec 17 '11 at 21:37

2 Answers2

12

Paths for a MacTeX distribution

The following settings should work:

latex       "/Library/TeX/texbin/latex" -synctex=1 -interaction=nonstopmode %.tex    
dvips       "/Library/TeX/texbin/dvips" -o %.ps %.dvi
ps2pdf      "/usr/local/bin/ps2pdf" %.ps    
MakeIndex   "/Library/TeX/texbin/makeindex" %.idx    
BiBTeX      "/Library/TeX/texbin/bibtex" %.aux    
pdfLaTeX    "/Library/TeX/texbin/pdflatex" -synctex=1 -interaction=nonstopmode %.tex    
dvipdf      "/Library/TeX/texbin/dvipdfm" %.dvi    
dvipng      "/Library/TeX/texbin/dvipng" -T tight -D 120 %.dvi    
Metapost    "/Library/TeX/texbin/mpost" --interaction nonstopmode     
DVI viewer  open %.dvi    
PS viewer   open %.ps    
PDF viewer  open %.pdf    
Ghostscript /usr/local/bin/gs "?am.ps"    
Asymptote   "/Library/TeX/texbin/asy" %.asy

If you have updated to a recent MacTeX and need to change them all at the same time, you can quit out of the app and edit the texstudio.ini file which is stored in ~/.config/texstudio. This is a plain text file and you can then do a global replace of the old path with /Library/TeX/texbin.

Paths for other types of distributions

If you are using any other TeX distribution, for example MacPorts or Fink, you will need to change /usr/texbin/ to the relevant path in that particular distribution. In MacPorts it is /opt/local/bin/.

I would not recommend using such a distribution, however, as they are generally harder to keep updated.

Screenshot

screenshot

Alan Munn
  • 218,180
  • 3
    I've added -synctex=1 also to the PdfLaTeX entry, which of course is missing from the screen shot, but is highly convenient. – egreg Dec 17 '11 at 21:47
  • Excellent, thank you Alan and @egreg - it works perfectly! – Geek On Acid Dec 17 '11 at 22:18
  • Thanks!! I had %.aux inside of double quote, I have changed to "/usr/texbin/bibtex" %.aux and all is ok. –  May 15 '12 at 11:54
  • my configuration is exactly what you typed up there, but still I get the error "could not start the command". I am using a newer version of TexMaker with MacTex. Where am I doing wrong? –  Dec 12 '12 at 11:00
  • As of Os X 10.11 all paths starting with /usr/texbin/ should be changed to /Library/TeX/texbin/. – Aydin Oct 29 '15 at 14:52
  • Where does this stuff go? I downloaded a latex template and tried to run it on a new OSX, gives me thes /usr/textbin/ error, but that code doesn't appear in the file. Where do I type /Library/TeX/texbin/? – Steve Jan 28 '16 at 00:11
  • @Steve Sorry this answer was out of date. The correct path should be /Library/TeX/texbin (replacing /usr/texbin in all of the settings. This tells you how to set the settings in the preferences for TeXMaker. The screenshot (which still shows the old paths at the moment) should help. Did you also install MacTeX? – Alan Munn Jan 28 '16 at 01:52
5

Note that old paths in /usr are not valid anymore in Os X 10.11+. All paths starting with /usr/texbin/ should be changed to /Library/TeX/texbin/.

Aydin
  • 1,983
  • One of the nice things about Stackexchange is that everyone can edit the content. So instead of adding this as an answer, you could have just edited my original answer to reflect the change. (I've don't that now.) – Alan Munn Jan 28 '16 at 01:54