vbox 前的垂直空间

vbox 前的垂直空间

注意:我使用的是纯 TeX

我正在尝试创建一个戏剧表演布局,以显示右侧对齐的舞台方向。

我必须将说明放在 中,以防止它们被拆分到多个页面。我的问题是,在 之前\vbox没有获得正确的垂直间距(我想要的) ,仅在 之后。\parskip\vbox

\vskip我可以在 内插入\vbox,但当方向块位于页面顶部时,这会导致问题。我该如何设置正确的间距?谢谢!

\parindent 0pt
\parskip8pt

\long\def\stage[#1]{
    \par
    \vbox{
        \hsize=6in
        \leftskip2.5in
        \parindent10pt
        \hfill
        {\it #1}
    }
}

\long\def\says #1:#2|{
    \bgroup
    \hskip-1in
    \vbox{\hsize=0.75in\hfill #1:}
    \hsize5.5in
    \leftskip1in
    \vskip-20pt
    #2\par
    \egroup}

\says Man: This is a rather odd problem to have, I'm not sure what to do with it.|

\says Chorus: Look behind you! You'll find it there!|

\stage [The man spins wildly in his chair]

\says Man: I don't see anything. Anything at all!|

\bye

答案1

A\vbox不是段落的开头,所以\parskip不添加粘合。

\parindent 0pt
\parskip8pt

\long\def\stage[#1]{
    \par\nobreak\vskip\parskip
    \vbox{
        \hsize=6in
        \leftskip2.5in
%        \parindent10pt %%% What for???
        \hfill
        \it #1\par
    }
}

\long\def\says #1:#2|{
    \par
    {
    \hskip-1in
    \hbox to 0.75in{\hfil #1:}
    \hsize5.5in
    \leftskip1in
    \vskip-20pt
    #2\par
    }
}

\says Man: This is a rather odd problem to have, I'm not sure what to do with it.|

\says Chorus: Look behind you! You'll find it there!|

\stage [The man spins wildly in his chair]

\says Man: I don't see anything. Anything at all!|

\bye

我修改了一些代码。特别是

\vbox{\hsize=0.75in\hfill #1:}

应该

\hbox to 0.75in{\hfil #1:}

\parindent更简单,更高效。我认为in的设置\stage毫无意义。另一方面,如果指令很长,效果会很奇怪。

在此处输入图片描述

相关内容