Lib tweaks
Some checks failed
CI / Typos (pull_request) Successful in 11s
CI / Typst formatting (pull_request) Failing after 5s
CI / Build (pull_request) Has been skipped

This commit is contained in:
2025-09-23 23:29:20 -07:00
parent e5b0053465
commit 81d6518553
3 changed files with 72 additions and 72 deletions

View File

@ -3,13 +3,10 @@
// Re-exports // Re-exports
// All functions that maybe used by client code are listed here // All functions that maybe used by client code are listed here
#import "misc.typ": * #import "misc.typ": *
#import "object.typ": problem, definition, theorem, example, remark, generic #import "object.typ": definition, example, generic, problem, remark, theorem
#import "solution.typ": ( #import "solution.typ": (
if_solutions, if_no_solutions, if_solutions, if_solutions_else, instructornote,
if_no_solutions, sample_solution, solution,
if_solutions_else,
solution,
instructornote,
) )
@ -38,10 +35,7 @@
margin: 20mm, margin: 20mm,
width: 8.5in, width: 8.5in,
height: 11in, height: 11in,
footer: align( footer: align(center, context counter(page).display()),
center,
context counter(page).display(),
),
footer-descent: 5mm, footer-descent: 5mm,
) )
@ -102,8 +96,8 @@
// Make handout title // Make handout title
{ {
import "header.typ": make_header, solution_warning, short_solution_warning import "header.typ": make_header, short_solution_warning, solution_warning
import "solution.typ": solutions_state, reset_solutions import "solution.typ": reset_solutions, solutions_state
reset_solutions() reset_solutions()

View File

@ -29,11 +29,7 @@
} }
// Render the object // Render the object
block( block(above: 8mm, below: 2mm, text(weight: "bold", obj_content))
above: 8mm,
below: 2mm,
text(weight: "bold", obj_content),
)
// Generate labeled metadata for this object. // Generate labeled metadata for this object.
// //
@ -57,7 +53,7 @@
if not ( if not (
it.element != none it.element != none
and it.element.has("value") and it.element.has("value")
and type(it.element.value) == "dictionary" and type(it.element.value) == dictionary
and it.element.value.keys().contains(magic_key) and it.element.value.keys().contains(magic_key)
) { ) {
// This label is not attached to object metadata // This label is not attached to object metadata
@ -100,9 +96,5 @@
#let remark = _mkobj("Remark") #let remark = _mkobj("Remark")
#let generic(obj_content) = { #let generic(obj_content) = {
block( block(above: 8mm, below: 2mm, text(weight: "bold", obj_content))
above: 8mm,
below: 2mm,
text(weight: "bold", obj_content),
)
} }

View File

@ -1,4 +1,4 @@
#import "misc.typ": ored, oblue #import "misc.typ": oblue, ored
/// If false, hide instructor info. /// If false, hide instructor info.
@ -61,10 +61,7 @@
} }
#let solution(content) = { #let solution(content) = {
if_solutions( if_solutions(align(center, stack(
align(
center,
stack(
block( block(
width: 100%, width: 100%,
breakable: false, breakable: false,
@ -83,16 +80,35 @@
inset: 3mm, inset: 3mm,
align(left, content), align(left, content),
), ),
), )))
),
)
} }
#let sample_solution(content) = {
align(center, stack(
block(
width: 100%,
breakable: false,
fill: oblue,
stroke: oblue + 2pt,
inset: 1.5mm,
align(left, text(fill: white, weight: "bold", [Sample Solution:])),
),
block(
width: 100%,
height: auto,
breakable: false,
fill: oblue.lighten(80%).desaturate(10%),
stroke: oblue + 2pt,
inset: 3mm,
align(left, content),
),
))
}
#let instructornote(content) = { #let instructornote(content) = {
if_solutions( if_solutions(align(center, stack(
align(
center,
stack(
block( block(
width: 100%, width: 100%,
breakable: false, breakable: false,
@ -111,7 +127,5 @@
inset: 3mm, inset: 3mm,
align(left, content), align(left, content),
), ),
), )))
),
)
} }