Code: Select all
\newcommand{\readme}[2]{%
\input{['file', #1, '_', #2, '.dat']}
}
Code: Select all
\newcommand{\readme}[2]{%
\input{['file', #1, '_', #2, '.dat']}
}
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
Code: Select all
\newcommand\reame[2]{%
\input{#1_#2.dat}%
}
Just out curiosity, what if you had the actual string '#1' as a file name? For example, my file would actually be named file#1.datjosephwright wrote:(I'm assuming you've dealt properly with the filenames here: underscores tend to be bad news!)Code: Select all
\newcommand\reame[2]{% \input{#1_#2.dat}% }
Code: Select all
\edef\x{file\string#1.dat}
\input{\x}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