\documentclass[11pt,a4paper]{book}
\usepackage{kantlipsum}
\usepackage{exsheets}
\DeclareInstance{exsheets-heading}{exclist}{default}{
runin = true ,
number-post-code = \space ,
attach = { main[r,vc]number[l,vc](-1em,0pt) } ,
above = 0pt,
below = 0pt
}
\SetupExSheets{
%% solution/print = true ,
headings = exclist ,
headings-format = \bfseries,
counter-within = chapter
}
\usepackage{scrextend}% needed with a KOMA-Script class, `addmargin' environment
\SetupExSheets{
question/pre-hook = \addmargin[1em]{0em} ,
question/post-hook = \endaddmargin ,
solution/pre-hook = \addmargin[1em]{0em} ,
solution/post-hook = \endaddmargin
}
\begin{document}
\section{one}
\begin{question}
This is sample question 1.
\end{question}
\begin{solution}
This is sample solution 1.
\end{solution}
\vfill
\vfill
\begin{question}
This is sample question 2.
\end{question}
\begin{solution}
This is sample solution 2.
\end{solution}
\vfill
\newpage
\printsolutions
\end{document}
Asked
Active
Viewed 488 times
4
1 Answers
4
\documentclass[11pt,a4paper]{book}
\usepackage{kantlipsum}
\usepackage{exsheets}
\SetupExSheets{
counter-format=No. qu[],
headings-format = \bfseries,
counter-within = chapter,
headings=runin,
question/name = Question
}
\begin{document}
\section{one}
\begin{question}
This is sample question 1.
\end{question}
\begin{solution}
This is sample solution 1.
\end{solution}
\vfill
\vfill
\begin{question}
This is sample question 2.
\end{question}
\begin{solution}
This is sample solution 2.
\end{solution}
\vfill
\newpage
\printsolutions
\end{document}
Edit: Thanks to @Clemens for his useful comments!
samcarter_is_at_topanswers.xyz
- 158,329

\RenewQuSolPair{question}[name=Question]{solution}is a complicated way of saying\SetupExSheets{question/name = Question}or\SetupExSheets{question/type = exam}. Also,counter-format = No.\,qu ,would suffice, no need for braces or brackets. – cgnieder Feb 04 '17 at 22:26