TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is an MWE which shows that something is weird in the framed package.




right margin discrepancy

Why does the framed environment disagree with minipage about where the right margin should be? Is there an easy way to get the two to line up?

(The framed package claims to be a "preproduction version" and its documentation is dated 2007. Could we have new maintainers maybe?)

share|improve this question
up vote 2 down vote accepted

framed does it well. The way you use \fbox, framing over the complete linewidth, exceeds the text width. The minipage has correct width, but \fbox adds to it. This should cause a warning.

As written in the comment below, calculating the width of the minipage would solve it:

    \textbackslash fbox: \lipsum[1]

For illustration, here's a screenshot without that correction, comparing normal text, framed and fboxed text:

frames example

share|improve this answer
So would \fbox{\begin{minipage}{\linewidth - 3pt}... work? – Seamus Mar 5 '11 at 10:55
@Seamus: It works similarly. I would calculate it: \dimexpr\linewidth-2\fboxrule-2\fboxsep. – Stefan Kottwitz Mar 5 '11 at 11:08

Your Answer


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.