+0

How to make an empty rectangle in Latex

+3
207
5
+117220

I just worked out how to make an empty box of various horizonal size easily in LaTex.

This is not a recommended method, but other methods that I have tried here have not worked.

This coding is really simple.  Just put letters inside but make the letters invisable!

\boxed{\color{white}ABC}

$$\boxed{\color{white} ABC}$$

\boxed{\color{white}ABCDGFRE}

$$\boxed{\color{white}ABCDGFRE}$$

Mar 15, 2022
edited by Melody  Mar 15, 2022

#1
+9402
+2

Another code I like to use to make things invisible is  \phantom{}

It will makes whatever you put inside invisible! I sometimes use it for spacing

Also there is the  \hspace  command which can be used to make a horizontal space of a specified length.

For example, the code:  a\hspace{3cm}b

makes this:

$$a\hspace{3cm}b$$

So there are 3 cm of space between the a and the b.

(Also here is a list of the different types of units of length it recognizes)

Mar 15, 2022
#2
+9402
+2

It looks like just making a box with the \hspace command makes a narrower box like this:

$$\boxed{\hspace{10cm}}$$

And I tried to use the \vspace command to make it taller but it seems like that doesn't work in math mode :\

hectictar  Mar 15, 2022
#3
+117220
+2

Thanks Hectictar,

I really like that \phantom one !

And the \hspace{3cm}b  looks like it would be really useful.

It is good to have seome more commands that actually do work here