Hello there everyone, I'm trying to learn the software and explore making & customizing things to learn, and I came across this use case: I made a custom theorem from the provided template of theorion package.
I wanted to add some sort of marker I called it suffix (an optional tag for the theorem). Ideally expecting it to have a flexibility when dealing with specifying the arguments like in stroke for example.
The goal was to achieve the look in the attached photo. which I did using the following code:
#set page(height: auto, width: 10cm)
#import "@preview/theorion:0.3.3": *
#import cosmos.clouds: *
// tag fnc to define the style
#let tag(fill: blue, body) = box(
radius:0.20em,
fill: fill.lighten(80%),
inset: (x:0.25em),
outset: (y:0.15em)
)[
#text(size:0.6em)[#body]
]
#show: show-theorion
#let (mytheo-counter, mytheo-box, mytheo, show-mytheo) = make-frame(
"theorem",
"Theorem",
counter: theorem-counter,
inherited-levels: 2,
inherited-from: heading,
render: (
prefix: auto,
title: "",
full-title: auto,
suffix: (text:auto,fill: blue), /* // need it to behave like `stroke` */
body) => [
#block(
fill:blue.lighten(85%),
inset: 0.5em,
radius: 0.4em,
)[
*#full-title*
#h(1fr)
#{
if suffix.text != auto {
tag(fill: suffix.fill)[#suffix.text]
}
}
#linebreak()
#body
]
]
)
#show: show-mytheo
#mytheo(
suffix:(text:"important", fill:red) // both specified, works fine
)[
#lorem(5)
]
(cont'd below)