typst-theorems
typst-theorems copied to clipboard
`#qedhere` misaligned in multiline equations
#import "@preview/ctheorems:1.1.2": *
#set page(height: auto, margin: 4em)
#let proof = thmproof("proof", "Proof")
#show: thmrules.with(qed-symbol: $square$)
#proof[
For each $a_1,…, a_k in A$, we have $
f (α^* (a_1, …, a_k))
&= f( (π_(α_1), …, π_(α_n)) (a_1, …, a_k))\
&= f( π_(α_1)(a_1, …, a_k), …, π_(α_n)(a_1, …, a_k) )\
&= f( a_(α_1), …, a_(α_n)) #qedhere
$
]
Ideally, the #qedhere would be aligned with the last line.
To amend that let me note that this is the only slight bug I encountered; otherwise I am thrilled with the addition of #qedhere in the latest version. It visually cleans up lots of proofs! So thanks on that front.
My qedhere solution was too simplistic: the qed symbol is in a grid column with a vertically centered (horizon) alignment. Here's a temporary fix:
#import "@preview/ctheorems:1.1.2": *
#set page(height: auto, margin: 4em)
#let proof = thmproof("proof", "Proof")
#show: thmrules.with(qed-symbol: $square$)
#let qed-multiline(eq) = grid(
columns: (1fr, auto, 1fr),
[], eq, align(right + bottom)[#thm-qed-show]
)
#proof[
For each $a_1,…, a_k in A$, we have
#qed-multiline($
f (α^* (a_1, …, a_k))
&= f( (π_(α_1), …, π_(α_n)) (a_1, …, a_k))\
&= f( π_(α_1)(a_1, …, a_k), …, π_(α_n)(a_1, …, a_k) )\
&= f( a_(α_1), …, a_(α_n))
$)
]
#proof[
$ (x + 1/x) #qedhere $
]
Using a bottom alignment in general wouldn't actually work in cases like the second one (single line but taller than usual). ~I'll have to think of a better solution for v2.0.0!~
Update: I think I have a working solution in the v2.0.0 branch, although it'll take a while to release since it's a fairly big update.