aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-01 10:17:22 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-01 10:17:22 +0100
commita9bf4321f6c406dfbb7d4bfec8bf3d2c771d34c6 (patch)
tree25cfff18e821f78575ef884be7ebfcef9b55ab23
parent9423be583305c5f0221df62dba94c2fb23eb9055 (diff)
fix `drop()` function
-rw-r--r--lib.typ9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib.typ b/lib.typ
index d3e2b61..8c18b25 100644
--- a/lib.typ
+++ b/lib.typ
@@ -24,15 +24,14 @@
})
}
-// TODO: how to write this so `drop(1mm)[content]` works?
-#let drop(body, distance: 0pt) = box[#move(dy: distance)[#body]]
+#let drop(distance, body) = box(move(dy: distance, body))
#let mirror(body) = scale(x: -100%)[#body]
#let TeX = context[#box[#{
let cfg = config.get()
[T]
h(cfg.kern-te)
- drop(distance: cfg.drop-tex)[E]
+ drop(cfg.drop-tex)[E]
h(cfg.kern-ex)
[X]
}]]
@@ -41,7 +40,7 @@
let cfg = config.get()
[X]
h(cfg.kern-xe)
- drop(distance: cfg.drop-xe)[#mirror[E]]
+ drop(cfg.drop-xe)[#mirror[E]]
}]]
#let LaTeX = context[#box[#{
@@ -51,7 +50,7 @@
h(cfg.kern-la)
// TODO: factor out `A` component and add spacing parameters to config
// TODO: `A` is too far to the left compared to real LaTeX
- drop(distance: -.2em)[#text(0.7em)[A]]
+ drop(-.2em)[#text(0.7em)[A]]
h(cfg.kern-at)
TeX
}]]