9

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.

yannisl
  • 117,160
  • 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 03: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. – yannisl Nov 25 '11 at 05: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 06:16
  • @Werner I tried \vsplit, but I don't know enough TeX to achieve any results. – yannisl Nov 25 '11 at 06:26
  • There is an experimental splitbox in adjustbox but it isn't what you want. – Martin Scharrer May 21 '12 at 19:46

1 Answers1

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.

egreg
  • 1,121,712