Suppose I have an mdframed
that spans several pages.
Each mdframed
will have a title but because one frame may span many pages what actually is under discussion in the frame may be lost by the reader when quickly searching for information.
So, what I would like to do is add a sort of "header" to each page(just like many books put the chapter title and/or section somewhere on the page.
The "header" though, is really the frame title or some other similar text that is placed on every page the mdframed
is on except possibly the first(since it may already exists as the frametitle
).
The text probably will be vertical if on the left and right margins and horizontal if at the top and bottom.
Is there any way to add this to an mdframed
? Basically it just needs some intelligence to not add itself the first time and to do something different at the end of the frame else it will just put itself in the same place every time along the border of the frame.
Update:
The code demonstrates the issue/"bug" with mdframed. A frame title appears at the end of a frame but the first thing on a new page(in my case it is opposite in that it I get a frametitle without any content(on the same page) at the start instead of at the end due to the type of content I'm using.
Basically the frame should end on the previous if it's content, on that page, is empty. (or in my case the frame should start on the next page (in my case I can use \newpage to fix the problem if I can put it in the right spots, which is difficult))
Also notice how rounded corners in subsequent frametitles on the same frame look bad. Roundcornershould be 0 on subsequent intra-frametitles.
\documentclass{book}
\usepackage{tikz, pgffor}
\usepackage[framemethod=TikZ]{mdframed}
\newcommand{\myframe}[2]{
\begin{mdframed}[rightline=true,
frametitlerule=true,frametitlerulecolor=blue,
frametitlebackgroundcolor=gray,repeatframetitle=true,
align=center,linecolor=gray, middlelinewidth=2pt,roundcorner=10pt, innerbottommargin=0.5cm, innertopmargin=0.05cm, frametitleaboveskip=8.5pt, skipbelow=10pt,frametitlealignment={\hspace*{0.25cm}},frametitle={#1}]#2\end{mdframed}
}%
\begin{document}
\foreach \l in {1,2,3,4,5,6,7,8,9} {\myframe{Title}{Frame \l{} content \hrule \vspace{8cm}
\hrule}}
\end{document}
repeattitle=true