I would like to expect the framebox
(like 1B) in the top of the each page when exercise
environment is started to ending the exercise
environment (i.e., page 2 and 3 only and not page 1, because exercise is started middle of the page 1). Please find the screenshot below:
![enter image description here][1]
My MWE IS:
\documentclass{book}
\usepackage[driver=none]{geometry}
\usepackage{fancyhdr}
\usepackage[tikz]{mdframed}
\geometry{
paperwidth=190mm,
paperheight=256mm,
asymmetric,
left=20mm,
right=20mm,
top=22.5mm,
bottom=15mm,
headsep=10.5mm,
footskip=4mm,
marginparsep=2mm,
headheight=21pt
}
\usepackage[cam,a4,center,pdflatex]{crop}
\usepackage{lipsum}
\newcounter{exercise}
\newenvironment{exercise}[1][]{
\stepcounter{exercise}%
\mdfsetup{%
backgroundcolor=green,
linecolor=blue,%
linewidth=2pt,
frametitlerule=true,
frametitlerulewidth=2.5pt,
}\relax
\begin{mdframed}%
}{%
\end{mdframed}%
}
\begin{document}
\chapter{Chapter Titlte}
\lipsum[1]
\begin{exercise}
\lipsum[1-12]
\end{exercise}
\lipsum[6-14]
\end{document}