General ⇒ \include all files from a directory?
\include all files from a directory?
I am making a cooking book in latex and every recipe is written in an external .tex file. They are all in a separate directory.
Now every time I add a new recipe texfile, I have to \include it in my main.tex file.
Is it possible to \include ALL files at once from the directory with all the recipe files? Something like \include{recipes\*.tex} would be useful.
Thank you!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10358
- Joined: Mon Mar 10, 2008 9:44 pm
\include all files from a directory?
welcome to the board!
It's easily possible on Linux and Unix systems, since they provide shell commands for listing and parsing directory contents. Some solutions are here:
I guess you use Windows, since you use a backslash in the path, not a slash. That makes it more difficult in my opinion, however you could write a bash file or use any programming language. TeX does not provide many ways for file handling, this is left to the operating system or external tools.
Stefan