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.

My school's recommended homework document class file uses a boxedminipage to typeset problem statements so they appear in a box. However, this has the unfortunate consequence that they can't be broken across pages — so problem statements frequently tend to push themselves onto a new page.

Is there a way around this, such that the box can be broken across pages? Or does anyone have any better suggestions for a way to visually offset the problem statements from the solutions?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Here is a short example using the mdframed package that is capable of breaking a boxed environment across a page:

enter image description here

\documentclass{article}
\usepackage{mdframed}% http://ctan.org/pkg/mdframed
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}

\lipsum[1-4]

\newmdtheoremenv[outerlinewidth=2,leftmargin=40,rightmargin=40,%
    backgroundcolor=yellow,outerlinecolor=blue,innertopmargin=0pt,%
    splittopskip=\topskip,skipbelow=\baselineskip,%
    skipabove=\baselineskip,ntheorem,roundcorner=5pt]{theorem}{Theorem}[section]

\begin{theorem}[Your important theorem]
\lipsum[1]
\end{theorem}

\lipsum[1-3]

\end{document}

See the mdframed documentation for more information on how the mdframed environment can be used. In the above example, lipsum was used to generate dummy text, Lorem Ipsum style.

share|improve this answer
add comment

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.