3

How do I disallow exsheets from starting a question on a new line if I have to use the enumerate environment immediately in it?

 \documentclass[12pt]{article}
 \usepackage[a4paper, top=3cm, bottom=3cm]{geometry}
 \usepackage{exsheets}
 \begin{document}
 \SetupExSheets{headings=runin}
 \begin{question}
 \begin{enumerate}
 \item Air
 \item Water
 \end{enumerate}
 \end{question}
 \end{document}

I tried the solution given here but it is not overwriting the first item on the words: Exercise 1.

\begin{question}
\vspace{-\parskip}\vspace{-\baselineskip}
\begin{enumerate}[leftmargin=*,topsep=0pt]
\item Air
\item Water
\end{enumerate}
\end{question}
  • You do know that the options to {enumerate} only work if you load the enumitem package? – clemens Feb 28 '15 at 14:41
  • @clemens: No I didn't. Thanks. But including it is still not giving the desired output. – Shahab Feb 28 '15 at 15:00
  • Obviously not. You should read the enumitem manual about the leftskip option. – clemens Feb 28 '15 at 15:05
  • @clemens: If I try \setlength{\leftskip}{1in} then all the items are shifted. I need only the first item shifted. – Shahab Feb 28 '15 at 15:34
  • Sorry, I meant the leftmargin option which is described in the enumitem manual. The one that you set leftmargin=* – clemens Feb 28 '15 at 15:35
4

Set leftmargin to a suitable value, e.g. 3.5cm.

Also, the vertical space can be added directly into the enumerate options (before={\vspace*{-\baselineskip}}).

MWE:

\documentclass[12pt]{article}
\usepackage[a4paper, top=3cm, bottom=3cm]{geometry}
\usepackage{exsheets}
\usepackage{enumitem}
\begin{document}
\SetupExSheets{headings=runin}
\begin{question}
\begin{enumerate}[leftmargin=3.5cm,topsep=0pt,before={\vspace*{-\baselineskip}}]
\item Air
\item Water
\end{enumerate}
\end{question}
\end{document} 

Output

enter image description here


EDIT

I'm not sure to understand your request in the comments, but here are two possibilities:

enter image description here

Code:

\documentclass[12pt]{article}
\usepackage[a4paper, top=3cm, bottom=3cm]{geometry}
\usepackage{exsheets}
\usepackage{enumitem}
\begin{document}
\SetupExSheets{headings=runin}

\begin{question}
\begin{enumerate}[leftmargin=0cm,itemindent=3.5cm,topsep=0pt,before={\vspace*{-\baselineskip}}]
\item Very very very very very very very very very very very very
very very very very very very very very very very very very very
very very very very very very very very very very very long text
\end{enumerate}
\begin{enumerate}[leftmargin=0cm,resume]
\item Very very very very very very very very very very very very
very very very very very very very very very very very very very
very very very very very very very very very very very long text
\item Very very very very very very very very very very very very
very very very very very very very very very very very very very
very very very very very very very very very very very long text
\end{enumerate}
\end{question}

\bigskip

\begin{question}
\begin{enumerate}[leftmargin=0cm,itemindent=3.5cm,topsep=0pt,before={\vspace*{-\baselineskip}}]
\item Very very very very very very very very very very very very
very very very very very very very very very very very very very
very very very very very very very very very very very long text
\end{enumerate}
\begin{enumerate}[leftmargin=0cm,itemindent=*,resume]
\item Very very very very very very very very very very very very
very very very very very very very very very very very very very
very very very very very very very very very very very long text
\item Very very very very very very very very very very very very
very very very very very very very very very very very very very
very very very very very very very very very very very long text
\end{enumerate}
\end{question}

\end{document} 
  • Thanks. But is there any way to keep the word Water directly below Exercise 1? – Shahab Feb 28 '15 at 18:05
2

To have the second (+third and so on) item under "Exercise" you can use a second enumerate session. Something like in one of the two examples below (I used karlkoeller's MWE):

\documentclass[12pt]{article}
\usepackage[a4paper, top=3cm, bottom=3cm]{geometry}
\usepackage{exsheets}
\usepackage{enumitem}
\begin{document}
\SetupExSheets{headings=runin}
\begin{question}
\begin{enumerate}[leftmargin=3.5cm,topsep=0pt,before={\vspace*{-\baselineskip}}]
\item Air
\end{enumerate}
\begin{enumerate}[leftmargin=0pt,partopsep=0pt,resume]
\item Water
\end{enumerate}
\end{question}
\begin{question}
    \begin{enumerate}[leftmargin=3.5cm,topsep=0pt,before={\vspace*{-\baselineskip}}]
        \item Air
    \end{enumerate}
    \begin{enumerate}[leftmargin=*,partopsep=0pt,resume]
        \item Water
    \end{enumerate}
\end{question}
\end{document}

output

Edit: When I want to have the items flowing like any other text I simply do not use enumerate (or any other alike), I just do it manually:

\documentclass[12pt]{article}
\usepackage[a4paper, top=3cm, bottom=3cm]{geometry}
\usepackage{exsheets}
\usepackage{blindtext}
\def\dummyText{The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.}
\begin{document}
\SetupExSheets{headings=runin}
\begin{question}
    1. \dummyText \\ 
    2. \dummyText
\end{question}
\end{document}

output

  • I thought of that. The problem is that the first item is entirely shifted. If the first item consists of text which is more then one line, then the entire block of text is shifted which doesn't look nice. Is there a way to have only the first line of the first item shifted? – Shahab Mar 1 '15 at 1:27
  • @Shahab In that case I'd simply not use enumerate- answer updated. – alwaysask Mar 1 '15 at 8:04

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.