4

The question has been written above.

6

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}
  • Could you tell us what the order of arguments for \fcolorbox is? – Joel Feb 18 '16 at 1:06
3
\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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