I want to put (1) a box around 1 equation inside an align environment, and also (2) a box around all equations in align environment. I'm already using tcolorbox and would like to use that. I have tried boxing all equations with tcolorbox but the problem is that it goes page-wide which I don't like, and also leaves a visible margin above the first equation. I want to keep equation numbers out of the box as well.
Any suggestions?
Edit: Thanks for pointing me to a solution. The problem, however, is that all the solutions use another math environment (either within tcolorbox or empheq package). I am using a very specialized align environment and hence have to have a box without tcolorbox or empheq equation style.
So I want a box around align equations without leaving \begin{align} and \end{align} environment.
Edit2: Here is the MWE code.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{flalign}
\begin{gathered}
A \quad \vphantom{\sum \limits _{n=0} ^{N-1}} \\
B \quad ~~ \vphantom{\sum \limits _{n=0} ^{N-1}}
\end{gathered}
&&
\begin{aligned}\label{equationAB}
A\: &= \sum \limits _{n=0} ^{N-1} a[n]\\
B &= \sum \limits _{n=0} ^{N-1} b[n]
\end{aligned}
&&
\end{flalign}
\end{document}


tcolorboxsolution withtcbhighmathshould be what you request, in my point of view. Anytcolorboxcan be configured to match top etc. spacing, background colour, frame style etc. – Dec 27 '15 at 08:53alignexample with numbers outside box (equations 7 and 8). – Ignasi Apr 21 '16 at 16:55