Here's a slight tweak to one of the mdframed examples that produces a framed title inset above the theorem box
\documentclass{article}
\usepackage{amsmath}
%\usepackage{svgcolor}
\usepackage[svgnames]{xcolor}
\usepackage[framemethod=tikz]{mdframed}
\newcounter{Lemma}[section]
\newenvironment{Lemma}[1][]{%
\stepcounter{Lemma}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=blue!20]
{\strut \color{DarkOliveGreen}{Lemma}~\theLemma};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=blue!20]
{\strut \color{DarkOliveGreen}{Lemma}~\theLemma:~\color{Maroon}{#1}};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=blue!20,%
linewidth=1pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax,}
\begin{mdframed}[]\relax%
}{\end{mdframed}}
\begin{document}
\begin{Lemma}[Distribution of inner products]\label{thm:stokesTheoremGeometricAlgebraII:1420}
Given two blades $A_s, B_r$ with grades subject to $0 < r < s$, and a vector $b$, the inner product distributes according to
\begin{equation*}
A_s \cdot \left( b \wedge B_r \right) = \left( A_s \cdot b \right) \cdot B_r.
\end{equation*}
\end{Lemma}
\end{document}
This looks like:

I'd like the title box to have a framed look instead of filled, but am unsure how to do that. There are examples, like " Example 5 – complex example with TikZ, where there is a distinct frame around the title, but that example isn't a good one for me to attempt to build from since it does a lot that I don't want (like overriding the Exercise environment).


\node[anchor=east,rectangle,draw=blue!20,fill=white]
(ie. still want a box for an unnamed, but still numbered begin/end block).
– Peeter Joot Apr 14 '14 at 18:50