+1 vote
in General IT Tips by (15.9k points)

I used \boxed{} to write an equation inside a box in MathJax, but it gave the error: "Undefined control sequence \boxed". Is there any alternative that I can use in MathJax to put an equation inside a box?

1 Answer

+3 votes
by (362k points)
selected by
 
Best answer

If \boxed{} is not supported in your MathJax environment, you can try \fbox{}.

Here is an example:

\fbox{$ 2x + y = 14 $}

The outer \fbox{} creates a box around the content. The inner $ ... $ ensures that the mathematical expression is processed correctly. Without the dollar signs, \fbox{} would treat the content as plain text, causing MathJax to not render it as math. Therefore, whenever using \fbox{} for math expressions in MathJax, always enclose the expression in $...$ to ensure proper rendering.

Related questions

+1 vote
1 answer
+1 vote
1 answer
+2 votes
1 answer

...