Skip to content

Problematic height=\textheight in \includegraphics when #| out-width only is fixedΒ #4612

@EricMarcon

Description

@EricMarcon

Bug description

As mentioned in #2417,

---
title: "Untitled"
format: latex
keep-md: true
---

```{r}
#| label: main-plot
#| out-width: 50%
plot(mtcars)
```

generates the following in LaTeX (as of version 1.2.335, RStudio 2022.12.0 on Windows 11):

\includegraphics[width=0.5\textwidth,height=\textheight]{test_files/figure-latex/main-plot-1.pdf}

In a 2-column document, the figure is not formated as expected: it is wider than its column.

In R Markdown, the same options generated

\includegraphics[width=0.5\textwidth]{test_files/figure-latex/main-plot-1.pdf}

which worked perfectly.

A temporary workaround is to divide the desired width by 2.

So I think height=\textheight should not be added if #| out-height: is not specified in the Quarto file: LaTeX does not need it and it does not allow correct format in 2-column documents.

Thanks!

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfigureslatexLaTeX engines related libraries and technologiespandocverify-fixedAlready fixed, awaiting verification from the issue reporter to confirm.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions