-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YAML confusion in parametric document when Python and R are used together #10103
Comments
I realized it is mainly because when R chunks are included engine becomes |
As explained in the documentation, you cannot use two engines.
Note that Quarto/Pandoc expect the metadata YAML block to be the first thing in the document (even if Pandoc allows multiple YAML block that are then merged together). Also note that title is used for several things that occur early in the process. To me there is no bug here. |
Side question: why changing the metadata using computational parameters while you can directly change the metadata in the CLI? (See |
I do not want to use two engines. But I would expect the parametric YAML behavior to stay the same because the engine switch is automatic. It is not actually a bug, but an undesired consequence of automatic engine switching. But I had only two options when reporting an issue 🙃 |
My current settings and habits are different but I'll keep it in mind. I did not think it would be possible to change title from the CLI. |
As answered, set the engine yourself: Quarto only uses |
Ah, I did not know a space between "#" and "|" would make such a difference. 💡 Then it solves my issue. |
I’m reopening as there might be something that could be done related to |
If we need to allow this for knitr engine in Quarto context, I think we can do that. but I did not know we supported |
It was done because Python formater such as Black would break the cell every time if it was not supported. |
Bug description
I was preparing a parametric document where title changes with respect to some parameters. I was able to do so with only python code blocks. But when I add an R code block, regardless of the position, the outcome is not desirable. It just shows the yaml as a simple code block, not actual title/subtitle etc.
Steps to reproduce
ps. Remove the R chunk to get a proper render.
Expected behavior
It should work normally and display title and author.
Actual behavior
When R chunk is included it does not display anything but codeblocks with only the title
Your environment
VSCode Version: 1.90.0 (Universal)
Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573
Date: 2024-06-04T19:34:44.157Z (2 wks ago)
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 22.1.0
Apple M1 Max
MacOS Ventura 13.0.1
Quarto check output
Quarto 1.4.555
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.4.555
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: Installation From Path
Path: /opt/homebrew/bin
Version: undefined
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.11.6
Path: /Users/rocket/.pyenv/versions/3.11.6/bin/python3
Jupyter: 5.7.1
Kernels: python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........OK
Version: 4.3.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
knitr: 1.43
rmarkdown: 2.24
[✓] Checking Knitr engine render......OK
The text was updated successfully, but these errors were encountered: