3

I want to use the exsheets package for some homework sheets in combination with enumitem. When I encapsulate an enumerate environment inside a question environment, the first item of the enumeration is shifted vertically, probably by a newline or parskip, as you can see in question no. 3 on the picture.

Output

Rather I would like it to start on the very same line. How can I do that with exsheets?

\documentclass{article}
\usepackage{enumitem}
\usepackage[load-headings]{exsheets}
\usepackage{tikz}
\SetupExSheets{headings=empty}
\newcommand*\circled[1]{%
  \tikz[baseline=(char.base)]
    \node[
      shape=circle,
      fill,
      inner sep=1.5pt,
      text=white,
      minimum size=1.5em
    ] (char) {\sffamily\bfseries #1};
}
\begin{document}
\begin{enumerate}[label=\protect\circled{\arabic*}]

\item
\begin{question} % This works as it should.
Please compute the following.
\begin{enumerate}
    \item What is $100+100$?
    \item Compute $100-100$.
\end{enumerate}
\end{question}

\item
\begin{enumerate} % I would like to use the 'question' environment here.
    \item What is $2+2$?
    \item Compute $2-2$.
\end{enumerate}

\item
\begin{question} % But if I directly add the enumerate-environment, see what happens :(
\begin{enumerate}
    \item What is $333+333$?
    \item Compute $999-333$.
\end{enumerate}
\end{question}

\end{enumerate}
\end{document}
9
  • Welcome to tex.se! I'd like to help but have never worked with exsheets. When I compile your example, it tells me that I'm missing a config file and the result looks different (has headings for every question). Maybe you could post you exsheets_headings.cfg file as well to make it easier to identify the problem.
    – Harald
    Commented Nov 27, 2014 at 14:59
  • @Harald, I do not have any special exsheets_headings.cfg file, other than the one shipped with exsheets. Maybe you are using an older version of exsheets? Try using \usepackage[load-headings]{exsheets}. Commented Nov 27, 2014 at 15:27
  • That's not exsheets' fault: list environments add some vertical space in the beginning, namely \topsep (+\parskip+\partopsep IIRC). (As an aside: I'd set exsheets' counter-format to use the circled numbers instead of surpressing exsheets' numbers completely and using an enumerate environment as a shell)
    – cgnieder
    Commented Nov 27, 2014 at 15:41
  • @cgnieder, no they don't?! In number 2) there is no vertical space added in the beginning. Commented Nov 27, 2014 at 15:46
  • Yes, they do, see page~145 of the LaTeX companion
    – cgnieder
    Commented Nov 27, 2014 at 15:46

2 Answers 2

1

Another (equally bad) option, if you really want to use tasks, e.g., for its nice horizontal layout.

\begin{question}
\begin{tasks}[before-skip=\dimexpr-\topsep-\baselineskip-\parskip\relax]
    \task What is $333+333$?
    \task Compute $999-333$.
\end{tasks}
\end{question}

Still, I wish that inline lists was the default behavior with runin heading styles.

0

As a very dirty walkaround I now use

\begin{question}
\vspace{-\parskip}\vspace{-\baselineskip}
\begin{enumerate}[leftmargin=*,topsep=0pt]
    \item What is $333+333$?
    \item Compute $999-333$.
\end{enumerate}
\end{question}

This works, but it's not very nice.

You must log in to answer this question.

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