Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#qedhere misaligned in multiline equations #18

Open
lukasjuhrich opened this issue Mar 14, 2024 · 2 comments
Open

#qedhere misaligned in multiline equations #18

lukasjuhrich opened this issue Mar 14, 2024 · 2 comments

Comments

@lukasjuhrich
Copy link

Repro:

#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
  $
]

image

Ideally, the #qedhere would be aligned with the last line.

@lukasjuhrich
Copy link
Author

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.

@sahasatvik
Copy link
Owner

sahasatvik commented Mar 16, 2024

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 $
]

test

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants