|
1 | | -#import "@preview/codly:1.3.0": * |
2 | | -#import "@preview/codly-languages:0.1.1": * |
3 | | - |
4 | 1 | #let section-counter = counter("sectioncounter") |
5 | 2 | #let section-points = state("sectionpoints", ()) |
6 | 3 |
|
|
136 | 133 | } |
137 | 134 |
|
138 | 135 |
|
139 | | -#let _getheight(height, ansheight) = { |
| 136 | +#let _getheight(height, ansheight, ansbox) = { |
140 | 137 | // NOTE: must have context when run |
141 | 138 | let h = if docmode.get() == "sol" { |
142 | 139 | 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 | + } |
145 | 146 | } else { |
146 | 147 | if ansheight == auto { auto } |
147 | 148 | else { ansheight - 12pt } |
|
166 | 167 | let pstr = _getptstr(points) |
167 | 168 |
|
168 | 169 | context { |
169 | | - let h = _getheight(height, ansheight) |
| 170 | + let h = _getheight(height, ansheight, ansbox) |
170 | 171 |
|
171 | 172 | block(width: 100%)[ |
172 | 173 | #if points != "" [ |
|
211 | 212 | let ansarr = { if type(answer) == int { (answer,) } else { answer } } |
212 | 213 |
|
213 | 214 | context { |
214 | | - let h = _getheight(height, ansheight) |
| 215 | + let h = _getheight(height, ansheight, ansbox) |
215 | 216 |
|
216 | 217 | let items = range(length).map(i => [ |
217 | 218 | #let fill = if docmode.get() == "sol" and ansarr.contains(i) { colorblue } else { white } |
|
330 | 331 | #let bubble(content, color) = [ |
331 | 332 | #box(content, fill: color.mix(white).transparentize(65%), radius: 3pt, inset: 2.5pt, stroke: stroke(paint: color, thickness: 0.5pt), baseline: 2.5pt) |
332 | 333 | ] |
| 334 | + |
0 commit comments