# How to split a minipage?

How can I measure the height of a minipage and then split and store the text into two macros? The first macro must store the text that does not exceed a certain limit say `\maxheight` and the second to store the balance of the text. Ideally I would like the split to happen at a word break.

-
Measuring the height of a `minipage` should not be a problem. However, typesetting up to some height restriction and then "un-typesetting" it into a macro is perhaps a task for `lualatex`. May I ask what the end use is? –  Werner Nov 25 '11 at 3:31
@Werner How would lualatex split it? I am just trying to truncate a textblock containing text to a certain height. I thought I would save the truncated part and just `\show` it to see the additional text. –  Yiannis Lazarides Nov 25 '11 at 5:52
I am not familiar with `lualatex`, but it provides a more code-like approach to TeX. (La)TeX's approach to such a problem would typically be far less elegant, in my opinion. –  Werner Nov 25 '11 at 6:16
@Werner I tried `\vsplit`, but I don't know enough TeX to achieve any results. –  Yiannis Lazarides Nov 25 '11 at 6:26
There is an experimental `splitbox` in `adjustbox` but it isn't what you want. –  Martin Scharrer May 21 '12 at 19:46

You can't really store the text into two macros, but rather the two pieces of the typeset `minipage` into two box registers.
However this can't be done with `minipage`, but only with lower level commands: `\vbox` and `\vsplit`.