bookdown adding abstract before the table of contents

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.

Hope it helps.

2 Likes