anyone-can-cook / rclass1

EDUC 260A: Introduction to Programming and Data Management Using R
https://anyone-can-cook.github.io/rclass1/
5 stars 5 forks source link

Issue with knitting to pdf? #101

Open ElizabethFlores1 opened 11 months ago

ElizabethFlores1 commented 11 months ago

I am not able to knit to pdf ps2 and I don't understand why. This is the code that I am using for my yaml section:

title: "Problem Set #2" author: "Elizabeth Flores" date: "October 9, 2023" urlcolor: blue output: pdf_document toc: true number_sections: true

and I am getting a scanner error when I press knit for line 6 which is the output: pdf_document line:

Error in yaml::yaml.load(..., eval.expr = TRUE) : Scanner error: mapping values are not allowed in this context at line 6, column 6 Calls: ... parse_yaml_front_matter -> yaml_load -> Execution halted

I'd appreciate any help trying to solve this!

jpbishop commented 11 months ago

I'm not getting an error, but the formatting looks odd. What's the code before the title, Elizabeth? Here's my code:

`--- output: pdf_document: default html_document: default


title: "Problem Set #2" author: "Joseph Bishop" date: "October 11, 2023" urlcolor: blue output: pdf_document ---toc: true ---toc_depth: 2 ---number_sections: true


knitr::opts_chunk$set(echo = TRUE)
jpbishop commented 11 months ago

Perhaps you need the dashes? Mine isn't right.

ElizabethFlores1 commented 11 months ago

I added the dashes:

---toc: true ---number_sections: true

and it did knit to pdf now! However it did not put a table of contents in the pdf :(