8

The question has been written above.

lockstep
  • 250,273
Display Name
  • 46,933

2 Answers2

9

You can use fcolorbox from the xcolor package or you can define your own command!

\documentclass{article}
\usepackage[kernelfbox]{xcolor}
\begin{document}

\def\twocolorbox#1#2#3{\color{#1}\fbox{\color{#2}#3}}

\twocolorbox{blue}{red}{terrible}

\fcolorbox{gray}{yellow}{test}
\end{document}
yannisl
  • 117,160
4
\documentclass{article}
\usepackage{color}
\newcommand{\myfbox}[2]{\textcolor{#1}{\fbox{\normalcolor#2}}}
\begin{document}
\myfbox{red}{This is a test}
\end{document}

or

\documentclass{article}
\usepackage{color}
\newcommand{\myfbox}[2]{\fcolorbox{#1}{white}{#2}}
\begin{document}
\myfbox{red}{This is a test}
\end{document}
IRAN
  • 2,338