vbox 消失在 hbox 内

vbox 消失在 hbox 内

我不明白为什么当 vbox 被两个 包围时它会消失\hss,例如:

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

这或多或少对应于我想要实现的目标,为什么没有def出现?

这里肯定有一些我遗漏的明显的东西,但我看不出来是什么。我会通过使用一些来解决这个问题\raise,但我想了解...

答案1

\vtop框很\hsize宽,因此它会消失在左边距之外。

尝试

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

您会看到它出现在左边距。

让我们做

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

日志将显示

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

相关内容