Skip to content
Snippets Groups Projects
Unverified Commit 0606e66c authored by Chris Holdgraf's avatar Chris Holdgraf Committed by GitHub
Browse files

:books: DOCS: instructions for custom CSS in printing HTML PDFs (#1031)

parent 4183d73c
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,24 @@ for a potential fix, and [this Jupyter Book issue](https://github.com/executable
where we're tracking the issue.
:::
### Control the look of PDF via HTML
Because you are using HTML as an intermediary for your book's PDF, you can control the look and feel of the HTML via your own CSS rules. Most CSS changes that you make to your HTML website will also persist in the PDF version of that website. For information about how to define your own CSS rules, see [](custom-assets).
To add CSS rules that **only apply to the printed PDF**, use the `@media print` CSS pattern to define print-specific rules. These will *only* be applied when the HTML is being printed, and will not show up in your non-PDF website.
For example, to **hide the right table of contents** at print time, you could add this rule:
```scss
@media print {
.bd-toc {
visibility: hidden;
}
}
```
The right Table of Contents would be present in your live website, but hidden when someone printed a PDF of your website.
(pdf/latex)=
## Build a PDF using LaTeX
......
......@@ -100,6 +100,7 @@ Simple is better than complex. 😵
```
````
(custom-assets)=
## Custom CSS or JavaScript
If you'd like to include custom CSS rules or JavaScript scripts in your book,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment