4

I am using the tasks package to create a list of maths problems in a textbook. Usually, these textbooks use a star or asterisk symbol to point out questions which are a bit more challenging than the rest; like this: With star

How can I go about this? Here's my code, which renders the star after the 'e)', but I want it before as shown above.

\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}
Luke Collins
  • 1,910

1 Answers1

4

Since one necessarily have to indicate which is different from the rest, you might just as well move the \star into position manually via \difficult rather than trying to automate things.

enter image description here

\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}
Werner
  • 603,163