3

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?

student
  • 18,305

3 Answers3

7

try

for file in *.tex; do pdflatex "$file"; done
jw013
  • 51,212
Wojtek
  • 2,330
6

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.

Bernhard
  • 12,272
1

Less typing, if no spaces in files:

 echo *.tex|xargs -n1 pdflatex
gena2x
  • 2,397