编译目录中的所有tex文件

stu*_*ent 3 bash latex

如果我pdflatex *.tex在一个目录中做,只会tex编译一个文件。我应该使用哪种语法*.tex来编译目录中的所有文件?

Woj*_*tek 7

尝试

for file in *.tex; do pdflatex "$file"; done
Run Code Online (Sandbox Code Playgroud)


Ber*_*ard 6

pdflatex显然只需要一个参数。我可以想到使用find -exec

find -name '*.tex' -maxdepth 1 -exec pdflatex {} \;
Run Code Online (Sandbox Code Playgroud)

但可能有更好的选择。