I checked out this page and they have very good answers but not exactly what I'd need. I would want the justification to be like it is in the answer they gave with everything in one line touching the margins but would like to make a new command for it instead of typing everything each time. Something like it is given in this page
\choice{apple}{banana}{orange}{pear}
So I tried defining a command like
\documentclass[a4paper,addpoints,answers,12pt]{exam}
\usepackage{graphicx,tabularx,caption,color,subcaption,amsmath,amssymb,lmodern,textcomp,gensymb,ifpdf,ifthen}
\newcommand{\mcq}{%
\begin{oneparchoices}
\choice #1
\choice #2
\choice #3
\choice #4
\choice #5
\end{oneparchoices}
}
\begin{document}
\mcq{uihoo}{eifhw2u}{fiwuhr}{fjwhf}{fnweir}
\end{document}
But this has too many errors:
line 12: Illegal parameter number in definition of \mcq. }
line 12: Illegal parameter number in definition of \mcq. }
line 12: Illegal parameter number in definition of \mcq. }
line 12: Illegal parameter number in definition of \mcq. }
line 12: Illegal parameter number in definition of \mcq. }
line 14: You can't use `macro parameter character #' in horizontal mode. \mcq
line 14: You can't use `macro parameter character #' in horizontal mode. \mcq
line 14: You can't use `macro parameter character #' in horizontal mode. \mcq
line 14: You can't use `macro parameter character #' in horizontal mode. \mcq
line 14: You can't use `macro parameter character #' in horizontal mode. \mcq
I will try whatever solution given with oneparcheckboxes
too but let's first have this answer.
\choice
as\item
.texdoc interface3
.) Otherwise, there's no advantage to using a macro rather than the{oneparchoices}
environment.