Open In App

Border Around Equation in LATEX

Last Updated : 17 Mar, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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}


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads