# Change border color of \fbox [duplicate]

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?

-
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

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

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}

% ...

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



You can define your own command using:

\newcommand\myfbox{\adjustbox{<keys>}}
% 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

http://tex.stackexchange.com/questions/tagged/mdframed

\documentclass{article}

\usepackage{lipsum}
\usepackage[framemethod=default]{mdframed}

\newmdenv[linecolor=red,backgroundcolor=yellow]{myframe}

\begin{document}

\begin{myframe}
\lipsum[1]
\end{myframe}

\end{document}

-
\documentclass{article}