# polyglossia with italian: orphan and widow problem

I encounter a problem when I load polyglossia with italian as default language. \clubpenalty = 10000 \widowpenalty = 10000 \displaywidowpenalty = 10000 do not prevent orphans and widows. The problem dissapears when I load german or english as default language. I use also the \setspace package and I suspect that this may cause the problem. But I have no idea why.

In the mini example the problem appears with an oprhan line at the end of page 8.

\documentclass[a4paper,twoside,10pt,openany]{book}

\usepackage[no-math]{fontspec}

\usepackage{setspace}
\setstretch{1,1}

\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{italian}
\setmainfont[Mapping=tex-text]{Linux Libertine}

\usepackage{lipsum}
\setlipsumdefault{1-55}

\clubpenalty = 10000
\widowpenalty = 10000
\displaywidowpenalty = 10000
\raggedbottom{}

\begin{document}
\lipsum{}
\end{document}

• The language file explicitly reset the penalties to smaller values. @egreg will perhaps know why. (babel's italian does it too). – Ulrike Fischer May 31 '17 at 14:48
• Using infinite penalty for avoiding club and widow lines is not a good method. – egreg May 31 '17 at 14:51
• @egreg, that is, you would recommend manual page-breaks? – sschron May 31 '17 at 14:54
• @sschron I recommend looking at the output and decide case by case: hiding the dirt under the carpet is not the best cleaning strategy. A well placed \enlargethispage is much more effective for taking care of clubs or widows. – egreg May 31 '17 at 14:57

Using book with \raggedbottom is not a good choice, in my opinion.

Also, using infinite penalty for avoiding club and widow lines should be reserved to automatized typesetting, where you have no time or possibility to examine each page with care.

Anyway, you can patch the language selection command to get what you ask for.

\documentclass[a4paper,twoside,10pt,openany]{book}

\usepackage[no-math]{fontspec}

\usepackage{setspace}
\setstretch{1,1}

\usepackage{polyglossia}
\setdefaultlanguage{italian}
\setmainfont{Linux Libertine O}

\makeatletter
\patchcmd\blockextras@italian{3000}{10000}{}{}
\patchcmd\blockextras@italian{3000}{10000}{}{}
\patchcmd\blockextras@italian{3000}{10000}{}{}
\makeatother

\usepackage{lipsum}
\setlipsumdefault{1-55}

\raggedbottom

\begin{document}
\lipsum{}
\end{document}


Don't load xltxtra: it adds nothing generally useful. Also Mapping=tex-text should be Ligatures=TeX, but can be omitted because it's the default.