Missing hyphenation patterns are not detected when babel loads the language from its .ini file (\babelprovide, provide=*)
@cderv ya está trabajando en esto.
Desde el 16/10/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
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 fromlanguage.dat, sohyphen_pkgs()and the map from #517 would givehyphen-mexican, which doesn't exist. Thehyphenrulesvalue in the.inifiles 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
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rstudio/tinytex
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
question
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
[FR] Add `cancel` package to TinyTeX bundleQuizá libre de nuevo @cderv la tomó hace 289 días y no hay ningún pull request abierto. Abierto
-
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Todos los issues de rstudio/tinytex
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Tests error instead of skipping when optional packages (ecmwfr, jsonvalidate) or BETY database are unavailablePosiblemente ocupada @madhavzanwar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PecanProject/pecan#4179 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Huber-group-EMBL/Rarr#261 ·
Los mantenedores suelen responder en 1 día