TransWikia.com

Exsheets: How can I print solutions with subsections correctly?

TeX - LaTeX Asked by garondal on April 6, 2021

I want to number my questions with exsheets with subsection which is possible with the command: counter-within={subsection}. But I wish to have the same numbers in my solutions.

I found this solution:
Theorem numbering as subsections and automatic solutions

but when I enter the exact same code into TexShop, I get something else.

With the following code

documentclass[a4paper,12pt]{article}

usepackage[T1]{fontenc}
usepackage[utf8]{inputenc}

usepackage{multicol}

usepackage{exsheets}
AddCounterPattern[exsheets]{subsection}{sub}


DeclareInstance{exsheets-heading}{mystyle}{default}{
points-pre-code = [ ,
points-post-code = ) ,
join = 
{
title[r,B]number[l,B](0.333em,0pt) ;
number[r,B]points[l,B](0.333em,0pt)
} ,
attach = { main[l,vc]title[l,vc](0pt,0pt) }
}

NewQuSolPair{pr}[name=Problem]{Solution}[name=ad Problem]

SetupExSheets{
question/pre-body-hook=itshape,
solution/pre-body-hook=itshape,
counter-within={subsection},
headings=mystyle,
points/name=Punkt/e,counter-format=se.sub.qu}

begin{document}


section{Section}

subsection{Subsection}
begin{pr}
 Problem
end{pr}
begin{Solution}
  Solution
end{Solution}

subsection{Subsection}

begin{pr}
 Problem
end{pr}
begin{Solution}
  Solution
end{Solution}

begin{pr}
 Problem
end{pr}
begin{Solution}
  Solution
end{Solution}

section{Section}

subsection{Subsection}
begin{pr}
 Problem
end{pr}
begin{Solution}
  Solution
end{Solution}
newpage


section{Solutions}
begin{multicols}{2}
  printsolutions
end{multicols}

end{document}

I have the outputenter image description hereenter image description here

but I want solutions numbers like 1.1.1 and 1.2.1. Does anybody know how to do this?

One Answer

I solved it: I had an old version of the exsheets.sty file. I works with the newest version - but I have seen that there is a newer version of exsheets called xsim.

Answered by garondal on April 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP