If I use this code provided by a question formulate of Sebastian for exercise environment.
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\newtcolorbox[auto counter]{problem}[2][]{%
breakable,
blankest,
enhanced,
attach boxed title to top left={yshift=-\tcboxedtitleheight},
left=\tcboxedtitlewidth+1mm,
top=0pt,
colback=white,
fonttitle=\bfseries\sffamily,
coltitle={cyan!60!black},
colbacktitle=white,
colframe=white,
title=\thetcbcounter,
overlay unbroken and first={%
\node[fill=gray!30, inner sep=1pt, minimum width=\tcboxedtitlewidth,
outer sep=0pt, text=cyan!60!black, anchor=north] at(title.south)
{\foreach \i in {1,...,#2}{\if#2gt1{\,}\fi$\bullet$}};},#1}
\begin{document}
\lipsum[1]
\begin{problem}{1}
\lipsum[2]
\end{problem}
\begin{problem}{4}
\lipsum[3]
\end{problem}
\begin{problem}{2}
\lipsum[4]
\end{problem}
\end{document}
How could we create solutions environment, so we have at the end of the book solution of the exercises where each one have reference to chapter, page, number of exercise with the corresponding level of difficulty?
Best Answer
I suggest to you to read
exercise
package documentation.There are the package options:
and
and the
Exercise
environment option:You can start with this simple example and then make your customization. As you can see, if you write your
Answer
environment immediately after the correspondingExercise
, the answer is automatically joined to the previous exercise.