1

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}
2
  • Don't use $$ … $$ for displayed equations. It's plan TeX syntax, and can yield bad vertical spacing.
    – Bernard
    Mar 27, 2017 at 1:03
  • @Bernard Good point. I corrected the code from the OP in my proposed solution. Mar 27, 2017 at 1:13

2 Answers 2

3

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

0

You can use this code:

\documentclass{article}
\usepackage{amsmath}
\newcommand{\tobecompleted}{\genfrac{}{}{0pt}{}{}{\underline{\hspace{1.5cm}}}}
\let\tbc\tobecompleted
\begin{document}

\[ \frac{1}{8} · \tbc = \tbc
  \hspace{1cm}
  \frac{7}{12} · \tbc = \tbc \]

\end{document} 

enter image description here

2
  • What is the purpose of declaring \newcommand{\tobecompleted} followed by let\tbc\tobecompleted?
    – pzorba75
    Mar 27, 2017 at 3:47
  • Just to avoid a cryptic name for the command.
    – Bernard
    Mar 27, 2017 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .