I am stuck with the following one where I want to input a file with a name in the line of \jobnameQ.tex
.
Here is my MWE excerpted from a bigger picture.
\documentclass{article}
\usepackage{lipsum}
\usepackage{filecontents}
\def\csinput{\expandafter\input{\csname\jobname Q.tex\endcsname}}
\begin{document}
\begin{filecontents}{\jobname Q.tex}
\lipsum[1]
\end{filecontents}
\csinput
\end{document}
This does not input any file and does not produce any output.
However, I know that if I define \csinput
in the manner
\def\csinput#1{\input{\jobname#1.tex}}
and call it like this,
\csinput{Q}
it will work.
I would like to know why the first methodology does not work. (And how it can be remedied.)