yihui / xaringan

Presentation Ninja 幻灯忍者 · 写轮眼
https://slides.yihui.org/xaringan/
Other
1.5k stars 280 forks source link

Use of an institute/affliation in YAML header #200

Closed paullemmens closed 5 years ago

paullemmens commented 5 years ago

Hi Yihui,

As a little exercise I'm trying to convert our corporate powerpoint template to xaringan. So far mostly successful. However, I'm running into a road bump when trying to introduce an affiliation/institute as part of the title slide. So I know that I can far more profoundly tailor the title slide with seal: false but out of curiosity and learning curve I wanted to do with the YAML header.

---
title: ABC
author: XYZ
institute: DEF
date: today
...
---

This then is placed on the title slide as (formatting irrelevant as an example) like this:

ABC

XYZ
DEF
today

This would then enable me to separately style author and affiliation instead of having to rely on kludges like author: XYX<br>DEF in the YAML.

How do I now get this additional header into the title slide? Can't seem to find a remark template in the package that I would need to add this additional parameter into, like I could/would need to do for instance for an custom built HTML file (based on Rmarkdown).

Would really appreciate a lead/hint how to proceed!

yihui commented 5 years ago

I'll leave this as a tiny exercise to you or anyone interested. You can add the institute info after this line in the default template (hopefully the Pandoc template is simple enough): https://github.com/yihui/xaringan/blob/072fc64d14392937d71218592cc4562d893a4ffd/inst/rmarkdown/templates/xaringan/resources/default.html#L34

And please submit a pull request after you are done. Thanks!

paullemmens commented 5 years ago

I just forked and cloned the repo. Not sure how I've missed that html file ... my bad. On to working on my first pull request!

paullemmens commented 5 years ago

This is the pull request

202

paullemmens commented 5 years ago

Sorry clicked the wrong button; not yet too familiar with github and PR's.

yihui commented 5 years ago

No worries. You did a great job!