3

I use polyglossia with LuaLaTeX.

Sometimes I get a warning like that, in strange places (beginning of the document, or \tableofcontents...):

Package polyglossia Warning: totalhyphenmin:'5' on input line 21.

Can someone figure out, why, or how to do in order to avoid such warnings?

A perhaps interesting detail: I’m preparing a small package to typeset books in Spanish or Italian. If I compile the same text with main language = italian, I don’t get any warning; with spanish, I do.

EDIT: as suggested by egreg, here a MWE:

\documentclass{memoir}
\usepackage{polyglossia}
\setmainlanguage{spanish}
\setotherlanguage{latin}% otherwise polyglossia complains about lipsum text

\usepackage{lipsum}

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

By compiling with LuaLaTeX, I get the warning: Package polyglossia Warning: totalhyphenmin:'5' on input line 8.

With \setmainlanguage{italian} instead of Spanish, the warning disappears. The warning disappears also if I let \setmainlanguage{spanish} but compile with XeLaTeX. (Helas, I must use LuaLaTeX for other reasons...)

NEW EDIT: perhaps this can have something to do with my issue: https://github.com/reutenauer/polyglossia/issues/111

1 Answers1

4

I see this code in polyglossia.sty

   \ifluatex
     % Set \totalhyphenmin if specified
     \prop_get:NxNTF \polyglossia@langsetup {#2/totalhyphenmin} \l_tmpa_tl
     {
        \xpg@warning{totalhyphenmin: '\l_tmpa_tl'}
        \expandafter\hyphenationmin \l_tmpa_tl%
     }%
     {}%

so when totalhyphenmin is set by a language you get the warning. Indeed, we find

\PolyglossiaSetup{spanish}{
  bcp47=es-ES,
  hyphennames={spanish},
  hyphenmins={2,2},
  totalhyphenmin=5,
  langtag=ESP,
  frenchspacing=true,
  indentfirst=true,
  fontsetup=true,
  babelname=spanish
}

in gloss-spanish.ldf.

Quite likely, whoever added the code mistook \xpg@warning for \xpg@info: one doesn't want the user to be warned about something the package developers deliberately used.

I added a comment to the relevant GitHub issue report

egreg
  • 1,121,712