我是 ConTeXt 的初学者,我不明白为什么\defineparagraphs
在这里关闭网格对齐:
\showgrid
\setuplayout [grid=yes]
\defineparagraphs[AntiphonNo][n=2]
\setupparagraphs[AntiphonNo][1][width=30pt, color=red]
\starttext
This is aligned just fine.
\startAntiphonNo
Col. 1\AntiphonNo
This is not aligned, and I don't know why.
\stopAntiphonNo
This is aligned just fine.
\stoptext
我应该用 来修复它吗\godown
?
\showgrid
\setuplayout [grid=yes]
\defineparagraphs[AntiphonNo][n=2]
\setupparagraphs[AntiphonNo][1][width=30pt, color=red, tolerance=strict]
\starttext
This is aligned just fine.
\godown[4.1pt]
\startAntiphonNo
Col. 1\AntiphonNo
This is not aligned, and I don't know why.
\stopAntiphonNo
\godown[-4.2pt]
This is aligned just fine.
\stoptext
答案1
您应该始终牢记的是,这paragraphs
算作一个表格环境而不是一个列,这意味着grid
内容的捕捉不是优先事项。
过去,环境的内容位于网格上,因为它仅使用几个嵌套的水平和垂直框,但是一段时间以来,环境的结果被放在一个\framed
块中。
默认情况下\framed
始终保持在文本的基线,这意味着所有字符都太高。
\setuppapersize [A6,landscape]
\defineparagraphs [test] [n=2]
\setuplayout [grid=yes]
\setupparagraphs [test] [frame=on]
\showgrid [lines]
\starttext
text
\startparagraphs [test]
\startparagraphscell
Weisman
\stopparagraphscell
\startparagraphscell
\samplefile{weisman}
\stopparagraphscell
\stopparagraphs
\stoptext
\framed
您可以使用键更改 的垂直位置,location
其中有两个选项可供您选择。您可以使用location=bottom
或location=depth
将框向下移动。
\setuppapersize [A6,landscape]
\defineparagraphs [test] [n=2]
\setuplayout [grid=yes]
\setupparagraphs [test] [frame=on]
\setupparagraphs [test] [location=depth]
\showgrid [lines]
\starttext
text
\startparagraphs [test]
\startparagraphscell
Weisman
\stopparagraphscell
\startparagraphscell
\samplefile{weisman}
\stopparagraphscell
\stopparagraphs
\stoptext
虽然这location=low
似乎是另一种让内容位于基线上的可能设置,但它仅在文本只有一行时才有效。当文本更多时,只有最后一行出现在正确的位置,其他所有内容都会向上移动。
\setuppapersize [A6,landscape]
\defineparagraphs [test] [n=2]
\setuplayout [grid=yes]
\setupparagraphs [test] [frame=on]
\setupparagraphs [test] [location=low]
\showgrid [lines]
\starttext
text
\startparagraphs [test]
\startparagraphscell
Weisman
\stopparagraphscell
\startparagraphscell
\samplefile{weisman}
\stopparagraphscell
\stopparagraphs
\stoptext