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.
Asked
Active
Viewed 1,421 times
9
yannisl
- 117,160
1 Answers
5
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.
You can look at this answer or at the answers to this question
If neither of them satisfy you, then you can be more precise in your question about your purposes.
minipageshould not be a problem. However, typesetting up to some height restriction and then "un-typesetting" it into a macro is perhaps a task forlualatex. May I ask what the end use is? – Werner Nov 25 '11 at 03:31\showit to see the additional text. – yannisl Nov 25 '11 at 05:52lualatex, 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 06:16\vsplit, but I don't know enough TeX to achieve any results. – yannisl Nov 25 '11 at 06:26splitboxinadjustboxbut it isn't what you want. – Martin Scharrer May 21 '12 at 19:46