quarto-dev / quarto-dev/quarto-cli

Warn when layouts will produce nested figure environments

Open
#13,030 6 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Jul 2, 2025.

article-layout enhancement latex layout lint
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

I'm having an issue with extra divs for html formatting causing extra figure environments to be created in latex output. I think this is similar to this issue https://github.com/quarto-dev/quarto-cli/issues/4142

I'm have some qmd that generates some wide figures that I've used divs to stretch across the screen. I'm also trying to generate a pdf, but the divs cause an extra figure environment to be created and result in this error.

I basically created this problem for myself by deciding to go back and create pdf output from existing source qmd files that I made for web page generation, so I have a lot of them and I would appreciate a suggestion to reuse code like this for both html and pdf.

Steps to reproduce

Quarto render this file

---
title: testcase
format:
  pdf:
    keep-tex: true
  html: default
---


## Test 

:::::{.column-screen-inset-right}

:::{layout-ncol=3}

![image 1]({{< placeholder 400 200 format=png >}})

![image 2]({{< placeholder 400 200 format=png >}})

![image 3]({{< placeholder 400 200 format=png >}})

:::

:::::

Actual behavior

This is the error generated.

ERROR: 
compilation failed- error
LaTeX Error: Not in outer par mode.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.182 
       

see test.log for more information.

Expected behavior

Would like to avoid the extra figure environment that causes the error.

Your environment
  • IDE: text editor - emacs 30.1
  • OS: Ubuntu: 20.04
Quarto check output
Quarto 1.7.32
[✓] Checking environment information...
      Quarto cache location: /home/apn/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.7.32
      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 Chrome Headless....................OK
      Using: Chrome found on system
      Path: /usr/bin/google-chrome
      Source: PATH

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.1
      Path: /home/apn/sw/bin/python3
      Jupyter: (None)

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

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

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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.