3

I would like to increase the linespread within a group. Namely, the linespread within an inline-enumeration. For this purpose, I have the following code.

\documentclass[]{article}
\parindent 0cm 
\usepackage{setspace}
\usepackage{enumerate}
\usepackage[inline,shortlabels]{enumitem}

\newlist{choices}{enumerate*}{1}
\setlist[choices]{itemjoin = \hspace{0.7cm}, label=\alph*)}

\begin{document}
{
\setstretch{2}
\begin{choices}
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
\end{choices}
}\\

\begin{choices}
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
\end{choices}
\end{document}

Which produces Output1

I would, however, like to have only the first list spaced with double spacing. Like so

\documentclass[]{article}
\parindent 0cm 
\usepackage{setspace}
\usepackage{enumerate}
\usepackage[inline,shortlabels]{enumitem}

\newlist{choices}{enumerate*}{1}
\setlist[choices]{itemjoin = \hspace{0.7cm}, label=\alph*)}

\begin{document}

\setstretch{2}
\begin{choices}
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
\end{choices}

\end{document}

which produces Output2

So, if I have only one list present, it works. As soon as there is another list, or other text, it doesn't. Can somebody help me?

Wrapping it in a minipage environment does the trick. Is there another solution?

2 Answers 2

2

Never use \\ in order to terminate paragraphs. Also, don't load enumerate along with enumitem.

\documentclass{article}
\usepackage{setspace}
\usepackage[inline]{enumitem}

\newlist{innerchoices}{enumerate*}{1}
\setlist[innerchoices]{
  itemjoin = \hspace{0.7cm},
  label=\alph*),
  before=\noindent,
  mode=unboxed,
}
\newenvironment{choices}[1][1]
  {\begin{spacing}{#1}\begin{innerchoices}}
  {\end{innerchoices}\end{spacing}}

\begin{document}

\begin{choices}[2]
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
\end{choices}

\begin{choices}
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
\end{choices}
\end{document}

enter image description here

3
  • why and why? :) so why should I not end paragraphs with // ? and why should I not load enumitem and enumerate together? they are compatible, no? Aug 24, 2018 at 19:34
  • 1
    @JohannesBleher \\ is not to be used for ending paragraphs. Ever. And no, enumerate and enumitem are not really compatible.
    – egreg
    Aug 24, 2018 at 20:12
  • alright. looked it up tex.stackexchange.com/questions/82664/… Aug 24, 2018 at 20:19
4

The package setspace offers an environment. You get the manual probably by typing texdoc setspaceon the command line.

\documentclass[]{article}
\parindent 0cm 
\usepackage{setspace}
\usepackage{enumerate}
\usepackage[inline,shortlabels]{enumitem}

\newlist{choices}{enumerate*}{1}
\setlist[choices]{itemjoin = \hspace{0.7cm}, label=\alph*)}

\begin{document}

\begin{spacing}{2}
  \begin{choices}
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \end{choices}
\end{spacing}

\begin{choices}
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
  \item $XXXX$
\end{choices}
\end{document}

We get:

enter image description here

2
  • your answer is great. i was torn... sorry. I roled a dice... Aug 24, 2018 at 20:21
  • 1
    @JohannesBleher That's allright, egreg needs the rep much more than I do.
    – Keks Dose
    Aug 24, 2018 at 20:54

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.