[XeTeX] polyglossia hyphenation questions: lonely words, punctuation, etc.
Aleksandar Zec
zealeksanman at gmail.com
Mon May 17 21:55:29 CEST 2010
2010/5/16 <enrico.gregorio at univr.it>:
>> 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.
Thank you very much for the explanations. So -- polyglossia doesn't
alter these basic rules. Also, \allowhyphens is what I needed.
Best regards,
Aleks
More information about the XeTeX
mailing list