# Overfull \hbox when using the mdframed package

UPDATE: 2011-12-12

As of 2011-12-12, I can confirm this issue has been resolved on TeXLive-2011.

When using the mdframed package to generate nice frames for my chemical reactions, I encounter the ever-so-popular warning:

Overfull \hbox (20.79999pt too wide) in paragraph at lines 12--12


I'm assuming that it has something to do with the border generated by mdframed, but I'm unsure.

My MWE is thus:

\documentclass[12pt]{article}

\usepackage[xcolor,linecolor=red]{mdframed}
\usepackage{showframe}

\begin{document}

\section*{Testing the \textsf{mdframed} Package}

\begin{mdframed}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Duis et sem et tortor volutpat placerat id in mauris.
Suspendisse eget tellus sed sem aliquet pellentesque.
\end{mdframed}

\end{document}


My MWE renders:

Is there anyway to remedy this warning, or should I simply ignore it?

-
I get no warning with that example (after correcting the error about xcolor). –  egreg Dec 6 '11 at 7:33
@egreg: What error with xcolor? –  Werner Dec 6 '11 at 7:52
@Werner It can be due to the fact that here I have a 2010 TeX Live. –  egreg Dec 6 '11 at 7:55
@egreg: Sure. This warning is produced with mdframed [2011/11/13 v1.0], regardless of xcolor. –  Werner Dec 6 '11 at 7:59
I can confirm that on TeX Live 2011 and mdframed 1.0 the warning is present. Seems like a bug. –  egreg Dec 6 '11 at 8:43

This bug was found by Dietrich Grau. At the moment I don't uploaded the new version because I am preparing the dtx-file.

In Version 1.0 I used a modification of \makebox with a calculated \hsize for the contents. \hsize gets the width of the text without three relevant lengths (\linewidth, \innerleftmargin and \innerrightmargin).

Normally the overfull box is the width of the addition of

2linewidth        = .4pt
+innerleftmargin  = 10pt
+innerrightmargin = 10pt
__________________________
overfull box      = 20.8pt


In the current development version this bug should be fixed and can be downloaded here: mdframed on github

Note to compile this version you need the documentclass ltxmdf which is available here: ltxmdf on github

@Werner: Thanks. (no grammar or orthography ;-) ) –  Marco Daniel Dec 6 '11 at 17:00
No problem! :) –  Werner Dec 6 '11 at 17:00