# Is it possible to automatically input all .tex files from a subfolder into a document in Overleaf?

I am working on a large document in Overleaf, and in order to keep an overview over the chapters, I have arranged them in a subfolder with a naming structure like this:

000_title.tex

001_abstract.tex

01_introduction.tex

02_theoretical_background.tex

I am subsequently adding more chapters to this, and sometimes changing their order. Hence I was wondering if it's possible to automatically include all files in that subfolder in sorting order into the document? I have seen that it is possible in LaTeX only through bash scripts, so I figured this wouldn't work in Overleaf.

Or maybe I'm not seeing things clearly and there is an even better solution to this problem?

• Overleaf-specific questions should be directed to Overleaf's helpdesk. I hear their LaTeX support staff is top-notch. – Mico Jan 15 at 11:02
• In that case sorry for spamming this forum, I'll direct myself to their support then! – Cb31w01 Jan 15 at 12:20
• Your document will not be very large presumably, maybe 20 chapters max? In such a case it would probably take you less time to just adjust one or two `\include` statements if something changes, instead of trying to create a fully automatic solution. – Marijn Jan 15 at 12:26

`````` \input{|ls}
• @yo' yes I wouldn't disagree with that (which is one reason I only showed `ls` and left the processing as an exercise for the reader) also marijn's comment under the question. – David Carlisle Jan 15 at 14:02