mirror of
https://github.com/hmemcpy/milewski-ctfp-pdf.git
synced 2024-09-11 22:37:13 +03:00
Adding build instructions
This commit is contained in:
parent
74aaf0f8f8
commit
ee1617e437
39
README.md
39
README.md
@ -8,15 +8,46 @@ Category Theory for Programmers
|
|||||||
|
|
||||||
This is an *unofficial* PDF version of "Category Theory for Programmers" by Bartosz Milewski, converted from his [blogpost series](https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/).
|
This is an *unofficial* PDF version of "Category Theory for Programmers" by Bartosz Milewski, converted from his [blogpost series](https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Conversion is done by scraping the blog with [Mercury Web Parser](https://mercury.postlight.com/web-parser/) to get a clean HTML content, modifying and tweaking with [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/), finally, converting to LaTeX with [Pandoc](https://pandoc.org/). See [scraper.py](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/master/src/scraper.py) for additional information.
|
Conversion is done by scraping the blog with [Mercury Web Parser](https://mercury.postlight.com/web-parser/) to get a clean HTML content, modifying and tweaking with [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/), finally, converting to LaTeX with [Pandoc](https://pandoc.org/). See [scraper.py](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/master/src/scraper.py) for additional information.
|
||||||
|
|
||||||
**Note**: this is a work in progress! Please [report](https://github.com/hmemcpy/milewski-ctfp-pdf/issues) any formatting/content issues, or better yet, send a PR!
|
Please [report](https://github.com/hmemcpy/milewski-ctfp-pdf/issues) any formatting/content issues, or better yet, send a PR!
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
*For macOS Users:* The Inconsolata LGC and Linux Libertine fonts are not included in MacTex. You need to install them separately. Download the Inconsolata LGC fonts [here](https://github.com/MihailJP/Inconsolata-LGC/downloads) and the Linux Libertine fonts [here](http://sourceforge.net/projects/linuxlibertine/files/linuxlibertine/5.3.0/LinLibertineOTF_5.3.0_2012_07_02.tgz/download). To install the fonts system-wide, move all the downloaded `.otf` files into the `/Library/Fonts` folder. After completing these tasks, continue with the instructions below.
|
||||||
|
|
||||||
|
The `src` directory contains the LaTeX sources. To recompile the book, go there and enter:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make
|
||||||
|
```
|
||||||
|
|
||||||
|
The file `preamble.tex` contains all the configuration and style declarations.
|
||||||
|
|
||||||
|
Chances for successful compilation are increased if you have almost complete installation of recent [TeX Live](https://www.tug.org/texlive/) distribution (the PDF here is compiled with 2017 release). The needed OpenType fonts must be installed in the operating system. You also need [Inkscape](https://inkscape.org/en/download/mac-os/) to recreate image PDFs from SVGs.
|
||||||
|
|
||||||
|
To remove all the generated PDFs and auxiliary files in the whole `src` tree:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ make clean-all
|
||||||
|
```
|
||||||
|
|
||||||
|
**Tip**: you can use a utility like [entr](http://entrproject.org/) to run a command after any `*.tex` file changes, e.g.:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ls **/*.tex | entr make
|
||||||
|
```
|
||||||
|
|
||||||
|
This will monitor all the `*.tex` files for changes, and will execute the `make` command if any of them changes. This speeds up development significantly, as you can freely modify any of the files, and get almost instant feedback!
|
||||||
|
|
||||||
Acknowledgements
|
Acknowledgements
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
PDF source and the tools to create it are based on the work by Andres Raba et al., available here: https://github.com/sarabander/sicp-pdf.
|
PDF LaTeX source and the tools to create it are based on the work by Andres Raba et al., available here: https://github.com/sarabander/sicp-pdf.
|
||||||
The book content is taken, with permission, from Bartosz Milewski's blogpost series, and adapted to the Texinfo/LaTeX format.
|
The book content is taken, with permission, from Bartosz Milewski's blogpost series, and adapted to the LaTeX format.
|
||||||
|
|
||||||
Thanks to the following people for contributing corrections/conversions:
|
Thanks to the following people for contributing corrections/conversions:
|
||||||
|
|
||||||
@ -27,4 +58,4 @@ License
|
|||||||
|
|
||||||
The PDF book, `.tex` files, and associated images and figures in directories `src/fig` and `src/content` are licensed under Creative Commons Attribution-ShareAlike 4.0 International License ([cc by-sa](http://creativecommons.org/licenses/by-sa/4.0/)).
|
The PDF book, `.tex` files, and associated images and figures in directories `src/fig` and `src/content` are licensed under Creative Commons Attribution-ShareAlike 4.0 International License ([cc by-sa](http://creativecommons.org/licenses/by-sa/4.0/)).
|
||||||
|
|
||||||
The script files `scraper.py` and others are licensed under GNU General Public License version 3 (for details, see src/LICENSE).
|
The script files `scraper.py` and others are licensed under GNU General Public License version 3 (for details, see [src/LICENSE](https://github.com/hmemcpy/milewski-ctfp-pdf/blob/master/src/LICENSE)).
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
|
|
||||||
LICENSING TERMS
|
LICENSING TERMS
|
||||||
|
|
||||||
1. Output PDF, .tex/.texi, all files in content/* and fig/* are licensed
|
1. Output PDF, *.tex, all files in content/* and fig/* are licensed
|
||||||
under Creative Commons Attribution-ShareAlike 4.0 International License
|
under Creative Commons Attribution-ShareAlike 4.0 International License
|
||||||
(http://creativecommons.org/licenses/by-sa/4.0/).
|
(http://creativecommons.org/licenses/by-sa/4.0/).
|
||||||
|
|
||||||
2. The script files scraper.py and texi-to-latex.pl
|
2. The script files scraper.py and additional scripts are under GNU GPL v.3:
|
||||||
are under GNU GPL v.3:
|
|
||||||
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
% !TEX TS-program = xelatex
|
% !TEX TS-program = xelatex
|
||||||
% !TEX encoding = UTF-8 Unicode
|
% !TEX encoding = UTF-8 Unicode
|
||||||
|
|
||||||
%===========================================%
|
|
||||||
% Preamble of the LaTeX version of SICP. %
|
|
||||||
% It will be read in by texi-to-latex.pl. %
|
|
||||||
%===========================================%
|
|
||||||
|
|
||||||
\documentclass[11pt,oneside]{book}
|
\documentclass[11pt,oneside]{book}
|
||||||
|
|
||||||
% New line height: 1.05 * 1.2 = 1.26
|
% New line height: 1.05 * 1.2 = 1.26
|
||||||
@ -20,7 +15,7 @@
|
|||||||
\setmonofont{Inconsolata LGC} % to turn out curly
|
\setmonofont{Inconsolata LGC} % to turn out curly
|
||||||
% ("typographic")
|
% ("typographic")
|
||||||
\defaultfontfeatures{% % in verbatim blocks
|
\defaultfontfeatures{% % in verbatim blocks
|
||||||
Scale=MatchLowercase, % ... and here again % of Scheme code.
|
Scale=MatchLowercase, % ... and here again % of Haskell code.
|
||||||
Mapping=tex-text, % Now the quote is
|
Mapping=tex-text, % Now the quote is
|
||||||
SmallCapsFeatures={LetterSpace=2.5,WordSpace=1.05}, % upright and safely
|
SmallCapsFeatures={LetterSpace=2.5,WordSpace=1.05}, % upright and safely
|
||||||
} % copy-pasteable to
|
} % copy-pasteable to
|
||||||
@ -198,4 +193,4 @@
|
|||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
\VerbatimFootnotes
|
\VerbatimFootnotes
|
Loading…
Reference in New Issue
Block a user