[Tex/LaTex] Space between item label and paragraph, enumitem

enumitem

In the MWE below, how can I reduce the space between the (i)/(ii) and their respective paragraphs, i.e. the blue lines? I would like to

  1. keep the "exercises" labels hugging the left margin
  2. keep the "subparts" labels hugging the left margin

If I use the labelsep parameter, the (i) and (ii) are dragged away from the left margin. Moreover, I don't think I'm using the widest parameter correctly.

\documentclass{article}
\usepackage[margin={1.25in,1.1in}]{geometry}
\usepackage{mathtools,enumitem,lipsum}

\newlist{exercises}{enumerate}{1}
\setlist[exercises]{label=\textbf{\thesection-\arabic*.\;},align=right,leftmargin=0pt,itemsep=15pt}
\newlist{subparts}{enumerate}{2}
\setlist[subparts]{label=(\roman*),align=left,widest=i}

\begin{document}

\section{Testing section}

\begin{exercises}
%
\item \lipsum[1]
\item
\begin{subparts}
\item \lipsum[2]
\item \lipsum[3]
\end{subparts}
\item
\end{exercises}

\end{document} 

enter image description here

Best Answer

The widest-parameter, from page 5 in the docs, says it should be used in conjunction with the *-values. That is if we do leftmargin=* then the widest=i would decide how much leftmargin there should be. This used in combination with labelsep gives you a result that I think is what you want:

\setlist[subparts]{label=(\roman*),align=left,widest=ii,
    labelsep=0pt,leftmargin=*}

Where labelsep is the distance from the counter mark. If you increase the widest you increase the space between the "anchor point" of the label (try changing it to e.g. widest=i or widest=iii or widest=asdf). labelsep increases extra distance from the widest label and out.

Doing this produces:

enter image description here

Here is the code in it's entirety:

\documentclass{article}
\usepackage[margin={1.25in,1.1in}]{geometry}
\usepackage{mathtools,enumitem,lipsum}

\newlist{exercises}{enumerate}{1}
\setlist[exercises]{label=\textbf{\thesection-\arabic*.\;},align=right,leftmargin=0pt,itemsep=15pt}
\newlist{subparts}{enumerate}{2}
\setlist[subparts]{label=(\roman*),align=left,widest=i,
    labelsep=0pt,leftmargin=*}

\begin{document}

    \section{Testing section}

     \begin{exercises}
         %
         \item \lipsum[1]
         \item
         \begin{subparts}
             \item \lipsum[2]
             \item \lipsum[3]
         \end{subparts}
         \item
     \end{exercises}

\end{document}
Related Question