1

I want to make a box for my daughter in order to fill in the blank. But it is not nice. How can I repair the boxes? enter image description here

  • The sourcecode for this MWE would help us. What could help, and I will post an answer using this, if you give us your code, is the \vcenter option. There are other ways, but I think this suffices. – nox Dec 28 '16 at 0:52
  • I tried \[\vcenter{\hbox{\rule{0.35cm}{0.35cm}}} + 2016 = 2017 \]. – minhthien_2016 Dec 28 '16 at 1:20
5

Here is a suggestion:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\newcommand{\pbox}[1]{\boxed{\phantom{#1}}}

\begin{document}

$ \pbox{2015} + 2016 = 4031 $

\medskip

$ \pbox{1} + \pbox{2} + \pbox{3} = 6 $

\medskip

$ \pbox{f(x)} = ax^2 + bx + c $

\medskip

$ \dfrac{6}{10} = \dfrac{\pbox{3}}{5} $

\end{document}

The contents is set as a \phantom inside a \boxed (from amsmath).

  • Nice work, even though the OP has not provided the MWE. – nox Dec 28 '16 at 1:33
  • @Werner HOw can I simplify this line$ 12\,\, \pbox{>} \,\,5 + 6.$? – minhthien_2016 Dec 28 '16 at 2:00
  • @toandhsp: You could probably use $ 12 \mathbin{\pbox{>}} 5 + 6 $. – Werner Dec 28 '16 at 2:16
  • @Werner Can I get a square box? If I use $ 12 \mathbin{\pbox{>}} 5 + 6 $ not nice. – minhthien_2016 Dec 28 '16 at 4:00
  • @toandhsp: Try with $ 12 \mathbin{\pbox{\vphantom{>}\rule{1ex}{0pt}}} 5 + 6 $. – Werner Dec 28 '16 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.