quarto-dev / quarto-dev/quarto-cli

Figure layout does not work properly with format docx

Open
#9,623 6 comments 2 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since May 12, 2024.

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

Description

Bug description

When trying to use multi-figure layout for a docx format output, the subfigures do not end up arranged as expected

Steps to reproduce
---
title: "Figure layout doesn't work properly in quarto >> docx"

format:
  docx:
    toc: false
    number-sections: true
    number-depth: 1
    highlight-style: github
    fig-dpi: 600
---

# Here is a figure layout following the example in the quarto docs closely    

Refer to the figure [[@fig-test]]?  

::: {#fig-test layout="[[-20, 60, -20], [45, -10, 45]]"}

![Patient Summary](IMAGES/fig1.png){#fig-summary}

![Birth History](IMAGES/fig2.png){#fig-birth}

![Gait Development](IMAGES/fig3.png){#fig-dev}

Add to the list of problems trying to use Quarto with MS Word
:::

the figures are ordinary png files
fig1
fig2
fig3

Another "clue" - if I remove the sub-figure references (i.e., {#fig1-summary, etc...} it STILL doesn't work, but it gives a different wrong answer.

Expected behavior

Well, it's an overstatement to say I "expected" it to work like the examples in the docs. After all, I've used quarto with docx format for a while, and have come to learn to expect the unexpected.

But, yeah! I guess I thought it might give me nicely laid out figures.

Actual behavior

Here is the output from the reprex above:

image

Here is the output if I remove the sub-figure references:

image

In some topological sense, I guess it's closer, but on the other hand it is cropping off images.

Other things, linke trying layout-ncol=2 and so on fail in equally "entertaining" ways.

Your environment
  • IDE RStudio
    2023.12.1 Build 402

  • OS Windows 10 Pro
    image

Quarto check output

[>] Checking tools....................OK
TinyTeX: v2023.11
Chromium: (not installed)

[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\Users\mschwartz\AppData\Roaming\TinyTeX\bin\windows
Version: 2023

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

[>] Checking Python 3 installation....OK
Version: 3.11.6
Path: C:/Users/mschwartz/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: (None)

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

[>] Checking R installation...........OK
Version: 4.2.2
Path: C:/PROGRA1/R/R-421.2
LibPaths:
- C:/Users/mschwartz/AppData/Local/R/win-library/4.2
- C:/Program Files/R/R-4.2.2/library
knitr: 1.45
rmarkdown: 2.25

[>] Checking Knitr 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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.