Update 2012-03-09: With an version of mdframed updated today, this is now fixed in the package and no longer requires the workaround provided below.
In Excess vertical space in mdframed ending with display math environment, I had wrapped the contents on mdframed within a minipage and had intended to file this as a separate question, as I believe that the minipage wrapper should not be necessary. Without this wrapper, if the content contains only display math, the width is not the full \linewidth.
Here is a snippet of the output showing the inconsistent output for the case of display math in red. Note that the output is fine if the frame has a title, but without the frame the width is not consistent:

Questions:
- Is there a
mdframedsetting to adjust this? If not, is there any better way to get the desired behavior other than using aminipage? - Is this a bug with
mdframed, or a feature?
Note:
- The code below is adapted from mdframed: Put a line below the frame title and give it a shaded background.
- Uncommenting the
\begin{minipage}and\end{minipage}produces what I believe is the correct result (to be consistent with the first two cases).
Code:
\documentclass{article}
\usepackage{showframe}
\usepackage{amsmath}
\usepackage[framemethod=TikZ]{mdframed}
\newenvironment{Frame}[1][]{%
\begin{mdframed}[%
frametitle={#1},
skipabove=\baselineskip plus 2pt minus 1pt,
skipbelow=\baselineskip plus 2pt minus 1pt,
linewidth=0.5pt,
frametitlerule=true,
frametitlebackgroundcolor=gray!30
]%
%\begin{minipage}{\linewidth}% this should not be necessary??
}{%
%\end{minipage}%
\end{mdframed}
}
\begin{document}\noindent
Text
\begin{Frame}[with Title]
Text
\end{Frame}
Text
\begin{Frame}% no Title
Text
\end{Frame}
Text
\begin{Frame}[Einstein]
\begin{align}
e & = mc^2
\end{align}
\end{Frame}
Text
\begin{Frame}\color{red}% no Title
\begin{align}
e & = mc^2
\end{align}
\end{Frame}
Text
\begin{Frame}\color{red}% no Title
\begin{align}
e &= mc^2\
F &= ma
\end{align}
\end{Frame}
Text
\begin{Frame}\color{red}% no Title
[
e = mc^2
]
\end{Frame}
\end{document}