4 ms·
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 Impre
by nonbel 10y ago
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 https://bookdown.org/yihui/bookdown/bookdown.pdf
- yihui 10y agoBecause PDF is for printing purposes. There could be many many problem if you copy and paste from PDF (white spaces being eaten, ligatures, curly quotes, en/em-dashes, ...; almost as bad as Word, except that PDF is beautiful). So don't copy from PDF, but from HTML instead. HTML is much more faithful in terms of preserving characters.
- nonbel 10y agoSo it is just an inherent limitation of pdfs? That's too bad, for some reason I find the html format less intuitive.