Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

enter image description here

share|improve this question
    
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
add comment

1 Answer

up vote 6 down vote accepted

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}

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.