In latex.ltx
I found \def\input{\@ifnextchar\bgroup\@iinput\@@input}
where \@@input
is expandable. I would like to know if there is an expandable version of \input
.
The problem comes from an example with my package alterqcm
.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand*{\square}{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}%
% \usepackage{fourier} % \square is defined with fourier
\usepackage{alterqcm}
\begin{document}
\begin{alterqcm}
\AQmessage{Soit $h$ la fonction telle que: $h:x\longmapsto x(x-1)$.}
\AQquestion{Par cette fonction: L'image de}{
{4 est 8},
{0 est 2},
{8 est 4},
{2 est 0}
}
\end{alterqcm}
\end{document}
Now it's possible to put the question in a file named 'question_1_2.tex'
\AQmessage{Soit $h$ la fonction telle que: $h:x\longmapsto x(x-1)$.}
\AQquestion{Par cette fonction: L'image de}{
{4 est 8},
{0 est 2},
{8 est 4},
{2 est 0}
}
Now
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand*{\square}{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}%
\usepackage{alterqcm}
\begin{document}
\begin{alterqcm}
\input{question_1_2.tex}
\end{alterqcm}
\end{document}
gives an error \omit misplaced
. I need to write :
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\newcommand*{\square}{\vbox{\hrule\hbox to 6pt{\vrule height 5.2pt \hfil\vrule}\hrule}}%
\usepackage{alterqcm}
\makeatletter
\newcommand*\ExpandableInput[1]{\@@input#1 }
\makeatother
\begin{document}
\begin{alterqcm}
\ExpandableInput{question_1_2.tex}
\end{alterqcm}
\end{document}
1) Is it possible to use another macro or version of \input
?
2) Why does the error disappear if I put
\begin{alterqcm}
...
\end{alterqcm}
inside question_1_2.tex
?