LaTeX & MathJax basic tutorial – Highlighting equation

To highlight an equation, \bbox can be used. E.g,

produces

$$ \bbox[yellow]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
$$

By default, the bounding box is “tight”, so it doesn’t extend beyond the characters used in the formula.
You can add a little space around the equation by adding a measurement after the color. E.g.,

produces

$$ \bbox[yellow,5px]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
$$

To add a border, use

produces

$$ \bbox[5px,border:2px solid red]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (2)
}
$$

You can do both border and background, as well:

produces

$$ \bbox[yellow,5px,border:2px solid red]
{
e^x=\lim_{n\to\infty} \left( 1+\frac{x}{n} \right)^n
\qquad (1)
}
$$

Leave a Reply

Your email address will not be published. Required fields are marked *