TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a series of mdframed frames in the document. Some frames are few pages long, and some pages have two frames within.

How can I display the frametitle of the corresponding page in the header as we display sections in the header.

\begin{mdframed}[style=example,frametitle=Some Title]
\begin{mdframed}[style=example,frametitle=Some Title]
share|improve this question
are you using fancyhdr? – cmhughes Apr 19 '12 at 17:07
@cmhughes yes, I have it too. – All Apr 19 '12 at 17:12
up vote 8 down vote accepted

The package mdframed stores the frame title in the command \mdf@frametitle. To bring this title to the header I used the internal command \@mkboth. This command is used inside the definitions of headings. Based on the token @ you have to use makeatletter/makeatother.



\begin{mdframed}[style=example,frametitle=Some Title 1]
\begin{mdframed}[style=example,frametitle=Some Title 2]

\begin{mdframed}[style=example,frametitle=Some Title 3]
\begin{mdframed}[style=example,frametitle=Some Title 4]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.