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 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.

share|improve this question
1  
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
add comment

1 Answer

up vote 4 down vote accepted

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.

share|improve this answer
add comment

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.