Skip to content

Commit 885e751

Browse files
committed
small fix
1 parent 096e358 commit 885e751

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/utils.typ

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#import "@preview/codly:1.3.0": *
2-
#import "@preview/codly-languages:0.1.1": *
3-
41
#let section-counter = counter("sectioncounter")
52
#let section-points = state("sectionpoints", ())
63

@@ -136,12 +133,16 @@
136133
}
137134

138135

139-
#let _getheight(height, ansheight) = {
136+
#let _getheight(height, ansheight, ansbox) = {
140137
// NOTE: must have context when run
141138
let h = if docmode.get() == "sol" {
142139
if ansheight == -1 {
143-
if height == auto { auto }
144-
else { height - 12pt }
140+
if ansbox {
141+
if height == auto { auto }
142+
else { height - 12pt }
143+
} else {
144+
auto
145+
}
145146
} else {
146147
if ansheight == auto { auto }
147148
else { ansheight - 12pt }
@@ -166,7 +167,7 @@
166167
let pstr = _getptstr(points)
167168

168169
context {
169-
let h = _getheight(height, ansheight)
170+
let h = _getheight(height, ansheight, ansbox)
170171

171172
block(width: 100%)[
172173
#if points != "" [
@@ -211,7 +212,7 @@
211212
let ansarr = { if type(answer) == int { (answer,) } else { answer } }
212213

213214
context {
214-
let h = _getheight(height, ansheight)
215+
let h = _getheight(height, ansheight, ansbox)
215216

216217
let items = range(length).map(i => [
217218
#let fill = if docmode.get() == "sol" and ansarr.contains(i) { colorblue } else { white }
@@ -330,3 +331,4 @@
330331
#let bubble(content, color) = [
331332
#box(content, fill: color.mix(white).transparentize(65%), radius: 3pt, inset: 2.5pt, stroke: stroke(paint: color, thickness: 0.5pt), baseline: 2.5pt)
332333
]
334+

0 commit comments

Comments
 (0)