I have a group of tex files named according to the following convention:
xxx_yyy_zzz.tex
I would like to use the components (xxx, yyy, zzz) of the file name as inputs in the document, n particular when creating the title / header. For example, I would like to be able to set the title of the document to be Learning about yyy'' and the author to be
zzz'' with a footer that says xxx.
I have so far found some code that lets me remove the end of a file name: https://tex.stackexchange.com/a/21808
I have also tried using \StrBetween from the xstring package to process \currfilename from the currfile package, but this doesn't work.
\documentclass{article}
\usepackage{currfile}
\usepackage{xstring}
\begin{document}
\makeatletter
\filename@parse{\currfilename}
\StrBetween{\filename@base}{_}{_}
\makeatother
\end{document}
Actually I think I'm using \StrBetween wrong, but even if I do something like
\StrBetween{\filename@base}{xxx}{zzz}
it doesn't print out yyy, but if I do
\StrBetween{a \filename@base b}{a}{b}
then it will print xxx_yyy_zzz.
Are there any suggestions as to how I can take a file named xxx_yyy_zzz.tex and include the text components xxx, yyy, and zzz to be used later in the file, e.g., in the header or title?