I'm having trouble producing a boxed equation in the same line as some other formulae. For example: $$ \frac{2}{4} =\[\boxed{ \frac{1}{2} }\] $$
I'd like to be able to show some calculations, followed by a boxed final answer. Any ideas?
boxesequationsmath-mode
I'm having trouble producing a boxed equation in the same line as some other formulae. For example: $$ \frac{2}{4} =\[\boxed{ \frac{1}{2} }\] $$
I'd like to be able to show some calculations, followed by a boxed final answer. Any ideas?
Best Answer
The standard LaTeX command for boxing something is
\fbox
. Its argument is in text mode; to switch to display format mathematics you need to issueThus your example becomes
producing
If you are using
amsmath
then its\boxed
command (thanks daleif for the link) already takes care of switching to maths and display style, so you just write the code for the math object directly between the braces{...}
In other words in the argument to
\boxed
you do not need math mode switching commands such as\[..\]
.