knitr: fig-width, fig-height and fig-format are silently ignored outside execute: and cell options
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #1045 @cscheid による — マージ済み
評価
調査の方向性
Start in crates/quarto-core/src/engine/knitr/mod.rs at build_format_config, which calls overlay_document_scope in engine/knitr/format.rs. Reproduce with the header example and confirm that fig-width is dropped at top level. Maintainers must first decide whether to honor these keys or warn on them, so ask before coding. Done means the chosen behavior holds for top-level and format: html: placements, and docs/guides/authoring/figures.qmd matches it.
索引モデルが issue の本文から書いたものです。
説明
Problem
fig-width, fig-height and fig-format are silently ignored for knitr documents unless they are under execute: or set on the cell. No warning is emitted, so the figure simply comes out at the defaults (7×5 in, 672×480 px PNG).
docs/guides/authoring/figures.qmd previously told readers to set fig-width and fig-height "in the document header", which leads straight to this.
Reproduction
---
title: t
fig-width: 9
fig-height: 4
fig-format: svg
---
```{r}
plot(1:3)
```
q2 render exits 0 with no warning and produces a 672×480 PNG instead of an SVG.
Results by placement
Tested with q2 0.39.0 and R 4.6.0 on macOS:
| Where the options go | Result |
|---|---|
| Top level of the header | ignored, no warning |
format: html: |
ignored, no warning |
execute: |
works |
Cell #| comments |
works |
Cause
The knitr engine only overlays the execute: scope onto its defaults (build_format_config in crates/quarto-core/src/engine/knitr/mod.rs, which calls overlay_document_scope in engine/knitr/format.rs).
Only knitr was tested; Jupyter's behavior is unknown.
Decision needed
Either honor these options at the top level and under format: <fmt>:, or warn when they appear there.
The docs passage has been corrected locally (not yet committed) to describe the execute: form and to state that the other placements have no effect. That wording would need to change if the options become honored.
- 主要言語
- Rust
- スター
- 293
- フォーク
- 20
- 平均マージ
- 12時間 21分
- マージ済み PR(30日)
- 178
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
quarto-dev/q2 のほかの issue
-
Navbar dropdown menus on the right side are missing `dropdown-menu-end`対応中かも @cscheid が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#1059 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
quarto-dev/q2#1031 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#957 ·
メンテナーはふだん 1 日以内に返信
-
Website headings have no anchor links (the Quarto 1 hover link icon)対応中かも @cscheid が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
quarto-dev/q2#1058 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
quarto-dev/q2#1053 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
nervosnetwork/fiber#1723 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
pbakaus/impeccable#1314 ·
メンテナーはふだん 1 日以内に返信
-
marmite skill: `curl ... | sh` is the first install method, bypassing review and integrity checksオープン
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
rochacbruno/marmite#565 ·