3

My code part

\newcommand{\iib}[5]{
\begin{center}
\begin{tabu} to 0.42\textwidth {@{}|X[l]@{}|X[l]|}
\textbf{A)} #1 & \textbf{B)} #2\\
\textbf{C)} #3 & \textbf{D)} #4\\
\multicolumn{2}{@{}|c|}{\textbf{E)} #5}
\end{tabu}
\end{center}}

and output,

enter image description here

But that I want,

enter image description here

Is this possible automatic for all answers? That is, B) and D) choices will (right) slide according to word. But, considering long word.

1 Answer 1

4

Perhaps you can try the following:

enter image description here

\documentclass{article}
\usepackage[a5paper]{geometry}% Just for this example
\usepackage{tabularx}

\newcommand{\multiplechoices}[5]{%
  \noindent
  \begin{tabularx}{\linewidth}{|X|l|}
    \textbf{A)} #1 & \textbf{B)} #2 \\
    \textbf{C)} #3 & \textbf{D)} #4 \\
   \multicolumn{2}{|p{\dimexpr\linewidth-2\tabcolsep-2\arrayrulewidth}|}{\centering\textbf{E)} #5}
  \end{tabularx}}

\begin{document}

\begin{enumerate}
  \item Is this question wrong?

  \multiplechoices{THE END}{END}{GAME OVER}{FINISH}{STOP}
\end{enumerate}

\end{document}

The last column is set using l, meaning the first X-column will stretch up to it, yet the entire table will fill the \linewidth. The last row is centered based on a fixed-width p-column that also fits \linewidth.

1
  • @ Werner, perfect working in all choices.
    – Özgür
    Jan 15, 2015 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .