just do it<br><br><div class="gmail_quote">On Sat, Dec 25, 2010 at 03:11, Vafa Khalighi <span dir="ltr"><<a href="mailto:vafakhlgh@gmail.com">vafakhlgh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div dir="ltr">I want to define a macro :<br><br>\newcommand\answer[4]{.....}<br><br>If  the length of all arguments 1 to 4 is less than 0.25\textwidth, then I want to typeset that as<br><br>

<p style="margin: 0px; text-indent: 0px;">\begin{multicols}{4}</p>
<p style="margin: 0px; text-indent: 0px;">\begin{itemize}</p>
<p style="margin: 0px; text-indent: 0px;">\item[a)] #1</p>
<p style="margin: 0px; text-indent: 0px;">\item[b)] #2</p>
<p style="margin: 0px; text-indent: 0px;">\item[c)] #3</p>
<p style="margin: 0px; text-indent: 0px;">\item[d)] #4</p>
<p style="margin: 0px; text-indent: 0px;">\end{itemize}</p>
<p style="margin: 0px; text-indent: 0px;">\end{multicols}</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">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:</p>


<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">\begin{multicols}{2}</p>
<p style="margin: 0px; text-indent: 0px;">\begin{itemize}</p>
<p style="margin: 0px; text-indent: 0px;">\item[a)] #1</p>
<p style="margin: 0px; text-indent: 0px;">\item[b)] #2</p>
<p style="margin: 0px; text-indent: 0px;">\item[c)] #3</p>
<p style="margin: 0px; text-indent: 0px;">\item[d)] #4</p>
<p style="margin: 0px; text-indent: 0px;">\end{itemize}</p>
<p style="margin: 0px; text-indent: 0px;">\end{multicols}</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">and finally if the length of any arguments from 1 to 4 is bigger than \textwidth, then I just want to typeset this as:</p>


<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">\begin{itemize}</p>

<p style="margin: 0px; text-indent: 0px;">\item[a)] #1</p>

<p style="margin: 0px; text-indent: 0px;">\item[b)] #2</p>

<p style="margin: 0px; text-indent: 0px;">\item[c)] #3</p>

<p style="margin: 0px; text-indent: 0px;">\item[d)] #4</p>

<p style="margin: 0px; text-indent: 0px;">\end{itemize}</p>
<br>How could I do this?<br><br>Thanks<br><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;"><br>
</p><p style="margin: 0px; text-indent: 0px;">\begin{multicols}{1}</p>
<p style="margin: 0px; text-indent: 0px;">\begin{itemize}</p>
<p style="margin: 0px; text-indent: 0px;">\item[a)] #1</p>
<p style="margin: 0px; text-indent: 0px;">\item[b)] #2</p>
<p style="margin: 0px; text-indent: 0px;">\item[c)] #3</p>
<p style="margin: 0px; text-indent: 0px;">\item[d)] #4</p>
<p style="margin: 0px; text-indent: 0px;">\end{itemize}</p>
<p style="margin: 0px; text-indent: 0px;">\end{multicols}</p><br><p></p><br></div>
<br>_______________________________________________<br>
TeX FAQ: <a href="http://www.tex.ac.uk/faq" target="_blank">http://www.tex.ac.uk/faq</a><br>
Mailing list archives: <a href="http://tug.org/pipermail/texhax/" target="_blank">http://tug.org/pipermail/texhax/</a><br>
More links: <a href="http://tug.org/begin.html" target="_blank">http://tug.org/begin.html</a><br>
<br>
Automated subscription management: <a href="http://tug.org/mailman/listinfo/texhax" target="_blank">http://tug.org/mailman/listinfo/texhax</a><br>
Human mailing list managers: <a href="mailto:postmaster@tug.org">postmaster@tug.org</a><br></blockquote></div><br><br clear="all"><br>-- <br><span style="color: rgb(102, 102, 102);">Cong Ding</span><br><br>