Closed floriandk closed 7 years ago
So just to make sure we agree: The result I would expect here is that no change is made, as the match is after the line comment:
\documentclass{article}
\usepackage[series={A},nofamiliar,noeledsec,noledgroup]{reledmac}
\begin{document}
\beginnumbering
\pstart
\edtext{A}{\Afootnote{a}}%A
\pend
\endnumbering
\end{document}
Do you agree? I have added a fix that implements this in https://github.com/stenskjaer/samewords/tree/bugfix/issue-12.
Could you test this?
Yes, I agree, everything after the %
should be ignored. In the case of the example above the resulting file should be identical to the input.
(Actually it wouldn't matter too much, if it were marked up, as reledmac
would end up not counting occurences of \sameword{}
after the %
anyway. But I think it is cleaner like it is now.)
But there is a word-boundry-issue. Please consider:
\documentclass[draft]{article}
\usepackage[series={A},nofamiliar,noeledsec,noledgroup]{reledmac}
\begin{document}
\beginnumbering
\pstart
wo% check whether "o" or "ø"
rd
\edtext{word}{\Afootnote{statement}} %A
w% "W" or "w"?
ord
word
\pend
\endnumbering
\end{document}
which is processed to
\documentclass[draft]{article}
\usepackage[series={A},nofamiliar,noeledsec,noledgroup]{reledmac}
\begin{document}
\beginnumbering
\pstart
wo% check whether "o" or "ø"
rd
\edtext{\sameword[1]{word}}{\Afootnote{statement}} %A
w% "W" or "w"?
ord
\sameword{word}
\pend
\endnumbering
\end{document}
but should probably be
\documentclass[draft]{article}
\usepackage[series={A},nofamiliar,noeledsec,noledgroup]{reledmac}
\begin{document}
\beginnumbering
\pstart
\sameword{wo% check whether "o" or "ø"
rd}
\edtext{\sameword[1]{word}}{\Afootnote{statement}} %A
\sameword{w% "W" or "w"?
ord}
\sameword{word}
\pend
\endnumbering
\end{document}
It works fine as long as there are spaces, eg.
\documentclass[draft]{article}
\usepackage[series={A},nofamiliar,noeledsec,noledgroup]{reledmac}
\begin{document}
\beginnumbering
\pstart
my %
phrase
\edtext{my phrase}{\Afootnote{her sentence}} %A
my phrase
\pend
\endnumbering
\end{document}
is marked up correctly.
This branch has another bug. Somehow the 30-words-boundry for checking isn't in place any more:
\documentclass[draft]{article}
\usepackage[series={A},nofamiliar,noeledsec,noledgroup]{reledmac}
\begin{document}
\beginnumbering
\pstart
test
thirtieth
twenty-ninth
twenty-eighth
twenty-seventh
twenty-sixth
twenty-fifth
twenty-fourth
twenty-third
twenty-second
twenty-first
twentieth
nineteenth
eighteenth
seventeenth
sixteenth
fifteenth
fourteenth
thirteenth
twelfth
eleventh
tenth
ninth
eighth
seventh
sixth
fifth
fourth
third
second
first
\edtext{test}{\Afootnote{check}}
first
second
third
fourth
fifth
sixth
seventh
eighth
ninth
tenth
eleventh
twelfth
thirteenth
fourteenth
fifteenth
sixteenth
seventeenth
eighteenth
nineteenth
twentieth
twenty-first
twenty-second
twenty-third
twenty-fourth
twenty-fifth
twenty-sixth
twenty-seventh
twenty-eighth
twenty-ninth
thirtieth
test
\pend
\endnumbering
\end{document}
will still mark-up "test". Putting some hundred words in front and after the \edtext
-command without a match will make it break off:
RecursionError: maximum recursion depth exceeded in comparison
I haven't tested other branches for this problem yet.
First: Thank you for these incredible tests, it is incredibly helpful! I apologize for the delay in getting back to the issues.
I have now solved (I believe) the problem of the handling of comments on the issue 12 branch. I fear that the issue about the 30 words boundary is not particular to this branch, so I will move that to a separate issue.
But if you could find the time at some point to confirm that the comments are handled better now, it would be awesome.
I'm really happy to be able to help! Your script will be very useful to me and you offering it to the public saves me from sorting out issues like these in my (way more hacky) attempts of putting together a script myself. So I am thanking you!
No combination of %
and samewords I could come up with puzzled the script any more. I'd say: solved.
with or without a lb before the
%
results in\sameword{%A}
which obviously doesn't compile in LaTeX.