maieul / ledmac

package reledmac for latex
http://www.ctan.org/tex-archive/macros/latex/contrib/reledmac
54 stars 28 forks source link

Nested samewords inside apparatus not counted #771

Open stenskjaer opened 6 years ago

stenskjaer commented 6 years ago

Version of reledmac / reledpar (if that is a devellopement version, please precise the branch)

2.26.11

Does the problem happens both in parallel typesetting and normal typesetting?

Description of the problem

I would expect this to be solved by #767, but it seems not to be the case. When you have two words that are nested inside each an \edtext{}{}, and the combination of two words is also found outside the edtext, it does not seem to count the multi word sameword as I would expect. This is occasioned by a problem in the samewords app: https://github.com/stenskjaer/samewords/issues/31#issuecomment-394979510

Minimal Working Example

\documentclass{scrartcl}

\usepackage[series={A},nofamiliar,noeledsec,noledgroup,draft]{reledmac}

\begin{document}

\beginnumbering
\pstart
\sameword{\sameword{aa} bb}
\edtext{
  cc
  \edtext{%
    \sameword[2]{\edtext{\sameword[3]{aa}}{\Afootnote{AA \emph{X}}}
      bb
    }
  }%
  {\Afootnote{BB AA \emph{Y}}}%
}%
{\lemma{cc–bb}\Afootnote{\emph{Ø}}}.
\pend
\endnumbering

\end{document}

This results in this apparatus:

1 ccbb]
1 aa² bb] BBAAY 
1 aa² ] AAX

I would expect this:

1 ccbb]
1 aa² bb²] BBAAY 
1 aa² ] AAX

This is also not perfect, of course, because the "aa² bb²" would be a consequence of both the "aa" and the "aa bb" being wrapped in each their sameword (which are then nested). This is therefore also an unsatisfying solution, but I'm really at a loss about how this could be done in another good way.

What I would however prefer, would be this:

1 ccbb]
1 aa bb²] BBAAY 
1 aa² ] AAX

But I know that this is technically difficult to achieve. And maybe my feeling about this is off...

Maybe @floriandk has an opinion about it?

floriandk commented 6 years ago

Also I would prefer "aa bb²] BBAAY" mainly because this is how I know it from manually typeset editions. But this is obviously complicating the already pretty complicated sameword-annotations even more and it will only affect very few instances in an edition.

Also while being a bit redundant "aa² bb²] BBAAY" is correct and intuitively comprehensible and there might even be editors/readers who'll prefer this style. Therefore I'd suggest to leave this problem for now, at least until single-word-samewords are working completely. If you ask me, other issues that have surfaced, especially #768 , would be far more important to solve if possible.

If and when Maïeul decides to tackle this challenge anyway at a later point I could imagine either:

stenskjaer commented 6 years ago

All right, I must admit that your suggested low-tech solution has a very immediate appeal, as it sounds pretty simple. And if the automatic samewords script is used, it would be an easy switch to give to determine which style the user would prefer.

However, that would only solve the problem when a \lemma{} is given explicitly, as you can then switch off the printing of the number manually. And it would therefore not solve the solution in this example. The solution of the editor could of course then be to create a \lemma{}.

Of course the world I am striving towards is one where you would never have to think about or change your tex source to solve sameword disambiguation problems. But maybe my wish is too naive.