我正在使用该tasks
包创建教科书中的数学问题列表。通常,这些教科书使用星号或星号符号来指出比其他问题更具挑战性的问题;如下所示:
我该怎么做?这是我的代码,它在“e)”之后呈现星号,但我希望它出现在前面,如上所示。
\documentclass{article}
\usepackage{amsmath,amsfonts,tasks,geometry}
\newcommand{\difficult}{\large$\star$\normalsize~~}
\geometry{a4paper, portrait, margin=1in}
\begin{document}
\begin{enumerate}
\item Prove the following statements by induction.
\begin{tasks}(2)
\task $\displaystyle\sum_{r=1}^n r^5=\frac{n^2}{12}(n+1)^2(2n^2+2n-1)$
\task $\displaystyle\sum_{r=1}^n \frac{1}{r(r+1)}=\frac{r}{r+1}$
\task $\displaystyle\prod_{r=1}^n r^{12}=(r!)^{12}$
\task $\displaystyle\prod_{r=2}^n \left(1-\frac{1}{r^2}\right)=\frac{n+1}{2n};~~\forall n\geq 2$
\task \difficult $\displaystyle\sum_{r=1}^n rx^{r-1}=\frac{1-(n-1)x^n+nx^{n+1}}{(x-1)^2}$
\task $\displaystyle\sum_{r=1}^n \frac{r^2+r+1}{r(r+1)}=\frac{n(n+2)}{n+1}$
\end{tasks}
\end{enumerate}
\end{document}
答案1
由于必须指出哪个与其他的不同,因此您也可以\star
通过手动方式将其移动到位,\difficult
而不是尝试自动化。
\documentclass{article}
\usepackage{amsmath,tasks,geometry}
\geometry{a4paper, portrait, margin=1in}
\newcommand{\difficult}{%
\leavevmode\makebox[0pt][r]{\large$\star$\hspace{1.5em}}}
\begin{document}
\begin{enumerate}
\item Prove the following statements by induction.
\begin{tasks}(2)
\task $\displaystyle\sum_{r=1}^n r^5=\frac{n^2}{12}(n+1)^2(2n^2+2n-1)$
\task\difficult $\displaystyle\sum_{r=1}^n \frac{1}{r(r+1)} = \frac{r}{r+1}$
\task $\displaystyle\prod_{r=1}^n r^{12}=(r!)^{12}$
\task $\displaystyle\prod_{r=2}^n \biggl( 1-\frac{1}{r^2} \biggr) = \frac{n+1}{2n};~~\forall n\geq 2$
\task\difficult $\displaystyle\sum_{r=1}^n rx^{r-1} = \frac{1-(n-1)x^n+nx^{n+1}}{(x-1)^2}$
\task $\displaystyle\sum_{r=1}^n \frac{r^2+r+1}{r(r+1)} = \frac{n(n+2)}{n+1}$
\end{tasks}
\end{enumerate}
\end{document}