Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

enter image description here

share|improve this question

1 Answer 1

up vote 15 down vote accepted

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}

enter image description here

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}

enter image description here

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

share|improve this answer
1  
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
1  
Probably using \vcenter is better than using an explicit dimension: \vcenter{\hbox{\text{\scalebox{1.25}{$\square$}}}} –  egreg Aug 8 '13 at 19:33
1  
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.