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

View File

@ -29,11 +29,7 @@
}
// Render the object
block(
above: 8mm,
below: 2mm,
text(weight: "bold", obj_content),
)
block(above: 8mm, below: 2mm, text(weight: "bold", obj_content))
// Generate labeled metadata for this object.
//
@ -57,7 +53,7 @@
if not (
it.element != none
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)
) {
// This label is not attached to object metadata
@ -100,9 +96,5 @@
#let remark = _mkobj("Remark")
#let generic(obj_content) = {
block(
above: 8mm,
below: 2mm,
text(weight: "bold", obj_content),
)
block(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.
@ -61,10 +61,7 @@
}
#let solution(content) = {
if_solutions(
align(
center,
stack(
if_solutions(align(center, stack(
block(
width: 100%,
breakable: false,
@ -83,16 +80,35 @@
inset: 3mm,
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) = {
if_solutions(
align(
center,
stack(
if_solutions(align(center, stack(
block(
width: 100%,
breakable: false,
@ -111,7 +127,5 @@
inset: 3mm,
align(left, content),
),
),
),
)
)))
}