4
\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}
Denis
  • 5,267
Young
  • 165

1 Answers1

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}

enter image description here

Edit: Thanks to @Clemens for his useful comments!

  • \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
  • @clemens Thanks for your useful comments -- and for the great package! The documentation is very well structured! – samcarter_is_at_topanswers.xyz Feb 05 '17 at 14:35