StartLaTeX faqLaTeX for Beginners F.A.Q.LaTeX topicsLaTeX courseSearch

In LaTeX, you can draw frames around many different elements. The following examples demonstrate how to achieve this for typical elements.

Frame around Text

\documentclass[a4paper]{article}
\begin{document}
\fbox{Frame around a plain text.}
\end{document}

Colorful Frame around Text

\documentclass[a4paper]{article}
\usepackage{xcolor}
\begin{document}
\fcolorbox{red}{white}{A red frame around a plain text.}
\end{document}

Frame around a Paragraph

\documentclass[a4paper]{article}
\begin{document}
\fbox{\parbox{\linewidth}{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}}
\end{document}

Colorful Frame around a Paragraph

\documentclass[a4paper]{article}

\usepackage{xcolor}
\begin{document}
\fcolorbox{red}{white}{\parbox{\linewidth}{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}}
\end{document}

Frame around a Table

\documentclass[a4paper]{article}
\begin{document}
\fbox{
\begin{tabular}{lll}
A & B & C \\
1 & 2 & 3 \\
\end{tabular}
}
\end{document}

Colorful Frame around a Table

\documentclass[a4paper]{article}
\usepackage{xcolor}
\begin{document}
\fcolorbox{red}{white}{
\begin{tabular}{lll}
A & B & C \\
1 & 2 & 3 \\
\end{tabular}
}
\end{document}

Frame around a Formula

\documentclass[a4paper]{article}
\begin{document}
With fbox: \fbox{$a^{2} + b^{2} = c^{2}$}
\end{document}

Alternative with the \boxed Command from amsmath

\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
With boxed: \boxed{a^{2} + b^{2} = c^{2}}
\end{document}

Colorful Frame around a Formula

\documentclass[a4paper]{article}
\usepackage{xcolor}
\begin{document}
\fcolorbox{red}{white}{$a^{2} + b^{2} = c^{2}$}
\end{document}

Frame around Itemize and Enumeration

\documentclass[a4paper]{article}
\begin{document}
\fbox{
\parbox{0.5\linewidth}{
\begin{itemize}
\item Itemize
\item Bullet 1
\item Bullet 2
\end{itemize}}
}
\fbox{
\parbox{0.5\linewidth}{
\begin{enumerate}
\item Enumeration
\item Item
\item Item
\end{enumerate}}
}
\end{document}

Colorful Frame around an Enumeration

\documentclass[a4paper]{article}
\usepackage{xcolor}

\begin{document}

% Red frame around enumerate environment
\fcolorbox{red}{white}{
\parbox{0.5\textwidth}{
\begin{enumerate}
\item Enumeration
\item Item
\item Item
\end{enumerate}}
}

% Blue frame around enumerate environment
\fcolorbox{blue}{white}{
\parbox{0.5\textwidth}{
\begin{enumerate}
\item Enumeration
\item Item
\item Item
\end{enumerate}}
}

\end{document}

Contact   Privacy Policy   disclosures

accept decline

This website uses cookies and pixel tags to ensure you get the best experience on our website. By using this website, you consent to the use of cookies.learn more about cookies see also our privacy policy