4

I am making a multiple-choice test. For some problems, the choices are nicely displayed in the tabbing environment. For some problems, since the choices display quotients, I don't think the tabbing environment is suitable. I know that \\ [5mm] at the end of a line in a tabbing environment either sets the inter-line spacing at 5mm or increases the default inter-line spacing by 5mm. I want the display of choices to be the same whether I am using the tabbing environment or the alignment environment.

I give a sample consisting of two problems. The choices of the first problem are displayed the way I like. How do I put the choices of the second problem \hspace*{2em} from the left margin?

I display the third problem only to show that the inter-line spacing is too big when the choices are usual in-line expressions. What is the inter-line spacing for these two environments?

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\begin{document}

\noindent {\bf 1.) }$A$, $B$, $C$, $D$, $E$, and $F$ are six points in the Cartesian plane. A line is drawn if, and only if, it contains two of these points. If no line contains three of the given points, how many lines are drawn?
\begin{tabbing}
\hspace*{2em} \= \kill
\> {\bf{a.) }}15 \\
\> {\bf{b.) }}18 \\
\> {\bf{c.) }}20 \\
\> {\bf{d.) }}30 \\
\> {\bf{e.) }}36
\end{tabbing}
\vskip0.25in


\noindent {\bf 2.) }A rectangular pen enclosing 4,000 square meters is to be made from split rail fencing along the span of one side of a barn. The pen is to be divided into three smaller, rectangular regions with more split rail fencing. If the side of this barn bordering the pen is $y$ meters long, how many meters of split rail fencing is needed to make the pen?
\begin{align*}
&\mbox{\bf{a.) }}\displaystyle{y + \frac{4,000}{y}} \\
&\mbox{\bf{b.) }}\displaystyle{y + \frac{16,000}{y}} \\
&\mbox{\bf{c.) }}\displaystyle{y + \frac{16,000}{3y}} \\
&\mbox{\bf{d.) }}\displaystyle{3y + \frac{8,000}{3y}} \\
&\mbox{\bf{e.) }}\displaystyle{3y + \frac{16,000}{3y}}
\end{align*}
\vskip0.25in


\noindent {\bf 3.) }Some bacteria are being cultured in a laboratory. The population of the bacteria in the culture $t$ days after the culture began is modeled by the function
\begin{equation*}
P(t) = 3,000 \left(2^{\frac{t}{4}}\right) .
\end{equation*}
By how many bacteria does the population increase from the end of the $4^{\mathrm{th}}$ day to the end of the $16^{\mathrm{th}}$ day?

\begin{tabbing}
\hspace*{3em} \= \hspace{2.5in} \= \kill
\> {\bf{a.) }}6,000     \> {\bf{b.) }}24,000 \\
\> {\bf{c.) }}36,000    \> {\bf{d.) }}42,000 \\
\> {\bf{e.) }}48,000
\end{tabbing}


\end{document}
10
  • 1
    why are you numbering "by hand" rather than use section headings or lists that number automatically? Commented May 14, 2015 at 16:31
  • @David Carlisle I just followed what I saw in an old manual.
    – user74973
    Commented May 14, 2015 at 17:06
  • 7
    burn that manual:-) Commented May 14, 2015 at 17:10
  • @David Carlisle I am looking at the enumitem package now. You're right - the manual is obsolete.
    – user74973
    Commented May 14, 2015 at 17:17
  • 1
    tabbing has no vertical space it's just normal spacing as in a paragarph, so \baselineskip Commented May 14, 2015 at 18:42

2 Answers 2

7

You can use the enumitem package. This gives you a lot of power to customise the enumerations. You can customise the vertical and horizontal spacing by giving the enumerate optional arguments. See the documentation http://anorien.csc.warwick.ac.uk/mirrors/CTAN/macros/latex/contrib/enumitem/enumitem.pdf for details, I think it is well explained there. Your code would look like this (I think it would also make your code more legible):

\begin{enumerate}[label=\bfseries \alph*.), itemsep=0.5em]
  \item $ y + \dfrac{4,000}{y} $
  \item $ y + \dfrac{16,000}{y} $
  \item $ y + \dfrac{16,000}{3y} $
  \item $ 3y + \dfrac{8,000}{3y} $
  \item $ 3y + \dfrac{16,000}{3y} $
\end{enumerate}

enter image description here

EDIT: For completeness, I am including a complete file with two variables that globally control the inter-line spacing and left indentation:

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{enumitem}


% Change these to globally change inter-line spacing and left indentation
\def\interLine{0.5em}
\def\leftMargin{0cm}

\begin{document}

\noindent {\bf 1.) }$A$, $B$, $C$, $D$, $E$, and $F$ are six points in the Cartesian plane. A line is drawn if, and only if, it contains two of these points. If no line contains three of the given points, how many lines are drawn?
\begin{enumerate}[label=\bfseries \alph*.), itemsep=\interLine, itemindent=\leftMargin]
  \item 15
  \item 18
  \item 20
  \item 30
  \item 36
\end{enumerate}
\vskip0.25in

\noindent {\bf 2.) }A rectangular pen enclosing 4,000 square meters is to be made from split rail fencing along the span of one side of a barn. The pen is to be divided into three smaller, rectangular regions with more split rail fencing. If the side of this barn bordering the pen is $y$ meters long, how many meters of split rail fencing is needed to make the pen?
\begin{enumerate}[label=\bfseries \alph*.), itemsep=\interLine, itemindent=\leftMargin]
  \item $ y + \dfrac{4,000}{y} $
  \item $ y + \dfrac{16,000}{y} $
  \item $ y + \dfrac{16,000}{3y} $
  \item $ 3y + \dfrac{8,000}{3y} $
  \item $ 3y + \dfrac{16,000}{3y} $
\end{enumerate}
\vskip0.25in


\noindent {\bf 3.) }Some bacteria are being cultured in a laboratory. The population of the bacteria in the culture $t$ days after the culture began is modeled by the function
\begin{equation*}
P(t) = 3,000 \left(2^{\frac{t}{4}}\right) .
\end{equation*}
By how many bacteria does the population increase from the end of the $4^{\mathrm{th}}$ day to the end of the $16^{\mathrm{th}}$ day?
\begin{enumerate}[label=\bfseries \alph*.), itemsep=\interLine, itemindent=\leftMargin]
  \item 6,000
  \item 24,000
  \item 36,000
  \item 42,000
  \item 48,000
\end{enumerate}


\end{document}
17
  • Maybe some space between the items is needed (the fractions are touching each other).
    – Alenanno
    Commented May 14, 2015 at 16:44
  • 1
    This can be done easily by using e.g. \begin{enumerate}[label=\bfseries \alph*.), itemsep=0.5em].
    – Augustin
    Commented May 14, 2015 at 16:47
  • I meant to fix it in your answer. :P
    – Alenanno
    Commented May 14, 2015 at 16:48
  • 1
    @user74973 AD 1: Yes, the itemsep=0.5em is the spacing between the inter-line spacing. You can indeed get the same spacing in all three cases if you use enumerate with that option in all three cases. AD 2: I don't really know how much the letters are indented, but you can set that using the leftmargin=... and itemindent=... options passed to the enumerate. AD 3: I would rather use enumerate in all three cases. This way you would get the same spacing in all three cases.
    – Augustin
    Commented May 14, 2015 at 18:14
  • 1
    @user74973 I found a question which is dealing exactly with you problem actually: tex.stackexchange.com/questions/46665/…
    – Augustin
    Commented May 14, 2015 at 18:42
3

Here's an alternative using tabularstacks, which I have wrapped into the macro \answers. The inter-answer gap is set to 4pt, and a 5pt buffer is added above and below the answer field, prior to performing the 1/4in \vskip.

EDITED so that automated label may be inserted with \>. REDITED to provide \newquestion, which is simply used to start a new question, with the question number incremented.

Thus, input is in the form of

\newquestion Text of question?
\answers{
  \> answer1 \\
  \> answer2 \\
  \> ...
}

The gap between the a.) and the answer can be set with \setstacktabulargap{<length>}. The default value is \tabcolsep.

The answers default to math mode input, but adding \stackText prior to a given \answers will change the default answer mode to text. It can be changed back with \stackMath following the conclusion of \answers.

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tabstackengine}
\stackMath
\makeatletter
\def\answers#1{%
  \renewcommand\>{\textbf{\alph{TAB@stackindex}.)}&}%
  \setstackgap{S}{4pt}%
  \par\noindent\hspace*{2em}\addstackgap[5pt]{\tabularShortstack{rl}{#1}}%
  \vskip0.25in\par\noindent\ignorespaces%
}
\makeatother
\newcounter{Question}
\newcommand\newquestion{\stepcounter{Question}\noindent\textbf{\arabic{Question}.)\ \,}}
%\setstacktabulargap{\tabcolsep}
\begin{document}

\newquestion $A$, $B$, $C$, $D$, $E$, and $F$ are six points in the Cartesian plane. A line is drawn if, and only if, it contains two of these points. If no line contains three of the given points, how many lines are drawn?
\answers{
  \> 15 \\
  \> 18 \\
  \> 20 \\
  \> 30 \\
  \> 36 
}
\newquestion A rectangular pen enclosing 4,000 square meters is to be made from split rail fencing along the span of one side of a barn. The pen is to be divided into three smaller, rectangular regions with more split rail fencing. If the side of this barn bordering the pen is $y$ meters long, how many meters of split rail fencing is needed to make the pen?
\answers{
  \> y + \dfrac{4,000}{y} \\
  \> y + \dfrac{16,000}{y} \\
  \> y + \dfrac{16,000}{3y} \\
  \> 3y + \dfrac{8,000}{3y} \\
  \> 3y + \dfrac{16,000}{3y}
}
\newquestion Some bacteria are being cultured in a laboratory. The population of the bacteria in the culture $t$ days after the culture began is modeled by the function
\begin{equation*}
P(t) = 3,000 \left(2^{\frac{t}{4}}\right) .
\end{equation*}
By how many bacteria does the population increase from the end of the $4^{\mathrm{th}}$ day to the end of the $16^{\mathrm{th}}$ day?
\answers{
  \> 6,000 \\
  \> 24,000 \\
  \> 36,000 \\
  \> 42,000 \\
  \> 48,000
}
\end{document}

enter image description here

2
  • I am going to try to get the display that I want using the enumerate environment. I have some questions about the post Augustin provided, but I think someone can answer these questions for me.
    – user74973
    Commented May 15, 2015 at 14:12
  • @user74973 The enumerate approach is very flexible. While neither approach is currently multicolumn, that might prove more of a challenge to both approaches, if you went in that direction. Best wishes. Commented May 15, 2015 at 15:00

You must log in to answer this question.

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