I'd like to expand a macro inside \AtBeginDocument, although I guess the concrete macro does not matter.
\documentclass{article}
\makeatletter
\@for\x:=1,2,3\do{%
\AtBeginDocument{\@input@{helper\x .tex}}%
}
\makeatother
\begin{document}
Do something with the definitions from helper1.tex etc.
\end{document}
The file inclusion works without the \AtBeginDocument{...}, and of course it does not work with it, as \x is not expanded at call time. I have the feeling the right amount of \expandafters in the right places will do the job, but I don't see it.
\xshorter than\tmp– David Carlisle Jul 04 '13 at 22:59\xwith six different meanings lovely? – egreg Jul 04 '13 at 23:01