Skip to content

Commit

Permalink
[fix] parentheses not scaling due to single string characters being t…
Browse files Browse the repository at this point in the history
…reated differently since Typst 0.13
  • Loading branch information
Mc-Zen committed Feb 19, 2025
1 parent 0968bd0 commit dbda2f9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/utility.typ
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@
// and "}" if alignment is left. Other possible values are
// "[", "]", "|", "{", and "}".
#let create-brace(brace, alignment, length) = {
let lookup = (
"{": ${$,
"}": $}$,
"|": $|$,
"[": $[$,
"]": $]$,
)
if brace == auto {
brace = if alignment == right {"{"} else {"}"}
brace = if alignment == right {${$} else {$}$}
} else if brace != none {
assert(brace in lookup, message: "Unsupported brace " + repr(brace))
brace = lookup.at(brace)
}
return $ lr(#brace, size: length) $
}
Expand Down

0 comments on commit dbda2f9

Please sign in to comment.