上下文:對列號的交叉引用

上下文:對列號的交叉引用

在兩列佈局中,我需要建立傳回所引用目標的行號和列號的參考。

由於似乎不存在列計數器,因此標題中顯示的列號是根據頁碼計算的。

我可以透過命令 \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

結果是:

PDF 包含行和頁的參考

相關內容