I still lose all formatting when copy-pasting code from the pdfs being generated. Why does that need to be a problem? Eg from page 47:
---
title: "An Impressive Book"
author: "Li Lei and Han Meimei"
output:
bookdown::gitbook:
lib_dir: assets
split_by: section
config:
toolbar:
position: static
bookdown::pdf_book:
keep_tex: yes
bookdown::html_book:
css: toc.css
documentclass: book
---
https://bookdown.org/yihui/bookdown/bookdown.pdf