Imporved modularity of math-block.
This commit is contained in:
parent
6a763ea918
commit
23d963609c
|
@ -25,20 +25,17 @@
|
|||
/* The `name` named variable allows us to give a name to be displayed instead of the numbers. */
|
||||
#let math-block(body, name: "", id: "", emphasis: "bold", decoration: "fill") = {
|
||||
let current-counter = counter(id)
|
||||
current-counter.step()
|
||||
|
||||
let name = if name == "" {
|
||||
current-counter.step()
|
||||
counter(heading).display() + current-counter.display()
|
||||
} else {
|
||||
"(" + name + ")"
|
||||
}
|
||||
let number = counter(heading).display() + current-counter.display()
|
||||
let name = if name == "" { [] } else { [ (#name)] }
|
||||
|
||||
if emphasis == "bold" {
|
||||
block-emph(way: decoration)[*#id #name.* #body]
|
||||
block-emph(way: decoration)[*#id #number#name.* #body]
|
||||
} else if emphasis == "italics" {
|
||||
block-emph(way: decoration)[_#id #name._ #body]
|
||||
block-emph(way: decoration)[_#id #number#name._ #body]
|
||||
} else {
|
||||
block-emph(way: decoration)[#id #name. #body]
|
||||
block-emph(way: decoration)[#id #number#name. #body]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue