Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Follow-up question to the accepted answer here and here. The latter seems promising, with the caveat that it doesn't work.

  • I'm using mdframed with tikz - but without "theorems". However, I too would like to see the title upon page breaks with a "continued" hint. How?

Screenshot, followed by MWE:

enter image description here

\documentclass[a4paper]{article}


\usepackage{graphicx}

% \usepackage[heightrounded=true, textheight=735pt, textwidth=430pt, layoutvoffset=27pt, hcentering, includefoot, headheight=26pt, headsep=10pt, footskip=10pt, showframe]{geometry}


\usepackage[framemethod=TikZ]{mdframed}

% \mdfsetup{skipabove=0pt,skipbelow=1\topskip, nobreak=true, innertopmargin=0.5\baselineskip, innerbottommargin=0.5\baselineskip, frametitleaboveskip=2pt, frametitlebelowskip=1pt}
%%%

\mdfdefinestyle{my_style_testing}{frametitlebackgroundcolor=pink}

\usepackage{lipsum}

\begin{document}

\lipsum[4]
\vspace{5cm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{mdframed}[style=my_style_testing,frametitle=\color{blue}{What an interesting title this is...}]

hello world

\lipsum[1]

\vspace{5cm}

\lipsum[3]

\vspace{5cm}

\lipsum[2]

\end{mdframed}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\end{document}
share|improve this question
    
Do you want just the text for the title or the text with the formatting (background color, etc)? –  Gonzalo Medina Jun 20 at 15:48
    
@GonzaloMedina The whole thing again (pink frame and all) plus "continued..." –  nutty about natty Jun 20 at 15:53
    
At first glance, this looks almost like an answer to me. –  nutty about natty Jun 20 at 16:09
    
If it's a short document, a "manual" solution, i.e. "faking it": just another box/frame with continued in title, will do the trick. For longer documents the "automatic" solution would be desirable, though. –  nutty about natty Jun 22 at 10:00
    
related: tex.stackexchange.com/a/95988/5049 –  cgnieder Jun 22 at 12:44

2 Answers 2

Possibly you'll need some minor adjustments:

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[framemethod=TikZ]{mdframed}

% \mdfsetup{skipabove=0pt,skipbelow=1\topskip, nobreak=true, innertopmargin=0.5\baselineskip, innerbottommargin=0.5\baselineskip, frametitleaboveskip=2pt, frametitlebelowskip=1pt}
%%%

\makeatletter
\mdfdefinestyle{my_style_testing}{
  frametitlebackgroundcolor=pink,
  splittopskip=3\baselineskip,
  middleextra={
    \node[
      text width=\the\dimexpr\linewidth-2\mdf@outerlinewidth@length-%
         2\mdf@middlelinewidth@length-2\mdf@innerlinewidth@length-%
         2\mdf@innerleftmargin@length\relax,
      anchor=north west,
      font=\mdf@frametitlefont,
      inner xsep=\mdf@innerleftmargin@length,
      outer sep=0pt,
      mdfframetitlebackground,
      rounded corners={max(\mdf@roundcorner@length%
                                         -\mdf@innerlinewidth@length%
                                        -.5\mdf@middlelinewidth@length,0)%
                                    }%
    ] at (P-|O) {\mdf@frametitle\ (Continued)};
  },
  secondextra={
    \node[
      text width=\the\dimexpr\linewidth-2\mdf@outerlinewidth@length-%
         2\mdf@middlelinewidth@length-2\mdf@innerlinewidth@length-%
         2\mdf@innerleftmargin@length\relax,
      anchor=north west,
      font=\mdf@frametitlefont,
      inner xsep=\mdf@innerleftmargin@length,
      outer sep=0pt,
      mdfframetitlebackground,
      rounded corners={max(\mdf@roundcorner@length%
                                         -\mdf@innerlinewidth@length%
                                        -.5\mdf@middlelinewidth@length,0)%
                                    }%
    ] at (P-|O) 
    {%
      \vbox{%
        \parskip\z@\relax%
        \parindent\z@\relax%
        \vskip\mdf@frametitleaboveskip@length%
        \mdf@frametitle\ (Continued)%
        \mdf@@frametitlerule\relax%
        \unvbox\mdf@splitbox@one\relax%
      }%
    };
  }
}
\makeatother

\usepackage{lipsum}

\begin{document}

\lipsum[4]
\vspace{5cm}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{mdframed}[style=my_style_testing,frametitle=\color{blue}{What an interesting title this is...}]

hello world

\lipsum[1]

\vspace{5cm}

\lipsum[3]

\vspace{5cm}

\lipsum[2]

\end{mdframed}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\end{document}

enter image description here

share|improve this answer
    
I think I still need help regarding the "minor adjustments": the second ("continued") title is significantly thicker than the original one. I'd like them to be exactly the same. How? –  nutty about natty Jun 20 at 21:55

If it's a short document, a "manual" solution, i.e. "faking it": just another box/frame with continued in title, will do the trick. For longer documents the "automatic" solution would be desirable, though.

share|improve this answer

Your Answer

 
discard

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.