# Line with a \hbox is overflowing right margin, why?

Let's say I have a hbox inside a paragraph like this:

Do you like me? \hfill\hbox{\quad$\bigcirc$ Yes\quad$\bigcirc$ No}.

If the text of the question is longer than this "Do you like me?", the line just won't break. The hbox with answers will just owerflow the right margin.

Why is that? Is that because I haven't adjusted the penalties? From what I read, for TeX hbox is something that cannot be broken into more lines. But why wouldn't it put a line break between the question and the answers?

The breakpoint is before the glue, and if it broke there, the first line would be too underfull. You can add an additional breakpoint after the glue:

\hsize 5cm

\hrule

Do you like me? \hfill\hbox{\quad$\bigcirc$ Yes\quad$\bigcirc$ No}.

Do you like me?\ \hfill\allowbreak\hbox{\quad$\bigcirc$ Yes\quad$\bigcirc$ No}.

Do you like me?\ \hfill\allowbreak\hbox{}\nobreak\hfill\hbox{\quad$\bigcirc$ Yes\quad$\bigcirc$ No}.

\bye

• Thank you very much. By trial and error, I achieved the same by adding \-. (Is it the same?) Now I am wondering how to make the second line align to the right; using \hfill before the \hbox leads nowhere, I assume TeX eats \hspace after a linebreak? – David Aug 27 '14 at 16:37
• @David simplest is probably to put \hbox{}\hfill after the penalty. \- will at a hyphen if it breaks at that point, so is not the same. – David Carlisle Aug 27 '14 at 16:39
• I'm sorry, but this doesn't work for me. Adding \hbox{x}\hfill after the \allowbreak makes the "x" stay on the same line the question is. How is that possible if the line is broken before the hbox{x}? Hope you don't mind me asking! – David Aug 27 '14 at 16:48
• @David that's because I told you the wrong thing, will update answer in a sec – David Carlisle Aug 27 '14 at 17:26