thebookofshaders/appendix/02/README.md

73 lines
2.2 KiB
Markdown
Raw Normal View History

2016-05-09 10:28:02 +00:00
## How to print this book?
Lets say you dont want to navigate or interact with the examples and you just want a good old fashion text book which you can read on the beach or on your commute to the city. In that case you can print this book.
2017-08-19 10:11:58 +00:00
2016-05-09 10:28:02 +00:00
#### Installing glslViewer
For printing this book you need first to parse it. For that you will need [`glslViewer`](https://github.com/patriciogonzalezvivo/glslViewer) a console shader tool that will compile and transform the shader examples into images.
2016-05-09 10:28:02 +00:00
In **MacOSX** get sure to have [homebrew](http://brew.sh/) installed and then on your terminal do:
```bash
brew install glslviewer
2016-05-09 10:28:02 +00:00
```
On **Raspberry Pi** you need to get [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), a Debian-based Linux distribution made for Raspberry Pi and then do:
2016-05-09 10:28:02 +00:00
```bash
sudo apt-get update
sudo apt-get upgrade
2016-12-13 21:25:58 +00:00
sudo apt-get install git-core glslviewer
2016-05-09 10:28:02 +00:00
```
#### Installing Python 2.7, Latex Engine and Pandoc
2016-05-09 10:28:02 +00:00
For parsing the Markdown chapters into Latex and then into a PDF file we will use Xetex Latex Engine and Pandoc.
In **MacOSX**:
Download and Install MacTeX by:
2017-08-19 10:11:58 +00:00
2016-05-09 10:28:02 +00:00
```bash
brew cask install mactex-no-gui
```
and then install [Pandoc](http://johnmacfarlane.net/pandoc/) and Python 2 by:
```bash
brew install pandoc python@2
2016-05-09 10:28:02 +00:00
```
On **Raspberry Pi** (Raspbian):
2016-05-09 10:28:02 +00:00
```bash
sudo apt-get install texlive-xetex pandoc python2.7
2016-05-09 10:28:02 +00:00
```
#### Compile the book into a pdf and print it
Now that you have all you need, it is time to clone [the repository of this book](https://github.com/patriciogonzalezvivo/thebookofshaders) and compile the book.
For that open your terminal once again and type:
```bash
cd ~
git clone https://github.com/patriciogonzalezvivo/thebookofshaders.git
cd thebookofshaders
make clean pdf
2016-05-09 10:28:02 +00:00
```
2017-08-19 10:11:58 +00:00
If everything goes well, you will see a `book.pdf` file which you can read on your favorite device or print.
#### Compile the book into an epub for use with an e-reader
```bash
cd ~
git clone https://github.com/patriciogonzalezvivo/thebookofshaders.git
cd thebookofshaders
make clean epub
```
The generated `book.epub` can be used directly, or converted to a `.mobi` file for use with Kindle by using a converter, for example Calibre.