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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10358
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