Reledmac:多行编号计数器

Reledmac:多行编号计数器

我正在使用 reledmac(实际上是 reledpar,但这在这里并不重要)作为关键版本。

我有一条主线文本,它贯穿整个文档,但其中穿插着评论以及用于比较的其他文本的段落。

\pausenumbering我知道我可以使用和暂停/恢复主线文本的行号\resumenumbering,但我也需要对引用的其他文本进行单独的行号。

\documentclass{article}
\usepackage{reledmac}

\begin{document}

    \beginnumbering
    \autopar

    Text A

    Text AA
    Text A

    Text AA
    Text A

    Text AA
    Text A

    Text AA
    
   \endnumbering

   \medskip

So at this point I would like to save the line number, then insert a different text with its own numbering for comparison.
   

  
    \beginnumbering
    \autopar

    Text B

    Text BB
    Text B

    Text BB
    Text B

    Text BB
    Text B

    Text BB
    
   \endnumbering

\medskip
Commentary finished, but what I want is that the A text numbering continues where it broke off and I would like to set the line number that I saved previously.
   
    \beginnumbering
    \autopar

    Text A Cont

    Text AA Cont
    Text A Cont

    Text AA Cont
    Text A Cont

    Text AA Cont
    Text A Cont

    Text AA Cont
    Text A Cont

    Text AA Cont
    Text A Cont

    Text AA Cont
    
   \endnumbering

   

\end{document}

\startlock并且\endlock效果不太好,而且即使它能起作用,它也不允许我对其他散布的文本进行单独的计数。

\setlinenum我可以用或设置行号\setline,但如何可靠地获取块末尾的行号?

答案1

您是否尝试过将最后一行保存到计数器?在 reledmac 中,您可以选择在排版给定文本时执行命令 ( \doinsidethislinehook)。

\documentclass{article}
\usepackage{reledmac}

% This is the counter and the command.
\newcounter{lines}
\makeatletter
\newcommand{\saveline}{\doinsidethislinehook{\setcounter{lines}{\the\line@num}}}
\makeatother

\begin{document}
    
    \beginnumbering
    \autopar
    
    Text A
    
    Text AA
    Text A
    
    Text AA
    Text A
    
    Text AA
    Text A
    
    Text AA\saveline 
    
    \endnumbering
    
    \medskip
    
    So at this point I would like to save the line number, then insert a different text with its own numbering for comparison.
        
    
    \beginnumbering
    \autopar
    Text B
    
    Text BB
    Text B
    
    Text BB
    Text B
    
    Text BB
    Text B
    
    Text BB
    
    \endnumbering
    
    \medskip
    Commentary finished, but what I want is that the A text numbering continues where it broke off and I would like to set the line number that I saved previously.
    
    \beginnumbering
    \autopar
    \setlinenum{\the\value{lines}}
    Text A Cont
    
    Text AA Cont
    Text A Cont
    
    Text AA Cont
    Text A Cont
    
    Text AA Cont
    Text A Cont
    
    Text AA Cont
    Text A Cont
    
    Text AA Cont
    Text A Cont
    
    Text AA Cont
    
    \endnumbering
\end{document}

相关内容