0

I want to customize the YAML header for my html output and I found the "YAML Fieldguide". Here are some subheaders listed like:

  • Basic YAML
  • LaTex/PDF Options
  • ...

And I don't know how to use them - for example email and keywords. My problem is, that I haven't found a proper explanation how to use the YAML Fieldguide.

I think I found some appropriate questions on this site like Authors and affiliations in the YAML of RMarkdown but for me it doesn't work...

While my research I also found out, that you have to do a "special" YAML header depending of your desired output (html, pdf, word...). But here I also don't find something like a tutorial or so.

So my question is:

  • Is there anywhere a proper explanation how to use the YAML Fieldguide
  • How to perform your accommodations to your desired output - html, pdf...
  • or at least some hints to this issue

Many thanks in advance!

Here my little code chunk where you see, that email and keywords isn't rendered to html.

# console input
# rmarkdown::render(input="./yourFile.Rmd",output_file="./yourRenderedFile.html")


---
# The YAML header
title: Customize your YAML header
subtitle: like you want
author: tueftla
email: tueftla@tueftla.com
date: "`r format(Sys.time(), '%d.%m.%Y')`"
output: html_document
abstract: "Content of the abstract"
keywords: word_1, word_2
---
tueftla
  • 369
  • 1
  • 3
  • 16
  • As the author of the answer that you linked to: I'd be curious to learn what didn't work for you. What caused you to abolish the approach? – tarleb Oct 12 '20 at 10:53
  • @ tarleb: First I have to confess that I had typing errors... But nevertheless the "institute" doesn't work. And still the keywords don't work - but these you haven't mentioned in your answer. Perhaps it is caused by the different output in the YAML header (html vs word and pdf). Do you have some documents that are describing how to use the YAML Fieldguide? – tueftla Oct 12 '20 at 12:03
  • Sorry, I have no experience with the fieldguide. Looks nice though, so thanks for pointing me to it :) – tarleb Oct 12 '20 at 20:34
  • @ tarleb: And how did you learned to draft the header in the linked answer? – tueftla Oct 13 '20 at 09:18
  • Well, I kind of cheated by writing the whole thing, Lua filter and all. That spared me of having to read my documentation ;) The downside is that I know only about the pandoc side of things; I'm mostly clueless about many things that R Markdown adds on top. It seems that there are conflicting features, which could be why the Lua filter approach isn't working for you. – tarleb Oct 13 '20 at 11:51

1 Answers1

1

If you write it in this way, the email of the author will appear at the beginning:

author: 
  name: tueftla
  email: tueftla@tueftla.com
Edo
  • 7,567
  • 2
  • 9
  • 19
  • @ Edo: thanks for your quick reply! And do you also know how to display "keywords"? And how did you know about putting name and email under the author? – tueftla Oct 12 '20 at 10:23
  • It was a lucky guess.. I tried it and it worked. Don't know about the keywords... sorry :( – Edo Oct 12 '20 at 10:25
  • I guessed also a lot. But not your proposal ;-) – tueftla Oct 12 '20 at 10:29
  • How do you expect those keywords to appear exactly? What should they represent? – Edo Oct 12 '20 at 10:34
  • Like represented in this document https://arxiv.org/pdf/1706.05985.pdf And (I hope it's a proper definition) keywords are telling you what words are of special interest in this text. Perhaps you can derive the topic of this text and decide if it is valuable for you – tueftla Oct 12 '20 at 10:52
  • what about [this](https://stackoverflow.com/questions/42272048/r-markdown-bookdown-how-to-display-keywords-below-an-abstract) ? – Edo Oct 12 '20 at 10:56
  • Here https://stackoverflow.com/questions/43239868/add-blank-line-to-word-output-rmarkdown they are excluding the YAML header in the normal document. I think it's the easiest way?! – tueftla Oct 12 '20 at 11:12