Incomplete Installation of LaTeX Packages for Language "de-CH"

已关闭 适合新手
#515 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

已经有一个关联 PR 被合并了。

  • #516 来自 @cderv —— 已合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
latex, r
领域
tooling

调研方向

先从 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rstudio/tinytex 的其他 Issue

查看 rstudio/tinytex 的全部 Issue

相似的 Issue

更多 R Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。