I'm trying to create an exec on mac to compile Latex, MakeIndex and BibTex in same time.

Here my make file :

latex -output-directory=build -interaction=nonstopmode sample.tex
makeindex build/sample.idx
makeindex build/sample.nlo -s nomencl.ist -o build/sample.nls
latex -output-directory=build -interaction=nonstopmode sample.tex
bibtex build/sample
latex -output-directory=build -interaction=nonstopmode sample.tex
latex -output-directory=build -interaction=nonstopmode sample.tex

But when I launch this exec with this in my sample folder, Terminal return me "Command not found".

I think this is a path problem but I'm not really efficient in this domain...


First of all, check if you gave your exec file execution rights:

chmod a+x yourexecfile.sh

If this doesn't help, type in your terminal

export PATH=$PATH:/usr/texbin

If this solves the problem, add this at the end of your .bashrc file in your home folder. If there is already a similar line like this, just add :/usr/texbinto it, e.g.,

export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin
| improve this answer | |
  • I think the OP's problem isn't that commands such as latex and bibtex aren't found. I suspect that his/her "exec file" isn't found by the shell. – Mico Aug 17 '13 at 13:30
  • He doesn't specify, so we don't know... "Command not found" sounds like a PATH problem to me. – Eekhoorn Aug 17 '13 at 13:33
  • 1
    Good point. He/she may also have forgotten to do a chmod a+x on the shell script file -- or it may be located in a place not searched by the shell... – Mico Aug 17 '13 at 13:34
  • Ah, of course. I'll edit my answer. If he uses a standard setup, which places wouldn't be searched by the shell? – Eekhoorn Aug 17 '13 at 13:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.