quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.98k stars 328 forks source link

When setting lang to ja-JP in Beamer, it attempts to install non-existent LaTeX packages, causing rendering to fail. #11256

Open ujtwr opened 4 weeks ago

ujtwr commented 4 weeks ago

Bug description

---
title: "Untitled"
format:
  beamer:
    pdf-engine: lualatex
    lang: ja-JP
---

## Quarto

あいうえお

When rendering this qmd file, an error occurs with the following message. Although it shows a permission issue here, even attempting installation as root fails because the specified LaTeX package does not exist."

> 1 package to install > installing hyphen-japanese (1 of 1) ERROR: [non-error-thrown] tlmgr returned a non zero status code You don't have permission to change the installation in any way, specifically, the directory /usr/local/texlive/2024/tlpkg/ is not writable. Please run this program as administrator, or contact your local admin. tlmgr: An error has occurred. See above messages. Exiting.

Steps to reproduce

Render qmd file bellow:

---
title: "Untitled"
format:
  beamer:
    pdf-engine: lualatex
    lang: ja-JP
---

## Quarto

あいうえお

Expected behavior

No response

Actual behavior

No response

Your environment

RStudio Server: 2024.09.0+375 on Ubuntu 24.04.1 Client: Windows11 + chrome Quarto: 1.5.57 (bundled with RStudio) Latex: texlive2024 (the latest version today)

Quarto check output

Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.57
      Path: /usr/lib/rstudio-server/bin/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/local/bin
      Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.3
      Path: /tmp/RtmpdepXB2/rstudio/terminal/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.4.1
      Path: /usr/lib/R
      LibPaths:
        - /home/nishide/R/x86_64-pc-linux-gnu-library/4.4
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.48
      rmarkdown: 2.28

[✓] Checking Knitr engine render......OK
TomBener commented 4 weeks ago

It seems this bug is similar to the scenario that happened to Chinese https://github.com/quarto-dev/quarto-cli/issues/10291

cscheid commented 3 weeks ago

I believe @TomBener is correct, and we need the analogous fix to https://github.com/quarto-dev/quarto-cli/commit/7b5c2477d12c84a0ddc9ca11e6b492cdac21f616

But, more generally, I subscribe to the "there's only three numbers in software engineering: 0, 1, and infinity" theory. So I don't believe this is only needed for simplified chinese and japanese; other writing systems probably need addressing as well, and we should come up with a more general fix.

cderv commented 3 weeks ago

So I don't believe this is only needed for simplified chinese and japanese; other writing systems probably need addressing as well, and we should come up with a more general fix.

Totally. We just need a way to know which one needs it or which don't. Or we just need to revert the feature in a way that we don't try to install it automatically and let user do it if there is a real problem.

I'll compare with tinytex R package because we don't have this issue, and probably because we don't try to install automatically a package if we detect this hyphen message in the log file.

winniehell commented 3 weeks ago

there is a list of languages that support hypenation at https://github.com/hyphenation/tex-hyphen/blob/master/data/language-codes/tex-languages.txt

maybe that helps

cderv commented 3 weeks ago

Definitely helpful ! This can be a good base for us, to only try installing for one of those known packages