0

The MWE below produces the following picture:

MWE

The problem is to obtain better vertical spacing between the inline rows. The problem seems to be due to the extra heights of the sigmas. I used the spacing environment from the setspace package but that seems to also include what loks like dramatically more space before and after the list.

So my question is: is there a way to only stretch the space between the items when using the inline option of enumitem?

Note: The tabbedenum environment was from this answer.

\documentclass{article}

\usepackage[inline]{enumitem}
\usepackage{tabto}

\newenvironment{tabbedenum}[2][]
{\NumTabs{#2}\begin{enumerate*}[
before={\unskip\hspace{\dimexpr-\parindent-1pt}\tab},itemjoin={\tab},#1]}%
{\end{enumerate*}}

\usepackage{setspace}

\begin{document}

\begin{enumerate}
\item Some text.

\begin{spacing}{3}
\begin{tabbedenum}{2}
\item $\displaystyle\sum_{r=1}^{n}x_r + \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r+y_r)?$
\item $\displaystyle\sum_{r=1}^{n}x_r \cdot \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r\cdot y_r)?$
\item $\displaystyle\sum_{r=1}^{n}(c\cdot x_r) = \displaystyle c\cdot\sum_{r=1}^{n}x_r?$
\item $\displaystyle\sum_{r=1}^{n}x_r + \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r+y_r)?$
\end{tabbedenum}
\end{spacing}

\item Some text.

\end{enumerate}


\end{document}
1
  • \spacing{3} seems huge! Your result looks fine for me. Another solution would be to use the tasks package, which has an after-item-skip key for that.
    – Bernard
    Oct 3, 2017 at 19:31

2 Answers 2

3

I'd use tasks:

\documentclass{article}

\usepackage{tasks}

\begin{document}

\begin{enumerate}
\item Some text.

\begin{tasks}[counter-format=(tsk[a]),label-width=1.5em](2)
\task $\displaystyle\sum_{r=1}^{n}x_r + \sum_{r=1}^{n}y_r = \sum_{r=1}^{n}(x_r+y_r)$?
\task $\displaystyle\sum_{r=1}^{n}x_r \cdot \sum_{r=1}^{n}y_r = \sum_{r=1}^{n}(x_r\cdot y_r)$?
\task $\displaystyle\sum_{r=1}^{n}(c\cdot x_r) =  c\cdot\sum_{r=1}^{n}x_r$?
\task $\displaystyle\sum_{r=1}^{n}x_r + \sum_{r=1}^{n}y_r = \sum_{r=1}^{n}(x_r+y_r)$?
\end{tasks}

\item Some text.

\end{enumerate}

\end{document}

Note that \displaystyle is a declaration that holds for the whole formula and that, generally, outer punctuation goes outside the formula.

enter image description here

You can customize the separation between rows: with

\begin{tasks}[counter-format=(tsk[a]),label-width=1.5em,after-item-skip=5ex](2)

you'd get

enter image description here

0

I found myself a solution. It relies on putting some vertical space by way of a zero width \rule at every instance of \item. Below is the code, whereby I kept the original code by way of comparison. (I also added a new paragraph at the beginning too.)

output of the code below

\documentclass{article}

\usepackage[inline]{enumitem}
\usepackage{tabto}

\newenvironment{tabbedenum}[2][]
{\NumTabs{#2}\begin{enumerate*}[
before={\unskip\hspace{\dimexpr-\parindent-1pt}\tab},itemjoin={\tab},#1]}%
{\end{enumerate*}}

\usepackage{setspace}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newenvironment{tabbedenumNEW}[3][]
{\par\vspace{\baselineskip}\NumTabs{#2}\begin{enumerate*}[
before={\unskip\hspace{\dimexpr-\parindent-1pt}\tab},itemjoin={\tab\rule[-#3]{0mm}{#3}},#1]}%
{\end{enumerate*}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



\begin{document}

\begin{enumerate}
\item Some text followed by original, note too much space before the next item.

\begin{spacing}{3}
\begin{tabbedenum}{2}
\item $\displaystyle\sum_{r=1}^{n}x_r + \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r+y_r)?$
\item $\displaystyle\sum_{r=1}^{n}x_r \cdot \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r\cdot y_r)?$
\item $\displaystyle\sum_{r=1}^{n}(c\cdot x_r) = \displaystyle c\cdot\sum_{r=1}^{n}x_r?$
\item $\displaystyle\sum_{r=1}^{n}x_r + \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r+y_r)?$
\end{tabbedenum}
\end{spacing}

\item Some text followed by new and improved.

\begin{tabbedenumNEW}{2}{2\baselineskip}
\item $\displaystyle\sum_{r=1}^{n}x_r + \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r+y_r)?$
\item $\displaystyle\sum_{r=1}^{n}x_r \cdot \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r\cdot y_r)?$
\item $\displaystyle\sum_{r=1}^{n}(c\cdot x_r) = \displaystyle c\cdot\sum_{r=1}^{n}x_r?$
\item $\displaystyle\sum_{r=1}^{n}x_r + \displaystyle\sum_{r=1}^{n}y_r = \displaystyle\sum_{r=1}^{n}(x_r+y_r)?$
\end{tabbedenumNEW}

\item Some text.

\end{enumerate}


\end{document}

You must log in to answer this question.

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