I would like to create special frame around my equations. This frame should obey to the golden ratio rule. This means that its width divided by its height should give 1.61803398875.
If possible, the code will adapt to choose the long side. For example for a long column vector, the height will be 1.61803398875 times longer than its width.
I've found the following code in another question in this forum (here). It uses tikz but I can't figure out how to modify it to obtain a golden ratio frame around my equations...
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{shapes}
\makeatletter
\newdimen\@myBoxHeight%
\newdimen\@myBoxDepth%
\newdimen\@myBoxWidth%
\newdimen\@myBoxSize%
\newcommand{\SquareBox}[2][]{%
\settoheight{\@myBoxHeight}{#2}% Record height of box
\settodepth{\@myBoxDepth}{#2}% Record depth of box
\settowidth{\@myBoxWidth}{#2}% Record width of box
\pgfmathsetlength{\@myBoxSize}{max(\@myBoxWidth,(\@myBoxHeight+\@myBoxDepth))}%
\tikz \node [shape=rectangle, shape aspect=1,draw=red,inner sep=2\pgflinewidth, minimum size=\@myBoxSize,#1] {#2};%
}%
\makeatother
\begin{document}
\SquareBox{I}
\SquareBox{y}
\SquareBox[thick, dashed]{long text}
\SquareBox[draw=blue]{longer text}
\SquareBox[draw=blue, thick, fill=yellow]{$e = mc^2$}
\SquareBox[draw=black, thick, fill=yellow!10, rounded corners=2pt]{$\displaystyle \int_{-\dfrac{\pi}{2}}^{\dfrac{\pi}{2}} dx $}
\end{document}
Thanks for your help in advance.


