At the moment I'm using the {tabular} environment to distinguish examples in a document I'm writing:
\begin{tabular}{r|p{11cm}}
\emph{Example} & [Lots of text and equations]
\end{tabular}
It makes it so that there's a nice line running down the left side of my page over the course of the example. The only problem is that it doesn't behave well with page breaks. I know the package longtable works for continuing tables onto several pages but since I have everything in one table entry, it doesn't work for me.
I realise I'm completely misusing {tabular} and am looking for an environment that will give me the same effect, but will continue the effect onto successive pages.
Best Answer
Two simple examples showing two possibilities: one with
mdframed
and the other one withtcolorbox
; the advantage of these packages overframed
is that they offer endless customization possibilities with a simplekey=value
interface:The page layout was changed just for the example.
You can also take a look at the answer to Typesetting a definition for more examples and variations (the code in that answer can be easily adapted to produce the label "Example" instead of "Definition").