
我希望將少量資訊放入列中。問題是資訊包含段落。基本上這就是我想要的:
Column 1 Line 1 Column 2 Line 1 Column 3 Line 1
Column 1 Line 2 Column 2 Line 2 Column 3 Line 2
Column 2 Line 3
問題是所有三列都使用不同的字體大小,因此僅僅將每行作為典型的行放置是\halign
行不通的。這是我目前的嘗試:
\def\Center#1{\hfil #1 \hfil}
\def\UseFont#1#2{\global\font\currentFont=#1 at #2 \currentFont}
\halign{
# & # & # \cr
\Center{Column 1 Line 1}\break\par %neither works
\Center{Column 1 Line 2}
&
\UseFont{cmb10}{18pt}
\Center{Column 2 Line 1}\break\par
\Center{Column 2 Line 2}\break\par
\Center{Column 2 Line 3}\break\par
&
\Center{Column 3 Line 1}\break\par
\Center{Column 3 Line 2}
\cr
}
該程式碼的問題是換行符不會傳輸。我認為問題是我陷入了受限水平模式,因為\halign
但是如果我將每一列扔進\vbox
vbox 的寬度就太寬並阻止其他列顯示。
我可以做什麼來實現這個目標?
答案1
\long\def\Center#1{\rightskip0pt plus 1fill \leftskip\rightskip \parindent0pt \parfillskip0pt\relax
#1\par}
\def\UseFont#1#2{\global\font\currentFont=#1 at #2 \currentFont}
\halign{
\vbox{\hsize3cm#\par} & \vbox{\hsize3cm#\par} & \vbox{\hsize3cm#\par} \cr
\Center{Column 1 Line 1\par %neither works
Column 1 Line 2}
&
\UseFont{cmb10}{18pt}
\Center{Column 2 Line 1\par
Column 2 Line 2\par
Column 2 Line 3}
&
\Center{Column 3 Line 1\par
Column 3 Line 2}
\cr
}
\end