0

I am using the exam document class. It has commands like \question which operate inside the environment questions. Within the document, you can write things like

\begin{questions}
\question Here is the text of the question.
\end{questions}

I have defined a custom \mquestion command within this for mathematics exams that adds a few additional features like auto-scaling space for the answer and prints the number of marks in the format I want:

\newcommand{\mquestion}[2]{\question[#1] #2
\begin{solution}[\stretch{#1}]
\end{solution}

\hfill \fillin

\droppoints }

I use it by typing things like \mquestion{3}{Text of the question.}.

Is there a way I can define a custom command that works like the original \question command and does not require the question text to be in braces?

Putting it in general terms, I want to be able to define a command like

\newcommand{\test}[1]{A#1B}
\test abc

which produces the output AabcB instead of AaB bc. The default behaviour seems to be that if braces are omitted the command only "captures" one character. I want it to capture all the way to the end of the paragraph. I notice that \item within the \itemize environment works this way, so perhaps this is something to do with environments.

0 Answers0