Matnlarga ishlov berish LaTex text Formatting


Typesetting Multiple Choice Questions in LaTeX


Download 0.75 Mb.
bet7/18
Sana09.04.2023
Hajmi0.75 Mb.
#1344635
1   2   3   4   5   6   7   8   9   10   ...   18
Bog'liq
Matnlarga ishlov berish

Typesetting Multiple Choice Questions in LaTeX
Written by Admin in Document classes,layout,Text formatting

In this tutorial, we will see how to write a multiple-choice exam in LaTeX, using the exam document class. This document class provides multiple tools to easily typeset exams in LaTeX, and we have already explored some of its capabilities in previous tutorials .


The exam package  provides four environments for listing the possible answers to the given question: two of them label the choices and the other two print checkboxes in front of the choices for the student to place checks next to the chosen answers. We will start the tutorial explaining all these environments in detail. Then we will learn how to prepare solutions for the questions, and also how to write fill-in-the-blank questions. Finally, we will explain how to customize every multiple-choice environment, to make it look as you like.
1. The choices and oneparchoices environments
The choices environment uses upper case letters to label the choices of the question and writes them as items in a list environment. Let’s see with a simple example how to use it:
% Choices environment
\documentclass{exam}
\begin{document}
\begin{questions}
\question My first question with multiple choices.
\begin{choices}
\choice The first choice.
\choice The second choice.
\choice The third choice.
\choice The fourth choice.
\end{choices}
\end{questions}
\end{document}
You can see the output of this example in the following image. The use of the environment is straightforward: each choice is started with a \choice command, and it works essentially in the same
way as the questions environment.
A simple question with multiple choice.

The oneparchoices environment works almost in the same way, but instead of writing the options in a list environment, it writes them in a single paragraph which is a continuation of the paragraph preceding the environment (unless you leave a blank line before beginning the environment). Let’s see how it looks changing the previous example:
% One par choices environment
\documentclass{exam}
\begin{document}
\begin{questions}
\question My first question with multiple choices.
\begin{oneparchoices}
\choice The first choice.
\choice The second choice.
\choice The third choice.
\choice The fourth choice.
\end{oneparchoices}
\end{questions}
\end{document}

The output is shown below. Note that, since we left an empty line between the question and the oneparchoices environment, the options are all written in a new paragraph. However, if no blank line were left, all the choices would follow the question on the very same line.
Choices on the same paragraph.

Download 0.75 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10   ...   18




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling