summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-29 21:40:39 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-29 21:40:39 +0100
commit2b133152c5af28d0f419e5ce78f529b99159500f (patch)
tree4c476ea9ddc18a1fbda7d814ee3c9c011d020274
parent60b2206e179317f9576fc9e89031ba9fd3892ec6 (diff)
downloaddirty-haskell.org-2b133152c5af28d0f419e5ce78f529b99159500f.tar
dirty-haskell.org-2b133152c5af28d0f419e5ce78f529b99159500f.tar.gz
dirty-haskell.org-2b133152c5af28d0f419e5ce78f529b99159500f.tar.bz2
dirty-haskell.org-2b133152c5af28d0f419e5ce78f529b99159500f.tar.xz
dirty-haskell.org-2b133152c5af28d0f419e5ce78f529b99159500f.zip
Tikz
-rw-r--r--default.nix2
-rw-r--r--provider/posts/simmons-intro-to-cat-t/1.1.md12
-rw-r--r--tex/preamble.tex7
3 files changed, 14 insertions, 7 deletions
diff --git a/default.nix b/default.nix
index d6e481e..0770eb3 100644
--- a/default.nix
+++ b/default.nix
@@ -11,7 +11,7 @@ rec {
11 } 11 }
12 ); 12 );
13 texEnv = with pkgs; texlive.combine { 13 texEnv = with pkgs; texlive.combine {
14 inherit (texlive) scheme-small standalone dvisvgm amsmath; 14 inherit (texlive) scheme-small standalone dvisvgm amsmath tikz tikz-cd;
15 }; 15 };
16 dirty-haskell-wrapper = pkgs.stdenv.mkDerivation rec { 16 dirty-haskell-wrapper = pkgs.stdenv.mkDerivation rec {
17 name = "dirty-haskell-wrapper"; 17 name = "dirty-haskell-wrapper";
diff --git a/provider/posts/simmons-intro-to-cat-t/1.1.md b/provider/posts/simmons-intro-to-cat-t/1.1.md
index 41aef99..f95c068 100644
--- a/provider/posts/simmons-intro-to-cat-t/1.1.md
+++ b/provider/posts/simmons-intro-to-cat-t/1.1.md
@@ -10,8 +10,8 @@ Sets and functions do form a category $\ca{Set}$.
10<div class="proof"> 10<div class="proof">
11The objects of $\ca{Set}$ are sets and its arrows are functions. 11The objects of $\ca{Set}$ are sets and its arrows are functions.
12 12
13For any set $A$ we construct $id_A$ by restricting $id$ to $A$: 13For any set $A$ we construct \idarr{A} by restricting \id to $A$:
14$$id_A = id \upharpoonright A$$ 14$$\idarr{A} = \id \upharpoonright A$$
15 15
16$\circ$ is indeed associative. 16$\circ$ is indeed associative.
17</div> 17</div>
@@ -21,9 +21,9 @@ $\circ$ is indeed associative.
21Each [poset](https://en.wikipedia.org/wiki/Partially_ordered_set) is a category. 21Each [poset](https://en.wikipedia.org/wiki/Partially_ordered_set) is a category.
22 22
23<div class="proof"> 23<div class="proof">
24The objects of each poset are its elements and we construct an arrow $\leq: a \to b$ for every pair of objects $(a, b)$ iff $a \leq b$. 24The objects of each poset are its elements and we construct an arrow $\begin{tikzcd} a \arrow[r, "\leq"] & b \end{tikzcd}$ for every pair of objects $(a, b)$ iff $a \leq b$.
25 25
26Reflexivity ($a \leq a$) and transitivity ($a \leq b \land b \leq c \implies a \leq c$) provide a construction for $id_a$ and $\circ$, respectively. 26Reflexivity ($a \leq a$) and transitivity ($a \leq b \land b \leq c \implies a \leq c$) provide a construction for \idarr{a} and $\circ$, respectively.
27</div> 27</div>
28</div> 28</div>
29 29
@@ -31,8 +31,8 @@ Reflexivity ($a \leq a$) and transitivity ($a \leq b \land b \leq c \implies a \
31Each [monoid](https://en.wikipedia.org/wiki/Monoid) is a category. 31Each [monoid](https://en.wikipedia.org/wiki/Monoid) is a category.
32 32
33<div class="proof"> 33<div class="proof">
34The objects of each monoid are its elements and we construct for every pair of elements $(a, b)$ an arrow $\cdot b : a \to a \cdot b$. 34The objects of each monoid are its elements and we construct for every pair of elements $(a, b)$ an arrow $\begin{tikzcd} a \arrow[r, "\cdot b"] & a \cdot b \end{tikzcd}$.
35 35
36The existence of an identity element and associativity, as required by the monoid structure, immediately provide us with a construction for $id$ and associativity of $\circ$. 36The existence of an identity element and associativity, as required by the monoid structure, immediately provide us with a construction for \id and associativity of $\circ$.
37</div> 37</div>
38</div> 38</div>
diff --git a/tex/preamble.tex b/tex/preamble.tex
index a583a3b..8ff41d1 100644
--- a/tex/preamble.tex
+++ b/tex/preamble.tex
@@ -5,5 +5,12 @@
5\usepackage{amsmath} 5\usepackage{amsmath}
6\usepackage{mathrsfs} 6\usepackage{mathrsfs}
7 7
8\usepackage{tikz}
9
10\usetikzlibrary{cd}
11
8\newcommand*{\ca}[1]{\ensuremath{\mathbf{#1}}\xspace} 12\newcommand*{\ca}[1]{\ensuremath{\mathbf{#1}}\xspace}
13\newcommand*{\idarr}[1]{\ensuremath{\mathrm{id}_{#1}}}
14
15\newcommand{\id}{\ensuremath{\mathrm{id}}}
9\renewcommand{\implies}{\rightarrow} 16\renewcommand{\implies}{\rightarrow}