Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Missing hyphenation patterns are not detected when babel loads the language from its .ini file (\babelprovide, provide=*)

Abierto
#519 2 comentarios 0 reacciones 0 asignados Ver en GitHub

@cderv ya está trabajando en esto.

Desde el 16/10/2026.

  • #520 de @cderv — cerrado sin fusionar
  • #522 de @cderv — abierto
  • #15088 de @cderv — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
latex, r
Área
backend

Línea de trabajo

Start with check_babel() and detect_hyphen() in R/latex.R, then compare their handling of the reported .log lines with the existing \@nopatterns warning. Reproduce the supplied \babelprovide example without hyphen-spanish installed and inspect the log; done means detecting the missing patterns and identifying the correct package to install. Open linked pull requests and related issues show this work is already under way.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

When babel loads a language from its .ini file instead of an .ldf file, missing hyphenation patterns produce no warning at all. The document compiles with the patterns of the current language (usually English), and check_babel() has nothing to match.

Tested with TinyTeX (TeX Live 2026, babel v26.13) without hyphen-spanish installed, and the functions from main run on the resulting .log.

\documentclass{article}
\usepackage[english]{babel}
\babelprovide[import]{spanish}
\begin{document}
\foreignlanguage{spanish}{Hola}
\end{document}

This compiles (exit 0) with pdflatex, xelatex and lualatex. The only trace in the log is an Info line:

Package babel Info: Importing data for 'spanish'
(babel)             from babel-es.ini. Reported on input line 3.
Package babel Info: Hyphen rules for 'spanish' set to \l@english
(babel)             (\language0). Reported on input line 3.

The same happens without any \babelprovide in the document, using the provide=* option:

\documentclass[spanish]{article}
\usepackage[provide=*]{babel}
\begin{document}
Hola
\end{document}

For both logs, check_babel() returns FALSE and detect_hyphen() returns nothing.

https://github.com/rstudio/tinytex/blob/872c51e3e40b6b37a156c89cd5f4b15d200c773f/R/latex.R#L427-L431

This is how babel works on purpose. When a language is set up from its .ini file, babel looks for patterns with the hyphenrules key, then with the hyphenrules value of the .ini file, and if none is found it uses the current \language (from \bbl@provide@hyphens in babel.sty v26.13):

  \bbl@ifunset{l@#1}%
    {\ifnum\@tempcnta=\m@ne
       \bbl@carg\adddialect{l@#1}\language
     \else
       \bbl@carg\adddialect{l@#1}\@tempcnta
     \fi}%

\adddialect writes the Hyphen rules for ... set to ... Info line, and nothing else. The .ldf files use \@nopatterns instead, which gives the No hyphenation patterns were preloaded warning that check_babel() already handles.

We can't just match Hyphen rules for 'X' set to \l@english, because the same Info line is in every log for the dialects defined in english.ldf:

Package babel Info: Hyphen rules for 'canadian' set to \l@english
(babel)             (\language0). Reported on input line 102.
Package babel Info: Hyphen rules for 'australian' set to \l@ukenglish
(babel)             (\language6). Reported on input line 105.

The fallback line comes right after the Importing ... data for 'X' from babel-<code>.ini line for the same language, while the dialect lines don't. We could use this pair to detect the missing patterns, but the pair is also there when the patterns are found under another name. With \usepackage[english]{babel} and \babelprovide[import]{<name>}, and only hyphen-english, hyphen-french and hyphen-german installed:

Package babel Info: Importing data for 'canadianfrench'
(babel)             from babel-fr-CA.ini. Reported on input line 3.
Package babel Info: Hyphen rules for 'canadianfrench' set to \l@french
(babel)             (\language8). Reported on input line 3.

Package babel Info: Importing data for 'austrian'
(babel)             from babel-de-AT.ini. Reported on input line 3.
Package babel Info: Hyphen rules for 'austrian' set to \l@ngerman-x-2024-02-28
(babel)             (\language5). Reported on input line 3.

Package babel Info: Importing data for 'mexican'
(babel)             from babel-es-MX.ini. Reported on input line 3.
Package babel Info: Hyphen rules for 'mexican' set to \l@english
(babel)             (\language0). Reported on input line 3.

Only the last one is missing patterns (hyphen-spanish). So two questions remain I think:

  • How to tell the fallback from a found pattern ? The target being the current \language (here \l@english, the main language) seems the only difference in the log.
  • Which package to install ? The name is a babel locale name (mexican), not a name from language.dat, so hyphen_pkgs() and the map from #517 would give hyphen-mexican, which doesn't exist. The hyphenrules value in the .ini files could be a better source for this map.

Quarto also has a check for Hyphen rules for 'X' set to \l@nil (added for quarto-dev/quarto-cli#8684) that tinytex doesn't have, and it does not catch the case above. It would be good to have one detection in both.

Related: #516, #517, #518

Lenguaje dominante
R
Estrellas
1.2k
Forks
128
Merge medio
1 h 44 min
PR fusionados (30 d)
3

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rstudio/tinytex

Todos los issues de rstudio/tinytex

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.