From 1a640f64953829f410859b7417984c179a3cce70 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 1 Sep 2025 15:34:45 +0200 Subject: [PATCH 1/5] Add failing test --- tests/docs/smoke-all/2025/09/01/12732.qmd | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/docs/smoke-all/2025/09/01/12732.qmd diff --git a/tests/docs/smoke-all/2025/09/01/12732.qmd b/tests/docs/smoke-all/2025/09/01/12732.qmd new file mode 100644 index 0000000000..034717660c --- /dev/null +++ b/tests/docs/smoke-all/2025/09/01/12732.qmd @@ -0,0 +1,24 @@ +--- +title: "The erroneous search for ngerman.ldf " +format: + pdf: + documentclass: lni + pdf-engine: pdflatex +_quarto: + tests: + pdf: + noErrors: default +--- + +```{r} +#| label: setup +#| echo: false +# this test should auto install those package +if (tinytex::check_installed("babel-german")) { + tinytex::tlmgr_remove("babel-german") +} +``` + +# MWE + +lorem ipsum \ No newline at end of file From cf639a403bb47a20f7bd57c813f6353f71f37732 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 1 Sep 2025 15:35:54 +0200 Subject: [PATCH 2/5] fix - regex for latex log should exclude newlines too to get the filename right --- src/command/render/latexmk/parse-error.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/render/latexmk/parse-error.ts b/src/command/render/latexmk/parse-error.ts index d58e3ef785..ca577e1f5c 100644 --- a/src/command/render/latexmk/parse-error.ts +++ b/src/command/render/latexmk/parse-error.ts @@ -270,7 +270,7 @@ const packageMatchers = [ { regex: /.* Loading '([^']+)' aborted!.*/g }, { regex: /.*! LaTeX Error: File `([^']+)' not found.*/g }, { regex: /.* file ['`]?([^' ]+)'? not found.*/g }, - { regex: /.*the language definition file ([^ ]+) .*/g }, + { regex: /.*the language definition file ([^\s]*).*/g }, { regex: /.* \\(file ([^)]+)\\): cannot open .*/g }, { regex: /.*file `([^']+)' .*is missing.*/g }, { regex: /.*! CTeX fontset `([^']+)' is unavailable.*/g }, From 574cd4ac5899f1bb20d1c60903debc820971d713 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 1 Sep 2025 17:35:36 +0200 Subject: [PATCH 3/5] add unit test for multiline log --- tests/unit/latexmk/parse-error.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/unit/latexmk/parse-error.test.ts b/tests/unit/latexmk/parse-error.test.ts index 3888c636e4..7da758cef0 100644 --- a/tests/unit/latexmk/parse-error.test.ts +++ b/tests/unit/latexmk/parse-error.test.ts @@ -35,6 +35,12 @@ unitTest("Detect missing files with `findMissingFontsAndPackages`", async () => assertFound("! LaTeX Error: File `framed.sty' not found.", "framed.sty"); assertFound("/usr/local/bin/mktexpk: line 123: mf: command not found", "mf"); assertFound("or the language definition file ngerman.ldf was not found", "ngerman.ldf"); + assertFound(`Package babel Error: Unknown option 'ngerman'. Either you misspelled it + (babel) or the language definition file ngerman.ldf + (babel) was not found. + (babel) There is a locale ini file for this language. + (babel) If it’s the main language, try adding \`provide=*' + (babel) to the babel package options.`, "ngerman.ldf") assertFound("!pdfTeX error: pdflatex (file 8r.enc): cannot open encoding file for reading", "8r.enc"); assertFound("! CTeX fontset `fandol' is unavailable in current mode", "fandol"); assertFound('Package widetext error: Install the flushend package which is a part of sttools', "flushend.sty"); From fc21c13a71089f200622ff951c6db76610096fd5 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 1 Sep 2025 17:38:51 +0200 Subject: [PATCH 4/5] Add to changelog --- news/changelog-1.8.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/news/changelog-1.8.md b/news/changelog-1.8.md index 9a29702b2f..390412fdc7 100644 --- a/news/changelog-1.8.md +++ b/news/changelog-1.8.md @@ -62,6 +62,10 @@ All changes included in 1.8: - ([#12775](https://github.com/quarto-dev/quarto-cli/issues/12775)): Convert Quarto-native layouts (divs with `layout` syntax) to Beamer columns, equivalent to using the Pandoc-native syntax of div with `columns` and `column` classes. +### `pdf` + +- ([#12732](https://github.com/quarto-dev/quarto-cli/issues/12732)): Correctly detect missing definition files in multiline babel error for search package to auto-install. + ### `hugo-md` - ([#12676](https://github.com/quarto-dev/quarto-cli/issues/12676)): Add support for rendering layout panels that are not floats. From 86141357bc88390c7d61b13b9f431205e41534cb Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Mon, 1 Sep 2025 17:41:42 +0200 Subject: [PATCH 5/5] Revert "Add failing test" This reverts commit 1a640f64953829f410859b7417984c179a3cce70. currently lni package is not compatible with Pandoc included LaTeX package --- tests/docs/smoke-all/2025/09/01/12732.qmd | 24 ----------------------- 1 file changed, 24 deletions(-) delete mode 100644 tests/docs/smoke-all/2025/09/01/12732.qmd diff --git a/tests/docs/smoke-all/2025/09/01/12732.qmd b/tests/docs/smoke-all/2025/09/01/12732.qmd deleted file mode 100644 index 034717660c..0000000000 --- a/tests/docs/smoke-all/2025/09/01/12732.qmd +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "The erroneous search for ngerman.ldf " -format: - pdf: - documentclass: lni - pdf-engine: pdflatex -_quarto: - tests: - pdf: - noErrors: default ---- - -```{r} -#| label: setup -#| echo: false -# this test should auto install those package -if (tinytex::check_installed("babel-german")) { - tinytex::tlmgr_remove("babel-german") -} -``` - -# MWE - -lorem ipsum \ No newline at end of file