-2

I'll try to improve the question: As you can see, the forth column is longer than the values shown and I have learned, that this not an extension of the \vbox, but an overflow. So, TeX does not want to lose content and prints out the overflow. Ok, but that is not, what I want to get. I have been advised to use \vsplit, but I do not know how to use it in this case. I do not get along with \vsplit yet. It is now clear to me, how to get the values of the boxes, they are shown on the left side. Now the improved question: Is it possible to catch the overflow, transfer it to a new box, that is not printed out without being explicitly called by \copy"x". Please give me an example, how to use \vsplit in \setbox3=

   \raggedright
    \parindent=0pt
    \newdimen\columnwidth%
    \columnwidth=100pt%
    \newdimen\columndepth
    \columndepth=100pt
    \newdimen\columnheight
    \columnheight=180pt
    \newwrite\valuesof
    \immediate\openout\valuesof=\jobname.val
    \def\text{This is the text that fills the boxes. This is the text that fills the boxes.\vskip\baselineskip }
    \def\values[#1]{\immediate\write\valuesof{\vbox{\bf Box#1} \vskip0.2\baselineskip height \the\ht#1 \vskip0.2\baselineskip%
     depth \the\dp#1 \vskip0.2\baselineskip%
     width \the\wd#1 \vskip0.2\baselineskip}}%to show the values in the text
     %endofdefinitions
     {\bf Questions about vboxes and their dimensions. \vskip\baselineskip Why are the vboxes extended over a given limit?}\vskip\baselineskip 
    \vskip\baselineskip 
    \hbox{%
    \setbox0=\vtop to \columnheight{\vskip-0.4pt\hsize\columnwidth\hrule width\hsize\vskip\baselineskip %
    \text\text\text\vfill
    \hrule width\hsize\vskip\baselineskip
    } %
    \setbox1=\vtop to \dp0 {\vskip-0.4pt\hsize\columnwidth\hrule width\hsize\vskip\baselineskip %
    \text\text\text\vfill
    \hrule width\hsize\vskip\baselineskip
    } %
    \setbox2=\vtop to \dp1{ \vskip-0.4pt\hsize\columnwidth\hrule width\hsize\vskip\baselineskip %
    \text\text\text\vfill
    \hrule width\hsize\vskip\baselineskip
    } %
    \setbox3=\vtop to \dp2{ \vskip-0.4pt\hsize\columnwidth\hrule width\hsize\vskip\baselineskip %
    \text\text\text\text\vfill
    \hrule width\hsize\vskip\baselineskip
    } %
    \values[0]
    \copy0
     \values[1]
    \copy1%
     \values[2]
    \copy2%
    \values[3]
    \copy3%
    }%
    \vskip60pt
\immediate\closeout\valuesof
\input\jobname.val

\bye%

  • it's not clear what your question is: you put in too much stuff, tex reports Overfull \vbox (127.34444pt too high) detected at line 37 and the box is that much too big. Add \vss if you want it to quietly overflow. (hboxes are just the same) – David Carlisle Nov 14 '22 at 19:28
  • One thing to remember: either a \vbox or an \hbox will not be broken, so if what is inside it exceeds the defined size (length or width), it will result in an overfull box message. – barbara beeton Nov 14 '22 at 20:14
  • I do not want an overflow, \vss seems to be a workaround here. I want TeX to make boxes as specified and would not like TeX to extend boxes by accident. And,question within a question: Why does TeX not show the real values for box3 ? – user284656 Nov 14 '22 at 20:14
  • @Barbara Beeton Maybe, this is the problem and a chance: Where and how may a box be broken and how does TeX tell? In the given example, TeX might count the characters that produce the overfill and extract them, to be given to another box. – user284656 Nov 14 '22 at 20:28
  • tex does show the real values they may not be the values that you expect but if you do not say what you expect it is hard to say anything. TeX never breaks a box, so there is nothing to "tell" You can split a box using \vsplit I did ask in one of your earlier questions if you wanted \vsplit but if you just post code without saying what it is supposed to do, we can not tell you what to change, just explain the output you get. \vss is not a "workaround" it is the way to control the position of the overflow, like \rlap and \llap in plain tex just differ by the position of \hss – David Carlisle Nov 14 '22 at 21:18
  • @David Carlisle Obviously, in my example TeX does not display the actual sizes, but the sizes, I defined in "vbox to \dp(x)". Earlier, I asked how to get the additional values, TeX addes to the given size. Please consider, that there ist nothing supposed to do, I'm only trying to understand TeX. And no, I do not want \vsplit. \vsplit is optional, so you have to tell TeX where to split, I want TeX to find out, where to split. – user284656 Nov 14 '22 at 22:08
  • tex never automatically splits a box. The main purpose of putting something in a box is to prevent splitting (over a page for vbox or over a line for hbox) – David Carlisle Nov 14 '22 at 22:10
  • "Obviously, in my example TeX does not display the actual sizes, " no the values shown are the size of the box, and reflects the space tex would leave on the page. If you add following text it will be positioned based on those values. If you want a box reflecting the natural size do not use to which forces the size. – David Carlisle Nov 14 '22 at 22:26
  • This may help: note that for TeX, the dimensions of the box are precisely what you specified—the dimensions are just three numbers (width, height, depth) and do not necessarily have any relation with, say, what region of the page gets ink on it (as you're thinking). If you really want it to only typeset whatever "fits" and "give back" the rest, then using paragraphs and \vsplit is the only way provided by TeX itself. If you're not happy with this there's nothing else you can do in TeX; you'd need to modify the TeX program itself, or write your own typesetting system. – ShreevatsaR Nov 15 '22 at 14:43
  • My problem with this forum is: If I ask "How do I get the values of...", I get an answer how to use them. I have to admit, that my questions are not clear enough or too sophisticated, but I have to say: Most advisors do not read the questions properly. I'd rather have an answer than a reproof. – user284656 Nov 16 '22 at 01:00
  • I had asked: Why are the vboxes extended over a given limit? I got some answers, how to deal with it, but I got no answer to my question. – user284656 Nov 16 '22 at 01:05
  • you got an answer; the boxes are not extended, they are the size you specify.The content is larger so overflows (with a warning). That exactly answers your question. In comments you hint you are not just asking why that happens but also wanting to know how to make something else happen. The answer to that probably involves \vsplit but you have not given any clear indication of what you want. I do not know why you have said you have been reproached, – David Carlisle Nov 16 '22 at 01:12
  • @David Carlisle I had a closer look on \vsplit, but for me, it does not work. Sorry for being unclear, but I said in the question, that this is not about solutions, but about understanding TeX. I appreciate your answers, there are not many people , who refer to tex-core nowadays. Please consider, that I am not a native english speaker. – user284656 Nov 16 '22 at 01:31
  • @user284656 your English is pretty good. but you should ask a question that says what you want to happen. you say you don't want solutions but if you just post code and ask why it does what it does then all we can do is explain that. eg vbox to xxx always makes a box of size xxx whatever the content. you should accept that answer, decide that is not what you need then ask how to get what you do need, as currently we can not guess what you need as your questions do not say what output you want. – David Carlisle Nov 16 '22 at 08:30
  • @user284656 It's a terminology issue: you keep saying the vboxes are "extended", but for TeX the vboxes are not extended; they are the same size you specify; it's just that the contents of the vbox overflow and happen to occupy some regions outside the vbox. – ShreevatsaR Nov 16 '22 at 14:55
  • @user284656 Sorry about the frustration. I don't know who downvoted, but don't take it personally; it happens. (Interpret the downvote as just meaning that the person is not excited about answering the question.) Consider asking a new self-contained question instead, with a new title and a body that is understandable without references to previous questions. (e.g. "Can \vsplit be used to catch overflow and transfer them to a new box without explicitly calling \copy?" or whatever: I don't actually understand the question yet—why you want to avoid \copy—but I imagine you can make it clearer.) – ShreevatsaR Nov 18 '22 at 00:16
  • 1
    Ok, end of story, it is all explained in https://tex.stackexchange.com/questions/20901/breakable-vboxes absolutely fine. – user284656 Nov 18 '22 at 19:43

1 Answers1

1

you put in too much content, tex reports

 Overfull \vbox (127.34444pt too high) detected at line 37

and the box is that much too big.

Add \vss if you want it to quietly overflow. Place it at the start or end of the box, or both, depending how you want the content to overflow the specified size.

This is a vertical analogue of plain TeX \rlap and \llap which just differ by the position of \hss

David Carlisle
  • 757,742