# Margins of mdframed without any effect

This code

\documentclass[]{scrbook}

\usepackage{mdframed} %
\usepackage{boxedminipage}

\begin{document}

\noindent
\begin{boxedminipage}{1.0\textwidth}
Box of 100 \% width
\end{boxedminipage}

\begin{mdframed}[
linecolor=black,%
leftmargin =-1cm,
rightmargin=+1cm,
]
Sample Text to fill the line. Sample Text to fill the line.
Sample Text to fill the line. Sample Text to fill the line.
Sample Text to fill the line. Sample Text to fill the line.
\end{mdframed}
\end{document}


does not show any margin on the left or right side.

Am I doing something wrong, or is this a bug in the package ?

Version of mdframed is 2012/01/09 v1.2a

-
It seems to be a bug. –  egreg Jan 14 '12 at 9:57
@egreg: I'm glad that it isn't bug. –  Marco Daniel Jan 14 '12 at 11:02
@MarcoDaniel I'm glad too. :) –  egreg Jan 14 '12 at 11:15
@MatthiasPospiech: Was the answer helpful? –  Marco Daniel Jan 14 '12 at 20:47
@MarcoDaniel: Yes. I was just surprised, that my code worked a few month ago. –  Matthias Pospiech Jan 15 '12 at 12:41

It isn't a bug. You are using a documentclass with the predefined setting twoside. mdframed detects the working in twoside mode.

In this case you have to possibilities.

1. Use the option usetwoside=false. In this case you can work with leftmargin/rightmargin. But theses margin are equal on odd and even sites.

2. Use the option innermargin/outermargin to influence the behavior.

Here an example:

\documentclass[]{scrbook}
\usepackage{showframe}
\usepackage{mdframed} %
\usepackage{boxedminipage}

\begin{document}

\noindent
\begin{boxedminipage}{1.0\textwidth}
Box of 100 \% width
\end{boxedminipage}

\begin{mdframed}[
linecolor=black,%
leftmargin =-1cm,
rightmargin=+1cm,
usetwoside=false,
]
Sample Text to fill the line. Sample Text to fill the line.
Sample Text to fill the line. Sample Text to fill the line.
Sample Text to fill the line. Sample Text to fill the line.
\end{mdframed}

\begin{mdframed}[
linecolor=black,%
innermargin =-1cm,
outermargin =+1cm,
]
Sample Text to fill the line. Sample Text to fill the line.
Sample Text to fill the line. Sample Text to fill the line.
Sample Text to fill the line. Sample Text to fill the line.
\end{mdframed}

\end{document}


-