I writing an RMarkdown document and am trying to style it by adding a CSS path file to the YAML header. However, when I try to knit the document, I get a scanner error:
# > Error in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: while parsing a quoted scalar at line 6, column 8 did not find expected hexdecimal number at line 6, column 13
Calls: <Anonymous> ... parse_yaml_front_matter -> yaml_load -> <Anonymous>
Execution halted
Whitespace matters in YAML heading. html_document is nested under output: and so it needs to be preceded by a tab. css is nested under html_document and so it needs yet another tab before it.
Unfortunately, the problem persists even when I apply whitespace like you suggested. It makes me wonder if there is a bug in my CSS stylesheet, but it seems normal to me:
The error you get if from YAML parsing, so this means that your YAML header is probably not indented correctly to add the CSS. This is as @James_Murray shared.
If you get the exact same issue, it means there is still an issue in the YAML formatting that makes the YAML not correctly parsable. YAML needs to respect a specific format to be read.
There is several way to apply CSS to a HTML output format. This is one of them. You could also use a css chunk