From 967d8420250153550ba1560cefe9ee53d54ce939 Mon Sep 17 00:00:00 2001 From: Mark Date: Wed, 26 Feb 2025 08:05:08 -0800 Subject: [PATCH] Added short warning to typst lib --- lib/typst/local/handout/0.1.0/header.typ | 20 ++++++++++++++++++++ lib/typst/local/handout/0.1.0/lib.typ | 10 ++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/lib/typst/local/handout/0.1.0/header.typ b/lib/typst/local/handout/0.1.0/header.typ index 21f2b78..f1f266d 100644 --- a/lib/typst/local/handout/0.1.0/header.typ +++ b/lib/typst/local/handout/0.1.0/header.typ @@ -29,6 +29,26 @@ ) } + +#let short_solution_warning() = { + set text(ored) + align( + center, + block( + width: 60%, + height: auto, + breakable: false, + fill: rgb(255, 255, 255), + stroke: ored + 2pt, + inset: 3mm, + ( + align(center, text(weight: "bold", size: 12pt, [Instructor's Handout])) + + parbreak() + ), + ), + ) +} + #let make_header( title, subtitle: none, diff --git a/lib/typst/local/handout/0.1.0/lib.typ b/lib/typst/local/handout/0.1.0/lib.typ index 43e503e..c2c0f96 100755 --- a/lib/typst/local/handout/0.1.0/lib.typ +++ b/lib/typst/local/handout/0.1.0/lib.typ @@ -32,6 +32,7 @@ title: none, by: none, subtitle: none, + short_warning: false, ) = { set page( margin: 20mm, @@ -92,7 +93,7 @@ // Make handout title { - import "header.typ": make_header, solution_warning + import "header.typ": make_header, solution_warning, short_solution_warning import "solution.typ": show_solutions let url = link( @@ -108,8 +109,13 @@ top_right: url, ) + if show_solutions { - solution_warning() + if short_warning { + short_solution_warning() + } else { + solution_warning() + } } }