Skip to content

Commit

Permalink
Feature/refactor build (#94)
Browse files Browse the repository at this point in the history
* initial reshuffling of files

* working export of latex files

* build 10pt and 12pt in parallel

* wip

* enable 3 volume build

* no images in cover

* wip refactored build

* all working

* wip
  • Loading branch information
winitzki authored Mar 30, 2024
1 parent dbb82af commit 551651e
Show file tree
Hide file tree
Showing 364 changed files with 2,311 additions and 503 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ jobs:
with:
fetch-depth: 1

- name: Build PDF using make_sofp_pdf.sh
- name: Build PDF using make_all.sh
id: full-pdf
uses: docker://winitzki/sofp-docker-build:latest
with:
args: "LYXDIR=/root/.lyx bash sofp-src/make_sofp_pdf.sh"
args: "LYXDIR=/root/.lyx bash sofp-src/make_all.sh"

- name: Upload built PDF
id: upload-pdf
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sofp-src/book_cover/sofp-3page-cover.pdf
asset_path: ./sofp-src/cover/sofp-3page-cover.pdf
asset_name: sofp-3page-cover.pdf
asset_content_type: application/pdf

Expand Down
34 changes: 1 addition & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This is the official source repository for the new book _The Science of Functional Programming: A tutorial, with examples in Scala_.

<img src="cover/book-draft-cover.png" width="150px" alt="Book cover"/>
<img src="book-draft-cover.png" width="150px" alt="Book cover"/>

The book is a tutorial exposition of the theoretical knowledge that functional programmers need. The material is developed from first principles and contains complete explanations, derivations, and proofs of almost all required results.

Expand Down Expand Up @@ -86,35 +86,3 @@ or if they wish to make comments or suggestions regarding the contents of the bo
- Milestone 4 (achieved in 2021): chapters 1-12 and 14 are completed.
- Milestone 5 (ETA: June 2023): the book is finished and available for
on-demand printing at lulu.com or elsewhere.

# Building a PDF version of the book from LyX sources

If you want to build from source, currently you need `LyX` 2.3.x and `pdftk` installed.

Change to the directory `sofp-src`.

The command `bash make_sofp_pdf.sh` builds PDF files `sofp.pdf` and `sofp-draft.pdf`.
The first file is a full draft with some unfinished chapters,
the second file contains only finished and proofread chapters.

If this does not work, you can build manually with a simple command such as `lyx --export pdf sofp.lyx`,
but the resulting PDF version will lack certain cosmetic features such as special colors and formatting.

If you do not have `LyX`, you can simply build from the provided LaTeX sources using commands such as

```bash
pdflatex --interaction=batchmode sofp.tex
makeindex sofp.idx
pdflatex --interaction=batchmode sofp.tex
```

# Docker image for PDF builds

A Docker image (containing a compatible version of LyX and LaTeX) is configured by the repository https://github.com/winitzki/sofp-docker-build
and is automatically uploaded to Docker Hub at https://hub.docker.com/repository/docker/winitzki/sofp-docker-build/builds

This Docker image is loaded by the file [build-pdf.yml](.github/workflows/build-pdf.yml#L31) in order to build the PDF version of the book.

The latest build is uploaded to Github when a new git tag is pushed.
This happens with each new release.
Also, a PDF build is performed on every commit to master.
Binary file removed cover/cover-no-lulu.pdf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified sample100pages.pdf
Binary file not shown.
38 changes: 38 additions & 0 deletions sofp-src/README_build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Source code

The full source of the book is in the subdirectory `sofp-src/`.

The subdirectories `cover` and `lyx` contain source files and are edited.

The subdirectory `tex` contains generated TeX files.

# Building a PDF version of the book from LyX sources

If you want to build from source, currently you need `LyX` 2.3.x and `pdftk` installed.

Change to the directory `sofp-src`.

The command `bash make_sofp_pdf.sh` builds PDF files `sofp.pdf` and `sofp-10pt.pdf`.

If this does not work, you can build manually with a simple command such as `lyx --export pdf sofp.lyx`,
but the resulting PDF version will lack certain cosmetic features such as special colors and formatting.

If you do not have `LyX`, you can build from the provided LaTeX sources using commands such as:

```bash
cd tex/
pdflatex --interaction=batchmode sofp.tex
makeindex sofp.idx
pdflatex --interaction=batchmode sofp.tex
```

# Docker image for PDF builds

A Docker image (containing a compatible version of LyX and LaTeX) is configured by the repository https://github.com/winitzki/sofp-docker-build
and is automatically uploaded to Docker Hub at https://hub.docker.com/repository/docker/winitzki/sofp-docker-build/builds

This Docker image is loaded by the file [build-pdf.yml](.github/workflows/build-pdf.yml#L31) in order to build the PDF version of the book.

The latest build is uploaded to Github when a new git tag is pushed.
This happens with each new release.
Also, a PDF build is performed on every commit to master.
Binary file removed sofp-src/book_cover/cover-background-4.jpg
Binary file not shown.
74 changes: 0 additions & 74 deletions sofp-src/book_cover/sofp-cover-parameters.tex

This file was deleted.

9 changes: 0 additions & 9 deletions sofp-src/book_cover/sofp-make-cover.sh

This file was deleted.

5 changes: 0 additions & 5 deletions sofp-src/chapter3-figure-make-pdf.sh

This file was deleted.

Binary file removed sofp-src/chapter3-picture.pdf
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
%% No header nor footer on the cover
\thispagestyle{empty}

\input{../sofp-cover-page-no-bg}
\input{sofp-cover-page-no-bg}

\end{document}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Binary file added sofp-src/lyx/monads_evil_face.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23340,10 +23340,6 @@ inner interchange
\end_inset

is written as:
\end_layout

\begin_layout Standard
\noindent
\begin_inset Formula
\[
\xymatrix{\xyScaleY{0.8pc}\xyScaleX{2.5pc} & M^{L^{L^{A}}}\ar[r]\sb(0.5){\text{ftn}_{L}^{\uparrow M}}\ar[ld]\sb(0.45){\text{sw}} & M^{L^{A}}\ar[d]\sb(0.45){\text{sw}}\\
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions sofp-src/sofp.lyx → sofp-src/lyx/sofp.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
\output_sync 0
\bibtex_command default
\index_command makeindex
\paperfontsize 12
\paperfontsize 10
\spacing single
\use_hyperref true
\pdf_title "The Science of Functional Programming: A Tutorial, with Examples in Scala"
Expand Down Expand Up @@ -297,7 +297,7 @@ status open


\backslash
input{sofp-cover-page}
input{sofp-cover-for-main-pdf}
\end_layout

\end_inset
Expand Down Expand Up @@ -1018,7 +1018,7 @@ status open


\backslash
input{sofp-back-cover-page}
input{sofp-back-cover-for-main-pdf}
\end_layout

\end_inset
Expand Down
File renamed without changes
3 changes: 3 additions & 0 deletions sofp-src/user.bind → sofp-src/lyx/user.bind
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Format 4
\bind "M-i 0" "command-sequence self-insert 0; char-left; math-insert \\bbnum"
\bind "M-i 1" "command-sequence self-insert 1; char-left; math-insert \\bbnum"
\bind "M-i w" "dialog-show-new-inset vspace"
\bind "M-i y" "math-insert \\updownarrow"
\bind "C-equal" "math-insert \\Rightarrow"
\bind "C-S-c" "dialog-show character"
\bind "C-S-p" "dialog-show paragraph"
Expand All @@ -67,4 +68,6 @@ Format 4
\bind "C-S-backslash" "math-delim | |"
\bind "M-Up" "math-superscript"
\bind "M-Down" "math-subscript"
\bind "C-S-equal" "math-insert \\leftrightarrow"
\bind "C-S-comma" "math-delim < >"

Loading

0 comments on commit 551651e

Please sign in to comment.