I load multiple source files into a document using the fancyvrb package. I found out how to include a static label. Now, I want to display the filename in the label (dynamic label based on input file). How can I achieve this?
In the following example, the label should be file_1.txt and file_2.txt instead of data.txt.
\documentclass[10pt, a4paper, twoside]{article}
\usepackage{fancyvrb}
\RecustomVerbatimCommand{\VerbatimInput}{VerbatimInput}{
label=\fbox{data.txt},
labelposition=topline,
}
\begin{document}
\VerbatimInput{file_1.txt}
\VerbatimInput{file_2.txt}
\end{document}
