I need to dynamically input a proper .tex file into my document. I wrote the following code that works only if instead of "\realyear{\season}" I explicitly write 2019. Inside the \input all new defined commands work, but the command that has one argument (which is \realyear) makes the document not to compile (error is "Argument of \filename@simplehas an extra }"). Why is that? How to overcome this issue?
\def \myfolder {../../../../../trial}
\def \season {Spring}
\def \yearstart{2018}
\def \yearfinish{2019}
\newcommand{\realyear}[1]{%
\ifthenelse{\equal{\detokenize{#1}}{\detokenize{Spring}}}
{\yearstart}
{\yearfinish}%
}
\input{\myfolder/trialfolder/\season\realyear{\season} common}
\ifthenelse
is not expandable. It won't work here.