quarto-dev / quarto-cli

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

compilation failed - error Undefined control sequence. l.227 \pandocbounded #10682

Closed yurivict closed 2 months ago

yurivict commented 2 months ago

Bug description

$ quarto render hello.qmd --to pdf

Executing 'hello.quarto_ipynb'
  Cell 1/1: 'fig-polar'...Done

pandoc 
  to: latex
  output-file: hello.tex
  standalone: true
  pdf-engine: xelatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf

metadata
  documentclass: scrartcl
  classoption:
    - DIV=11
    - numbers=noendperiod
  papersize: letter
  header-includes:
    - '\KOMAoption{captions}{tableheading}'
  block-headings: true
  title: Quarto Basics
  jupyter: python3

Rendering PDF
running xelatex - 1
  This is XeTeX, Version 3.141592653-2.6-0.999996 (Web2C 2024) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode

updating tlmgr

updating existing packages
ERROR: 
compilation failed- error
Undefined control sequence.
l.227 \pandocbounded
                    {\includegraphics[keepaspectratio]{hello_files/figure-pd...

see hello.log for more information.

Steps to reproduce

n/a

Expected behavior

No response

Actual behavior

No response

Your environment

No response

Quarto check output

$ quarto check Quarto 1.6.9 [✓] Checking versions of quarto binary dependencies... Pandoc version 3.3.0: OK

mcanouil commented 2 months ago

@yurivict Please follow the guidelines provided when opening an issue. We unfortunately can't use your report.

Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? The goal is to make it as easy as possible for us to recreate your problem so that we can fix it: please help us help you! Thanks.


You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````). See https://quarto.org/bug-reports.html#small-is-beautiful-aim-for-a-single-document-with-10-lines.

If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.

RPython
`````md ````qmd --- title: "Reproducible Quarto Document" format: html engine: knitr --- This is a reproducible Quarto document. {{< lipsum 1 >}} ```{r} x <- c(1, 2, 3, 4, 5) y <- c(1, 4, 9, 16, 25) plot(x, y) ``` ![An image]({{< placeholder 600 400 >}}){#fig-placeholder} {{< lipsum 1 >}} The end after @fig-placeholder. ```` ````` `````md ````qmd --- title: "Reproducible Quarto Document" format: html engine: jupyter --- This is a reproducible Quarto document. {{< lipsum 1 >}} ```{python} import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5] y = [1, 4, 9, 16, 25] plt.plot(x, y) plt.show() ``` ![An image]({{< placeholder 600 400 >}}){#fig-placeholder} {{< lipsum 1 >}} The end after @fig-placeholder. ```` `````

Additionally and if not already given, please share the output of quarto check within a code blocks (i.e., using three backticks ```txt), see https://quarto.org/bug-reports.html#check.

tuncbkose commented 2 months ago

I have encountered the same error with using quarto render file.qmd --to pdf on

# Test

![](file.png)

It looks to me like the \pandocbounded function added to pandoc on 3.2.1 is not defined in some step of the rendering.

Error is given on:

Quarto 1.5.55
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.1: OK
      Dart Sass version 1.58.3: 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.55
      Path: /.../micromamba/envs/quarto/bin

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

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

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.5 (Conda)
      Path: /.../micromamba/envs/quarto/bin/python
      Jupyter: 5.7.2
      Kernels: python3, julia-1.10

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

but with downgrading everything is ok:

Quarto 1.4.557
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.12: OK
      Dart Sass version 1.58.3: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.557
      Path: /.../micromamba/envs/quarto/bin

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

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

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.5 (Conda)
      Path: /.../micromamba/envs/quarto/bin/python
      Jupyter: 5.7.2
      Kernels: python3, julia-1.10

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
mcanouil commented 2 months ago

Please upgrade your Quarto CLI to the latest stable version. Also your example is not reproducible as the file does not exist.

Note that I cannot reproduce using latest 1.5 or 1.6 pre-release.

---
title: "Quarto Playground"
format: pdf
---

This is a playground for Quarto.

{{< lipsum 1 >}}

![An image]({{< placeholder 600 400 >}}){#fig-placeholder}

Edit: Quarto 1.5.57 does not embed Pandoc 3.2.1, but 3.2.0 (I am not aware of a Pandoc downgrade in 1.5). This means you have a bad install of Quarto which suggest you did not install it via any of the assets provided by Quarto but very likely using a third party provider.

mcanouil commented 2 months ago

The development version and 1.6 pre-release embeds Pandoc 3.2.0. So @yurivict is also using a non-standard install since it depends on Pandoc 3.3. Quarto is not responsible of this and actually cannot do anything if you decide to use non-validated dependencies.

tuncbkose commented 2 months ago

Alright. But for what its worth (and perhaps for reference to other people encountering the same thing), what I described above applies to installing via conda-forge. Also for the example given, any image file results in the same behavior, just thought it would be redundant to specify.

mcanouil commented 2 months ago

Then the conda-forge recipe (not maintained by Quarto) is doing something wrong. The recipe should enforce the dependencies used/validated in Quarto, see https://github.com/quarto-dev/quarto-cli/blob/main/configuration.

Edit: probably better to report the issue on the conda force quarto repo: https://github.com/conda-forge/quarto-feedstock/issues

cderv commented 2 months ago

FWIW conda-forge recipe is there: https://github.com/conda-forge/quarto-feedstock

It seems it is not embedding the right version somehow if this happens. Though it is reading from the right configuration file.

Let's move the issue there.

mcanouil commented 2 months ago

The configuration file in Quarto allows Pandoc to be any patch version though. It's currently set to 3.2, meaning 3.2.1 is valid but actually not tested/validated in Quarto. Is it on purpose? https://github.com/quarto-dev/quarto-cli/blob/main/configuration#L14

cderv commented 2 months ago

I am not sure to follow your comment. I think it based on wrong assumption for our it work for Quarto.

The configuration file is not something following some versioning spec. It is used by Quarto to know which deps to install and we only need the version to fill our value so that we download from the right url, and the release tag on github is correctly 3.2.

3.2.1 is not valid. Quarto 1.5 and current 1.6 prerelease only works with Pandoc 3.2 only.

It is probably what is happening in conda feedstock: it is not correctly converting this value to a specific version for it to be used during conda installation. It is up to the tool using quarto's configuration file to do the right thing.

cderv commented 2 months ago

I have commented about the problem there. Let's close here!

Thank you for the report.

mfisher87 commented 2 months ago

Thanks all, this is really useful info!

It is probably what is happening in conda feedstock: it is not correctly converting this value to a specific version for it to be used during conda installation. It is up to the tool using quarto's configuration file to do the right thing.

This sounds correct. Between 1.4 and 1.5, it seems that the number of digits used to pin pandoc in configuration changed, and so our expression used to calculate the runtime dependency on pandoc stopped producing a valid output. I think we have a solution over in the feedstock issue https://github.com/conda-forge/quarto-feedstock/issues/58, but would like someone to check my work :)

mcanouil commented 2 months ago

I am not sure to follow your comment. I think it based on wrong assumption for our it work for Quarto.

The configuration file is not something following some versioning spec. It is used by Quarto to know which deps to install and we only need the version to fill our value so that we download from the right url, and the release tag on github is correctly 3.2.

3.2.1 is not valid. Quarto 1.5 and current 1.6 prerelease only works with Pandoc 3.2 only.

It is probably what is happening in conda feedstock: it is not correctly converting this value to a specific version for it to be used during conda installation. It is up to the tool using quarto's configuration file to do the right thing.

So Pandoc does not use the full version number ... that is confusing and inconsistent.

cderv commented 2 months ago

So Pandoc does not use the full version number ... that is confusing and inconsistent.

@mcanouil Pandoc follows Haskell PVP for its version numbering. This is different than SemVer where it must be X.Y.Z.

Note that pandoc uses the Haskell Package Versioning Policy. Version numbers should be understood as EPOCH.MAJOR.MINOR.PATCH.

It seems this policy does not make the C part of A.B.C to be mandatory when this is 0. So 3.2 is perfectly valid and consistent with this policy. In Haskell world, it seems common https://hackage.haskell.org/packages/browse

It has been a discussion in PVP to make that more clear in there policy

@mfisher87 thanks I'll have a look.

mcanouil commented 2 months ago

Thanks @cderv it makes "sense".

mfisher87 commented 2 months ago

I was confused about that as well, thanks for the context!