## LaTeX forum ⇒ Text Formatting ⇒ Need to write the options horizontally rather vertically

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
sachinrajsharma
Posts: 35
Joined: Sun Apr 08, 2012 5:48 am

### Need to write the options horizontally rather vertically

Hi,
Good Day!
Request you to please suggest how can I have the multiple options horizontally rather getting it vertically as these are consuming too much space while I am writing questions in hundred or so.

Files are attached for your reference.

Thanks,
Sachin
Attachments
Test File.pdf
Test File.tex

Tags:

Johannes_B
Site Moderator
Posts: 3551
Joined: Thu Nov 01, 2012 4:08 pm
There are special classes and packages around to do this stuff.

See the code below, use the answers option and you are in for a surprise

\documentclass[%answers]{exam}\usepackage[utf8]{inputenc}\everymath{\displaystyle}\usepackage{mathtools}\usepackage{showframe}\begin{document}\small \begin{questions}  	\question $5+7=$\begin{oneparchoices}	\choice $1$	\CorrectChoice $42$	\choice $12$	\choice $\sqrt{2}$\end{oneparchoices}\newcommand{\JBQ}{%\question  $(\sin x-\cos x)^2$ is equal to \begin{oneparchoices}\choice  $1$  \choice  $1-2\sin x \cos x$ \choice  $-1$  \choice$1+2\sin x\cos x$\end{oneparchoices}} \JBQ\JBQ\JBQ\JBQ\JBQ \question What does$\sum\limits_{n=1}^{k\rightarrow\infty}1+\frac{1}{n}$ give you?\begin{oneparchoices}	\choice something 	\choice something else	\CorrectChoice Odd spacing\end{oneparchoices}  \JBQ\JBQ\JBQ\JBQ\JBQ\JBQ\end{questions}\end{document}

If you don't want to use tis class, you can do it using package enumitem.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:
Here's another proposal:
\documentclass[10pt,a4paper]{article} % \everymath{\displaystyle}%  this is a /BAD/ idea! \usepackage{amsmath}\usepackage{exsheets}% also loads the tasks' package \begin{document}% \small % if the while document should by set in smaller                 % fontsize then use a different fontsize as class option \begin{question}   $(\sin x-\cos x)^2$ is equal to   \begin{tasks}(4)     \task $1$     \task $1-2\sin x\cos x$     \task $-1$     \task $1+2\sin x\cos x$   \end{tasks}\end{question} \end{document}

exsheets.png (7.57 KiB) Viewed 2003 times

Please use math mode for all mathematical expressions, even if they're just a number. Especially if they're a negative number. Even more important when you use math operators like sine or cosine.

I am a bit puzzled by your example: it sets \everymath{\displaystyle} (a bad decision IMHO) when not everybody knows \everymath but then you don't use such basics as \sin or \cos`.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim