Skip to content

Commit

Permalink
Merge pull request #2 from 01mf02/lambda
Browse files Browse the repository at this point in the history
Compile jq programs to lambda-terms
  • Loading branch information
01mf02 authored Feb 28, 2025
2 parents fcc2b0f + 92f78cc commit 965009d
Show file tree
Hide file tree
Showing 11 changed files with 856 additions and 736 deletions.
29 changes: 18 additions & 11 deletions acm.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#let mainFont = "Linux Libertine O"
#let sfFont = "Linux Biolinum O"
#let mainFont = "Libertinus Serif"
#let sfFont = "Libertinus Sans"

#let show-month(month) = (
"January",
Expand Down Expand Up @@ -61,8 +61,8 @@
https:\/\/doi.org\/#pub.doi
]

#let total-pages(loc) = {
let total = counter(page).final(loc).last()
#let total-pages = context {
let total = counter(page).final().last()
[#total page#if(total > 1) { [s] }]
}
#let even-page(loc) = calc.rem(loc.page(), 2) == 0
Expand All @@ -87,6 +87,7 @@
// Currently supported formats are:
// - acmsmall
format: "acmsmall",
draft: false,

// Title, subtitle, authors, abstract, ACM ccs, keywords
title: "Title",
Expand Down Expand Up @@ -137,6 +138,8 @@
authors: if authors-short == none { author-names(authors) } else { authors-short },
)

set par.line(numbering: n => text(red)[#n]) if draft

// Set document metadata
set document(title: title, author: authors.map(author => author.name))

Expand All @@ -150,17 +153,20 @@
left: 46pt,
right: 46pt
),
header: text(size: 8pt, font: sfFont, locate(loc => if loc.page() > 1 { header(short, pub, loc) })),
footer: text(size: 8pt, locate(loc => align(if even-page(loc) { left } else { right }, footer(pub)))),
header: text(size: 8pt, font: sfFont, context {
if counter(page).get().first() > 1 { header(short, pub, here()) }
}),
footer: text(size: 8pt, context {
align(if even-page(here()) { left } else { right }, footer(pub))
}),
header-ascent: 17pt,
footer-descent: 24pt,
)

// title page
{
set text(size: 9pt)
set par(justify: true, leading: 0.555em)
show par: set block(below: 9.5pt)
set par(justify: true, leading: 0.555em, spacing: 9.5pt)

// Display title
text(font: sfFont, size: 14.4pt, weight: "bold", title)
Expand All @@ -182,7 +188,7 @@
#pub.volume,
#pub.number,
Article #pub.article (#show-month(pub.month) #pub.year),
#locate(total-pages).
#total-pages.
https:\/\/doi.org\/#pub.doi
]

Expand Down Expand Up @@ -213,8 +219,9 @@
set par(
justify: true,
leading: 5.35pt,
first-line-indent: 9.5pt)
show par: set block(below: 5.35pt)
first-line-indent: 9.5pt,
spacing: 5.35pt
)

body
}
10 changes: 8 additions & 2 deletions common.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/ctheorems:1.1.0": thmplain, thmrules
#import "@preview/ctheorems:1.1.3": thmplain, thmrules

#let thm(x, y, ..args) = thmplain(x, y, inset: (left: 0em, right: 0em), ..args)
#let example = thm("example", "Example")
Expand All @@ -11,14 +11,20 @@
).with(numbering: none)

#let or_ = $quad || quad$
#let app(..xs) = $#xs.pos().join($med$)$
#let lam(..xs) = $lambda #app(..xs). thick$
#let bind = $>#h(-0.5em)>#h(-1em / 6)=$
#let bindl = $class("binary", bind_S)$
#let bindr = $class("binary", bind_R)$
#let stream(..xs) = $angle.l #xs.pos().join($, $) angle.r$
#let var(x) = $\$#x$
#let ok(x) = $app("ok", #x)$
#let cartesian = math.op($circle.small$)
#let arith = math.op($dot.circle$)
#let mod = math.op($\%$)
#let aritheq = math.op($dot.circle#h(0pt)=$)
#let fold = math.op($phi.alt$)
#let update = $models$
#let update = $|#h(0pt)=$
#let alt = $slash.double$
#let alteq = math.op($alt#h(0pt)=$)
#let defas = $#h(0pt):$
Expand Down
Loading

0 comments on commit 965009d

Please sign in to comment.