From 112b7019ebca79bcc9690fc054df7fd3c64d347c Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 24 Dec 2024 21:39:09 +0100 Subject: add more configuration option validation --- lib.typ | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lib.typ') diff --git a/lib.typ b/lib.typ index 8c18b25..3828b3e 100644 --- a/lib.typ +++ b/lib.typ @@ -18,6 +18,17 @@ #let metalogo(..opts) = context{ config.update(c => { for (key, value) in opts.named() { + assert( + c.at(key, default: none) != none, + message: "metalogo: Unknown option \"" + key + "\"" + ) + let expected_type = type(c.at(key)) + let actual_type = type(value) + assert( + expected_type == actual_type, + message: "metalogo: Option \"" + key + "\" has type `" + + str(expected_type) + "` but was assigned a `" + str(actual_type) + "`" + ) c.insert(key, value) } return c @@ -75,9 +86,11 @@ #let LuaTeX = box[Lua#TeX] #let LaTeXe = context[#box[#{ + let cfg = config.get() + LaTeX - // TODO: both of these are separate components in LaTeX's metalogo + h(cfg.kern-x2) [2] - sym.epsilon + [$attach(, b: #sym.epsilon)$] }]] -- cgit v1.2.3