
2열 레이아웃에서는 참조된 대상의 행과 열 번호를 반환하는 참조를 생성해야 합니다.
컬럼 카운터가 없는 것 같으니 헤더에 표시되는 컬럼 번호는 페이지 번호를 기준으로 계산됩니다.
\someline(대상용) 및 \inlinerange(참조용) 명령으로 줄 번호를 참조할 수 있고, \pagereference(대상용) 및 \at(참조용) 명령으로 페이지 번호를 참조할 수 있습니다. 그런데 칼럼을 어떻게 참조할 수 있나요?
참조된 대상의 열 번호를 계산하려면(헤더에서 수행한 작업에 따라) 대상이 왼쪽 또는 오른쪽 열에 있는지 여부에 대한 정보(페이지 번호 외에)가 필요합니다. 이 정보를 어떻게 얻을 수 있나요?
(79페이지의 ConTeXt 참조에는 \currentcolumn 명령을 사용하는 예가 있는데, 나에게는 항상 1을 반환하고 이 예는 어쨌든 나에게 작동하지 않습니다.)
아래에는 줄과 페이지에 대한 참조가 포함된 두 개의 열 설정에 대한 예가 나와 있습니다. 여기서 대신 열 번호가 필요합니다.
\setuppapersize[A4][A4]
\setupbodyfont[9pt]
\setupcolumns[
n=2,
distance=1cm,
]
\setuplinenumbering[
step=5,
method=page,
location=right,
align=flushright,
width=.25cm
]
\setupheadertexts[]
\setupheadertexts
[\ctxlua{context(2 * tex.count.pageno - 1)}]
[\ctxlua{context(2 * tex.count.pageno)}]
[\ctxlua{context(2 * tex.count.pageno - 1)}]
[\ctxlua{context(2 * tex.count.pageno)}]
\starttext
\startcolumns
\startlinenumbering
\dorecurse{2}{\input lorem}\par
REFERENCE 1: Target 1 is in line \inlinerange[TestI], column ? (how to get this?) on page \at[TestI].\par
\dorecurse{2}{\input lorem}\par
\someline[TestI]\pagereference[TestI]TARGET 1.\par
\dorecurse{2}{\input lorem}\par
\stoplinenumbering
\stopcolumns
\stoptext
그 결과는 다음과 같습니다.