Possible Duplicate:
Is there an \arrayrulecolor-like command to change the rule color of \fbox?

I'm using an \fbox to have a border around a minipage.

my content

Is there any way to set the border color of the \fbox?

  • You can also use the package tcolorbox. Mar 1 '12 at 20:10
  • Note that the line break after the first { will add a space there. You should add a % direct after it to avoid that. The same might be required after \end{minipage}. Mar 1 '12 at 20:18
  • 2
    @lockstep: I see the connection to the linked question, but because it is not a very good phrased question with only minimalistic answers I'm against closing this question as a duplicate. Mar 1 '12 at 20:20

The xcolor package provides \fcolorbox{<frame color>}{<background color>}{<text>}. You can also use my adjustbox package with the cfbox=<color> and minipage=<width> keys:


% ...


% or, if the whole thing should be 0.25\textwidth wide, including the border:


You can define your own command using:

% usage: \myfbox{<content>}

I would recommend the mdframed package, which provides many options- you can frame your environment quite simply, or if you want complicated examples you can use tikz, pstricks.

The documentation has many examples, and you can find questions tagged with mdframed here


enter image description here






\fcolorbox{red}{yellow}{\parbox{\dimexpr \linewidth-2\fboxsep-2\fboxrule}{%


enter image description here

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