Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#519 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@cderv がすでに取り組んでいます。

2026年10月16日 から。

  • #520 @cderv による — マージされずにクローズ
  • #522 @cderv による — オープン
  • #15088 @cderv による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
latex, r
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
R
スター
1.2k
フォーク
128
平均マージ
1時間 44分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rstudio/tinytex のほかの issue

rstudio/tinytex の issue をすべて見る

似ている issue

R の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。