Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\lemma with n-dash #13

Closed
floriandk opened this issue Aug 1, 2017 · 10 comments
Closed

\lemma with n-dash #13

floriandk opened this issue Aug 1, 2017 · 10 comments
Milestone

Comments

@floriandk
Copy link

In our typographical tradition it is the usual that the abbreviated part in \lemma is denoted by dashes, sometimes n-dashes, sometimes m-dashes, sometimes with spaces on their sides, sometimes without – but hardly ever \ldots.
Would it be possible to add this to the code so that

\documentclass{article}

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

\begin{document}

\beginnumbering
\pstart
\edtext{B}{\Afootnote{del.}}
\edtext{F}{\Afootnote{del.}}
\edtext{B C D E F}{\lemma{B--F}\Afootnote{b c d e f}}
\edtext{B}{\Afootnote{bb}}
\edtext{F}{\Afootnote{ff}}
\pend
\endnumbering


\end{document}

would be annotated to display the apparatus unambiguously?

If this is tricky, I can quite easily get by by redefining \ldots. In this case I'd suggest that you add to the readme that \ldots is required to get the \lemma annotated correctly ... it took me quite some time to realise what the problem was ;)

@stenskjaer
Copy link
Owner

This should be pretty simple. I will get on to it as soon as possible. Maybe tonight, maybe tomorrow. I think I might also want to add an option for defining other "span symbols".

@stenskjaer
Copy link
Owner

I have pushed a suggestion for a solution to this. Please see branch https://github.com/stenskjaer/samewords/tree/issue-13.

This adds the ability to include a configuration file where any custom ellipsis patterns can be written.

I have already included your suggested different types of dashes, so they will always be taken into consideration. But it is also possible to declare custom patterns with the config file.
See the README (https://github.com/stenskjaer/samewords/tree/issue-13#configuration-file) for how the config file works.

Can you confirm if that works at your end?

@floriandk
Copy link
Author

I can confirm that it works out of the box for -, -, --, --, ---, ---, , , and . Great!

Also customisation via json (eg. for ) works well.

I couldn't get it to process the pattern "\\,–\\," though, but this is probably because \, isn't a word-boundry in samewords and I think it shouldn't be either. So I guess it's better to let this lie.

@stenskjaer
Copy link
Owner

Thank you.

I'm not quite sure I understand how you wanted to test "\\,-\\,". When I add that pattern as an ellipsis pattern and test this string \edtext{A B C D E}{\lemma{A ,-, E}\Afootnote{A Vat.}}, it correctly identifies ",-," as an ellipsis pattern. Was that not what you would expect?

@floriandk
Copy link
Author

The idea was to put thin space (LaTeX \, = 0.16667em) on both sides of the dash. But this is not priority for me at all.

@stenskjaer
Copy link
Owner

stenskjaer commented Sep 23, 2017

Well that actually works too. The only thing is that comma is a meta-character in regex too, so both the backslash and the comma need to be escaped. This creates this regex pattern: \\\\,-\\\\,. It's not pretty, but it works.

I have added a note about this to the readme of this branch.

EDIT: I have added the example to the sample_config file

@floriandk
Copy link
Author

I am not familiar with python's specific RegEx flavour, but are you sure about comma being a meta character outside of {}?

At least I cannot get it to work:

\documentclass{article}

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

\begin{document}

\beginnumbering
\pstart
\edtext{\sameword[1]{B}}{\Afootnote{del.}}
\edtext{\sameword[1]{F}}{\Afootnote{del.}}
\edtext{B C D E F}{\lemma{B\,--\,F}\Afootnote{b c d e f}}
\edtext{\sameword[1]{B}}{\Afootnote{bb}}
\edtext{\sameword[1]{F}}{\Afootnote{ff}}
\pend
\endnumbering


\end{document}

with

  "ellipsis_patterns": [
    "\\\\,-+\\\\,"
  ],

gives me

\pstart
\edtext{\sameword[1]{B}}{\Afootnote{del.}}
\edtext{\sameword[1]{F}}{\Afootnote{del.}}
\edtext{B C D E F}{\lemma{B\,--\,F}\Afootnote{b c d e f}}
\edtext{\sameword[1]{B}}{\Afootnote{bb}}
\edtext{\sameword[1]{F}}{\Afootnote{ff}}
\pend

which is obviously incorrect.

But as said earlier, this isn't a case that is bothering me too much.

@stenskjaer
Copy link
Owner

This was a very interesting problem. This had to do with how the word segmentation system works. It didn't take the TeX spacing macros into consideration, so that's why this didn't work when you actually used them correctly (as you do in the example).

I have pushed some changes that I believe solve the problem. Agree?
It should be possible to use any TeX spacing command (as defined on p. 339 of The TeX Book).

@stenskjaer stenskjaer added this to the 0.2.0 milestone Jan 27, 2018
@stenskjaer
Copy link
Owner

The whole underlying system has been completely rewritten. According to all my tests, this as working as it's supposed to now.

@floriandk
Copy link
Author

Is the rewritten code you mention included in the vers. 0.2.7 branch "issue-19"? Testing any ellipsis marker, with or without calling the json file give me an incorrect result, e.g. the one from the top gives:

\documentclass{article}

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

\begin{document}

\beginnumbering
\pstart
\edtext{\sameword[1]{B}}{\Afootnote{del.}}
\edtext{\sameword[1]{F}}{\Afootnote{del.}}
\edtext{\sameword{B} C D E \sameword{F}}{\lemma{B--F}\Afootnote{b c d e f}}
\edtext{\sameword[1]{B}}{\Afootnote{bb}}
\edtext{\sameword[1]{F}}{\Afootnote{ff}}
\pend
\endnumbering


\end{document}

instead of

\documentclass{article}

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

\begin{document}

\beginnumbering
\pstart
\edtext{\sameword{B}}{\Afootnote{del.}}
\edtext{\sameword{F}}{\Afootnote{del.}}
\edtext{\sameword[1]{B} C D E \sameword[1]{F}}{\lemma{\sameword{B}--\sameword{F}}\Afootnote{b c d e f}}
\edtext{\sameword{B}}{\Afootnote{bb}}
\edtext{\sameword{F}}{\Afootnote{ff}}
\pend
\endnumbering


\end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants