Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I have a box not take the full width?

ie.

\hbox{keke}\hbox{lala} % end up on their own lines instead of same line.
\vbox{keke}\vbox{lala} % same thing, except also indented.

Why does \hbox by default take the whole line width? Does not compute.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You need to exit vertical mode, otherwise TeX just stacks up the hboxes.

\leavevmode\hbox{keke}\hbox{lala}
share|improve this answer
2  
This is precisely what LaTeX's \mbox does for you. –  Harald Hanche-Olsen Jan 25 '11 at 22:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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