使用 ConTeXt 在双列布局中进行行编号

使用 ConTeXt 在双列布局中进行行编号

我正在尝试将代码分布在两列上:

\definetyping[code][numbering=line,
                bodyfont=small]

\starttext
\setuplinenumbering[location=text,style=\ttx]
\startcolumns[n=2]
\startcode
this
is
some
code
spread
over
two
columns
\stopcode
\stopcolumns
\stoptext

它的渲染效果如下:

1 this    2 spread
  is      3 over
  some    4 two
  code    5 columns

我尝试手动拆分它

\stopcode
\startcode[continue]

但结果还是一样。我该如何修复行号?

编辑:

适用于:

\definelinenumbering[code][start=100,location=text,style=\ttx]
...
\startcolumns[n=2]
  \startlinenumbering[code]
    \startcode
      ...
    \stopcode
  \stoplinenumbering
\stopcolumns

但是,在我的文档的其他地方以这种方式使用它失败了:

\startlinenumbering[code]
  \startcode
    foo
  \stopcode
\stoplinenumbering

sometext

\startlinenumbering[code,continue]
  \startcode
    bar
  \stopcode
\stoplinenumbering

得出:

tex error       > tex error on line 31 in file /.../test.tex: ! Missing number, treated as zero                                                      

<to be read again>                                                                                        
s                                                                                                         
\page_lines_start_define ...ngparameter \c!start s                                                        
                                                  tep \linenumberingparamete...                           
\page_lines_start_followup ..._lines_start_define                                                         
                                                  \fi \attribute \linenumber...                           
\syst_helpers_double_empty_one_spaced ...1[{#2}][]                                                        

<to be read again>                                                                                        
\startcode                                                                                                
l.31   \startcode

相关内容