Code Snippets TeX

Short texts TeX 🧑‍💻 Code snippets TeX ✍️ Reading lists TeX 👀

untitled: a trio from https://penrose.ink

type Set type Point type Map constructor Singleton : Point p -> Set function Intersection : Set a * Set b -> Set function Union : Set a * Set b -> Set function Subtraction : Set a * Set b -> Set function CartesianProduct : Set a * Set b -> Set function Difference […]

untitled: a trio from https://penrose.ink

type Set type Point type Map constructor Singleton : Point p -> Set function Intersection : Set a * Set b -> Set function Union : Set a * Set b -> Set function Subtraction : Set a * Set b -> Set function CartesianProduct : Set a * Set b -> Set function Difference […]

Sequence diagram in TikZ

% Reference Manual: https://perso.ensta-paris.fr/~kielbasi/tikzuml/var/files/html/web-tikz-uml-userguidech5.html#x7-740005 % pgf-umlsd.sty % tikz-uml.sty \documentclass{standalone} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{tikz-uml} \usepackage{pgf-umlsd} \begin{document} \begin{tikzpicture} \tikzumlset{fill call=lightgray!20,font=\small} \begin{umlseqdiag} {\tikzset{draw/.append style={drop shadow=black}} \umlobject[no ddots,fill=white,x=0]{Authenticator} \umlobject[no ddots,fill=white,x=3.7]{Client} \umlobject[no ddots,fill=white,x=6.2]{Server} } \umlactor[no ddots,fill=white,x=2,y=-0.7,scale=0.75]{user} \begin{umlcall}[% op={\colorbox{lightgray}{$u=\text{username}$}}, dt=6, padding=4, return={$c=\text{challenge}$}, ]{Client}{Server} \end{umlcall} \begin{umlcall}[% op={request($c$)}, padding=7, return={$C=\text{credential}$}, ]{Client}{Authenticator} \begin{umlcall}[% op={\shortstack{interact()\\\;}}, dt=6, padding=1, with return, ]{Authenticator}{user} \end{umlcall} \end{umlcall} \begin{umlcall}[% […]

untitled: a trio from https://penrose.ink

type Set type Point type Map constructor Singleton : Point p -> Set function Intersection : Set a * Set b -> Set function Union : Set a * Set b -> Set function Subtraction : Set a * Set b -> Set function CartesianProduct : Set a * Set b -> Set function Difference […]

My LaTeX patterns

\newcommand\todo[1]{\textcolor{red}{#1}} \newcommand\g[1]{\textcolor{gray}{#1}} \newcommand*{\scale}[2][4]{\scalebox{#1}{$#2$}}% \newcommand*{\resize}[2]{\resizebox{#1}{!}{$#2$}}% \newcommand\ko[1]{ \begin{CJK}{UTF8}{} % require \usepackage{CJKutf8} \CJKfamily{mj} #1 \end{CJK} } \newcommand{\comment}[1]{} \newcommand{\pvalue}[0]{\textit{p}-value} \newcommand{\ttest}[0]{\textit{t}-test} \newcommand{\MLP}[0]{\mathrm{MLP}} \newcommand{\Transformer}[0]{\mathrm{Transformer}} \newcommand{\BiMLP}[0]{\mathrm{Bi-MLP}} \newcommand{\PE}[0]{\mathrm{PE}} \newcommand{\idx}[0]{\texttt{idx}} \newcommand{\topk}[0]{\mathrm{top}_k} \newcommand{\where}[0]{\mathrm{where}} \newcommand{\textor}[0]{\textrm{or}} \newcommand{\cat}[0]{\mathbin\Vert} \newcommand{\khop}[0]{k\text{-hop}} \newcommand{\vscore}[0]{\overrightarrow{\textrm{score}}} % table color \usepackage{xcolor} \usepackage{colortbl} \usepackage{soul} \definecolor{weakgray}{HTML}{e7e7e7} \definecolor{weakblue}{HTML}{E3F2FD} \definecolor{weakred}{HTML}{FFEBEE} \definecolor{midblue}{HTML}{bbdefb} \definecolor{midred}{HTML}{ffcdd2} \newcommand\cellwg{\cellcolor{weakgray}} \newcommand\cellwb{\cellcolor{weakblue}} \newcommand\cellwr{\cellcolor{weakred}} \newcommand\cellmb{\cellcolor{midblue}} \newcommand\cellmr{\cellcolor{midred}}