0

I am using reledmac (actually reledpar, but this does not matter here) for a critical edition.

I have a mainline text, which continues throughout the document, but it is interspersed with comments and with passages from other texts for comparison.

I know I can pause/resume the line numbering for the mainline text with \pausenumbering and \resumenumbering, but I need separate line numbering for the referenced other texts as well.

\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 and \endlock does not work terribly well, plus even if it does work, it does not allow me to have a separate counter for the other interspersed texts.

I can set the line number with \setlinenum or \setline, but how do I reliably get the line number at the end of a block?

1 Answer 1

0

Have you tried saving the last line to a counter? In reledmac, you have the option to execute a command when a given text is typeset (\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .