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

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?

share|improve this question

marked as duplicate by lockstep, Werner, topskip, egreg, Count Zero Mar 2 '12 at 9:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You can also use the package tcolorbox. – Marco Daniel 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}. – Martin Scharrer Mar 1 '12 at 20:18
@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. – Martin Scharrer Mar 1 '12 at 20:20
up vote 15 down vote accepted

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>}
share|improve this answer

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






share|improve this answer
\fcolorbox{red}{yellow}{\parbox{\dimexpr \linewidth-2\fboxsep-2\fboxrule}{%


enter image description here

share|improve this answer

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