Replies: 3 comments 2 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am basically trying to do some dynamic documents using quarto and typst. but I am not able to pass colours from R code to typst.
The issue is this:

I have penguins.qmd which is parameterised. The qmd file works as expected and creates a dynamic report which has also some nice colour codes based on the input parameter. But when I use render.R to create reports for all species, everything works except the colour coding. I can’t find a way to do this. Now since i need this report for three species of penguins in my analysis, i can change my params argument in penguins.qmd to generate report. This works as expected as shown below.
The report is also colour coded. Now i can use render.R to generate all reports at once. But the issue is although some contents change when we use this approach some contents do not change. as show below

as can be seen color is still of adelie in side bar. also in header it is still adelie. I guess it is beacause of my template issues. Hope i have made my issue clear!
Github Repo
Beta Was this translation helpful? Give feedback.
All reactions