[Tex/LaTex] Change border color of \fbox

boxescolorframed

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.

\fbox{
\begin{minipage}{0.25\textwidth}
my content
\end{minipage}
}

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

Best Answer

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:

\usepackage{xcolor}
\usepackage{adjustbox}

% ...

\adjustbox{minipage=0.25\textwidth,cfbox=<color>}{<content>}

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

\adjustbox{minipage=0.25\textwidth-2\fboxsep-2\fboxrule,cfbox=<color>}{<content>}

You can define your own command using:

\newcommand\myfbox{\adjustbox{<keys>}}
% usage: \myfbox{<content>}
Related Question