-
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
|
Accessibility: To improve accessibility, please add alternative text to your screenshots. This helps all users, including those using screen readers, to understand the context of the images. A brief description can make a big difference! See Good Alt Text, Bad Alt Text — Making Your Content Perceivable. |
Beta Was this translation helpful? Give feedback.
-
|
Parameters are for computations as already stated in your previous issue, they are not metadata, so you cannot do as So use actual metadata such as top level "species" and generate that metadata in your code. ```{r}
#| output: asis
#| echo: false
cat(sprintf("\n\n---\nspecies: %s\n---\n\n", params[["species"]]))
```In the future, please share small example and don't use ---
title: "Penguins"
format:
typst:
template-partials:
- typst-show.typ
- typst-template.typ
params:
species: Adelie
engine: knitr
---
```{=typst}
#v(-1em)
*#text(size: 1.6em)[`{r} params[["species"]]`]*
``` |
Beta Was this translation helpful? Give feedback.
-
|
Thanks a lot. Just one clarification. The ```{r} |
Beta Was this translation helpful? Give feedback.
-
|
For anyone searching for this: Regarding using parameters for execution as Pandoc's metadata to be used in a document, a lua filter, or a template, you need to explicitly pass them. This is not done automatically. You can pass them all, or some of them. See the latest article in Quarto R 📦 : quarto-dev.github.io/quarto-r/articles/dynamic-metadata.html#advanced-use-case-conditional-content-based-on-parameters |
Beta Was this translation helpful? Give feedback.
-
|
I had solved this problem already. But little curious. How would you pass the meta variable from quarto to typst template? |
Beta Was this translation helpful? Give feedback.
-
|
Perfect!! Thanks for the clarification
…On Fri, 7 Nov 2025 at 3:25 PM, Christophe Dervieux ***@***.***> wrote:
I am not sure to understand the cat() question.
Let me try to explain differently in a generic way.
-
In quarto params field in YAML is not passed to Pandoc. It is only
used to define some default parameters for knitr. Jupyter engine does not
use this syntax. This is all explained at
https://quarto.org/docs/computations/parameters.html
-
params object is only accessible in computations. It won't be written
anywhere to be passed to later processing by Pandoc in Quarto workflow. So
if as any computation value, if it needs to be used later for a Lua filter
or a Pandoc's template, it needs to be passed to Pandoc processing step.
-
Metadata are a way to pass information to Lua filter in Pandoc, and
they are also used as variables for pandoc's template. Defining metadata is
done using YAML either in main header block, or later in the document.
Using YAML block syntax
---
key: value
key2:
- value1
- value2
key3:
subkey: value3
---
-
So for passing from R to Pandoc, one needs to write such block. Either
using inline computation
---
key: `{r} var_from_R`
---
or using write_yaml_meta_data() help that will write this block for
you.
I hope this clarify. Understanding the mechanism will let you adapt to
what you want to do. And maybe the cat thing fits in there.
Hope it helps
—
Reply to this email directly, view it on GitHub
<#13339 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APQKHSZVIVYCLIFJLKM6CCD33RUBHAVCNFSM6AAAAACFZYD2ZGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIOJQGA4DGOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.


For anyone searching for this:
Regarding using parameters for execution as Pandoc's metadata to be used in a document, a lua filter, or a template, you need to explicitly pass them. This is not done automatically. You can pass them all, or some of them.
See the latest article in Quarto R 📦 : quarto-dev.github.io/quarto-r/articles/dynamic-metadata.html#advanced-use-case-conditional-content-based-on-parameters