Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maelle/bspagedjs
Playing with bookdown::bs4_book() and pagedjs-cli to get both HTML and PDF book out of the same Rmd products.
https://github.com/maelle/bspagedjs
Last synced: about 1 month ago
JSON representation
Playing with bookdown::bs4_book() and pagedjs-cli to get both HTML and PDF book out of the same Rmd products.
- Host: GitHub
- URL: https://github.com/maelle/bspagedjs
- Owner: maelle
- Created: 2020-11-04T12:53:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-05T15:01:05.000Z (about 4 years ago)
- Last Synced: 2024-10-11T18:24:10.945Z (2 months ago)
- Language: TeX
- Homepage: https://maelle.github.io/bspagedjs/intro.html
- Size: 433 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - maelle/bspagedjs - Playing with bookdown::bs4_book() and pagedjs-cli to get both HTML and PDF book out of the same Rmd products. (TeX)
README
# Book PDF without LaTeX? :sunglasses:
This is a minimal example of a book based on R Markdown and **bookdown** (https://github.com/rstudio/bookdown).
## Result
* [HTML](https://maelle.github.io/bspagedjs/index.html)
* [PDF](https://maelle.github.io/bspagedjs/result.pdf)## Context
This uses the `bs4_book()` template for HTML and then for getting a PDF
* tweaks of the HTML and merging of all chapters
* some print CSS, see [stylesheet](style.css)
* pagedjs-cli.See [build.R](build.R)
Why use this and not LaTeX?
* procrastination? :see_no_evil:
* not having to redefine colors, environments for the LaTeX output
* not having to knit the same Rmd's twice for the two outputs (which also excludes using pagedown).Why not pagedown?
* I want a non paginated HTML in the browser, and I want the PDF to be pre-generated.
## What's needed?
* dev bookdown and co to use `bs4_book()`
* a stylesheet with print CSS
* mathjax without loading messages see [mathjax.html](mathjax.html) (or no mathjax if your book does not feature equations)So in `_output.yml` e.g.
```yaml
bookdown::bs4_book:
theme:
bootswatch: "litera"
primary: "#982a31"
fg: "#2b2121"
bg: "#ffffff"
repo: https://github.com/maelle/bspagedjs
css: style.css
mathjax: NULL
includes:
in_header: mathjax.html
```* pagedjs-cli (locally, or using GitHub Actions)