I would like to thank those who have edited my question, and thoae who had answered the previous post. I am trying to write a book with the following key features
- Questions laid out in the
exam
class format withquestion
number,part
andsubpart
- Questions, question parts and subparts should indicate the number of marks or points as well as total points for the whole question such as
\addtotalpoints
in exam class - Solutions which will be written after the question during typesetting, but appearing at the end of the book.
code:
\documentclass[12pt,fleqn]{book}
\usepackage{exsheets}
\SetupExSheets{
counter-format=ch.qu,counter-within=chapter
}
\DeclareInstance{exsheets-heading}{block}{default}
{
join = { title[r,B]number[l,B](1ex,0pt) } ,
attach =
{
main[l,vc]title[l,vc](0pt,0pt) ;
main[r,vc]points[l,vc](\marginparsep,0pt)
},
above = \baselineskip-.5ex ,
below = .5ex}\NewQuSolPair{exercise}{solution}
\DeclareInstance{exsheets-heading}{myheadings2}{default}{
runin = true,
number-post-code = \space,}
\SetupExSheets{
question/pre-body-hook = {%
\hyperlink{sol:\CurrentQuestionID}{\underline{\textbf{Exercise:}
\GetQuestionProperty{counter}{\CurrentQuestionID}}}\par
},
solution/pre-hook = {% \hypertarget{sol:\CurrentQuestionID}{}%
},
solution/pre-body-hook = {%
\hyperref[qu:\CurrentQuestionID]{\underline{\textbf{Solution:}
\GetQuestionProperty{counter}{\CurrentQuestionID}}}\par
},
headings = myheadings2 }
\section{Cell structure}
\begin{itemize}
\item all living organisms are made up of cells
\item cells may be specialised to carry out a particular function
\item specialised cells include root hair cells, nerve cells, red blood cells
\end{itemize}
\begin{exercise}
\begin{enumerate}
\item[]
\item Which organelle is responsible for:
\begin{enumerate}
\item entry and exit of substances into or out of the cell
\item controlling all cellular activities
\end{enumerate}
\item Below is a diagram of a plant cell.
\begin{enumerate}
\item Identify parts 1- 6.
\item Identify features which are \textbf{not} found in animal cells
\end{enumerate}
\end{enumerate}
\end{exercise}
\begin{solution}
\begin{enumerate}
\item[]
\item
\begin{enumerate}
\item cell membrane
\item nucleus
\end{enumerate}
\item
\begin{enumerate}
\item \begin{itemize}
\item chloroplast
\item permanent vacuole
\item cytoplasm
\item cell wall
\item cell membrane
\item nucleus
\end{itemize}
\item
\begin{itemize}
\item chloroplast/1
\item permanent vacuole/2
\item cell wall/4
\end{itemize}
\end{enumerate}
\end{enumerate}
\end{solution}
\chapter{Nutrition}
\section{Diet}\index{Diet}
\begin{itemize}
\item living organisms need food for the following:
\begin{enumerate}
\item to produce energy that is used in work and physical exercise and to keep the body temperature at $37^OC$
\item for growth
\item to renew and repair worn out tissues
\end{enumerate}
\end{itemize}
\begin{exercise}
\begin{enumerate}
\item
\begin{enumerate}
\item A person’s diet should contain carbohydrate and fat and protein. Give two reasons why.
\item Name one health problem, other than being overweight, that is linked to an unbalanced diet.
\end{enumerate}
\item Explain the importance of the following in maintaining good health
\begin{enumerate}
\item personal hygiene
\item sewage disposal
\end{enumerate}
\end{enumerate}
\end{exercise}
\begin{question}
\begin{enumerate}
\item
\begin{enumerate}
\item
\begin{itemize}
\item to get a balanced diet / to prevent malnourishment
\item to obtain energy
\item for building cells / growth / repair
\end{itemize}
\item heart disease, any deficiency disease
\end{enumerate}
\item
\begin{enumerate}
\item prevent the spread of diseases
\item prevent the spread of diseases
\end{enumerate}
\end{enumerate}
\end{question}
\chapter{Answers}
\printsolutions
\end{document}
exam
class since you usebook
. Recreating the items you want is hard work. Theexam
class doesn't typeset the solutions at the end, but underneath the question. The best I came up with is using anenumerate
and label all\item
s and then type all the solutions at the end of the document.