![如何扩展页面内容以填充 ConTeXt 中的可用空间?](https://linux22.com/image/415853/%E5%A6%82%E4%BD%95%E6%89%A9%E5%B1%95%E9%A1%B5%E9%9D%A2%E5%86%85%E5%AE%B9%E4%BB%A5%E5%A1%AB%E5%85%85%20ConTeXt%20%E4%B8%AD%E7%9A%84%E5%8F%AF%E7%94%A8%E7%A9%BA%E9%97%B4%EF%BC%9F.png)
我有一份这样的文件:
\starttext
\definepapersize[card][height=8.5in,width=11in]
\setuppapersize[card][letter, landscape]
\definemakeup[jeopardy][align=middle,headerstate=start]
\startmakeup[jeopardy]
Text
\stopmakeup
\startmakeup[jeopardy]
More text
\stopmakeup
\startmakeup[jeopardy]
This has a whole paragraph. There is some more writing. This has lots.
\stopmakeup
\stopttext
我如何让文本扩展以填充可用空间(不包括页边距)?例如,第一页的“文本”可能扩展 2000% 以填充整个页面,但“更多文本”更大,因此扩展至 1560%。最后一页有整个段落,因此可能仅扩展 550% 以填充该文本至最大尺寸。
答案1
使用\scale[width=\textwidth]{text to be inserted}
。更多详细信息请参阅 Wiki:
https://wiki.contextgarden.net/Command/scale
顺便说一下,你的例子有一个拼写错误\stoptext
编辑
如果需要换行,请使用\framed
内部\scale
\scale[width=\textwidth]{\framed[frame=off,offset=0cm,align=middle,location=middle] {Text \\ to \\ break}}
我已经向您的 MWE 添加了一些行,以便您可以看到它的工作原理。
\starttext
\definepapersize[card][height=8.5in,width=11in]
\setuppapersize[card][letter, landscape]
\definemakeup[jeopardy][align=middle,headerstate=start]
\startmakeup[jeopardy]
\scale[width=\textwidth]{Text}
\stopmakeup
\startmakeup[jeopardy]
\scale[width=\textwidth]{More text}
\stopmakeup
\startmakeup[jeopardy]
\scale[width=\textwidth]{This has a whole paragraph. There is some more writing. This has lots.}
\stopmakeup
\startmakeup[jeopardy]
\scale[width=\textwidth]{\framed[frame=off,offset=0cm,align=middle,location=middle] {I \\ am \\ awesome}}
\stopmakeup
\stoptext