# Make options al horizontal instead vertical in multiple choice

I want to type some multiple choice questions. I have the following code. The problem is that in some questions I need options in one line and evenly spaced, and in some questions I need two in one line and evenly spaced. How can I do that. I know that there are some answers related to this but I tried to figure out from that how to change this code, but every time I get an error and I don't want to use a different code all together. It will be nice if I am able to do this in this very code.

Thanks for the help in advance.

\documentclass{article}
%--------------------------------------------------------------------
%--------------------------------------------------------------------
\newcounter{choice}
\renewcommand\thechoice{($\alph{choice}$)}
\newcommand\choicelabel{\thechoice}
%--------------------------------------------------------------------------------
\newenvironment{choices}%
{\list{\choicelabel}%
{\usecounter{choice}\def\makelabel##1{\hss\llap{##1}}%
\settowidth{\leftmargin}{W.\hskip\labelsep\hskip 0 em}%
\def\choice{%
\item
} % choice
\topsep=0pt
\partopsep=0pt
}%
}%
{\endlist}
%--------------------------------------------------------------------------------
\def\CChoice{%
\choice
}
\let\CChoice\CChoice
%    \par % Uncomment this to have choices always start a new line
% \let\par\@empty
% If we're continuing the paragraph containing the question,
% then leave a bit of space before the first choice:
\ifvmode\else\enskip\fi
\ignorespaces
%
{}
\makeatother
}
\vfill
\begin{center}
\end{center}
}

%--------------------------------------------------------------------
\begin{document}

\begin{enumerate}
\item One of these things is not like the others; one of these things
is not the same.  Which one doesn't belong?
\begin{choices}
\choice George
\choice Paul
\choice John
\CChoice Ringo
\end{choices}
\item What was the color of George Washinton's white horse?
\begin{choices}
\choice Green
\CChoice Yellow
\choice White
\choice Socrates
\end{choices}
\item What was the color of George Washinton's white horse?
\begin{choices}
\choice Green
\choice Yellow
\CChoice White
\choice Socrates
\end{choices}
\item One of these things is not like the others; one of these things
is not the same.  Which one doesn't belong?

\begin{choices}
\choice George
\choice Paul
\choice John
\choice Ringo
\end{choices}
\item What was the color of George Washinton's white horse?

\begin{choices}
\choice Green
\choice Yellow
\choice White
\choice Socrates
\end{choices}
\end{enumerate}

\end{document}


From this question: we create a multicolumn environment:

\makeatletter
\newenvironment{multichoices}[1][2]{%
\begin{multicols}{#1}}{%
\end{multicols}}
\makeatother


and use it in the choices environment. MWE:

\documentclass{article}
\usepackage{multicol}
%--------------------------------------------------------------------
%--------------------------------------------------------------------
\newcounter{choice}
\renewcommand\thechoice{($\alph{choice}$)}
\newcommand\choicelabel{\thechoice}
%--------------------------------------------------------------------------------
\newenvironment{choices}%
{\list{\choicelabel}%
{\usecounter{choice}\def\makelabel##1{\hss\llap{##1}}%
\settowidth{\leftmargin}{W.\hskip\labelsep\hskip 0 em}%
\def\choice{%
\item
} % choice
\topsep=0pt
\partopsep=0pt
}%
}%
{\endlist}
%--------------------------------------------------------------------------------
\def\CChoice{%
\choice
}
\let\CChoice\CChoice
%    \par % Uncomment this to have choices always start a new line
% \let\par\@empty
% If we're continuing the paragraph containing the question,
% then leave a bit of space before the first choice:
\ifvmode\else\enskip\fi
\ignorespaces
%
{}
\makeatother
}
\vfill
\begin{center}
\end{center}
}

\makeatletter
\newenvironment{multichoices}[1][2]{%
\begin{multicols}{#1}}{%
\end{multicols}}
\makeatother

%--------------------------------------------------------------------
\begin{document}

\begin{enumerate}
\item One of these things is not like the others; one of these things
is not the same.  Which one doesn't belong?
\begin{choices}
\begin{multichoices}[4]
\choice George
\choice Paul
\choice John
\CChoice Ringo
\end{multichoices}
\end{choices}
\item What was the color of George Washinton's white horse?
\begin{choices}
\begin{multichoices}[2]
\choice Green
\CChoice Yellow
\choice White
\choice Socrates
\end{multichoices}
\end{choices}
\end{enumerate}
\end{document}


BTW: why not use the exam class?

• Thanks for the help. Its part of a bigger project and the document class is book so I can add another class. – Kumarm Oct 29 '18 at 21:08