# framed-like boxes across pages [mathspec or biblatex packages]

I'm trying to find the code to get boxes like the ones we can enjoy in the mathspec or biblatex user guides. It seems to be based on the listings and framed packages. Here is a working minimal example

\documentclass{book}
\usepackage{listings}
\usepackage{xcolor}
\usepackage[top=9cm,bottom=10cm]{geometry}
\usepackage{lipsum}
\definecolor{boxframe}{rgb}{0.99,0.05,0.05}
\definecolor{boxfill}{rgb}{0.99,0.95,0.95}
\lstdefinestyle{plain}{escapechar={\#}}
\lstnewenvironment{example}[1][]
{\lstset{aboveskip=15pt,xleftmargin=3pt,xrightmargin=3pt,basewidth=0.5em,basicstyle=\normalsize,frame=single,backgroundcolor=\color{boxfill},fillcolor=\color{white},rulecolor=\color{boxframe},framesep=2pt,framerule=0.5pt,style=plain,#1}}{}
\begin{document}
\lipsum[1]
\lipsum[1]
\begin{example}
listing
listing
listing
listing
listing
listing
\end{example}
\lipsum[1]
\end{document}


I'd like to be able to extract the relevant piece of code in the listings package for other purposes but, so far, in vain. I thought it was using the framed package but it is not.

-
The source is all available, so you could go digging. For biblatex a lot of the work is done by ltxdockit.sty –  Alan Munn Jan 13 '11 at 1:21
it is pretty strange because the listings guide mentions the framed package but I cannot find where in the code? I think it is the same for ltxdockit.sty. I'll go further. –  pluton Jan 13 '11 at 1:30
listings is inspired by fancyvrb and it makes more sense to use it in a way you already did, define a new environment. –  Herbert Jan 13 '11 at 9:25
@Herbert: I'll have a look at fancyvrb but I wanted to create a theorem-like environment (title, numbering, labeling similar to ntheorem or thmtools) based on the frame offered by listings. That is why I wanted to extract the code dedicated to the frame. Using listings as such could be possible also. –  pluton Jan 13 '11 at 14:27

You don't need framed.sty.
Use listings.sty and modify its properties.
Together with fancyvrb.sty you can create showexpl.sty-like environment that can span across multiple pages.