Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

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...

share|improve this question

marked as duplicate by Heiko Oberdiek, lockstep, Mico, barbara beeton, karlkoeller Aug 17 '13 at 15:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Welcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Jubobs Aug 17 '13 at 13:05
Why don't you use latexmk? –  Alan Munn Aug 17 '13 at 13:05
You could also use the arara package; see ctan.org/tex-archive/support/arara/doc for information on how to get started with arara. –  Mico Aug 17 '13 at 13:06
I use latexmk, but I prefer generalize the compilation, for xelatex for instance. This make file run wthout problem on Ubuntu –  user35244 Aug 17 '13 at 13:35
If that is indeed a make file, can you post the whole thing, and the output of ls -Al from its directory? –  Sean Allred Aug 17 '13 at 15:12

1 Answer 1

up vote 1 down vote accepted

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
share|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. –  biologue Aug 17 '13 at 13:33
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? –  biologue Aug 17 '13 at 13:37
Thank you Biologue, export save me !! –  user35244 Aug 17 '13 at 13:48

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