在许多文本中,我看到了\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