Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Hyphenation detection misses the documented dehyph-exptl usage, and maps Swiss German (1901) to hyphen-swiss

Aperta
#518 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
latex, r
Ambito
tooling

Direzione di ricerca

Start in R/latex.R, where check_babel(), detect_hyphen() and hyphen_pkgs() match babel and hyphsubst log messages, and add patterns for the two dehyph-exptl messages quoted in the issue. For the Swiss German case, the fix depends on a maintainer choice: either map swiss to hyphen-german in hyphen_pkgs() (outside the generated R/hyphen.R), or map the full babel-german descriptions. Done means the new log strings are matched in tests, and the maintainer has confirmed which mapping to use.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up to #516 and #517. While porting the same logic to quarto-cli (quarto-dev/quarto-cli#15035), I tested the hyphenation detection against real LaTeX logs and found two cases that don't work.

All tests below use TinyTeX without dehyph-exptl installed, xelatex, and the functions from main (check_babel(), detect_hyphen(), hyphen_pkgs()) run on the resulting .log.

1. The documented ways to use dehyph-exptl are not detected

#517 maps ngerman-x-latest and the other pinned names to dehyph-exptl, but this only works when babel raises You haven't defined the language 'ngerman-x-latest' yet. This happens with \selectlanguage{ngerman-x-latest} or \begin{hyphenrules}{ngerman-x-latest}, which is not how the dehyph-exptl documentation (section 2.2.2 of dehyph-exptl.pdf) says to use these patterns. It documents two ways, and neither is detected.

With babel:

\documentclass{article}
\usepackage[ngerman]{babel}
\babelprovide[hyphenrules=ngerman-x-latest]{ngerman}
\begin{document}
Silbentrennung Donaudampfschifffahrtsgesellschaft.
\end{document}

This compiles, but with the default patterns, and only gives a warning:

Package babel Warning: Requested 'hyphenrules' for 'ngerman' not found:
(babel)                ngerman-x-latest.
(babel)                Using the default value. Reported on input line 3.

With hyphsubst:

\documentclass{article}
\usepackage[ngerman=ngerman-x-latest]{hyphsubst}
\usepackage[ngerman]{babel}
\begin{document}
Silbentrennung Donaudampfschifffahrtsgesellschaft.
\end{document}

This one fails:

! Package hyphsubst Error: Unknown pattern `ngerman-x-latest'.

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

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

https://github.com/rstudio/tinytex/blob/872c51e3e40b6b37a156c89cd5f4b15d200c773f/R/latex.R#L454-L458

We could match these two messages and pass the name through hyphen_pkgs() like the others. The hyphsubst error is fatal, so it would go with detect_hyphen(). The babel warning doesn't fail the compilation, so it would go with check_babel().

I have not checked yet that installing dehyph-exptl is enough for these documents to then use the patterns (the format needs to be rebuilt with the new language.dat entries).

2. Swiss German with the 1901 spelling gives hyphen-swiss

hyphen_pkgs() keeps only the first word of the language name, for messages like the language `German (current orthography)' .

https://github.com/rstudio/tinytex/blob/872c51e3e40b6b37a156c89cd5f4b15d200c773f/R/latex.R#L434-L447

These descriptions come from babel-german, which passes a description instead of a pattern name to \@nopatterns. All of them start with German, except the ones for Swiss German with the 1901 spelling, in babel-german.def:

\@nopatterns{Swiss Standard German (1901 orthography) and German (1901 orthography)}
...
\@nopatterns{Swiss Standard German (1901 orthography),
             falling back to German (1901 orthography)}

So with this warning

Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language 'Swiss Standard German (1901 orthography) and German (1901 orthography)' into the format.

check_babel() tries to install hyphen-swiss, which doesn't exist in TeX Live. The swissgerman patterns are in hyphen-german.

We could map swiss to hyphen-german in hyphen_pkgs(), or map the full babel-german descriptions to their package instead of keeping the first word. The first way is simpler, but swiss is not a name from texlive.tlpdb, so it would need to stay outside the generated R/hyphen.R.

Once this is decided here, I'll follow the same logic in quarto-cli.

Lingua principale
R
Stelle
1.2k
Fork
128
Merge medio
1h 44m
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rstudio/tinytex

Tutte le issue di rstudio/tinytex

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.