Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#519 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

@cderv đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #520 của @cderv — đã đóng, không merge
  • #522 của @cderv — đang mở
  • #15088 của @cderv — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
latex, r
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
R
Star
1.2k
Fork
128
Merge trung bình
1 giờ 44 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rstudio/tinytex

Tất cả issue của rstudio/tinytex

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.