Search code examples
rxaringanremarkjs

Name Property in Xaringan Slides


I am probably missing something very obvious, but when creating a new slide in xaringan, what does name do? For example name: setup, or name:usecourse or name:ninja set at the start of the slide?

I can't find references in the custom css so I am really not sure what this is doing.

To see an example of how this is being used: https://github.com/rstudio-education/arm-workshop-rsc2019/blob/master/static/slides/xaringan.Rmd

And the repo where the custom css files live: https://github.com/rstudio-education/arm-workshop-rsc2019/tree/master/static/slides/css


Solution

  • If you name a slide, an id will be appended to the slide. So say now you want to go to the slide named ninja from another slide (within the same presentation) then you can refer to it by [click here](#ninja).

    Also if you append #ninja to your slide URL then it will go directly to that slide, e.g. yourslides.html#ninja.

    You can also use named slides as a template for other slides. E.g.

    name: ninja
    
    Institute Logo (say)
    
    ---
    
    template: ninja
    
    Content to be appended