/// Typst handout library, used for all documents in this repository. // Re-exports // All functions that maybe used by client code are listed here #import "misc.typ": * #import "object.typ": problem, definition, theorem #import "solution.typ": if_solutions, if_no_solutions, solution /// Main handout wrapper. /// Use this as follows: /// /// ``` /// #show: handout.with( /// group: "Advanced 2", /// title: [Handout Title], /// by: "author", /// subtitle: "optional", /// ) /// /// /// ``` #let handout( doc, group: none, title: none, by: none, subtitle: none, ) = { set page( margin: 20mm, width: 8in, height: 11.5in, footer: align( center, context counter(page).display(), ), footer-descent: 5mm, ) set par(leading: 0.55em, first-line-indent: 0mm, justify: true) set text(font: "New Computer Modern") set par(spacing: 0.5em) show list: set block(spacing: 0.5em, below: 1em) set heading(numbering: (..nums) => nums.pos().at(0)) set list( tight: false, indent: 5mm, spacing: 3mm, ) show heading.where(level: 1): it => { set align(center) set text(weight: "bold") block[ Section #counter(heading).display(): #text(it.body) ] } show ref: it => { // Custom impl for object references let x = _ref_obj(it) if (x != none) { return x } // Use default `ref` implementation otherwise return it } // // Begin content // // Make handout title { import "header.typ": make_header, solution_warning import "solution.typ": show_solutions let url = link( "https://betalupi.com/handouts", "betalupi.com/handouts", ) make_header( title, subtitle: subtitle, by: by, top_left: group, top_right: url, ) if show_solutions { solution_warning() } } // Include rest of document doc }