I would guess that this would be easier with the enumtem package.
hh
1. multiplechoice in LaTeX (Vafa Khalighi)
----------------------------------------------------------------------
Message: 1
Date: Sat, 25 Dec 2010 13:11:12 +1100
From: Vafa Khalighi
To: texhax@tug.org
Subject: [texhax] multiplechoice in LaTeX
Message-ID:
Content-Type: text/plain; charset="iso-8859-1"
I want to define a macro :
\newcommand\answer[4]{.....}
If the length of all arguments 1 to 4 is less than 0.25\textwidth, then I
want to typeset that as
\begin{multicols}{4}
\begin{itemize}
\item[a)] #1
\item[b)] #2
\item[c)] #3
\item[d)] #4
\end{itemize}
\end{multicols}
if the length of one of the arguments from 1 to 4 is less than 0.5\textwidth
but greater than 0.25\textwidth provided the length of no arguments from 1
to 4 is greater than 0.5\textwidth, then I want to typeset this as:
\begin{multicols}{2}
\begin{itemize}
\item[a)] #1
\item[b)] #2
\item[c)] #3
\item[d)] #4
\end{itemize}
\end{multicols}
and finally if the length of any arguments from 1 to 4 is bigger than
\textwidth, then I just want to typeset this as:
\begin{itemize}
\item[a)] #1
\item[b)] #2
\item[c)] #3
\item[d)] #4
\end{itemize}
How could I do this?
Thanks
\begin{multicols}{1}
\begin{itemize}
\item[a)] #1
\item[b)] #2
\item[c)] #3
\item[d)] #4
\end{itemize}
\end{multicols}
-------------- next part --------------