# Cup and cap

> The evaluation (cap) and coevaluation (cup) maps of a dual pair of objects. A String diagrams example with its LaTeX source.

A String diagrams example in the TeXeR TikZ library: https://texer.org/library/string-diagrams/cup-cap

Package: [String diagrams](https://texer.org/library/string-diagrams.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: cup, cap, duality, rigid category

## Source

```latex
\begin{tikzpicture}[thick]
  \draw (0,0) node[below] {$A^*$} -- (0,0.6) arc[start angle=180, end angle=0, radius=0.6] -- (1.2,0) node[below] {$A$};
  \node at (0.6,-0.9) {$\mathrm{ev}_A$};

  \draw (3,1.6) node[above] {$A$} -- (3,1) arc[start angle=180, end angle=360, radius=0.6] -- (4.2,1.6) node[above] {$A^*$};
  \node at (3.6,-0.9) {$\mathrm{coev}_A$};
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
\begin{tikzpicture}[thick]
  \draw (0,0) node[below] {$A^*$} -- (0,0.6) arc[start angle=180, end angle=0, radius=0.6] -- (1.2,0) node[below] {$A$};
  \node at (0.6,-0.9) {$\mathrm{ev}_A$};

  \draw (3,1.6) node[above] {$A$} -- (3,1) arc[start angle=180, end angle=360, radius=0.6] -- (4.2,1.6) node[above] {$A^*$};
  \node at (3.6,-0.9) {$\mathrm{coev}_A$};
\end{tikzpicture}
\end{document}
```
