使用任务包进行编码

使用任务包进行编码

我该如何编码问题3.)并且5.)与剩余代码保持一致?显示内容就是我想要的。

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\newlength\labelwd
\settowidth\labelwd{\bfseries viii.)}
\usepackage{tasks}
\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?
        \begin{tasks}(3)
          \task 10
          \task 11
          \task 12
          \task 13
          \task 14
        \end{tasks}
\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)$.
        \begin{tasks}(3)
          \task 1
          \task 2
          \task 3
          \task 4
          \task 6
        \end{tasks}
\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?
        \begin{tasks}(3)
          \task 0
          \task 1
          \task 2
          \task 3
          \task 4
        \end{tasks}
\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}

答案1

我会这样做:

\documentclass{amsart}
\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\newlength\labelwd
\settowidth\labelwd{\bfseries viii.)}
\usepackage{tasks}
\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?
        \begin{tasks}(3)
          \task 10
          \task 11
          \task 12
          \task 13
          \task 14
        \end{tasks}

  \item For every natural number $n$, $\tau(n)$ is the number of positive divisors of $n$. Evaluate $\tau^{3}(12)$.
        \begin{tasks}(3)
          \task 1
          \task 2
          \task 3
          \task 4
          \task 6
        \end{tasks}

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

        \begin{tasks}[counter-format = tsk[R], label-format=\normalfont, after-skip=1\medskipamount](3)
          \task $p + q$ is even.
          \task $pq$ is odd.
          \task $p^{2} - q^{2}$ is even
        \end{tasks}
        Which of the following must be true?
        \begin{tasks}(3)
          \task I only
          \task II only
          \task I and II only
          \task I and III only
          \task I, II, and III
        \end{tasks}

  \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?
        \begin{tasks}(3)
          \task 0
          \task 1
          \task 2
          \task 3
          \task 4
        \end{tasks}

  \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$
  \end{tasks}
  Which is divisible by 3?
  \begin{tasks}(3)
    \task I only
    \task II only
    \task I and II only
    \task II and III only
    \task I, II, and III
  \end{tasks}
\end{enumerate}

\end{document} 

在此处输入图片描述

变体:

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\newlength\labelwd
\settowidth\labelwd{\bfseries viii.)}
\usepackage{tasks}
\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?
        \begin{tasks}(3)
          \task 10
          \task 11
          \task 12
          \task 13
          \task 14
        \end{tasks}
\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)$.
        \begin{tasks}(3)
          \task 1
          \task 2
          \task 3
          \task 4
          \task 6
        \end{tasks}
\end{enumerate}

\noindent {\textbf{3.) }}$p$ and $q$ are prime numbers greater than 2. which of the following statements must be true?
\begin{tasks}[counter-format =tsk[R], item-indent=5.1em](1)
\task $p + q$ is even.
\task $pq$ is odd. 
\task $p^{2} - q^{2}$ is even
\end{tasks}
\begin{tasks}[ item-indent=\dimexpr\labelwd+2.85em](2)
\task I only
\task II only
\task I and II only
\task I and III only
\task I, II, and III
\end{tasks}

\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?
        \begin{tasks}(3)
          \task 0
          \task 1
          \task 2
          \task 3
          \task 4
        \end{tasks}
\end{enumerate}

\noindent {\textbf{5.) }}$n$ is a positive integer. Which of the following quantities is divisible by 3? 
    \begin{tasks}[counter-format =tsk[R], item-indent=5.1em](1)
   \task $n^{3} - 1$ 
    \task   $n^{3} + 1$ 
    \task $n^{3} + 2n$
    \end{tasks}
    \begin{tasks}[item-indent=\dimexpr\labelwd+2.85em](2)
    \task I only
    \task II only
    \task I and II only
    \task II and III only
    \task I, II, and III
    \end{tasks}

\end{document} 

在此处输入图片描述

答案2

我对原始代码所做的唯一修改是在序言中添加了\newlength\HeightOfRadicalNotationand ,并在第一个示例中将 and 作为任务环境的一个选项。它确实为我提供了第一个示例中表达式之间更合适的间距。行间距是多少?它没有 $\sqrt{1}$ 的高度那么大。\settoheight\HeightOfRadicalNotation{$\sqrt{1}$}after-item-skip=\HeightOfRadicalNotation

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

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

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

\usepackage{tasks}
\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.
\begin{tasks}[after-item-skip=\HeightOfRadicalNotation](1)
\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)$
\end{tasks}
\vskip0.25in


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

\end{document}

相关内容