![unhboxing が垂直モードを無視し、unvboxing が水平モードを無視するのはなぜでしょうか?](https://rvso.com/image/420013/unhboxing%20%E3%81%8C%E5%9E%82%E7%9B%B4%E3%83%A2%E3%83%BC%E3%83%89%E3%82%92%E7%84%A1%E8%A6%96%E3%81%97%E3%80%81unvboxing%20%E3%81%8C%E6%B0%B4%E5%B9%B3%E3%83%A2%E3%83%BC%E3%83%89%E3%82%92%E7%84%A1%E8%A6%96%E3%81%99%E3%82%8B%E3%81%AE%E3%81%AF%E3%81%AA%E3%81%9C%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%81%8B%3F.png)
最初の質問
unhboxing が垂直モードを無視し、unvboxing が水平モードを無視するのはなぜでしょうか?
次の2枚の写真の後のMWE
- どちらも最初の質問のテキストを配信します
- 垂直モードでの
\unhbox
/の効果と水平モードでの/の効果を示しています。\unhcopy
\unvbox
\unvcopy
最初の質問のテキストは次の 2 つの画像にも示されています。これらは MWE をコンパイルした結果です。
\newbox\MyBox
\setbox\MyBox=\hbox{%
\vbox{\hbox{box1a}\hbox{box1b}}%
\vbox{\hbox{box2a}\hbox{box2b}}%
\vbox{\hbox{box3a}\hbox{box3b}}%
}
\noindent{%
\bf The {\tt\string\hbox} in box-register {\tt\string\MyBox} is:\hfill\break
\tt\string\hbox\string{\char37 \hfill\break
\null\ \ \ \ \ \ \ %
\string\vbox\string{\string\hbox\string{box1a\string}\string\hbox\string{box1b\string}\string}\char37 \hfill\break
\null\ \ \ \ \ \ \ %
\string\vbox\string{\string\hbox\string{box2a\string}\string\hbox\string{box2b\string}\string}\char37 \hfill\break
\null\ \ \ \ \ \ \ %
\string\vbox\string{\string\hbox\string{box3a\string}\string\hbox\string{box3b\string}\string}\char37 \hfill\break
\null\ \ \ \ \ %
\string}\char37 \hfill
}%
\noindent{\bf In vertical mode I expect boxes to be placed atop/below each
other no matter if the boxes to be placed themselves are horizontal or vertical
boxes.\hfill\break
Thus in vertical mode I expect from {\tt\string\unhcopy}ing the {\tt\string\hbox} held in
box-register {\tt\string\MyBbox} that the three {\tt\string\vbox}es it contains are
placed atop/below each other:}\bigskip
\par\vbox{\hbox{box1a}\hbox{box1b}}%
\vbox{\hbox{box2a}\hbox{box2b}}%
\vbox{\hbox{box3a}\hbox{box3b}}%
\bigskip\noindent{\bf But in vertical mode from {\tt\string\unhcopy}ing I
get the three vertical boxes placed to the left/right of each other, with {\tt\string\parindent}-glue
at the left of the leftmost box:}\bigskip
\par\unhcopy\MyBox
\bigskip\noindent{\bf Just as if I did {\tt\string\box} the {\tt\string\hbox}
in horizontal mode:}\bigskip
\par\leavevmode\box\MyBox
\bigskip\noindent{\bf Why? Where am I wrong in my understanding of the workings of {\tt\string\unhbox}/{\tt\string\unhcopy}?}
\vfill\eject
\setbox\MyBox=\vbox{%
\hbox{\vbox{\hbox{box1a}\hbox{box1b}}}%
\hbox{\vbox{\hbox{box2a}\hbox{box2b}}}%
\hbox{\vbox{\hbox{box3a}\hbox{box3b}}}%
}
\bigskip\noindent{\bf
\bf The {\tt\string\vbox} in box-register {\tt\string\MyBox} is:\hfill\break
\tt
\string\vbox\string{\char37 \hfill\break
\null\ \ \ \ \ \ \ \string\hbox\string{\string\vbox\string{\string\hbox\string{box1a\string}%
\string\hbox\string{box1b\string}\string}\string}\char37 \hfill\break
\null\ \ \ \ \ \ \ \string\hbox\string{\string\vbox\string{\string\hbox\string{box2a\string}%
\string\hbox\string{box2b\string}\string}\string}\char37 \hfill\break
\null\ \ \ \ \ \ \ \string\hbox\string{\string\vbox\string{\string\hbox\string{box3a\string}%
\string\hbox\string{box3b\string}\string}\string}\char37 \hfill\break
\null\ \ \ \ \ \string}\char37 \hfill
}%
\noindent{\bf In horizontal mode I expect boxes to be placed left/right to each other no
matter if the boxes to be placed themselves are horizontal or vertical boxes.\hfill\break
Thus in horizontal mode I expect from {\tt\string\unvcopy}ing the {\tt\string\vbox} held in
box-register {\tt\string\MyBbox} that the three {\tt\string\hbox}es it contains are placed
left/right to each other, with {\tt\string\parindent}-glue at the left of the leftmost
{\tt\string\hbox}:}\bigskip
\leavevmode\hbox{\vbox{\hbox{box1a}\hbox{box1b}}}%
\hbox{\vbox{\hbox{box2a}\hbox{box2b}}}%
\hbox{\vbox{\hbox{box3a}\hbox{box3b}}}%
\bigskip\noindent{\bf But in horizontal mode from {\tt\string\unvcopy}ing
I get the three horizontal boxes placed atop/below each other:}\bigskip
\leavevmode\unvcopy\MyBox
\bigskip\noindent{\bf Just as if I did {\tt\string\box} the {\tt\string\vbox} in vertical mode:}\bigskip
\par\box\MyBox
\bigskip\noindent{\bf Why? Where am I wrong in my understanding of the workings of {\tt\string\unvbox}/{\tt\string\unvcopy}?}
\bye
2番目の質問:
同じ長さの多数の行を含むボックス レジスタ\MyBox
があるとします。\vbox
\hboxes
\box
そのボックス レジスタを使用すると、単一の行がページ間で分割されない垂直ボックスが生成されます。
\newcount\tmpcnt
\newbox\MyBox
\setbox\MyBox=\vbox{%
\tmpcnt=0 %
\loop\advance\tmpcnt by 1 \hbox to 3cm{Line:\hfill\number\tmpcnt.}\ifnum\tmpcnt<100 \repeat
}%
\noindent
\box\MyBox
\bye
\unvbox
そのボックスレジスタを実行すると、単一の行が複数のページに分割されます。
\newcount\tmpcnt
\newbox\MyBox
\setbox\MyBox=\vbox{%
\tmpcnt=0 %
\loop\advance\tmpcnt by 1 \hbox to 3cm{Line:\hfill\number\tmpcnt.}\ifnum\tmpcnt<100 \repeat
}%
\noindent
\nobreak\unvbox\MyBox
\bye
これと組み合わせて、\unvbox
これらの行を複数のページに分割するだけでなく、右揃えにするにはどうすればよいでしょうか。次のようにします。
\newcount\tmpcnt
\tmpcnt=0 %
\noindent
\loop
\advance\tmpcnt by 1 %
\null\hfill\hbox to 3cm{Line:\hfill\number\tmpcnt.}\break
\ifnum\tmpcnt<100 \repeat
\par
\bye
答え1
\unhbox
水平リストを公開し、文字と同じように新しい段落と新しい水平リストを開始します。共通点\leavevmode
は\def\leavevmode{\unhbox\voidb@x}