Text under equation

Just for fun (this may not be the optimal way of doing this):

\documentclass[12pt]{article}
\pagestyle{plain}
\usepackage[margin=1.8cm]{geometry}
\geometry{a4paper}
\usepackage[parfill]{parskip}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[usenames]{color}
\definecolor{cyan}{rgb}{0,1,1}
\newcommand{\cyan}[1]{\textcolor{cyan}{#1}}
\definecolor{black}{rgb}{0,0,0}
\newcommand{\black}[1]{\textcolor{black}{#1}}

\begin{document}

\[
  \text{read stall cycles} =
  \cyan{\underbrace{\black{\frac{\text{reads}}{\text{program}}
        \times \parbox{48pt}{read miss \\ rate (\%)}}}_{\text{read
        miss per program}}} \times
  \cyan{\underbrace{\black{\parbox{76pt}{read miss \\ penalty
          (cycle)}}}_{\parbox{62pt}{\scriptsize\centering number of cycles \\
        per read miss}}}
\]

\end{document}

enter image description here

Tags:

Text

Math Mode