I'd like for a chapter to appear before the table of contents (but after the title page) in the pdf_book
output of Bookdown
.
One way to do this is to add the chapter to a .tex
file and and link it using before_body:
. However, this means the chapter will not appear in gitbook
(which I also need). I'd prefer not to keep both a .tex
and .Rmd
version of the same chapter.
An ideal solution would be if the chapter could be kept in a .Rmd
file, and its contents extracted into the before_body
for pdf_book
. That way it's still available for gitbook
. Though I'm not sure how I might do that, or indeed if it's possible?
Is there a solution? Or is it exceeding the limits of Bookdown
's flexibility?
Any help would be greatly appreciated, thanks!
\tableofcontents
somewhere in your markdown, and remove it from the pandoc template... – mb21