[Tex/LaTex] How does using \makebox allow arbitrary placement of things on a page

boxesmarginspositioning

What is it about using \makebox that makes it disregard text body borders / margins, where other boxes respect the margins / text width and friends?

I ask this because it seems like a magic box that you can just throw anything into and do whatever (same with \parbox, I suppose). In TikZ, you have to use the overlay option. Is it due to something implicit like that?

Best Answer

There is nothing special about \makebox. If you go

\parbox{1cm}{...}

then if ... is wider than 1in you will get an overfull box, but it is possible to make the text visually wider without being wider to tex, eg

\parbox{1cm}{XXXXXXXXXXX\hspace{-10cm}X}

is not overfull, despite the fact that the X will extend past the 1cm boundary of the box.

\makebox is just a box with (if you use the length option) a specified width but glue added either side that can stretch or shrink an arbitrary amount so that the contents are always exactly the width of the box, even if they appear to extend past it.