Skip to content
Related Articles

Related Articles

Improve Article
Border Around Equation in LATEX
  • Last Updated : 17 Mar, 2021

The Latex command to put the border (box) around an equation is as

\fbox or \boxed

Description :

\boxed command draws a box around argument. The argument is in text mode.

Example :

\boxed{sin\frac{x}{2} = \frac{1}{4}}

Output :



\boxed{sin\frac{x}{2} = \frac{1}{4}}

Next we can add the desire color to the border as

\color{colorName}

Description :

\color command set color of the font or the border around the box. The argument is the name of the color.

Example :

\color{green}\boxed{\color{black} x + y = 10}

Output :

\color{green}\boxed{\color{black} x + y = 10}

Lastly let’s see the boxes filled with color through command as



\colorbox{colorName}{text}

Description :

\colorbox command fills the background color of the box with the argument. The argument is the name of the color.

Example :

\colorbox{green}{\color{white}Hello from GeeksForGeeks}

Output:

\colorbox{green}{\color{white}Hello from GeeksForGeeks}

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :