I just don't know how to do it.

I have seen it in other posts, but I can't find them.

  • $\begingroup$ Poking you to accept one of the answers ;) $\endgroup$
    – jojeck Mod
    Commented Aug 9, 2023 at 8:37
  • $\begingroup$ I hate having to choose between friends. $\endgroup$ Commented Aug 9, 2023 at 13:57
  • $\begingroup$ Thank you for choosing, next time you need to choose Matt over Peter :) $\endgroup$
    – jojeck Mod
    Commented Aug 18, 2023 at 22:22
  • $\begingroup$ @jojeck , I need you to answer some questions about Royi and Overlord in the other thread. $\endgroup$ Commented Aug 18, 2023 at 23:18
  • 1
    $\begingroup$ See the Math.SE MathJax FAQ, community answer, for the full syntax for an outlined colored box. $\endgroup$
    – Rob
    Commented Nov 25, 2023 at 16:09

2 Answers 2


$$\fbox{ Like this for text.}$$

\fbox{ Like this for text.}


$$\boxed{e^{j\pi} = -1}$$

\boxed{e^{j\pi} = -1}

This sort-of works for colors:

$$\color{red}{\boxed{\color{black}{e^{j\pi} = -1}}}$$

\color{red}{\boxed{\color{black}{e^{j\pi} = -1}}}

for an equation.

  • 1
    $\begingroup$ Thanks, Peter. Is there a way to specify the color of the box? $\endgroup$ Commented Jul 22, 2023 at 15:17
  • 1
    $\begingroup$ @robertbristow-johnson That's an attempt... $\endgroup$
    – Peter K. Mod
    Commented Jul 28, 2023 at 0:23
  • 1
    $\begingroup$ Thanks. I didn't know about either the \color or \boxed instructions. $\endgroup$ Commented Jul 28, 2023 at 2:24

In Mathjax you can do something like this (which I used in this post):

\bbox[#f8f1ea, 0.6em, border: 0.15em solid #fd8105]{a^2+b^2=c^2}

Looks like this:

$$\bbox[#f8f1ea, 0.6em, border: 0.15em solid #fd8105]{a^2+b^2=c^2}$$

You can find the documentation here.

  • $\begingroup$ thanks Matt. do you know where I can find this documented? I presume the first word somehow specifies the the color but what does the second word (0.6em) specify? $\endgroup$ Commented Aug 3, 2023 at 12:39
  • $\begingroup$ @robertbristow-johnson: I added the doc-link at the end of my answer. $\endgroup$
    – Matt L.
    Commented Aug 3, 2023 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .