quarto-dev / quarto-dev/quarto-cli

Plot embedded from Jupyter notebook is not scaled correctly in LaTeX pdf output

Open
#10,520 8 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Sep 9, 2024.

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

Description

Bug description

In newest version of Quarto (1.5) an R plot from Jupyter notebook is not scaled correctly - it runs beyond the right margin of the page.

Steps to reproduce
---
title: "Test"
format:
  pdf:
    documentclass: scrreprt
---

{{< embed test1.ipynb#plot1 >}}

In the notebook there are two cells:

The first one is:

options(repr.plot.res = 600, repr.plot.width = 5.5, repr.plot.height = 2.5)

The second one is:

#| label: plot1
#| fig-cap: Plot of 10 points
plot(1:10, 1:10)
Expected behavior

In older versions of quarto (1.3 and I believe also 1.4) the image was scaled properly, so it fit within the margins.

Actual behavior

The image goes past the right margin.

Your environment

Windows 11

Quarto check output

C:\Users\Ondrej\Desktop\mlbook>quarto check
Quarto 1.5.56
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: 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.56
Path: C:\Users\Ondrej\AppData\Local\Programs\Quarto\bin
CodePage: 1252

[>] Checking tools....................OK
TinyTeX: v2023.09
Chromium: 869685

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

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

[>] Checking Python 3 installation....(None)

  Unable to locate an installed version of Python 3.
  Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK
Version: 4.4.1
Path: C:/PROGRA1/R/R-441.1
LibPaths:
- C:/Users/Ondrej/AppData/Local/R/win-library/4.4
- C:/Program Files/R/R-4.4.1/library
knitr: 1.48
rmarkdown: 2.27

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