deneir/BPV/qrs/utils.typ
Arthur Grisel-Davy 56021ab305 review
2023-06-26 17:34:28 -04:00

64 lines
1.7 KiB
Typst

// Comment macros
#let agd(content) = {
text(blue, size:15pt)[#sym.star.filled]
[#footnote[agd: #content]]
}
#let cn = text(purple,size:15pt)[ #super[[citation needed]]]
// problem statement environment
// Usage:
// #ps(title: "Boot Process Verification",
// content: "Given a set of time series..."
// )<ps:label>
#let ps_counter = counter("ps_counter")
#let ps(content, title: none) = [
#ps_counter.step()
#pad(y: 10pt,[
*Problem Statement #ps_counter.display() (#title)*:
#content
])
]
#let reset-acronym(term) = {
// Reset a specific acronym. It will be expanded on next use.
if term in acronyms{
state("acronym-state-" + term, false).update(false)
}
}
#let reset-all-acronyms() = {
// Reset all acronyms. They will all be expanded on the next use.
for term in acronyms.keys() {
state("acronym-state-" + term, false).update(false)
}
}
// Show rule to paste in the document for the acronym generation to work.
// #show ref: r =>{// Overload the reference definition
// // Grab the term, target of the reference
// let term = if type(r.target) == "label"{
// str(r.target)
// }
// else{
// // I don't know why the target could not be a type label but it is handled
// none
// }
// if term in acronyms{
// // Grab definition of the term
// let definition = acronyms.at(term)
// // Generate the key associated with this term
// let state-key = "acronym-state-" + term
// // Create a state to keep track of the expansion of this acronym
// state(state-key,false).display(seen => {if seen{term}else{[#definition (#term)]}})
// // Update state to true as it has just been defined
// state(state-key, false).update(true)
// }
// else{
// r
// }
// }