Skip to content

Commit

Permalink
Feature/format part3 (#90)
Browse files Browse the repository at this point in the history
* wip corrections in chapters 10 and 11

* wip

* more fixes in chapter 11

* reduce verbosity of the build OS info

* update scripts

* wip

* wip

* wip fixes

* wip

* reformatting in chapter 11

* last changes in chapter 11

* wip

* chapter 12 wip

* wip

* wip reformatting vol.2

* wip

* wip

* wip

* wip

* minor fixes in chapter 12 and essays

* wip finishing the traversable chapter

* update latex

* wip fixing the last problem in Chapter 12

* wip finishing chapter 12

* wip finishing chapter 12

* update the proof for zipWithIndex

* wip

* update tex

* wip

* corrections in chapter 1

* corrections in chapter 2

* update pdf

* wip reformatting chapters 3 and 4

* edit chapter 4

* wip reformatting chapter 5

* last corrections in chapter 5

* minor fix

* last corrections before releasing vol.1
  • Loading branch information
winitzki committed Mar 10, 2024
1 parent e6e130a commit c6a36c5
Show file tree
Hide file tree
Showing 44 changed files with 6,601 additions and 4,853 deletions.
2 changes: 1 addition & 1 deletion sofp-src/book_cover/sofp-cover-parameters.tex
Expand Up @@ -18,7 +18,7 @@
% -- Ingram: page count MUST be divisible by 2.
% -- Blurb : page count MUST be divisible by 6.
% Add blank pages as needed in final PDF generations!
\pgfmathsetmacro\TotalPageCount{1258}% Must be manually entered
\pgfmathsetmacro\TotalPageCount{1293}% Must be manually entered
\pgfmathsetmacro\PaperWidthPt{7.444in}%
\pgfmathsetmacro\PaperHeightPt{9.68in}%

Expand Down
4 changes: 2 additions & 2 deletions sofp-src/book_cover/sofp-make-cover.sh
@@ -1,9 +1,9 @@
#!/bin/bash
# Prepare the three cover pages in parallel.
(
for f in sofp-spine sofp-back-cover sofp-front-cover; do
pdflatex --interaction=batchmode "$f" &
done
wait # Wait until all 3 cover pages are done.
pdflatex --interaction=batchmode sofp-3page-cover


) >& /dev/null
21 changes: 21 additions & 0 deletions sofp-src/excluded_words
Expand Up @@ -4,8 +4,10 @@
^(res(ult)?)[0-9]+$
^116772449ClassicalMechanics$
^18pt$
^1980s$
^1990s$
^1[abc]$
^2000s$
^25pt$
^48pt$
^4ac$
Expand Down Expand Up @@ -49,6 +51,7 @@
^BigDecimal$
^BigM$
^Bjarnason$
^Bloomberg$
^Boehm$
^Booleans$
^Bornat$
Expand Down Expand Up @@ -98,6 +101,7 @@
^Disjunction$
^Doel$
^Dyckhoff$
^EDSL$
^Either3$
^EitherMonadOps$
^EitherT$
Expand Down Expand Up @@ -134,6 +138,7 @@
^FoldOpScan$
^FoldOpSyntax$
^FoldOpZip$
^Fortran$
^Frac$
^FracBD$
^FracD$
Expand All @@ -159,6 +164,7 @@
^GADTs$
^GC$
^GPUs$
^GUIs$
^GeneratorDrivenPropertyChecks$
^Gentzen$
^Gliebe$
Expand Down Expand Up @@ -216,6 +222,7 @@
^LaTeX$
^Lagrangians$
^Lataillade$
^Lem$
^Lempty$
^Liftings$
^Lindley$
Expand Down Expand Up @@ -275,6 +282,7 @@
^NaN$
^Naturality$
^Netflix$
^Ngtrks$
^NioMonad$
^NoRealRoots$
^NoRoots$
Expand All @@ -286,6 +294,8 @@
^Num$
^NumberFormatException$
^OCaml$
^OOP$
^OOUI$
^Oliveira$
^OneRoot$
^OneRootQ$
Expand All @@ -302,6 +312,7 @@
^PLPT$
^PNG$
^PQ$
^PROLOG$
^PTVF$
^PTVFs$
^PTree$
Expand All @@ -314,6 +325,7 @@
^PaymentTuple$
^Peirce$
^Peyton$
^Pgvdrk$
^Ph$
^Poincar$
^PostScript$
Expand All @@ -327,6 +339,7 @@
^ProcessIO$
^Profunctor$
^Profunctors$
^Prolog$
^PropTree$
^PureScript$
^QEqu$
Expand All @@ -351,7 +364,9 @@
^RunnerM$
^RunnerTry$
^Rypacek$
^SIMULA$
^SOO$
^SWI$
^Scala$
^Schwarz$
^SearchResult$
Expand Down Expand Up @@ -536,6 +551,7 @@
^bdca$
^benchmarking$
^bfs$
^biapplicative$
^bifunctor$
^bifunctorQ$
^bifunctors$
Expand Down Expand Up @@ -670,6 +686,7 @@
^dcba$
^de$
^declaratively$
^declarativeness$
^defaultDouble$
^defaultFunc$
^defaultInt$
Expand Down Expand Up @@ -737,6 +754,7 @@
^expr$
^expr1$
^expr2$
^expressivity$
^extendedchars$
^extensibility$
^extractorEither$
Expand Down Expand Up @@ -1090,9 +1108,11 @@
^p2q$
^packagename$
^pairProduct$
^parallelizability$
^parallelizable$
^parallelize$
^parallelized$
^parallelizes$
^parameterize$
^parameterized$
^parametrically$
Expand Down Expand Up @@ -1377,6 +1397,7 @@
^typeclasses$
^typedef$
^typelevel$
^uber$
^unary$
^uncommented$
^uncu$
Expand Down
17 changes: 8 additions & 9 deletions sofp-src/make_sofp_pdf.sh
Expand Up @@ -31,6 +31,7 @@ function source_hash {

# Make a PDF package with embedded source archive.

# This function is not used now.
function run_latex_many_times {
local base="$1"
echo "LaTeX Warning - Rerun" > "$base.log"
Expand Down Expand Up @@ -88,7 +89,7 @@ function insert_examples_exercises_count { # This is replaced in the root file o
local stmts=`cat "$base"-*.tex | LC_ALL=C fgrep -c '\subsubsection{Statement '`
local diagrams=`cat "$base"-*.tex | LC_ALL=C fgrep -c '\xymatrix{'`
local bdate=`date -R`
local osinfo=`uname -rs`
local osinfo=`uname -s`
local pdftex=`pdflatex --version | fgrep pdfTeX\ 3.14`
LC_ALL=C sed -i.bak -e "s|PDFTEXVERSION|$pdftex|g; s|BUILDDATE|$bdate|g; s|BUILDOPERATINGSYSTEM|$osinfo|g; s,NUMBEROFEXAMPLES,$examples,g; s,NUMBEROFEXERCISES,$exercises,g; s,NUMBEROFDIAGRAMS,$diagrams,g; s,NUMBEROFSTATEMENTS,$stmts,g; s,NUMBEROFCODESNIPPETS,$codesnippets,g;" "$target"
}
Expand All @@ -104,12 +105,9 @@ function add_lulu {
}

function assemble_sources {
rm -rf "$srcbase"
mkdir "$srcbase"
# Copy the required source files to "$srcbase"/. Include graphics files referenced as images.
cp ../README.md excluded_words $name*lyx $name*tex `grep -o 'includegraphics[^}]*}' $name*tex | sed -e 's,[^{]*{\([^}]*\)}.*,\1.*,' |while read f; do ls $f ; done` *.sh "$srcbase"/
tar jcf "$name-src.tar.bz2" "$srcbase"/*
rm -rf "$srcbase"/
# Include graphics files referenced as images.
cp ../README.md README_build.md
tar jcvf "$name-src.tar.bz2" README*.md excluded_words $name*lyx $name*tex `grep -o 'includegraphics[^}]*}' $name*tex | sed -e 's,[^{]*{\([^}]*\)}.*,\1.*,' |while read f; do ls $f ; done` *.sh >& /dev/null
}

# This requires pdftk to be installed on the path. Edit the next line as needed.
Expand Down Expand Up @@ -162,7 +160,8 @@ assemble_sources &

echo "Creating a full PDF file..."

make_pdf_with_index "$name" # Output is $name.pdf, main file is $name.tex, and other .tex files are \include'd.
# Output is $name.pdf, main file is $name.tex, and other .tex files are \include'd.
make_pdf_with_index "$name" >& /dev/null

# Wait until assemble_sources is finished.
wait
Expand Down Expand Up @@ -214,7 +213,7 @@ if [ x"$1" == x-nolulu ]; then
# Create a pdf file without references to lulu.com and without lulu.com's ISBN.
mv "$name".pdf "$name"-lulu.pdf
remove_lulu $name
make_pdf_with_index "$name" fast
make_pdf_with_index "$name" fast >& /dev/null
create_draft $name $draft-nolulu.pdf

# The main file "$name".pdf has lulu.com information.
Expand Down
7 changes: 4 additions & 3 deletions sofp-src/prepare_10point.sh
Expand Up @@ -17,14 +17,15 @@ cp ../book_cover/* ./book_cover/
cp book_cover/* .

cp book_cover/sofp-cover-parameters.tex.src book_cover/sofp-cover-parameters.tex

echo "Preparing PDF with 10 point font."
# Set 10pt font.
LC_ALL=C sed -i.bak -e 's|fontsize=12pt|fontsize=10pt|' sofp.tex


(
pdflatex --interaction=batchmode sofp
makeindex sofp.idx

pdflatex --interaction=batchmode sofp

) >& /dev/null
mv sofp.pdf ../sofp-10pt.pdf
echo "sofp-10pt.pdf prepared"
10 changes: 4 additions & 6 deletions sofp-src/prepare_volume.sh
Expand Up @@ -32,9 +32,6 @@ cd $dir

tar jxf ../sofp-src.tar.bz2
mv sofp-src/* .
# Special handling for random-pages files.
mkdir random-pages
mv random-pages*png random-pages/

cp ../sofp*.tex ../sofp.* .
cp ../book_cover/* ./book_cover/
Expand Down Expand Up @@ -129,11 +126,12 @@ mv $name.tex sofp.tex
# Disable PDF hyperlinks and remove covers.
LC_ALL=C sed -i.bak -e 's|colorlinks=true|colorlinks=false|; s|\\input{sofp-cover-page}||; s|\\input{sofp-back-cover-page}||; ' sofp.tex
echo "Starting to prepare volume $v"
pdflatex --interaction=batchmode sofp
makeindex sofp.idx
(
pdflatex --interaction=batchmode sofp /dev/null
makeindex sofp.idx
cp ../*.aux . # Enable references to other chapters.
pdflatex --interaction=batchmode sofp

) >& /dev/null
mv sofp.pdf ../$name.pdf
echo "Volume $v is prepared in $name.pdf"

Expand Down
2 changes: 1 addition & 1 deletion sofp-src/sofp-appendices.lyx
Expand Up @@ -191,7 +191,7 @@
\renewcommand{\ogreaterthan}{\boxrightarrow}
\renewcommand{\varogreaterthan}{\boxrightarrow}
\end_preamble
\options open=any,numbers=noenddot,index=totoc,bibliography=totoc,listof=totoc,fontsize=12pt
\options numbers=noenddot,index=totoc,bibliography=totoc,listof=totoc,fontsize=12pt
\use_default_options true
\master sofp.lyx
\maintain_unincluded_children false
Expand Down

0 comments on commit c6a36c5

Please sign in to comment.