[Tex/LaTex] How to put a framed box around text + math environment

framed

I am looking for something like \fbox but it seems that you cannot use it when a math environment is included. However its not only a math environment (then you could use \boxed I know) but also text, I need to be in a frame.

example:

\rdmframeboxaroundwhatever{

blablabla

\begin{align}
Formula of the universe
\end{align}


Hoaray

}

Best Answer

You can also use tcolorbox:

enter image description here

Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tcolorbox}

\begin{document}
\begin{tcolorbox}

blablabla

\begin{align}
E &= mc^2 & \text{Formula of the universe}
\end{align}


Hoaray

\end{tcolorbox}

\end{document}