quarto-dev / quarto-dev/quarto-cli

Strange bug related to multiple PDF formats with quarto 1.4.429

Open
#7,325 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug latex
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

This is a tough bug (or bugs) to explain, so please bear with me. I have been using Quarto 1.4.429 to deal with the issue reported here https://github.com/quarto-dev/quarto-cli/issues/7267, but I have been noticing some strange regressions where if I render on my Ubuntu 20 machine in rstudio or from the command line specifying to only render to the titlepage-pdf format, then I get incorrect table numbering again, but if I render from the command line letting it render all available formats, including pdf and docx, then the table numbering is correct provided that I specify that the pdf format render to a different filename than the titlepage-pdf format (using the output-file option). On my Ubuntu 22 machine yesterday I was able to render correctly in rstudio without these issues, so the problem is somehow a mix of OS (or pandoc version?) and quarto and multi-format qmd documents.

Unfortunately, I haven't been able to come up with a minimal example that reproduces all of these issues (my actual document is a long paper with lots of moving pieces, so hard to identify which elements are essential). But I have been able to create a minimal example that at least shows that rendering multiple PDF formats from the command-line produces errors (on Ubuntu 20 - not sure if this impacts Ubuntu 22) that seem to be related to interactions between the multiple formats. See example below.

Steps to reproduce

Render from the command line the following document using quarto render test.qmd:

---
title: "Test table numbering"
format: 
  titlepage-pdf: default
  pdf: default
---
Expected behavior

Should render without error.

Actual behavior

Here is the output:

$ quarto render test-table-numbering.qmd
pandoc 
  to: latex
  output-file: test-table-numbering.tex
  standalone: true
  pdf-engine: xelatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf
  
metadata
  block-headings: true
  title: Test table numbering
  
pandoc 
  to: latex
  output-file: test-table-numbering.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: Test table numbering
  

Rendering PDF
running xelatex - 1
  This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Debian) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  
running xelatex - 2
  This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Debian) (preloaded format=xelatex)
   restricted \write18 enabled.
  entering extended mode
  

ERROR: NotFound: No such file or directory (os error 2): open 'test-table-numbering.tex'

Stack trace:
    at async Object.open (ext:deno_fs/30_fs.js:564:15)
    at async processLines (file:///opt/quarto/bin/quarto.js:73760:18)
    at async file:///opt/quarto/bin/quarto.js:73737:9
    at async Object.complete (file:///opt/quarto/bin/quarto.js:70032:37)
    at async Object.onPostProcess (file:///opt/quarto/bin/quarto.js:76403:36)
    at async renderFileInternal (file:///opt/quarto/bin/quarto.js:76387:5)
    at async renderFiles (file:///opt/quarto/bin/quarto.js:76160:17)
    at async render (file:///opt/quarto/bin/quarto.js:81164:21)
    at async Command.fn (file:///opt/quarto/bin/quarto.js:81284:32)
    at async Command.execute (file:///opt/quarto/bin/quarto.js:8111:13)

If I choose to just render a single format (e.g., quarto render test.qmd --to pdf), then the error goes away.

Your environment
  • IDE: RStudio 2023.09.0 Build 463
  • OS: Ubuntu 20.04.6 LTS
  • R version 4.3.1 (2023-06-16)
Quarto check output
$ quarto check
Quarto 1.4.429
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.8: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.4: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.429
      Path: /opt/quarto/bin

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

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

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

[✓] Checking Python 3 installation....OK
      Version: 3.8.10
      Path: /usr/bin/python3
      Jupyter: 4.6.3
      Kernels: python3

(/) Checking Jupyter engine render....Traceback (most recent call last):
  File "/opt/quarto/share/jupyter/jupyter.py", line 21, in <module>
    from notebook import notebook_execute, RestartKernel
  File "/opt/quarto/share/jupyter/notebook.py", line 18, in <module>
    from nbclient import NotebookClient
ModuleNotFoundError: No module named 'nbclient'
[✓] Checking Jupyter engine render....OK

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal test.qmd and run quarto render test.qmd on the reported Ubuntu 20.04 environment, then compare it with quarto render test.qmd --to pdf. Trace the multi-format render around the two pandoc invocations and the missing test-table-numbering.tex; done means both PDF formats render without error and table numbering remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, latex, ubuntu
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.