[Tex/LaTex] How to vertically align a fraction and an answer blank

fractions

I am trying to typeset a worksheet where students will fill in things in blanks. In the below example, they will fill in what they multiply each of the fractions by to get a common denominator. However, the blanks are not aligned with the bottom of the fractions; they are too high. How could I move the fractions up (or resize them) or move the blanks down so that they are aligned?

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

$$\frac{1}{8}\cdot\underline{\hspace{1.5cm}}=\underline{\hspace{1.5cm}}
\hspace{1cm} 
\frac{7}{12}\cdot\underline{\hspace{1.5cm}}=\underline{\hspace{1.5cm}}$$

\end{document}

Best Answer

You can use a normal \frac command and use the \phantom approach (or use another blank space that works in math mode). \phantom occupies the space that would have been used by it's argument.

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

\section*{Code Provided by OP}

\begin{equation}
\frac{1}{8}\cdot\underline{\hspace{1.5cm}}=\underline{\hspace{1.5cm}}
\hspace{1cm} 
\frac{7}{12}\cdot\underline{\hspace{1.5cm}}=\underline{\hspace{1.5cm}}
\end{equation}

\section*{Code Proposes by Manuel Kuehner}

\begin{equation}
\frac{1}{8} \cdot \frac{\phantom{123456}}{\phantom{123456}} =\frac{\phantom{123456}}{\phantom{123456}}
\hspace{1cm} 
\frac{7}{12} \cdot \frac{\phantom{123456}}{\phantom{123456}} =\frac{\phantom{123456}}{\phantom{123456}}
\end{equation}

\end{document}

enter image description here