Skip to content

Can I use R variables in quarto YAML? #1391

Closed
@giabaio

Description

@giabaio

I may be missing something obvious, but I would like to do that. I'm working on a quarto slide presentation (formatted in revealjs) and I have defined a bunch of objects in the params variable in my YAML

---
...
params:
   title: "My title"
   author: Gianluca Baio
   date: 27 November 2022
   institute: "[My work](Their website)"
   conference: "Where I'm speaking"
   location: "What town"
...
---

HERE GOES THE REST OF MY SLIDES

What I would like to do is to use the elements of params to feed to the footer that I want to use for the slides, something like

...
format: 
   revealjs:
      footer: `r params$author` | `r params$title` | `r params$date`

but it seems like I can't use the

`r command`

tag inside the yaml, as it returns an error

bad indentation of a mapping entry at line 9, column 10:
       footer: `r params$author`

Like I said, it's possible I am not doing this right --- but can anyone explain why and how I can do it instead?

Thanks
Gianluca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions