# How to write a formula using box product

Can anybody help in writing the following formula... I am having trouble. LHS I can write, but not the RHS.

-

You can use \DeclareMathOperator* from amsmath to declare an operator accepting "limits" in super/sub script positions:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}

\DeclareMathOperator*{\MyS}{\text{\raisebox{-0.25ex}{\scalebox{1.25}{$\square$}}}}
\newcommand\Osq{\mathbin{\text{\scalebox{.84}{$\square$}}}}

\begin{document}

$G_1\Osq G_2\Osq \cdots \Osq G_n = \MyS_{i=1}^{n}G_i.$

\end{document}


As egreg comments, perhaps one could use \vcenter instead of an explicit dimension in the definition of \MyS; in this way, the square will be vertically centered with respect to the equal sign:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}

\DeclareMathOperator*{\MyS}{\vcenter{\hbox{\text{\scalebox{1.3}{$\square$}}}}}
\newcommand\Osq{\mathbin{\text{\scalebox{.84}{$\square$}}}}

\begin{document}

$G_1\Osq G_2\Osq \cdots \Osq G_n = \MyS_{i=1}^{n}G_i.$

\end{document}


Notice also the use of \mathbin in the definition of \Osq to have the proper spacing for a binary operator.

-
even though the normal-sized box is baseline-aligned, setting the enlarged box on the baseline doesn't look right. shifting it down a bit (perhaps with the top aligned at cap height) would look much better. –  barbara beeton Aug 8 '13 at 18:36
@barbarabeeton Agreed. I lowered just a bit. I hope it's better now. –  Gonzalo Medina Aug 8 '13 at 18:44
@barbarabeeton in fact, I also reduced the size of the square used as binary operator; I think it looks better this way. –  Gonzalo Medina Aug 8 '13 at 19:02
Probably using \vcenter is better than using an explicit dimension: \vcenter{\hbox{\text{\scalebox{1.25}{$\square$}}}} –  egreg Aug 8 '13 at 19:33
@GonzaloMedina Your 1.1pt will be used in all styles; probably an ex based dimension together with \text would be better. –  egreg Aug 8 '13 at 20:08