2

I would like to have a maths exercise in a document so that the questions are numbered thus:

1. Question 1
     a) subquestion 1      b) subquestion 2    c)subquestion 3
     d) subquestion 4      e) subquestion 5    f)subquestion 6
     etc.

2. Question 2

I've managed to achieve something similar using the multicols package, but this renders the letters in vertical order, rather than horizontal. The code of my attempt is detailed below:

\documentclass{report}
\usepackage{multicol,amsmath,amsfonts}
\begin{document}
\subsubsection*{Exercise 18.1}
    \begin{enumerate}
        \item Prove the following by induction on $n$, where $n\in\mathbb Z^+$.     
        \begin{enumerate}
            \begin{multicols}{2}
            \item $\displaystyle\sum_{r=0}^n 2^r=2^{n+1}-1$
            \item $5+5^2+\cdots+5^n=\displaystyle\frac{5(5^n-1)}{4}$
            \item $\displaystyle\sum_{r=0}^n a^r=\frac{a(a^n-1)}{a-1};~a\in\mathbb R$\\
            \item The sum of the first $n$ odd numbers is $n^2$.    
            \end{multicols}         
            \item $\displaystyle(1+a)+2(2+a)+3(3+a)+\cdots+n(n+a)=\frac{n}{6}(n+1)(3a+2n+1);~a\in\mathbb R$
            \item $5(4)+6(5)+7(6)+\cdots+n(n-1)=\displaystyle\frac{1}{3}(n^3-n-60);~\forall n\geq 5$
            \item $1^4+2^4+3^4+\cdots+n^4=\displaystyle\frac{n}{30}(n+1)(2n+1)(3n^2+3n-1)$
        \end{enumerate}     
        \item Prove the following statements by induction.
        \begin{enumerate}
            \begin{multicols}{2}
                \item $\displaystyle\sum_{r=1}^n r^5=\frac{n^2}{12}(n+1)^2(2n^2+2n-1)$
                \item $\displaystyle\sum_{r=1}^n \frac{1}{r(r+1)}=\frac{r}{r+1}$
                \item $\displaystyle\prod_{r=1}^n r^{12}=(r!)^{12}$
            \end{multicols}
        \end{enumerate}
    \end{enumerate}
\end{document}

Which renders the following output: Output Anyone know how I can achieve the horizontal ordered numbering?

1 Answer 1

11

The tasks package is made for that. I added enumitem, to easily customise the enumerate environment (wide option). Also, I simplifies your your code with everymath{\displaystyle}at the beginning of the enumerate environment. The labels can be easily customised with the counter-format key. Last, not least, if an item is longer than one column, it it is typed as a \parbox. Alternatively, you can let it spread for more than one column with the star version of \tasks:

\documentclass{report}
\usepackage{multicol,amsmath,amsfonts}
\usepackage{enumitem}
\usepackage{tasks}

\begin{document}

\subsubsection*{Exercise 18.1}
\begin{enumerate}[wide = 0pt]\everymath{\displaystyle}
  \item Prove the following by induction on $n$, where $n\in\mathbb Z^+$.
        \begin{tasks}(2)
          \task $\sum_{r=0}^n 2^r=2^{n+1}-1$
          \task $5+5^2+\cdots+5^n=\frac{5(5^n-1)}{4}$
          \task $\sum_{r=0}^n a^r=\frac{a(a^n-1)}{a-1};~a\in\mathbb R$\\
          \task The sum of the first $n$ odd numbers is $n^2$.
          \task* $(1+a)+2(2+a)+3(3+a)+\cdots+n(n+a)=\frac{n}{6}(n+1)(3a+2n+1);~a\in\mathbb R$
          \task* $5(4)+6(5)+7(6)+\cdots+n(n-1)=\frac{1}{3}(n^3-n-60);~\forall n\geq 5$
          \task* $1^4+2^4+3^4+\cdots+n^4=\frac{n}{30}(n+1)(2n+1)(3n^2+3n-1)$
        \end{tasks}
  \item Prove the following statements by induction.
        \begin{tasks}[counter-format={\bfseries tsk[1].}](2)
          \task $\sum_{r=1}^n r^5=\frac{n^2}{12}(n+1)^2(2n^2+2n-1)$
          \task $\sum_{r=1}^n \frac{1}{r(r+1)}=\frac{r}{r+1}$
          \task $\prod_{r=1}^n r^{12}=(r!)^{12}$

        \end{tasks}
\end{enumerate}

\end{document} 

enter image description here

4
  • Excellent! And if need be, how would I change the labels? (to roman/arabic for example) Jan 12, 2016 at 22:45
  • 1
    I updated my answer to show how to customise the label, and added a few details.
    – Bernard
    Jan 13, 2016 at 1:00
  • Thanks for this! It's great. I'm having trouble getting it to work with other labels though. For example, if I use the option [counter-format={tsk[i].}] to try to produce i., ii,..., I get an error. And if I use the option [counter-format={(tsk[a])}] to try to produce (a), (b),... then there is no space between the heading and the entry.
    – user93370
    Jul 5, 2017 at 18:59
  • 1
    @user93370: To have a roman counter, the syntax is [counter-format={tsk[r].}]. For the second problem, add something like [label-width=1.5em].
    – Bernard
    Jul 5, 2017 at 19:12

You must log in to answer this question.

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