Incomplete Installation of LaTeX Packages for Language "de-CH"
已经有一个关联 PR 被合并了。
- #516 来自 @cderv —— 已合并
评估
调研方向
先从 TinyTeX 的包安装检测逻辑入手,在全新安装中复现文档中的 de-CH 示例。跟踪 nswissgerman.ldf 如何选择 babel-german,并将其与 de 语言映射进行比较,然后添加一个有针对性的回归测试。完成的标准是自动安装在需要时包含 hyphen-german,并且无需手动安装包即可呈现该示例。
由索引模型根据 Issue 内容生成。
描述
Problem Description
When I render this document with language de-CH in a fresh TinyTeX installation:
---
title: "Untitled"
lang: de-CH
format: pdf
---
```{r}
library(kableExtra)
kbl(mtcars, booktabs = TRUE)
```
the package babel-german is installed automatically as it should be:
finding package for nswissgerman.ldf
> 1 package to install
> installing babel-german (1 of 1)
Still, rendering aborts with the following error:
ERROR:
compilation failed- error
Package babel Error: You haven't defined the language 'ngerman' yet.
(babel) Perhaps you misspelled it or your installation
(babel) is not complete.
Workaround
After installing the package hyphen-german manually with
tinytex::tlmgr_install("hyphen-german")
rendering works.
Expected Behaviour
My understanding is that TinyTeX should automatically install all the required packages for successful rendering. If this is indeed the idea, then I think that for the language de-CH, the package hyphen-german should also be automatically installed such that rendering works without any need for manual installation of LaTeX packages.
Additional Remark
Surprisingly, at least for me, when using the language de, rendering works even when hypen-german is not installed. I have not checked, however, whether hyphenation is correct. Maybe, hypen-german should also be automatically installed in this case?
Session info
I'm rendering the document by pressing "Preview" in Positron, so this is not the session info from the exact session where the rendering took place. I ran this in a fresh R session:
xfun::session_info('tinytex')
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 26.04.1 LTS, Positron 2026.09.1
##
## Locale:
## LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## LC_TIME=de_CH.UTF-8 LC_COLLATE=en_US.UTF-8
## LC_MONETARY=de_CH.UTF-8 LC_MESSAGES=en_US.UTF-8
## LC_PAPER=de_CH.UTF-8 LC_NAME=C
## LC_ADDRESS=C LC_TELEPHONE=C
## LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C
##
## Package version:
## graphics_4.6.1 grDevices_4.6.1 stats_4.6.1 tinytex_0.61.1
## tools_4.6.1 utils_4.6.1 xfun_0.61
##
## LaTeX version used:
## TeX Live 2026 (TinyTeX) with tlmgr 2026-10-02
Checklist
When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:
-
formatted your issue so it is easier for us to read?
-
included a minimal, self-contained, and reproducible example?
-
pasted the output from
xfun::session_info('tinytex')in your issue? -
upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
-
installed and tested your bug with the development version of the tinytex package using
remotes::install_github("rstudio/tinytex")?
- 主要语言
- R
- 星标
- 1.2k
- 派生
- 128
- 平均合并
- 1 小时 12 分钟
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rstudio/tinytex 的其他 Issue
-
Missing hyphenation patterns are not detected when babel loads the language from its .ini file (\babelprovide, provide=*)可能已有人在做 @cderv 于 22 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
[FR] Add `cancel` package to TinyTeX bundle可能重新可做 @cderv 于 305 天前认领,目前没有进行中的 PR。 未关闭
-
难度 3/5 1-2 天 新手友好度 25/100
-
enhancement
难度 5/5 一周以上 新手友好度 20/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
nf-core/nanostring#195 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
bgreenwell/pdp#140 · 1 条评论 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 87/100
-
upkeep
难度 2/5 1-3 小时 新手友好度 64/100
tidyverse/ellmer#1220 · 1 条评论 ·
维护者通常 4 天内回复
-
status:fix-merged
难度 2/5 1-3 小时 新手友好度 76/100
ichirio/rtfreporter#928 ·
维护者通常 1 天内回复