LaTeX Tip of the Day – \fbox, \mbox, \makebox, \framebox
When typesetting with LaTeX, sometimes you need to take a little control back from the automatic routines that determine linebreaks. Or perhaps you want to manually control the placement of text on a line.
The latex command \makebox[w][position]{content} inserts an unbreakable box of width w (10pt, 2cm, 0.23in, \textwidth will work), where the content is positioned flush left (use the letter l), flush right (r), centered (c), or will fill the box (s). The square brackets mean that those arguments are optional (if you only specify one, LaTeX assumes you’re giving the width). The default positioning is (c), and the default width is just big enough to fit the content (if you specify a width that is too small, the text will overflow onto text outside the box.

The command \framebox is exactly the same, except it draws a solid line around the box:

The commands \mbox{content} and \fbox{content} are equivalent to \makebox{content} and \framebox{content}, respectively (\mbox and \fbox are robust, so you should use them if possible). To change the thickness of the outline drawn by \fbox to 2pt, add the command \renewcommand{\fboxrule}{2pt} anywhere before the \fbox.

Note how the boxes make the line overflow.