Define special 'choicehoriz4' format

Added by Nikola Z. Guscic almost 11 years ago

I would like to define a special format for questions, let's call it 'choicehoriz4'.

It would be used to horizontally set answers in one line A, B, C, D, so that the boxes would always be in fixed pre-defined positions on the page, regardless of the length of the respective answers. I need the boxes with A and C to align precisely with answers A and C when {multicol}{2} is used. That is the format used in our school.

The only problem is that I have no idea where to begin :) My total experience with LaTex is still under a week.

If someone could point me in the right direction it would be very much appreciated.

Thanks,

Niko Z.


Replies (4)

RE: Define special 'choicehoriz4' format - Added by Alexis Bienvenüe almost 11 years ago

Can you post a small image of the result you want to reproduce?

RE: Define special 'choicehoriz4' format - Added by Nikola Z. Guscic almost 11 years ago

Of course, how about this:

Question 1. This is the first question. Answers are laid out in {multicol}{2} format.

   A.                                  C.                       

   B.                                  D.

Question 2. This is the second question. Answers are laid out in proposed {choiceshoriz4} format.

   A.                B.                C.               D.  

My school requires a format that always places choices A,B,C,D horizontally in this pre-set position. Choice A in this format would always be flushed left, aligned with choice A when one uses {multicol}{2} or choices format. Choice C would be aligned with choice C when one uses {multicol}{2}. Choices B and D would be evenly spaced. For, example, choice B would always be exactly halfway between A and C. The idea is that everything looks nicely aligned when exam is printed.

I imagine this setting would depend on the page size and wouldn't be very flexible, i.e. one would always have to write four answer options. However, this lack of flexibility is not a problem in my specific case.

RE: Define special 'choicehoriz4' format - Added by Alexis Bienvenüe almost 11 years ago

Perhaps you can use the multicol LaTeX package, and enclose the choices environments inside multicols environments:

\begin{questionmult}{pref}    
  Among the following cities, which ones are french prefectures?
  \begin{multicols}{2}
    \begin{choices}
      \correctchoice{Poitiers}
      \wrongchoice{Sainte-Menehould}
      \correctchoice{Avignon}
    \end{choices}
  \end{multicols}
\end{questionmult}

See attached sample source file — boxes seem to be properly aligned.

simple.tex - Sample with both 2 columns and 4 columns formats (1.6 kB)

RE: Define special 'choicehoriz4' format - Added by Nikola Z. Guscic almost 11 years ago

I've tried this, it works perfectly and looks very good when printed!

So, the trick is to change parameter {2} to {4}, i.e. {multicols}{4}.

Thanks a lot for the solution. :)

(1-4/4)