[texhax] multiplechoice in LaTeX

Hubert Lam hubert at hubertlam.info
Sat Dec 25 23:09:35 CET 2010


Also you can use the enumitem package to alter the "enumerate" environment so that you can type:

\begin{enumerate}[label={\alph*)}]
\item choice 1
\item choice 2
\item choice 3
\end{enumerate }

Rather than manually labelling the choices.

From: texhax-bounces at tug.org [mailto:texhax-bounces at tug.org] On Behalf Of Cong Ding
Sent: Sunday, December 26, 2010 7:51 AM
To: Vafa Khalighi
Cc: texhax at tug.org
Subject: Re: [texhax] multiplechoice in LaTeX

just do it
On Sat, Dec 25, 2010 at 03:11, Vafa Khalighi <vafakhlgh at gmail.com<mailto:vafakhlgh at gmail.com>> wrote:
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}



_______________________________________________
TeX FAQ: http://www.tex.ac.uk/faq
Mailing list archives: http://tug.org/pipermail/texhax/
More links: http://tug.org/begin.html

Automated subscription management: http://tug.org/mailman/listinfo/texhax
Human mailing list managers: postmaster at tug.org<mailto:postmaster at tug.org>



--
Cong Ding
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20101225/06a5fddb/attachment.html>


More information about the texhax mailing list