From 2b133152c5af28d0f419e5ce78f529b99159500f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 29 Jan 2016 21:40:39 +0100 Subject: Tikz --- default.nix | 2 +- provider/posts/simmons-intro-to-cat-t/1.1.md | 12 ++++++------ tex/preamble.tex | 7 +++++++ 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 { } ); texEnv = with pkgs; texlive.combine { - inherit (texlive) scheme-small standalone dvisvgm amsmath; + inherit (texlive) scheme-small standalone dvisvgm amsmath tikz tikz-cd; }; dirty-haskell-wrapper = pkgs.stdenv.mkDerivation rec { 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}$.
The objects of $\ca{Set}$ are sets and its arrows are functions. -For any set $A$ we construct $id_A$ by restricting $id$ to $A$: -$$id_A = id \upharpoonright A$$ +For any set $A$ we construct \idarr{A} by restricting \id to $A$: +$$\idarr{A} = \id \upharpoonright A$$ $\circ$ is indeed associative.
@@ -21,9 +21,9 @@ $\circ$ is indeed associative. Each [poset](https://en.wikipedia.org/wiki/Partially_ordered_set) is a category.
-The 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$. +The 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$. -Reflexivity ($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. +Reflexivity ($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.
@@ -31,8 +31,8 @@ Reflexivity ($a \leq a$) and transitivity ($a \leq b \land b \leq c \implies a \ Each [monoid](https://en.wikipedia.org/wiki/Monoid) is a category.
-The 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$. +The 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}$. -The 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$. +The 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$.
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 @@ \usepackage{amsmath} \usepackage{mathrsfs} +\usepackage{tikz} + +\usetikzlibrary{cd} + \newcommand*{\ca}[1]{\ensuremath{\mathbf{#1}}\xspace} +\newcommand*{\idarr}[1]{\ensuremath{\mathrm{id}_{#1}}} + +\newcommand{\id}{\ensuremath{\mathrm{id}}} \renewcommand{\implies}{\rightarrow} -- cgit v1.2.3