Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I do pdflatex *.tex in a directory, only one tex file is compiled. Which syntax should I use that all *.tex files in the directory are compiled?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

try

for file in *.tex; do pdflatex "$file"; done
share|improve this answer
add comment

pdflatex apparently only takes one argument. I can think of using find -exec

find -name '*.tex' -maxdepth 1 -exec pdflatex {} \;

But there may be better alternatives.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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