<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>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<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><style type="text/css">p, li { white-space: pre-wr
<style type="text/css">p, li { white-space: pre-wrap; }</style>
</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>