maieul / ledmac

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

hyphenation rules not applied to lemma in a language other than the default language with polyglossia #699

Open ppasedach opened 7 years ago

ppasedach commented 7 years ago

I am looking at some Overfull \hboxes, trying to understand why hyphenation is not applied. See the two examples:

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{english}
\usepackage{reledmac}
\Xarrangement{paragraph}

\begin{document}
\beginnumbering
\pstart

This is \edtext{some}{\Afootnote{Some stuff to fill up the line: XXXXXXXXXXXXXXXXXXXXXXXXXX}} text for \edtext{testing}{\Afootnote{Is this hyphenated?}} purposes.

\pend
\endnumbering
\end{document}

selection_019

\documentclass{article}
\usepackage{polyglossia}
\setdefaultlanguage{german}
\setotherlanguage{english}
\usepackage{reledmac}
\Xarrangement{paragraph}

\begin{document}
\beginnumbering
\pstart
\begin{english}
This is \edtext{some}{\Afootnote{Some stuff to fill up the line: XXXXXXXXXXXXXXXXXXXXXXXXXX}} text for \edtext{testing}{\Afootnote{Is this hyphenated?}} purposes.
\end{english}
\pend
\endnumbering
\end{document}

selection_020

In the first one English is the default language, and the lemma "testing" is hyphenated. In the second example I switched the default language to German, but wrapped my text in an english environment, such that the text should be hyphenated according to the rules for English. They apparently are not applied: Hyphenation does not occur here. If I add another X in my line-filling-up-string on the left side of it, I get the hyphenation "tes-ting" which is valid new German hyphenation (We had an orthography reform some years back).

Some more testing suggested that the hyphenation rules for "other" languages are not applied in the apparatus, but one can get them to work, for example using the \textenglish{} command, but I have not found a way to get it to work for the lemma, neither by explicitly switching the first argument of the \edtext command to english, nor by using a separate \lemma{} command.

maieul commented 7 years ago

I think you should try with the language environment around the \beginnumbering…\endnumbering

ppasedach commented 7 years ago

Unfortunately it's the same. Hyphenation according to default language, as far as I can see.

maieul commented 7 years ago

Ok. I see the problem. Idealy, I should associate language with footnote automatically, but is complex and I have no time.

But you can add

\Xwraplemma{\textenglish}
\Xwrapcontent{\textenglish}

To your preamble

ppasedach commented 7 years ago

O.k., that seems to be doing it for the moment.