If I have two boxes like so:
\hbox to 2cm{\vrule\hfil\hbox{\vrule keke\vrule}\hfil\vrule}
\bye
, then is it possible somehow for the inner \hbox to take all of that 2cm? (the \hfils and \vrules are there only to illustrate the sizes)
|
If I have two boxes like so:
, then is it possible somehow for the inner |
|||
|
This doesn't answer your question, but perhaps you want something like this?
|
||||
|
|
My idea was hairier than I thought, and falls a bit too far from a solution to count as an answer, but since I spent some time on it ... the basic idea, given code as follows (all code in Plain Tex):
is that (i)
namely that 1.0fill is 105.905 of Tex's internal measure; and (ii), you can use this glue setting factor to go back and substitute the vrule for the last skip:
The the two box registers will contain three items of the same width, but the last skip from box 0 will be replaced by a rule in box 1. You can make this step easier by defining a macro with a "hole" where the skip/hbox are to go. We don't want to have to calculate the width based on looking up the results by hand: we want to get the "setting" width for the glue dimension automatically. This is where it gets hard. I think there is no way in Tex or Etex to internally extract the stretch/shrink factor of skips, although there is the possibility to spit out the information using So I can think of two problematic ways to get the value wanted here:
|
|||
|
|
\hbox to2cm{...}or\hbox spread2cm{...}, but\hbox spread1fil{...}doesn't work. If you don't give a specification, then the box has its natural width. Maybe you can explain what you're really trying to accomplish. – TH. Apr 14 '11 at 5:08\wd\hfillgave you the width that the\hfillwould take up, you would want the inner hbox to be\hbox to \wd\hfill? I know a way to get this result, but it's quite ugly. – Charles Stewart Apr 14 '11 at 5:50