General ⇒ input files with variable filenames
input files with variable filenames
Suppose we have the following files:
foobar.tex
foo123.tex
bar123.tex
foo456.tex
bar456.tex
The files foo123 and foo456 are latex root files and include foobar.tex.
In foobar.tex I want to include bar123 if I compile foo123. When compiling foo456 the file bar456 should be included. And so on.
I started with xstring and tried \StrBehind{\jobname}{foo}. But this gives me an empty string.
My questions are:
How to extract the needed data from \jobname
and
how to build a new filename for using with \input
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