1

I want to box the following two-line single equation. I checked the existing posts to no avail. Appreciate any help.

\documentclass[12 pt]{article}
\usepackage{amsmath}
\usepackage{enumerate}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\begin{document}

\begin{equation}
\begin{split}
&hijoiojoij \\
&=iuiouooipip
\end{split}
\end{equation}

\end{document}
4

Using only the basic \boxed command, or \fcolorbox from xcolor:

\documentclass[12 pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[svgnames]{xcolor}

\begin{document}

\begin{equation}
\boxed{\quad\begin{split}
&hijoiojoij \\
&=iuiouooipip
\end{split}\quad}
\end{equation}

\begin{equation}
\setlength{\fboxrule}{0.8pt}
\fcolorbox{IndianRed}{Seashell}{\quad$ \begin{split}
&hijoiojoij \\
&=iuiouooipip
\end{split} $\quad}
\end{equation}

\end{document} 

enter image description here

1

You can use hf-tikz:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{hf-tikz}

\begin{document}

\begin{equation}
\begin{split}
\tikzmarkin{a}&hijoiojoij \\
&=iuiouooipip\tikzmarkend{a}
\end{split}
\end{equation}

\end{document}

Every ornament needs a new label (in the example case a), but it wouldn't be very difficult to assign the label automatically.

enter image description here

The ornament style can be customized.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[customcolors,nofill,norndcorners]{hf-tikz}

\hfsetbordercolor{black}

\begin{document}

\begin{equation}
\begin{split}
\tikzmarkin{a}&hijoiojoij \\
&=iuiouooipip\tikzmarkend{a}
\end{split}
\end{equation}

\end{document}

enter image description here

  • thank you. It almost worked. Can the size of the box be customized? In my actual situation, the box doesn't fill up the whole equation. – Eureka Jun 17 '18 at 9:25
  • @Fib1123 Look at the package documentation for fine tuning, there are several examples. – egreg Jun 17 '18 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.