上下文:\defineparagraphs 与网格对齐?

上下文:\defineparagraphs 与网格对齐?

我是 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=bottomlocation=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

在此处输入图片描述

相关内容