5

I would like to make a frame around content that breaks across pages. For that I use mdframed package.

Note that in that frame I also have \section and \subsection markers (because I am writing a research proposal for TUBITAK where all my content has to be put into a 1pt wide frame ... originally they use Microsoft Word with a single-column-single-row table where the row has a frame and can break across pages ... now I have to reproduce that in LaTeX because ... you know ... Word has no Biblatex and so on.

If I use \begin{mdframed} it works nice, but the frame is too thin. Using \usepackage[linewidth=1pt]{mdframed} did not work.

Now I tried to configure the frame to use a heavier line style with \newmdtheoremenv. Now I get compile errors for each \section and \subsection entry.

Do you have any ideas how I could avoid that?

If you have another idea for putting text into across-page-breakable frames or just for putting vertical lines besides text on the page I am also grateful. (I could then just add starting and finishing horizontal lines. mdframed makes footnotes frame-local so having an alternative solution would even be better.)

2
  • 1
    You can use tcolorbox. Are you willing?
    – user11232
    Aug 5, 2014 at 10:46
  • I basically need any kind of content within the frame (I can put figures outside) and it has to break across pages. I will have a look if tcolorbox can do that.
    – peschü
    Aug 5, 2014 at 10:49

1 Answer 1

3

tcolorbox is more advanced and fancier for such jobs. Here is a simple example to get you started.

\documentclass[12pt,a4paper]{article}
\usepackage{kantlipsum}
\usepackage{tcolorbox}%

\tcbuselibrary{breakable}
\begin{document}%
\begin{tcolorbox}[boxrule=1pt,colback=yellow!30,arc=0mm, breakable] %% you can add many more options if 
                                                                    %% you like.
\section{Some section}
\kant[1-5]
\subsection{A subsection}
\kant[1]
\end{tcolorbox}
\end{document}

enter image description here

You can make it fancier and adjust dimensions etc. For details refer to the manual.

3
  • Thank you, it seems tcolorbox can really do everything I need. [I also found \tcbline that comes in very handy.]
    – peschü
    Aug 5, 2014 at 11:02
  • Ah yes, and the \tcbuselibrary{breakable} is a very crucial part of the example that I missed in my first attempts.
    – peschü
    Aug 5, 2014 at 11:03
  • 1
    @peschü Once you start using tcolorbox, you won't leave it. It is very handy :)
    – user11232
    Aug 5, 2014 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .