[XeTeX] polyglossia hyphenation questions: lonely words, punctuation, etc.

enrico.gregorio at univr.it enrico.gregorio at univr.it
Sun May 16 21:25:07 CEST 2010


> Hello XeTeX list,
> 
> Consider this example (results shown in the attached png). My questions:
> a. the word "территориальное" is not hyphenated in (0) but it is in (1); why?
> 
> b. the same word is not hyphenated in (3); is the reason the same here
> or the presence of "(" and ")" somehow stops hyphenation?
> 
> c. is there a way to be sure thay any punctuation character (dot, --,
> ---, :, etc.) doesn't stop hyphenation? hyphenat package provides this
> for dash (-) only through \hyp{} command.
> 
> d. regarding the previous question, what is the right way to get
> (5)--(6) hyphenated before and after "--"?
> 
> \documentclass[12pt,twoside]{report}
> \usepackage{polyglossia}
> \setmainlanguage{russian}
> \setmainfont[Mapping=tex-text]{Minion Pro}
> \begin{document}
> \fbox{
> \begin{minipage}{2cm}
>  0.\par
>  территориальное\par
>  1.\par
>  текст текст территориальное\par
>  2.\par
>  текст текст территориальное.\par
>  3.\par
>  (территориальное)\par
>  4.\par
>  текст текст
>  (территориальное)\par
>  5.\par
>  административно--территориальное.\par
>  6.\par
>  (административно--территориальное)\par
>  7.\par
>  (административно--территориальное).
> \end{minipage}
> }
> \end{document}

TeX (and XeTeX) doesn't hyphenate the first word in a paragraph, nor any
"word" where there's already an explicit hyphen, past that hyphen. Putting
\hspace{0pt} before the problematic part cures the problem.

Probably a macro such as babel's \allowhyphens might be a good solution:

\providecommand{\allowhyphens}{\nobreak\hspace{0pt}}

You wouldn't want a break at the explicit hyphen, would you? The
\nobreak ensures this. Thus

\allowhyphens административно--\allowhyphens территориальное.\par

will do.

Ciao
Enrico

--
Enrico Gregorio          + Dipartimento di Informatica          + Tel: +39 045 8027937
Enrico.Gregorio at univr.it + Università degli Studi di Verona     +
(gregorio at math.unipd.it) + Strada le Grazie 15 / I-37134 Verona + Fax: +39 045 8027928



More information about the XeTeX mailing list