# How to insert a box in equations to indicate spaces for writing answers in an exam paper?

Currently, I use write things like

$3 + 4 = \underline{\hspace{2cm}}$


in the exam paper I am preparing. The \underline indicates where students should write their answer.

However, I want to change the underlines into empty boxes where students can fill in answers, such as a number. This allows me to control how large font they write.

• Please elaborate about what output you exactly need. And not related but you should not use $$...$$ in LaTeX, but $...$ instead or just $...$ if it's inline math. See this very extensive post about that. Mar 11 at 9:45

See this code:

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}

\parindent=0mm
\begin{document}
\begin{enumerate}
\item   3+4=\\ \hfill \framebox(\textwidth,10){}\\
\item 7x5=\\ \hfill \framebox(\textwidth,10){}\\
\item $\dfrac{x^2-1}{x-1}=$\\ \hfill \framebox(\textwidth,20){}\\
\item $\int x^2\,dx=$\\ \hfill \framebox(\textwidth,30){}\\
\item Make the construction of an equilater triangle with a ruler and a compass.\\ \hfill \framebox(\textwidth,150){}\\
\end{enumerate}
\end{document}


and his output: