![ConTeXt 中的“\hbox 到 \hsize”是什么意思?](https://linux22.com/image/314596/ConTeXt%20%E4%B8%AD%E7%9A%84%E2%80%9C%5Chbox%20%E5%88%B0%20%5Chsize%E2%80%9D%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F.png)
在许多文本中,我看到了\hbox to \hsize
,例如:
{\hbox to \hsize \bgroup
\hfill
\setupframed[height=5cm,offset=.5em,frame=off,backgroundcolor=red]
\framed[width=12cm,align=left]{#1}%
\framed[width=4cm,align=left,leftframe=off]{#2}%
\egroup}
我不知道整个盒子是什么意思?to
里面的是什么意思?
答案1
比较不同的盒子:
\starttext
foo\hfill bar
\def\test#1#2{\hbox to \hsize \bgroup
\hfill
\setupframed[height=5cm,offset=.5em,frame=on,backgroundcolor=red]
\framed[width=0.2\hsize,align=left,framecolor=blue]{#1}%
\framed[width=0.29\hsize,align=left,leftframe=off,framecolor=red]{#2}%
\egroup}
\blank
\framed{\test{some more text}{the second argument}}
\def\test#1#2{\hbox to 0.5\hsize \bgroup
\hfill
\setupframed[height=5cm,offset=.5em,frame=on,backgroundcolor=red]
\framed[width=0.2\hsize,align=left,framecolor=blue]{#1}%
\framed[width=0.29\hsize,align=left,leftframe=off,framecolor=red]{#2}%
\egroup}
\framed{\test{some more text}{the second argument}}
\stoptext