2
\boxed{
\begin{align*}
x &= 1 \\
y &= 1
\end{align*}
}

obviously doesn't work/compile..

\begin{framed}
\begin{align*}
x &= 1 \\
y &= 1
\end{align*}
\end{framed}

sort of work, but it will look ugly because the box is unnecessarily big.

2 Answers2

3

Use the sledge hammer trio : amsmath, empheq and tcolorbox:

\documentclass[14pt,a4paper,headlines=6,headinclude=true]{scrartcl}
\usepackage{empheq}
\usepackage[theorems,skins]{tcolorbox}

\newtcbox{\mybox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced jigsaw,arc=0pt,boxrule=0.5pt,boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=2pt,colback=white,colframe=black,
#1}

\begin{document}
\begin{empheq}[box=\mybox]{align*}
    x &= 1 \\
    y &= 1
\end{empheq}
\end{document}

enter image description here

Adjust left, right etc as suitable, they are margins for the box.

  • Thanks Harish, I've meant to ask this actually: http://tex.stackexchange.com/questions/240310/box-aligned-equation-under-deep-itemization – DarknessGuideMe Apr 24 '15 at 05:27
1
Try this:
\documentclass{article}
\usepackage{empheq}
\newcommand\exactfbox[1]{\fbox{\hskip1em#1\hskip1em}}
\begin{document}
\begin{empheq}[box=\exactfbox]{align*}
 x &= 1 \\
 y &= 1
\end{empheq}
\end{document}

enter image description here