Skip to content

Instantly share code, notes, and snippets.

@lambdabetaeta
lambdabetaeta / type-theory-macros.sty
Last active February 27, 2024 13:42
type-theory-macros
%% Basic Type Theory macros
%% Alex Kavvos, 2024-
%% with thanks to Daniel Gratzer
\ProvidesPackage{lambda-macros}[2024/02/20 type-theory-macros]
%% Load in your own work by putting in the same folder as your file and invoking
%%
%% \usepackage{type-theory-macros}
%%
@lambdabetaeta
lambdabetaeta / cbpv.sty
Last active April 10, 2024 14:56
LaTeX macros for Call-by-Push-Value
%% LaTeX macros for Call-by-Push-Value
%% Alex Kavvos, 2021-2024
\ProvidesPackage{cbpv}[2023/01/11 cbpv-macros]
%% We require Jon Sterling's delimiters package for nice parentheses.
\RequirePackage{jmsdelim}
%% THE FOLLOWING MACROS REQUIRE THE USE OF **xparse**
@lambdabetaeta
lambdabetaeta / lattices.sty
Last active April 8, 2024 14:48
Macros for lattices
\RequirePackage{amsmath}
\RequirePackage{xparse}
\RequirePackage{bbold}
\NewDocumentCommand{\TV}{}{\mathbb{2}}
\NewDocumentCommand{\Sup}{o}{
\DelimMin{2} \mathop{\bigsqcup\IfValueT{#1}{_{#1}}}
}
\NewDocumentCommand{\DirectedSup}{o}{
@lambdabetaeta
lambdabetaeta / maths.sty
Last active February 27, 2024 14:37
Generic mathematical macros
\RequirePackage{xparse}
\RequirePackage{mathtools}
\RequirePackage{jmsdelim}
%% Defining equality and equivalence
\NewDocumentCommand{\defeq}{}{\stackrel{\mathclap{\mbox{\tiny def}}}{=}}
\newcommand{\defequiv}{\stackrel{\mathclap{\mbox{\tiny def}}}{\equiv}}
%% Some bracket shorthands
\NewDocumentCommand{\prn}{m}{\DelimPrn{#1}}
@lambdabetaeta
lambdabetaeta / categories.sty
Last active March 20, 2024 19:04
Macros for category theory
\RequirePackage{xparse}
\RequirePackage{jmsdelim}
\RequirePackage{graphicx}
%% CATEGORICAL CONSTANTS
\NewDocumentCommand{\SET}{}{\mathbf{Set}}
\NewDocumentCommand{\CAT}{}{\mathbf{Cat}}
\NewDocumentCommand{\COCONT}{}{\textbf{Cocont}}
\NewDocumentCommand{\TT}{}{\mathbb{T}}
\NewDocumentCommand{\BB}{}{\mathcal{B}}
@lambdabetaeta
lambdabetaeta / fitch.sty
Created February 3, 2023 00:37
Macros for typesetting Fitch-style lambda calculi
\RequiresPackage{lambda}
\NewDocumentCommand{\Lock}{}{\text{\faLock}}
\NewDocumentCommand{\LockCx}{m}{#1, \Lock}
\NewDocumentCommand{\MkBox}{m}{\Tm{\mathsf{box}\DelimPrn{#1}}}
\NewDocumentCommand{\UnBox}{m}{\Tm{\mathsf{unbox}\DelimPrn{#1}}}
@lambdabetaeta
lambdabetaeta / lambda-macros.sty
Last active April 10, 2024 15:46
Lambda calculus/PL LaTeX macros
%% Basic Lambda Calculus macros
%% Alex Kavvos, 2021-2023
\ProvidesPackage{lambda-macros}[2024/04/10 lambda-macros]
%% Load in your own work by putting in the same folder as your file and invoking
%%
%% \usepackage{lambda-macros}
%%
ps2pdf -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true -dEmbedAllFonts=true -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dModoImageFilter=/FlateEncode
exiftool -all:all= $1
qpdf --linearize --replace-input $1