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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When creating two columns or balancing it, we may use \vsplit to achieve this, but can we split a \hbox in TeX?

Compared with \vsplit, an example may be like this:

\setbox0=\hbox to 6in{ ... }
\setbox1=\hsplit0 to 3in

Maybe a method will be that we can put the contents of \box0 into a \vbox, then the horizontal lists in \box0 can be broken into lines. Any ideas?

share|improve this question
up vote 14 down vote accepted

Basically the method is as you said:

enter image description here

\setbox0=\hbox{one two three four five six seven eight nine ten eleven}
\noindent\unhbox0 \par 

box1: \box1

box3: \box3

share|improve this answer
Yeah, David, maybe, this is the only method to do that, but, in my opinion :-) – Timothy Li Mar 29 '13 at 9:57
Upvoted. I am pretty sure, though, that LuaTeX would enable a "cleaner" approach. – mbork Mar 29 '13 at 11:27
@mbork surely you are not suggesting that lua code could beat the classic elegance of \unskip\global\setbox1\lastbox :-) – David Carlisle Mar 29 '13 at 11:44
@TimLi if you only want to separate the items in a box then one could imagine other ways, and luatex gives you access to the horizontal list so you could reconstruct it, however if you want to split at exactly half distance and possibly break a word at that point, then you would have to invoke the hyphenation algorithm and so much of the line breaking machinery anyway. – David Carlisle Mar 29 '13 at 11:46
@DavidCarlisle: I haven't used LuaTeX, only ConTeX for a week, but LuaTeX should be my choice in the future, It is cool to have access to the TeX kernel. – Timothy Li Mar 29 '13 at 12:07

Your Answer


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.