I would like — using the exercise
package — to make lists of exercises using the ExerciseList
environment. The output is supposed to look like in the below example.
The exercises are to be indented as shown, with the number to the left, like in an ordinary list environment. Can this be done within the exercise
package?
EDIT: In order to please @cfr, I hereby publish my own attempts at solving this problem. The code crashes painfully:
\documentclass[openright,book]{memoir}
%Dansk sprog:
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\renewcommand{\danishhyphenmins}{22}
%\OnehalfSpacing %hvis der oenskes halvanden linjeafstand
%Pakker
\usepackage[noDcommand]{kpfonts} % the kpfonts font
\usepackage{%
amsmath,graphicx,enumerate,amstext,geometry,array,xfrac,bm,mathtools,siunitx,
%tikz, pgfplots
etoolbox, xparse, %til subexc
fixltx2e, %fikser et par bugs i LaTeX-kernen
microtype, %smaa fiks, der goer tekst lettere at laese
varioref,
}
\usepackage{exercise}
\renewcommand\ExerciseListName{} % I don't want any word like "exercise" anywhere
\renewcommand\ExerciseHeaderTitle{\Exercisetitle}
\renewcommand{\ExerciseListHeader}{\ExerciseHeaderDifficulty%
\item[\ExerciseHeaderNB]\ExerciseHeaderTitle\ %
\ExerciseHeaderOrigin\ignorespaces}
\renewenvironment{ExerciseList}{\enumerate[1]\beginExerciseListEnv}{\endExerciseListEnv\endenumerate}
\begin{document}
\begin{ExerciseList}
\Exercise What is this?
\Exercise What is that
\Question What in the world?
\subQuestion What is this?
\ExeText We define $x = y$.
\end{ExerciseList}
\end{document}
Best Answer
Since in the comments an
exsheets
solution for such a layout was welcomed here it is... the usage is quite different from theexercise
package, though...The solution contains of several steps:
Wrap KOMA-Script's
addmargin
environment around thequestion
environment with the help ofetoolbox
's\AtBeginEnvironment
and\AtEndEnvironment
. This gets the question bodies indented by the specified margin (3em
in the example below). Theaddmargin
environment is provided by thescrextend
package so it can be used with other classes, too.Declare a new heading instance inspired by
margin-nr
instance described in theexsheets
manual which uses the same margin as set by theaddmargin
environment (3em
in the example below) to place the question number aligned with the text margin.Set up
exsheets
to use the new instance and add some options for in-section numbering.This is how the document from the code below looks like: