We are preparing a critical edition with reledmac. For some of the texts, we provide a collation.
The relevant critical notes (\Afootnote) provide:
first, the last word common to all witnesses, as a catchword – this we put into \lemma;
then, the variants, which we enter into \Afootnote proper.
Each variant starts with the catchword again.
The problem: This way, we have to repeat the catchword manually for each new witness. We would like to automate the process (and maybe make it customizable along the way, add nice props around the catchword, f.i. \textbullet~#1\enskip).
Is there a way to temporarily store the argument of \lemma and repeat it at will (within one footnote)?
This information should be specific to each footnote – the next footnote will have a different \lemma argument.
I have tried, to no avail, to define a new command \repeatlemma;
I made a conditional \ifinfoot that is true iff within a footnote (using \Xwrapcontents);
but then I got lost in the complicated hook system of reledmac.
Here's a MWE:
\documentclass{article}
\usepackage[series={A},noend,nofamiliar,noeledsec]{reledmac}
\Xarrangement[A]{paragraph}
\Xnolemmaseparator[A]
\Xinplaceoflemmaseparator[A]{0.5em}
\begin{document}
\beginnumbering
\pstart
%
Lorem ipsum dolor,
%
\edtext{quod erat demonstrandum.}{%
\lemma{quod}\Afootnote{% % \lemma prints "quod" in the apparatus
erat demonstrandum \textit{A}\quad % 1st witness
%
%\repeatlemma\ % should print "quod" again
quod % this would be made superfluous by \repeatlemma
demonstrandum est \textit{B}}} % 2nd witness
%
\pend
\endnumbering
\end{document}
And here's the desired output if \repeatlemma was implemented (an example from our latest volume):

For consistency reasons,
it would be great if this didn't require
a new, dedicated series of Xfootnotes,
or a new user-level command (\AfootnoteCollation),
but rather if we could stick to the usual \Afootnote;
we're OK with hacking the definition of Xfootnote or modifying some other internals, though.
Any help would be appreciated.
(In case it is relevant: we always write the argument of \lemma{} explicitly, we don't let it inherit argument #1 of \edtext{}.)
\edtext{#1}{\lemma{#2}\Afootnote{#3}}. To "nest" a footnote is to put another\edtext{...\Afootnote{...}}into arg #1, right? But the command I'm looking for would print #2, which is the direct argument of \lemma{}, and not arg #1. So there would be no overlap with the other footnote, right?Also, FWIW: in a critical footnote, we always write
– marquinho Mar 25 '21 at 22:01\lemma{}, even if we leave it empty (for style reasons). So in our case, #2 never defaults to #1 (arg #1 of \edtext). So if \repeatlemma prints #2, it should be safe.- one contening the default lemma
- second contening both the overriding lemma and the footnote, as specific macro
– Maïeul Mar 26 '21 at 10:12