Skip to content

Instantly share code, notes, and snippets.

@tjbcg
Last active August 6, 2025 12:42
Show Gist options
  • Save tjbcg/aeffe3a78c8101e1a933af2bf3d252cc to your computer and use it in GitHub Desktop.
Save tjbcg/aeffe3a78c8101e1a933af2bf3d252cc to your computer and use it in GitHub Desktop.
Direct and inverse limits in Typst

Quick snippet to add injlim and projlim to typst, defined as math operators with the correct baseline.

Keywords: direct limit, inverse limit, projective limit, injective limit, colimit, varinjlim varprojlim

output
#let (injlim, projlim) = {
let factory = arrowsym => context {
let size = measure[lim].width
let arrow = pad(top: -1em, math.stretch(math.script(arrowsym), size: size))
math.attach(math.limits[lim], b: arrow)
}
(sym.arrow.r, sym.arrow.l).map(factory).map(math.op.with(limits: true))
}
$ QQ = injlim_(n>0) 1/n ZZ $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment