I am trying to use bookdown to write a report with the final output being a pdf
I have read several sites where there are lots of work arounds using Latex (not my greatest skill to be honest)
I have three things i am trying to accomplish but i think once i get one of them the rest will fall into place. I want to add the abstract above the table of contents. Below is my YAML
When i add the abstract to the YAML in the hope it will go above the contents i get the error
Error in yaml::yaml.load(..., eval.expr = TRUE) :
Scanner error: while scanning a simple key at line 3, column 1 could not find expected ':' at line 4, column 1
Calls: ... parse_yaml_front_matter -> yaml_load ->
Execution halted
This happens when i add other things such as keywords
I have seen the blog post which describes how to get the abstract and thanks in above the contents but i keep getting the same error.
I also looked at a blog post by Ed Berry but was unsure where to actually put the section below in respect to the rest of the markdown document
If you want to add an abstract in a bookdown using pdf_book format, the best think is to add it as its own chapter, unumbered
# Abstract {-}
Text of the asbract
Then I guess you can disable the toc by default and create it using latex command in your document where you want it to be like this
# Abstract {-}
An abstract
\tableofcontents
It would be created after the abstract chapter.
You'll need
output:
bookdown::pdf_book:
toc: false
In your index.Rmd or _output.yml
I let you try, it works in my example with bookdown demo repo
Thanks for the question by the way, it made me look into this to clarify this ! Thanks.
At the end, with pdf it is all latex and you can use any latex tricks to achieve your customisation.
Thanks very much @cderv. After re-installing tinytex and using the code bookdown::render_book("index.Rmd", pdf_book()), I get to where i almost want to be
I would need to put a page break after the title and before the contents to get it spot on but you have shown me where i need to tinker with it. Thanks again for your help and I hope you have a lovely weekend