Skip to content

Instantly share code, notes, and snippets.

@ccshan
Forked from wilbowma/meow.tex
Last active June 19, 2019 13:50
Show Gist options
  • Save ccshan/b05a9da98eed318138d222e4ee82d5d8 to your computer and use it in GitHub Desktop.
Save ccshan/b05a9da98eed318138d222e4ee82d5d8 to your computer and use it in GitHub Desktop.
\documentclass{article}
\usepackage{mathpartir}
\usepackage{tikz}
% https://tex.stackexchange.com/questions/122415/mathchoice-and-tikzs-remember-picture
\newcommand{\tikzmark}[2]{\tikz[remember picture,inner sep=0,baseline,anchor=base] \node (#1) {#2};}
\begin{document}
\[
\inferrule
{e_1 : \Pi x:A.B \\
\tikzmark{d}{$e_2$} : A}
{e_1 ~ \tikzmark{a}{$e_2$} : B[\tikzmark{b}{$e_2$}/x]
\tikz[overlay,remember picture] {\draw[-latex,bend left=30] (a.north) to (b.north);}
\tikz[overlay,remember picture] {\draw[thick,dotted,-latex,bend right=50] (a.south) to (d.south);}
}
\]
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment