# Creating Multiple Choice Questions with Answers Without Exam Classs

I want to sort as seen in the photo above. But the results are as follows. Attention to the red frame.

I've tried alot but I could not. Waiting for your help, thank you.

\documentclass[9pt,a4paper,twocolumn]{extarticle} % 10pt font size, A4 paper and two-sided margins

\usepackage[top=3.4cm,bottom=3.6cm,left=2.2cm,right=2.85cm,columnsep=0.75cm]{geometry} % Document margins and spacings

\usepackage{amsmath,amsthm,amsfonts,amssymb}

\usepackage{ifthen}

\usepackage{framed,color}

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage[turkish]{babel}

\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}

\newcounter{choice}
\renewcommand\thechoice{\Alph{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 2.5em}%
\def\choice{%
\item} % choice
\topsep=0pt
\partopsep=0pt}%
}%
{\endlist}

\newenvironment{oneparchoices}%
{%
\setcounter{choice}{0}%
\def\choice{%
\refstepcounter{choice}%
\ifnum\value{choice}>1\relax
\penalty -50\hskip 4em plus 4em\relax
\fi
\choicelabel
\nobreak\enskip
}% choice
% If we're continuing the paragraph containing the question,
% then leave a bit of space before the first choice:
\ifvmode\else\enskip\fi
\ignorespaces
}%
{}

\usepackage{palatino} % Use the Palatino font

\usepackage{amsfonts}

\usepackage{microtype} % Improves spacing

\usepackage[bf,sf,center]{titlesec} % Required for modifying section titles - bold, sans-serif, centered

\usepackage{fancyhdr} % Required for modifying headers and footers
\fancyfoot[C]{\textbf{\textsf{\thepage}}} % Bottom center footer
\renewcommand{\footrulewidth}{1.4pt} % Rule under the footer
\pagestyle{fancy} % Use the custom headers and footers throughout the document

\newcommand{\entry}[4]{\markboth{#1}{#1}\textbf{#1}\ {(#2)}\ \textit{#3}\ $\bullet$\ {#4}}  % Defines the command to print each word on the page, \markboth{}{} prints the first word on the page in the top left header and the last word in the top right
\setlength{\columnseprule}{0,5pt}
%----------------------------------------------------------------------------------------

\begin{document}

{\centering $2^a=19$

$3^b=11$

$5^c=9$ \\}

\noindent \textbf{olduğuna göre aşağıdaki sıralamalardan hangisi doğrudur?}

\medskip

\begin{oneparchoices}
\choice $b<a<c$
\choice $b<c<a$
\choice $c<b<a$
\choice $c<a<b$
\choice $a<b<c$
\end{oneparchoices}

\end{document}

• You are loading amsfonts, for example, 3 times. Surely once would be sufficient? – cfr Apr 4 '15 at 16:51

This is a possibility: I just left the definition of oneparchoices, as the rest is irrelevant. Note that the environ package is necessary.

I use the trick in https://tex.stackexchange.com/a/99365/4427 for centering the last line.

\documentclass[twocolumn]{article}
\usepackage[top=3.4cm,bottom=3.6cm,left=2.2cm,right=2.85cm,columnsep=0.75cm]{geometry}

\usepackage{environ}

\newcounter{choice}
\renewcommand\thechoice{\Alph{choice}}

\makeatletter
\def\choice#1\choice{%
\do@choice{#1}%
\@ifnextchar\relax{}{\choice}%
}
\newcommand{\do@choice}[1]{%
\stepcounter{choice}%
\makebox{\thechoice. #1\unskip}\hspace{1cm plus 2cm minus .5cm}%
}
\makeatother

\NewEnviron{oneparchoices}{%
\setcounter{choice}{0}%
\par\vspace{\topsep}
\leftskip=0pt plus 0.5fil
\rightskip=0pt plus -0.5fil
\parfillskip=0pt plus 1fil
\noindent\BODY\choice\relax
\par\vspace{\topsep}
}

\begin{document}

Some text before the choices just to see how they are
aligned with respect to the margins.

\begin{oneparchoices}
\choice $b<a<c$
\choice $b<c<a$
\choice $c<b<a$
\choice $c<a<b$
\choice $a<b<c$
\end{oneparchoices}

Some text after the choices just to see how they are
aligned with respect to the margins.

\end{document}


• Very nice, but this time is a problem in the short choices. For example; i.imgur.com/Quld0an.png i.imgur.com/f8vQLQk.png – isizay Apr 4 '15 at 18:51
• Is there any way to accomplish what I want? – isizay Apr 6 '15 at 9:01
• @isizay Not really, without first measuring the boxes and doing some computations. In my opinion, short choices should be indented. – egreg Apr 6 '15 at 9:05
• \, It worked, add horizontal space. Thanks for your help. – isizay Apr 6 '15 at 10:32