Skip to content

Commit

Permalink
stop using titlesec package
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei.winitzki committed Nov 8, 2020
1 parent c1f1b28 commit 9f5c06a
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
id: upload-pdf
uses: actions/upload-artifact@v2
with:
name: PDF files
name: PDF files and LaTeX logs
path: |
./sofp-src/sofp*.pdf
./sofp-src/sofp-logs.tar.bz2
Expand Down
2 changes: 2 additions & 0 deletions sofp-src/excluded_words
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
^cYD$
^cadabra$
^cadalgebra$
^catamorphism$
^catsMonoidRoute$
^cb
^ccc$
Expand Down Expand Up @@ -442,6 +443,7 @@
^indices$
^inequivalent$
^init$
^injective$
^inlined$
^intValue$
^intuitionistic$
Expand Down
Binary file modified sofp-src/sofp-draft.pdf
Binary file not shown.
31 changes: 28 additions & 3 deletions sofp-src/sofp-free-type.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -10105,7 +10105,16 @@ larger
\begin_inset Formula $L^{A}$
\end_inset

(lists and streams).
that includes both finite and infinite lists.
It is clear that
\begin_inset Formula $f_{1}$
\end_inset

is injective; the same holds also for
\begin_inset Formula $f_{2}$
\end_inset

.
\end_layout

\begin_layout Standard
Expand Down Expand Up @@ -11337,11 +11346,27 @@ The Church encoding
\begin_inset Formula $R$
\end_inset

, there is a unique fixpoint-preserving function
, there is a unique fixpoint-preserving map
\begin_inset Formula $T\rightarrow R$
\end_inset

.
called a catamorphism.
To define that map, assume that the fixpoint
\begin_inset Formula $R$
\end_inset

has a known function
\begin_inset Formula $\text{fix}_{R}:F^{R}\rightarrow R$
\end_inset

and write
\begin_inset Formula
\[
\text{cata}:T\rightarrow R\quad,\quad\quad\text{cata}\triangleq t^{:\forall X.\,(F^{X}\rightarrow X)\rightarrow X}\rightarrow\text{fix}_{R}\triangleright t^{R}\quad.
\]

\end_inset

***
\end_layout

Expand Down
13 changes: 10 additions & 3 deletions sofp-src/sofp-free-type.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,9 @@ \subsection{Recursive type equations with different fixpoints}
and $L_{\text{inf}}^{A}$. To see this formally, we consider the functions
$f_{1}:L_{\text{fin}}^{A}\rightarrow L^{A}$ and $f_{2}:L_{\text{inf}}^{A}\rightarrow L^{A}$.
The function $f_{1}$ embeds values of type $L_{\text{fin}}^{A}$
(finite lists) in the type $L^{A}$ (lists and streams).
(finite lists) in the type $L^{A}$ that includes both finite and
infinite lists. It is clear that $f_{1}$ is injective; the same holds
also for $f_{2}$.
Additionally, we can show that the functions $f_{1}$ and $f_{2}$
preserve the fixpoint structure of the types. {*}{*}{*}
Expand Down Expand Up @@ -2440,8 +2442,13 @@ \subsubsection{Statement \label{subsec:Statement-strong-dinaturality-property-of
The Church encoding $T\triangleq\forall X.\,(F^{X}\rightarrow X)\rightarrow X$
of the fixpoint has a special property: for any other fixpoint $R$,
there is a unique fixpoint-preserving function $T\rightarrow R$.
{*}{*}{*}
there is a unique fixpoint-preserving map $T\rightarrow R$ called
a catamorphism. To define that map, assume that the fixpoint $R$
has a known function $\text{fix}_{R}:F^{R}\rightarrow R$ and write
\[
\text{cata}:T\rightarrow R\quad,\quad\quad\text{cata}\triangleq t^{:\forall X.\,(F^{X}\rightarrow X)\rightarrow X}\rightarrow\text{fix}_{R}\triangleright t^{R}\quad.
\]
{*}{*}{*}
\subsection{The co-Yoneda identities}
Expand Down
12 changes: 1 addition & 11 deletions sofp-src/sofp-monads.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -22053,20 +22053,10 @@ status open

\begin_layout Plain Layout
typeclass!
\begin_inset listings
inline true
status open

\begin_layout Plain Layout

\family typewriter
Monad
\end_layout

\end_inset


\end_layout

\end_inset

for monads and a law-checking test function can be defined by
Expand Down
2 changes: 1 addition & 1 deletion sofp-src/sofp-monads.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5048,7 +5048,7 @@ \subsection{From semimonads to monads: Motivation for the identity laws}
{\color{greenunder}\text{right identity law of }M:}\quad & \text{flm}_{M}(\text{pu}_{M})=\text{id}^{:M^{A}\rightarrow M^{A}}\quad.\label{eq:monad-right-identity-law-for-flatMap}
\end{align}

A typeclass\index{typeclass!Monad@\lstinline!Monad!} for monads and
A typeclass\index{typeclass!Monad@\texttt{Monad}} for monads and
a law-checking test function can be defined by
\begin{lstlisting}
abstract class Monad[F[_]: Functor : Semimonad] {
Expand Down
33 changes: 27 additions & 6 deletions sofp-src/sofp.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,35 @@
\usepackage{pstricks}

% Fix the numbering of exercises: subsubsections appear as paragraphs but are numbered.
\usepackage{titlesec}
%\usepackage{titlesec} % Incompatible with komascript's later versions?
% See https://tex.stackexchange.com/questions/7627/how-to-reference-paragraph
% See the `titlesec` package documentation at http://www.ctex.org/documents/packages/layout/titlesec.pdf
\titleformat{\subsubsection}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
\titlespacing{\subsubsection}{0pt}{5pt}{3\wordsep}
\titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
\titlespacing{\subparagraph}{\parindent}{\parskip}{3\wordsep}
\titlespacing{\paragraph}{0pt}{3pt}{2\wordsep}
%\titleformat{\subsubsection}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
%\titlespacing{\subsubsection}{0pt}{5pt}{3\wordsep}
%\titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
%\titlespacing{\subparagraph}{\parindent}{\parskip}{3\wordsep}
%\titlespacing{\paragraph}{0pt}{3pt}{2\wordsep}

\renewcommand*{\subsubsectionformat}{}
\RedeclareSectionCommand[ % Statement 1.2.3.4
runin=true,
afterskip=2ex,
beforeskip=2.5pt plus 0.3pt minus 0.05pt,
afterindent=false,
font={\normalfont\normalsize\bfseries}
]{subsubsection}
\RedeclareSectionCommand[ % Proof
runin=true,
font={\normalfont\normalsize\bfseries},
afterindent=false,
afterskip=2ex,
beforeskip=0pt
]{subparagraph}
\RedeclareSectionCommand[
runin=true,
afterskip=1.3ex,
beforeskip=0pt
]{paragraph}

% Make page headers and page numbers smaller
\addtokomafont{pagehead}{\small}
Expand Down
Binary file modified sofp-src/sofp.pdf
Binary file not shown.
37 changes: 29 additions & 8 deletions sofp-src/sofp.tex
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,35 @@
\usepackage{pstricks}

% Fix the numbering of exercises: subsubsections appear as paragraphs but are numbered.
\usepackage{titlesec}
%\usepackage{titlesec} % Incompatible with komascript\textsf{'}s later versions?
% See https://tex.stackexchange.com/questions/7627/how-to-reference-paragraph
% See the `titlesec` package documentation at http://www.ctex.org/documents/packages/layout/titlesec.pdf
\titleformat{\subsubsection}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
\titlespacing{\subsubsection}{0pt}{5pt}{3\wordsep}
\titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
\titlespacing{\subparagraph}{\parindent}{\parskip}{3\wordsep}
\titlespacing{\paragraph}{0pt}{3pt}{2\wordsep}
%\titleformat{\subsubsection}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
%\titlespacing{\subsubsection}{0pt}{5pt}{3\wordsep}
%\titleformat{\subparagraph}[runin]{\normalfont\normalsize\bfseries}{}{0pt}{}
%\titlespacing{\subparagraph}{\parindent}{\parskip}{3\wordsep}
%\titlespacing{\paragraph}{0pt}{3pt}{2\wordsep}

\renewcommand*{\subsubsectionformat}{}
\RedeclareSectionCommand[ % Statement 1.2.3.4
runin=true,
afterskip=2ex,
beforeskip=2.5pt plus 0.3pt minus 0.05pt,
afterindent=false,
font={\normalfont\normalsize\bfseries}
]{subsubsection}
\RedeclareSectionCommand[ % Proof
runin=true,
font={\normalfont\normalsize\bfseries},
afterindent=false,
afterskip=2ex,
beforeskip=0pt
]{subparagraph}
\RedeclareSectionCommand[
runin=true,
afterskip=1.3ex,
beforeskip=0pt
]{paragraph}

% Make page headers and page numbers smaller
\addtokomafont{pagehead}{\small}
Expand Down Expand Up @@ -248,8 +269,8 @@
~\\
ISBN: 978-0-359-76877-6\\
\\
{\scriptsize{}Source hash: ec23f32797ba47ca13bd6dbfd8952ef0a7ae2d565668d617ab01e3fe217c99ee}\\
{\scriptsize{}Git commit: bdc9913567921e2a90d2444af520ffa92fa12d42}\\
{\scriptsize{}Source hash: 3515c69cb444b87f936718c788552de2c08f6770282e8efc9ac274deecac4799}\\
{\scriptsize{}Git commit: c1f1b28b34ff90d02ac51ba7313a0234de2b46be}\\
~\\
{\scriptsize{}Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation License,
Expand Down

0 comments on commit 9f5c06a

Please sign in to comment.