Por que etc. é adicionado no final de um \vbox e o que isso significa?

Por que etc. é adicionado no final de um \vbox e o que isso significa?

Um pequeno código de exemplo

% pdfTeX
\newbox\thbx
\setbox\thbx\hbox{abc}
\newbox\tvbx
\setbox\tvbx\vbox{\unhbox\thbx}
\showbox\tvbx
\bye

produziria

\thbx=\box16
\tvbx=\box17
> \box17=
\vbox(6.94444+0.0)x469.75499
.\hbox(6.94444+0.0)x469.75499, glue set 434.47717fil
..\hbox(0.0+0.0)x20.0
..\tenrm a
..\tenrm b
..\kern0.27779
..\tenrm c
..etc.

O que significa a última linha da saída ( etc.) e por que ela foi colocada lá pelo TeX?

Responder1

Por padrão \showboxbreadth=5, ou seja, após o TeX mostrar os cinco primeiros elementos da lista ele escreverá etc.para indicar que há mais.

Há outro parâmetro que influencia a saída \showboxe é \showboxdepth(default 3), que é o nível de aninhamento para o qual o TeX desce. Se a profundidade foi excedida, isso é indicado por [].

Veja também este trecho do TeXbook:

\danger When \TeX\ displays a box as part of diagnostic output, the amount
of data is controlled by two parameters called ^|\showboxbreadth| and
^|\showboxdepth|. The first of these, which plain \TeX\ sets equal to~5,
tells the maximum number of items shown per level; the second, which plain
\TeX\ sets to~3, tells the deepest level. For example, a small box
whose full contents are ^^{internal box format} ^^{symbolic box format}
\begintt
\hbox(4.30554+1.94444)x21.0, glue set 0.5
.\hbox(4.30554+1.94444)x5.0
..\tenrm g
.\glue 5.0 plus 2.0
.\tenrm || (ligature ---)
\endtt
will be abbreviated as follows when |\showboxbreadth=1| and |\showboxdepth=1|:
^^{ligature} ^^{em-dash}
\begintt
\hbox(4.30554+1.94444)x21.0, glue set 0.5
.\hbox(4.30554+1.94444)x5.0 []
.etc.
\endtt
And if you set |\showboxdepth=0|, you get only the top level:
\begintt
\hbox(4.30554+1.94444)x21.0, glue set 0.5 []
\endtt
(Notice how `^|[]|' and `^|etc.|'~indicate that the data has been
truncated.)

informação relacionada