Using a command within subimport leads to problems.
Consider the following files, which have to lay side-by-side in the same folder. test.tex:
\documentclass[]{letter}
\usepackage{import}
\def\AV{510}
\def\AVVers{4}
\begin{document}
The test-values are AV \AV{} V\AVVers{}.
\subimport{}{Test AV \AV{} V\AVVers{}.tex}
%\subimport{}{Test AV 510 V4.tex}
\end{document}
Test AV 510 V4.tex:
17
Using the first, unexpanded call of \subimport, we get the error message
! LaTeX Error: File `Test AV 510{} V4{}.tex' not found.
Using the second, expanded one, we get the expected result, namely
I am aware that LaTeX macros use the first token as argument, such that one should use {} to prevent that the macro devours the first white space after it. But why is the macro evaluated somehow else within \subimport and what do I have to do to prevent it?
\space
instead of the first{}
. (the second{}
is anyway not needed)\AV
macro,\space
will swallow the space after it.