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.

I don't understand why a vbox disappears when it's surrounded by two \hss, for instance in:

\hbox to 0pt{\hss abc\hss}
\hbox to 0pt{\hss\vtop{def}\hss}% doesn't work
\hbox to 0pt{\vtop{ghi}\hss}% works 
\bye

which more or less corresponds to what I'd like to achieve, why doesn't def show up?

There must be something obvious I'm missing here, but I can't see what. I will work around this by using some \raise, but I'd like to understand...

share|improve this question
    
Welcome to TeX.SX! –  Christian Hupfer Jul 17 at 14:28
    
It is there, but rather far away! Remember that def starts horizontal mode and the resulting box will be \hsize wide. –  egreg Jul 17 at 14:32
    
My warm welcome too! –  egreg Jul 17 at 14:41

1 Answer 1

up vote 9 down vote accepted

The \vtop box will be \hsize wide, so it disappears beyond the left margin.

Try with

\hbox to0pt{\hss\vtop{\hsize=4cm def}\hss}

and you'll see it appear in the left margin.

Let's do

\hbox to 0pt{\hss\vtop{def}\hss}\showlists

and the log will show

### vertical mode entered at line 0
### current page:
\glue(\topskip) 3.05556
\hbox(6.94444+0.0)x0.0, glue set - 234.8775fil
.\glue 0.0 plus 1.0fil minus 1.0fil
.\vbox(6.94444+0.0)x469.75499
..\hbox(6.94444+0.0)x469.75499, glue set 436.6994fil
...\hbox(0.0+0.0)x20.0
...\tenrm d
...\tenrm e
...\tenrm f
...\penalty 10000
...etc.
.\glue 0.0 plus 1.0fil minus 1.0fil
total height 10.0
 goal height 643.20255
prevdepth 0.0
share|improve this answer
    
I understand now, thank you very much! I thought the vbox would be 0pt wide (and thus overfull)... But I should have noticed that the last box is not overfull! –  Elie Roux Jul 17 at 14:38
    
@ElieRoux An \hbox with \hss in it will be never overfull nor underfull. –  egreg Jul 17 at 14:39

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.