# Encoding with the tasks package

How do I encode problems 3.) and 5.) that is consistent with the remaining code? The display is what I want.

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\newlength\labelwd
\settowidth\labelwd{\bfseries viii.)}
\settasks{counter-format =tsk[a].), label-format=\bfseries, label-offset=1em, label-align=right, label-width
=\labelwd, before-skip =\smallskipamount, after-item-skip=0pt}
\usepackage{enumitem}
\setlist[enumerate,1]{% (
leftmargin=*, itemsep=12pt, label={\textbf{\arabic*.)}}}

\begin{document}

\begin{center}\Large{\textbf{Elementary Number Theory}}\end{center}\vskip0.25in

\begin{enumerate}[itemsep=\baselineskip]
\item How many positive integers less than 100 have a remainder of 3 upon division by 7?
\end{enumerate}

\begin{enumerate}[start=2, itemsep=\baselineskip]
\item For every natural number $n$, $\tau(n)$ is the number of positive divisors of $n$. Evaluate $\tau^{3}(12)$.
\end{enumerate}

\noindent {\textbf{3.) }}$p$ and $q$ are prime numbers greater than 2. which of the following statements must be true? \\
\hspace*{3em} \hphantom{3.)\ }
\begin{tabular}{r l}
{\bf I}     &   \hspace*{-0.5em}$p + q$ is even. \\
{\bf II}    &   \hspace*{-0.5em}$pq$ is odd. \\
{\bf III}   &   \hspace*{-0.5em}$p^{2} - q^{2}$ is even
\end{tabular}
\begin{tabbing}
\hspace*{2em} \= \hspace{2.5in} \= \kill
\> {\textbf{a.) }}I only        \> {\textbf{b.) }}II only \\
\> {\textbf{c.) }}I and II only \> {\textbf{d.) }}I and III only \\
\> {\textbf{e.) }}I, II, and III
\end{tabbing}
\vskip0.25in

\begin{enumerate}[start=4, itemsep=\baselineskip]
\item How many integers less than 1000 are such that the remainder upon division by each of 2, 3, 4, 5, 6, and 7 is 1?
\end{enumerate}

\noindent {\textbf{5.) }}$n$ is a positive integer. Which of the following quantities is divisible by 3? \\
\hspace*{3em} \hphantom{3.)\ }
\begin{tabular}{r l}
{\bf I}     &   \hspace*{-0.5em}$n^{3} - 1$ \\
{\bf II}    &   \hspace*{-0.5em}$n^{3} + 1$ \\
{\bf III}   &   \hspace*{-0.5em}$n^{3} + 2n$
\end{tabular}
\begin{tabbing}
\hspace*{2em} \= \hspace{2.5in} \= \kill
\> {\textbf{a.) }}I only        \> {\textbf{b.) }}II only \\
\> {\textbf{c.) }}I and II only \> {\textbf{d.) }}II and III only \\
\> {\textbf{e.) }}I, II, and III
\end{tabbing}

\end{document}


I would do it this way:

\documentclass{amsart}
\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\newlength\labelwd
\settowidth\labelwd{\bfseries viii.)}
\settasks{counter-format =tsk[a].), label-format=\bfseries, label-offset=1em, label-align=right, label-width
=\labelwd, before-skip =\smallskipamount, after-item-skip=0pt}
\usepackage[inline]{enumitem}
\setlist[enumerate]{% (
labelindent = 0pt, leftmargin=*, itemsep=12pt, label={\textbf{\arabic*.)}}}

\begin{document}

\begin{center}\Large{\textbf{Elementary Number Theory}}\end{center}\vskip0.25in
%\setlist[enumerate, 1]{itemsep=\baselineskip}
\begin{enumerate}
\item How many positive integers less than 100 have a remainder of 3 upon division by 7?

\item For every natural number $n$, $\tau(n)$ is the number of positive divisors of $n$. Evaluate $\tau^{3}(12)$.

\item $p$ and $q$ are prime numbers greater than 2. Consider the following statements:

\task $p + q$ is even.
\task $pq$ is odd.
\task $p^{2} - q^{2}$ is even
Which of the following must be true?

\item How many integers less than 1000 are such that the remainder upon division by each of 2, 3, 4, 5, 6, and 7 is 1?

\item $n$ is a positive integer. Consider the following quantities:
\begin{tasks}[counter-format = tsk[R], label-format=\normalfont,  after-  skip=1\medskipamount](3)
\task $n^{3} - 1$ \
\task $n^{3} + 1$
\task $n^{3} + 2n$
Which is divisible by 3?
\end{enumerate}

\end{document}


A variant:

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\newlength\labelwd
\settowidth\labelwd{\bfseries viii.)}
\settasks{counter-format =tsk[a].), label-format=\bfseries, label-offset=1em, label-align=right, label-width
=\labelwd, item-indent=\dimexpr\labelwd+1em\relax, before-skip =\smallskipamount, after-item-skip=0pt}
\usepackage{enumitem}
\setlist[enumerate,1]{% (
leftmargin=*, itemsep=12pt, label={\textbf{\arabic*.)}}}

\begin{document}

\begin{center}\Large{\textbf{Elementary Number Theory}}\end{center}\vskip0.25in

\begin{enumerate}[itemsep=\baselineskip]
\item How many positive integers less than 100 have a remainder of 3 upon division by 7?
\end{enumerate}

\begin{enumerate}[start=2, itemsep=\baselineskip]
\item For every natural number $n$, $\tau(n)$ is the number of positive divisors of $n$. Evaluate $\tau^{3}(12)$.
\end{enumerate}

\noindent {\textbf{3.) }}$p$ and $q$ are prime numbers greater than 2. which of the following statements must be true?
\task $p + q$ is even.
\task $pq$ is odd.
\task $p^{2} - q^{2}$ is even

\begin{enumerate}[start=4, itemsep=\baselineskip]
\item How many integers less than 1000 are such that the remainder upon division by each of 2, 3, 4, 5, 6, and 7 is 1?
\end{enumerate}

\noindent {\textbf{5.) }}$n$ is a positive integer. Which of the following quantities is divisible by 3?
\task $n^{3} - 1$
\task   $n^{3} + 1$
\task $n^{3} + 2n$

\end{document}


• No. I am imitating the display on standardized tests. Do you know how to get the display that I have with an align environment using an enumerate environment (and the tasks package)? – Adelyn Mar 11 '16 at 12:18
• I sent you a pdf file of my display yesterday. Can you help me with getting the display that I want? – Adelyn Mar 13 '16 at 17:20
• @Adelyn: I've added another code, more like what you want. Is it ? – Bernard Mar 15 '16 at 0:05
• I looked at the e-TeX manual at http://texdoc.net/texmf-dist/doc/etex/base/etex_man.pdf for an explanation for the use of \dimexpr and \relax. I am not familiar with computer science, though. Why do you have item-indent=\dimexpr\labelwd+1em\relax instead of item-indent=\labelwd+3em? – Adelyn Mar 15 '16 at 15:19
• I'll check the point you mention. For the rest, will you also define \HeightOfDisplayFractionsWithIntegrals or whatever? – Bernard Mar 16 '16 at 20:23

The only edit that I made to the original code is that I added \newlength\HeightOfRadicalNotation and \settoheight\HeightOfRadicalNotation{$\sqrt{1}$} in the preamble and after-item-skip=\HeightOfRadicalNotation as an option to the tasks environment in the first example. It does give me more appropriate spacing between the expressions in the first example. What is the inter-line spacing? It is not as big as the height of $\sqrt{1}$.

\documentclass[10pt]{amsart}
\usepackage{amsmath}
\usepackage{array,booktabs}

\newlength\labelwd
\settowidth\labelwd{ iii.)}

\settoheight\HeightOfRadicalNotation{$\sqrt{1}$}

\settasks{counter-format =tsk[r].), label-format=\bfseries, label-offset=1em, label-align=right, label-width
=\labelwd, item-indent=\labelwd+3em, before-skip =\smallskipamount, after-item-skip=0pt}

\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings,backgrounds,patterns}

\usepackage{mathtools}

\usepackage{pgfplots}
\pgfplotsset{compat=1.11}

\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in} \setlength{\textwidth}{6.1in}
\setlength{\topmargin}{0.0in} \setlength{\textheight}{9in}

\begin{document}

\noindent \textbf{Example} \vskip1.25mm
\noindent State any vertical asymptotes of the following functions.
\task  $(x - 1)\big\slash \bigl(\sqrt{x} - 1\bigr)$
\task  $1 \big\slash \bigl(\sqrt{x} - 1\bigr)$
\task  $1 \big\slash \sqrt[\uproot{1} \leftroot{-1} 3]{x}$
\task  $\displaystyle (x - 1) \big\slash \bigl(\sqrt[\uproot{1} \leftroot{-1} 3]{x} - 1\bigr)$
\vskip0.25in

\noindent \textbf{Example} \vskip1.25mm
Show that the following functions are increasing functions on the interval $[0, \, \infty)$.
\task $x^{2} + x + 1$
\task $x^{2} + bx$ for any $b > 0$
\task $x^{3} + 2x^{2} + 3x - 7$

\end{document}