General\include all files from a directory?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
cyberman
Posts: 1
Joined: Sat May 14, 2011 10:24 pm

\include all files from a directory?

Post by cyberman »

Hello!

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!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

\include all files from a directory?

Post by Stefan Kottwitz »

Hi,

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
LaTeX.org admin
Post Reply