3

I've typed an exam up, and my nested enumerates seem to cause a problem with the separation between my label and the actual line item. This happens specifically when using the inlineitem command, which allows me to list more than one item on the same line. The first item in the line has more spacing between the label and the item than subsequent items on the same line...

Here is my minimum working example:

\documentclass[10pt]{article}

\usepackage{amsmath, amssymb, graphicx, fancyhdr, color,booktabs, calc,caption,pgfplots, enumitem}
\makeatletter

\newcommand{\inlineitem}[1][]{
\ifnum\enit@type=\tw@
    {\descriptionlabel{#1}}
  \hspace{\labelsep}
\else
  \ifnum\enit@type=\z@
       \refstepcounter{\@listctr}\fi
    \quad\@itemlabel\hspace{\labelsep}
\fi}
\makeatother

\begin{document}

\begin{enumerate}[leftmargin=.75cm,align=left,labelsep=0cm,label=\textbf{Problem \arabic*. }]

\item Prove each of the following:

\begin{enumerate}[leftmargin=.75cm,labelsep=0cm,align=left,label=(\alph*)]

\item $x = y$ {\color{white}......} \inlineitem $x = 2y$ {\color{white}......} \inlineitem $3x - 5 = 2020$

\end{enumerate}

\end{enumerate}

\end{document}
3

I propose to use the tasks environment, or shortenumerate from shortlst.

Example with tasks:

\documentclass[10pt]{article}

\usepackage{amsmath, amssymb, graphicx, fancyhdr, color,booktabs, calc,caption,pgfplots, enumitem}
\usepackage{tasks}

\begin{document}

\begin{enumerate}[leftmargin=.75cm,align=left,labelsep=0cm,label=\textbf{Problem \arabic*. }]

  \item Prove each of the following:

        \begin{tasks}[counter-format =(tsk[a]), label-offset=1.25em](3)
          \task $x = y$ {\color{white}......} \task $x = 2y$ {\color{white}......} \task $3x - 5 = 2020$
          \task $y = z$ {\color{white}......} \task $y = 6z$ {\color{white}......} \task $z-10 = 1010$
        \end{tasks}

\end{enumerate}

\end{document} 

enter image description here

| improve this answer | |
  • Nice! What else can go inside of tsk[] instead of a? How would I do roman numerals? Or little roman numerals? – layman Dec 8 '15 at 17:15
  • Also, what if you want to make two rows of items? – layman Dec 8 '15 at 17:18
  • Just use \tsk[r]. This is explained in § 4 of the documentation. – Bernard Dec 8 '15 at 17:18
  • All this is automatic. Please take a look at my updated answer. – Bernard Dec 8 '15 at 17:21
  • 1
    It's exactly that. The advantage of shortlst is that, in case an item sets over more than one column, the package uses the required number of columns automatically, while with tasks you have to specify how many columns you need. – Bernard Dec 8 '15 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.