% mathdemo.tex
\documentclass{article}
\begin{document}
Putting a formula like $\log_2 2 = 1$ inside text is 
as easy as $(5-3)$-$\frac{8}{4}$-3.  Of course you can do more
complicated things like this except from my dissertation:

\[
  \mbox{offset} = 
    \overbrace{\left\lfloor \frac{\mbox{row \#}}{2} 
                \right\rfloor}^{\mbox{which pair}}
    \bmod 
    \overbrace{\left(\frac{k}{r}\right)}^{\mbox{pairs/round}}
\]

\noindent Given the offset, the communication dimension is 
calculated as follows:
\[
  \mbox{commDim} = (p + r \cdot \mbox{offset}) \bmod k
\]

\end{document}

