Meta Post
MathJax 支持 \newcommand
但不支持 \newcommand*
。
To use the following three macros it is necessary to \require{color} first.
\colorbox : box with a background color
\colorbox{<color>}{<text>}
\colorbox{yellow}{text}
\(\colorbox{yellow}{text}\)
\colorbox{yellow}{$a^2+b^2=c^2$}
\(\colorbox{yellow}{\)a^2+b^2=c^2\(}\)
Notice that the box is a bit too high when the content is pure text.
\fbox : framed box
\fbox{text}
\(\fbox{text}\)
\fbox{$a^2+b^2=c^2$}
\(\fbox{\)a^2+b^2=c^2\(}\)
Again the box is a bit too high when the content is pure text.
\fcolorbox: a box with both a frame color and a background color.
\fcolorbox{<frame color>}{<background color>}{<text>}
\fcolorbox{red}{blue}{text}
\(\fcolorbox{red}{blue}{text}\)
\fcolorbox{red}{blue}{$a^2+b^2=c^2$}
\(\fcolorbox{red}{blue}{\)a^2+b^2=c^2\(}\)
To use the \enclose macro you have to \require{enclose} first.
\enclose{roundedbox}{a^2+b^2 = c^2}
\(\enclose{roundedbox}{a\^2+b\^2 = c\^2}\)